Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0
-
None
Description
Hello there! I render text, specifically color bitmaps from font, using Qt FreeType engine. Bug that I will describe affect any component of Qt that can render text: QTextEdit, QPainter. I'm using font: https://github.com/googlefonts/noto-emoji/tree/main/fonts NotoColorEmoji_WindowsCompatible.ttf. This font have CBDT table, bitmaps inside. And I came across bug that heavily affects performance.
Shortly: in https://github.com/qt/qtbase/blob/dev/src/gui/text/freetype/qfontengine_ft.cpp we have variable 'cacheEnabled' that is set to false when font to be rendered is not scalable (line #780). So glyphs aren't cached and every time engine loads it directly from font. which means it loads colored .png files under the hood again and again, so it obviously affects performance, especially on big texts with a lot of emojis, in our case.