void GuiPainter::leaveMonochromeMode()
{
- LASSERT(!monochrome_min_.empty(), /**/);
+ LASSERT(!monochrome_min_.empty(), return);
monochrome_min_.pop();
monochrome_max_.pop();
}
return;
// double the size if needed
+ // FIXME THREAD
static QVector<QPoint> points(32);
if (np > points.size())
points.resize(2 * np);
}
-int GuiPainter::smallCapsText(int x, int y,
- QString const & s, FontInfo const & f)
-{
- FontInfo smallfont(f);
- smallfont.decSize().decSize().setShape(UP_SHAPE);
-
- QFont const & qfont = getFont(f);
- QFont const & qsmallfont = getFont(smallfont);
-
- setQPainterPen(computeColor(f.realColor()));
- int textwidth = 0;
- size_t const ls = s.length();
- for (unsigned int i = 0; i < ls; ++i) {
- QChar const c = s[i].toUpper();
- if (c != s.at(i)) {
- setFont(qsmallfont);
- } else {
- setFont(qfont);
- }
- if (isDrawingEnabled())
- drawText(x + textwidth, y, c);
- textwidth += fontMetrics().width(c);
- }
- return textwidth;
-}
-
-
int GuiPainter::text(int x, int y, docstring const & s,
FontInfo const & f)
{
int textwidth;
- if (f.realShape() == SMALLCAPS_SHAPE) {
- textwidth = smallCapsText(x, y, str, f);
- textDecoration(f, x, y, textwidth);
- return textwidth;
- }
-
// Here we use the font width cache instead of
// textwidth = fontMetrics().width(str);
// because the above is awfully expensive on MacOSX
// same as that of a soft-hyphen (0x00ad), unless it
// occurs at a line-break. As a kludge, we force Qt to
// render this glyph using a one-column line.
+ // This is needed for some math glyphs.
+ // FIXME In texted, this behaves differently depending
+ // on lyxrc.force_paint_single_char status.
+ // Should the soft hyphen char be displayed at all?
+ // I don't think so (i.e., Qt is correct as far as
+ // texted is concerned). /spitz
if (s.size() == 1 && str[0].unicode() == 0x00ad) {
setQPainterPen(computeColor(f.realColor()));
QTextLayout adsymbol(str);