From 121b7b7a3cb401cb1597b8d56b9372f09aae6b51 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 5 Aug 2016 15:55:30 +0200 Subject: [PATCH] Windows: Fix Adobe/Mozilla format color fonts after Windows update After the Anniversary update of Windows 10 (update 1607), color fonts using the Adobe/Mozilla format with embedded SVGs are detected as color fonts by DirectWrite, but they do not contain any colored layers. The result of this was that we would no longer draw these fonts using the pen color, but we would also not support the colored glyphs in the fonts. In order to still support using these fonts as regular monochromatic fonts, we check if there is actually a palette in the font file before registering it as a color font. [ChangeLog][QtGui][Windows] Fixed rendering Adobe/Mozilla format color fonts with other colors than black after Windows 10 Anniversary update. Task-number: QTBUG-55097 Change-Id: I8d74787e49530d1167b9f2533ffdf7ab814c3358 Reviewed-by: Friedemann Kleint Reviewed-by: Tim Jenssen --- src/plugins/platforms/windows/qwindowsfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 08769a3b39a..314da702ebd 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1810,7 +1810,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, if (SUCCEEDED(directWriteFontFace->QueryInterface(__uuidof(IDWriteFontFace2), reinterpret_cast(&directWriteFontFace2)))) { if (directWriteFontFace2->IsColorFont()) - isColorFont = true; + isColorFont = directWriteFontFace2->GetPaletteEntryCount() > 0; } #endif const QFont::HintingPreference hintingPreference =