11 /// Standard Sizes (mode styles)
25 // This is the part common to MetricsInfo and PainterInfo
31 MetricsBase(BufferView * bv, LyXFont const & font, int textwidth);
37 /// current math style (display/text/script/..)
39 /// name of current font - mathed specific
41 /// This is the width available in pixels
47 // This contains a Metricsbase and Information that's only relevant during
48 // the first phase of the two-phase draw
54 MetricsInfo(BufferView * bv, LyXFont const & font, int textwidth);
62 // This contains a Metricsbase and Information that's only relevant during
63 // the second phase of the two-phase draw
67 explicit PainterInfo(BufferView * bv);
69 void draw(int x, int y, char c);
75 /// width of current item
80 struct TextMetricsInfo {};
83 // Generic base for temporarily changing things.
84 // The original state gets restored when the Changer is destructed.
86 template <class Struct, class Temp = Struct>
89 Changer(Struct & orig) : orig_(orig) {}
99 // temporarily change some aspect of a font
100 struct FontChanger : public Changer<LyXFont> {
102 FontChanger(LyXFont & orig, char const * font);
108 // temporarily change a full font
109 struct FontSetChanger : public Changer<MetricsBase> {
111 FontSetChanger(MetricsBase & mb, char const * font);
117 // temporarily change the style
118 struct StyleChanger : public Changer<MetricsBase> {
120 StyleChanger(MetricsBase & mb, Styles style);
126 // temporarily change the style to script style
127 struct ScriptChanger : public StyleChanger {
129 ScriptChanger(MetricsBase & mb);
133 // temporarily change the style suitable for use in fractions
134 struct FracChanger : public StyleChanger {
136 FracChanger(MetricsBase & mb);
140 // temporarily change the style suitable for use in tabulars and arrays
141 struct ArrayChanger : public StyleChanger {
143 ArrayChanger(MetricsBase & mb);
148 // temporarily change the shape of a font
149 struct ShapeChanger : public Changer<LyXFont, LyXFont::FONT_SHAPE> {
151 ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);
157 // temporarily change the available text width
158 struct WidthChanger : public Changer<MetricsBase>
161 WidthChanger(MetricsBase & mb, int width);