Commit 6af82fe9 authored by Eskil Abrahamsen Blomfeldt's avatar Eskil Abrahamsen Blomfeldt
Browse files

Windows: Fix crash when loading color fonts from data


When color fonts are loaded from data, the font returned will
be a DirectWrite engine even the hinting preference does not
require it. This would cause a crash as we unconditionally cast
the pointer to QWindowsFontEngine*.

Using GDI and the unique family name hack to load the font from
data works fine, but we need to make sure we reference count
the font resource in this case, so we have to implement the
setUniqueFamilyName() logic in the DirectWrite engine as well
for this specific case.

[ChangeLog][Windows] Fixed crash when loading color fonts from
data.

Task-number: QTBUG-55595
Change-Id: I05443e8a396105da68ac4872b48339130b86c7f6
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: default avatarLars Knoll <lars.knoll@qt.io>
parent 8cd28ea8
No related merge requests found
Showing with 35 additions and 5 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment