Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
QFontEngine::DesignMetrics shaping flag:
the only related public API is `QTextDocument::useDesignMetrics` (\since 4.1);
the only font engines that do not ignore this flag are: Freetype and Win (+DirectWrite FE always works in font metrics);
the problem is that we're respecting DesignMetrics flag in both shaping and rendering for every glyph, loosing the performance quite measurable (especially while shaping, cause the flag gets determined for every glyph albeit set for the whole document)
possible solutions:
a) deprecate this API entirely
b) make it a part of the font request (maybe QFont::StyleStrategy?) to affect a whole font engine
QFont::ForceIntegerMetrics style strategy:
handled only by Freetype, Mac and DirectWrite font engines, however implemented differently:
– | Freetype | Mac | DirectWrite |
---|---|---|---|
ascent | – | + | + |
descent | – | + | + |
leading | – | + | + |
capHeight | – | + | + |
xHeight | – | + | + |
averageCharWidth | – | + | – |
properties | – | 2 | 3 |
boundingBox(glyph_t) | 1 | 2 | 3 |
boundingBox(QGlyphLayout) | – | 2 | 3 |
recalcAdvances | + | + | + |
possible solutions:
a) check if it is still used anywhere and if we're able to deprecate it some later
b) unify the implementation and cover other font engines