QLFontInfo::QLFontInfo(LyXFont const & f)
- : metrics(font)
{
-
string const pat = symbolFamily(f.family());
if (!pat.empty()) {
bool tmp;
}
}
- font.setPointSizeF(convert<double>(lyxrc.font_sizes[f.size()])
- * lyxrc.zoom / 100.0);
-
switch (f.series()) {
case LyXFont::MEDIUM_SERIES:
font.setWeight(QFont::Normal);
<< "' matched by\n" << fromqstr(font.rawName()) << endl;
}
- lyxerr[Debug::FONT] << "The font has size: "
- << font.pointSizeF() << endl;
-
// Is this an exact match?
if (font.exactMatch())
lyxerr[Debug::FONT] << "This font is an exact match" << endl;
lyxerr[Debug::FONT] << "XFLD: " << fromqstr(font.rawName()) << endl;
- metrics = QFontMetrics(font);
-}
+ font.setPointSizeF(convert<double>(lyxrc.font_sizes[f.size()])
+ * lyxrc.zoom / 100.0);
-#ifdef USE_LYX_FONTCACHE
-int QLFontInfo::width(Uchar val)
-{
- QLFontInfo::WidthCache::const_iterator cit = widthcache.find(val);
- if (cit != widthcache.end())
- return cit->second;
+ lyxerr[Debug::FONT] << "The font has size: "
+ << font.pointSizeF() << endl;
+
+ if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
+ metrics.reset(new GuiFontMetrics(font));
+ }
+ else {
+ // handle small caps ourselves ...
+ LyXFont smallfont = f;
+ smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
+ QFont font2(font);
+ font2.setPointSizeF(convert<double>(lyxrc.font_sizes[smallfont.size()])
+ * lyxrc.zoom / 100.0);
+
+ metrics.reset(new GuiFontMetrics(font, font2));
+ }
- int const w = metrics.width(QChar(val));
- widthcache[val] = w;
- return w;
}
-#endif
bool GuiFontLoader::available(LyXFont const & f)