When resolving the filenames of fonts, we would first match against
the font face name, meaning that an italic font, for instance would
always be matched to the file of the regular font in the same face.
To fix this, we look up the full name in the file name cache first,
before the face name.
Also, since the font names in the registry are the English names,
but the names we get when enumerating the fonts on the system can
be localized on non-English locales, we need to translate the
full name of the font before we give up on matching it against the
registry. Since this can be a heavy operation, we add a cut-off
which skips resolving the English name when the style is one of
the most common "Italic" or "Bold" since we know these to be
English.
[ChangeLog][QtGui][Windows] Fix selecting non-regular fonts when
using the Freetype engine.
Task-number: QTBUG-47485
Change-Id: If897abb93dc93263902b1c62bc3f66c4d06721c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>