Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.1, 5.10.0
-
None
Description
It appears QSGDefaultGlyphNode and QFontEngineFT's assumptions are not in line when it comes to large font sizes.
The following reduction causes a stack overflow on any platform using freetype with Qt 5.10
code
import QtQuick 2.7
Text {
renderType: Text.NativeRendering
font
text: font.pixelSize
}
code
This is because the call to loadGlyph resulting from QFontEngineFT::alphaMapForGlyph bails after considering the metrics are too large to warrant caching, so we end up calling QFontEngine::alphaMapForGlyph, which leads to infinite recursion.
QFontEngineFT::Glyph is designed around the idea that it is only used in conjunction with caching, so metrics would likely overflow anyway (width and height are a signed char), which means most of the machinery at play isn't really fit for the job.
I'm not sure how this would be best solved without affecting the wide-range of existing use cases out there, while not adding tons of complexity with yet another very different code path.