GuiFontMetrics::GuiFontMetrics(QFont const & font)
- : font_(font), metrics_(font, 0),
+ : font_(font), metrics_(font, 0), xheight_(metrics_.xHeight()),
strwidth_cache_(strwidth_cache_max_cost),
breakstr_cache_(breakstr_cache_max_cost),
qtextlayout_cache_(qtextlayout_cache_max_size)
int GuiFontMetrics::xHeight() const
{
// LATTEST(metrics_.xHeight() == ascent('x'));
- return metrics_.xHeight();
+ return xheight_;
}
return *wid_p;
PROFILE_CACHE_MISS(width);
/* Several problems have to be taken into account:
- * * QFontMetrics::width does not returns a wrong value with Qt5 with
+ * * QFontMetrics::width returns a wrong value with Qt5 with
* some arabic text, since the glyph-shaping operations are not
* done (documented in Qt5).
* * QTextLayout is broken for single characters with null width