Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0 Beta3
-
None
Description
I tested google's nanoemoji to create emoji fonts. It generates some good fonts (COLRv0 and COLRv1) but it can also generate fonts that don't display in browsers (CBDT and SBIX versions).
Even though the fonts "don't work", they shouldn't cause an assertion failure. I attached a minimal reproduction with the fonts below. The failure happens when calling qNextPowerOfTwo(static_cast<quint32>(-1)) from QTextureGlyphCache::fillInPendingGlyphs (line 225 at v6.9.0-beta3), because requiredHeight is zero.
#include <QApplication> #include <QFontDatabase> #include <QPainter> int main(int argc, char **argv) { QApplication app(argc, argv); QImage img(10, 10, QImage::Format_ARGB32); QPainter p(&img); int idCbdt = QFontDatabase::addApplicationFont("bad-cbdt.ttf"); p.setFont(QFont(QFontDatabase::applicationFontFamilies(idCbdt)[0])); p.drawText(0, 0, " 😂"); // note the space in the string int idSbix = QFontDatabase::addApplicationFont("bad-sbix.ttf"); p.setFont(QFont(QFontDatabase::applicationFontFamilies(idSbix)[0])); p.drawText(0, 0, " 😂"); }