void image(int, int, int, int, graphics::Image const &, bool) override {}
/// draw a string
- void text(int, int, docstring const &, FontInfo const &) override {}
+ void text(int, int, docstring const &, FontInfo const &, Direction const = Auto) override {}
/// draw a char
- void text(int, int, char_type, FontInfo const &) override {}
+ void text(int, int, char_type, FontInfo const &, Direction const = Auto) override {}
/// draw a string
void text(int, int, docstring const &, Font const &, double, double) override {}
virtual void image(int x, int y, int w, int h,
graphics::Image const & image, bool const revert_in_darkmode = false) = 0;
+ // Direction for painting text
+ enum Direction { LtR, RtL, Auto };
+
/// draw a string at position x, y (y is the baseline).
- virtual void text(int x, int y, docstring const & str, FontInfo const & f) = 0;
+ virtual void text(int x, int y, docstring const & str, FontInfo const & f,
+ Direction const dir = Auto) = 0;
/// draw a char at position x, y (y is the baseline)
- virtual void text(int x, int y, char_type c, FontInfo const & f) = 0;
+ virtual void text(int x, int y, char_type c, FontInfo const & f,
+ Direction const dir = Auto) = 0;
/** draw a string at position x, y (y is the baseline). The
* text direction is enforced by the \c Font.
}
-void GuiPainter::text(int x, int y, char_type c, FontInfo const & f)
+void GuiPainter::text(int x, int y, char_type c, FontInfo const & f, Direction const dir)
{
- text(x, y, docstring(1, c), f);
+ text(x, y, docstring(1, c), f, dir);
}
-void GuiPainter::text(int x, int y, docstring const & s, FontInfo const & f)
+void GuiPainter::text(int x, int y, docstring const & s, FontInfo const & f, Direction const dir)
{
- text(x, y, s, f, Auto, 0.0, 0.0);
+ text(x, y, s, f, dir, 0.0, 0.0);
}
lyx::graphics::Image const & image, bool const darkmode = false) override;
/// draw a string at position x, y (y is the baseline).
- void text(int x, int y, docstring const & str, FontInfo const & f) override;
+ void text(int x, int y, docstring const & str, FontInfo const & f,
+ Direction const dir = Auto) override;
/// draw a char at position x, y (y is the baseline)
- void text(int x, int y, char_type c, FontInfo const & f) override;
+ void text(int x, int y, char_type c, FontInfo const & f,
+ Direction const dir = Auto) override;
/** draw a string at position x, y (y is the baseline). The
* text direction is enforced by the \c Font.
line_style ls = line_solid, int lw = thin_line,
Qt::PenJoinStyle js = Qt::BevelJoin);
- // Direction for painting text
- enum Direction { LtR, RtL, Auto };
-
// Real text() method
void text(int x, int y, docstring const & s,
FontInfo const & f, Direction const dir,
FontInfo f = pi.base.font;
augmentFont(f, "mathnormal");
f.setColor(Color_latex);
- pi.pain.text(x, y, str, f);
+ pi.pain.text(x, y, str, f, Painter::LtR);
}
FontInfo f = pi.base.font;
augmentFont(f, "mathnormal");
f.setColor(Color_foreground);
- pi.pain.text(x, y, str, f);
+ pi.pain.text(x, y, str, f, Painter::LtR);
}