DirectWrite: Inherit synthesized properties for fallback fonts
When a fallback font is selected, we need to copy out the
properties from the main font which can be synthesized
by the font engine. In particular, this is weight > normal,
and oblique style.
This is the DirectWrite equivalent of
a856c4a902.
Change-Id: I5d1215c66a433c8a8029c06e7a3dcee287f3f76f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
bb10
parent
d6b9ae201b
commit
96cc7fe5c2
|
|
@ -1357,6 +1357,11 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
|
|||
QWindowsFontEngineDirectWrite *fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace,
|
||||
fontEngine->fontDef.pixelSize,
|
||||
data);
|
||||
if (fontEngine->fontDef.weight > QFont::Normal)
|
||||
fedw->fontDef.weight = fontEngine->fontDef.weight;
|
||||
if (fontEngine->fontDef.style > QFont::StyleNormal)
|
||||
fedw->fontDef.style = fontEngine->fontDef.style;
|
||||
fedw->fontDef.family = fam;
|
||||
return fedw;
|
||||
} else {
|
||||
qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__);
|
||||
|
|
@ -1368,7 +1373,13 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
|
|||
// Get here if original font is not DirectWrite or DirectWrite creation failed for some
|
||||
// reason
|
||||
|
||||
return new QWindowsFontEngine(fam, lf, data);
|
||||
QFontEngine *fe = new QWindowsFontEngine(fam, lf, data);
|
||||
if (fontEngine->fontDef.weight > QFont::Normal)
|
||||
fe->fontDef.weight = fontEngine->fontDef.weight;
|
||||
if (fontEngine->fontDef.style > QFont::StyleNormal)
|
||||
fe->fontDef.style = fontEngine->fontDef.style;
|
||||
fe->fontDef.family = fam;
|
||||
return fe;
|
||||
}
|
||||
|
||||
bool QWindowsFontEngine::supportsTransformation(const QTransform &transform) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue