Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.2
-
None
Description
We have a case where we load fonts via QFontDatabase::addApplicationFont and we also unload them once we have no consumers of this font anymore. Loading and unloading the fonts seems to cause issues with QtQuick text rendering. Sometimes characters disappear. I attached an example app that should show this issue. In addition to disappearing characters , we can observe crashes from the render thread when glyphs are being accessed from the TTF of a removed font.
How To Use The Example
Run the app and keep clicking the blue rectangle on the right. Every time it's clicked it will either load the font and display some random text or unload and remove the text. It also selects one of three custom fonts. After clicking it a couple of times missing characters should be noticeable.
I also attached a screenshot of the missing text. In the metal shader debugger I could also see that the geometry for the missing characters is very small. The characters are also not included in the attached glyph texture.
The text that was supposed to be displayed is: "j8LdwXrut0cPX7lbqOhY"
One of the missing characters in the glyph texture is 'L' for example.
Attachments
For Gerrit Dashboard: QTBUG-100697 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
401318,5 | Invalidate text when application fonts are added or removed | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
401319,3 | Flush font cache when we load new application fonts | dev | qt/qtbase | Status: MERGED | +2 | 0 |
484579,1 | Flush font cache when we load new application fonts | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |