X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmetricsinfo.C;h=9544e68883c464c85566db05bda984a00992a269;hb=8765ab59cdddad67284007813ef25934ea0042ce;hp=efe237dc703daf9b32cd4768c46100b02a3358e3;hpb=e978fa42e38be22e9312be963ba6512fcd4b45ef;p=lyx.git diff --git a/src/metricsinfo.C b/src/metricsinfo.C index efe237dc70..9544e68883 100644 --- a/src/metricsinfo.C +++ b/src/metricsinfo.C @@ -14,12 +14,15 @@ #include "LColor.h" #include "metricsinfo.h" -#include "mathed/math_support.h" +#include "mathed/MathSupport.h" #include "frontends/Painter.h" #include + +namespace lyx { + using std::string; @@ -46,19 +49,25 @@ MetricsInfo::MetricsInfo(BufferView * bv, LyXFont const & font, int textwidth) -PainterInfo::PainterInfo(BufferView * bv, Painter & painter) - : pain(painter), ltr_pos(false) +PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter) + : pain(painter), ltr_pos(false), erased_(false) { base.bv = bv; } -void PainterInfo::draw(int x, int y, char c) +void PainterInfo::draw(int x, int y, char_type c) { pain.text(x, y, c, base.font); } +void PainterInfo::draw(int x, int y, docstring const & str) +{ + pain.text(x, y, str, base.font); +} + + Styles smallerScriptStyle(Styles st) { switch (st) { @@ -104,6 +113,7 @@ ArrayChanger::ArrayChanger(MetricsBase & mb) {} + ShapeChanger::ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape) : Changer(font) { @@ -111,6 +121,7 @@ ShapeChanger::ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape) orig_.setShape(shape); } + ShapeChanger::~ShapeChanger() { orig_.setShape(save_); @@ -152,6 +163,18 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name) LyXFont::FONT_SIZE oldsize = save_.font.size(); mb.fontname = name; mb.font = LyXFont(); + augmentFont(mb.font, from_ascii(name)); + mb.font.setSize(oldsize); +} + + +FontSetChanger::FontSetChanger(MetricsBase & mb, docstring const & name) + : Changer(mb) +{ + save_ = mb; + LyXFont::FONT_SIZE oldsize = save_.font.size(); + mb.fontname = to_utf8(name); + mb.font = LyXFont(); augmentFont(mb.font, name); mb.font.setSize(oldsize); } @@ -191,3 +214,6 @@ ColorChanger::~ColorChanger() { orig_.setColor(lcolor.getFromLyXName(save_)); } + + +} // namespace lyx