Remove QCoreTextFontEngine::supportsColorGlyphs
This is always true on the versions we currently support. Change-Id: I1aecbbd1f41e0f4f03b380358cd762ca00bb1e97 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>bb10
parent
9d620483c6
commit
16fefc258e
|
|
@ -588,8 +588,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
|
|||
fallbackList.append(familyNameFromPostScriptName(item));
|
||||
}
|
||||
|
||||
if (QCoreTextFontEngine::supportsColorGlyphs())
|
||||
fallbackList.append(QLatin1String("Apple Color Emoji"));
|
||||
fallbackList.append(QLatin1String("Apple Color Emoji"));
|
||||
|
||||
// Since we are only returning a list of default fonts for the current language, we do not
|
||||
// cover all unicode completely. This was especially an issue for some of the common script
|
||||
|
|
|
|||
|
|
@ -218,11 +218,9 @@ void QCoreTextFontEngine::init()
|
|||
synthesisFlags = 0;
|
||||
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont);
|
||||
|
||||
#if defined(Q_OS_IOS) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
if (supportsColorGlyphs() && (traits & kCTFontColorGlyphsTrait))
|
||||
if (traits & kCTFontColorGlyphsTrait)
|
||||
glyphFormat = QFontEngine::Format_ARGB;
|
||||
else
|
||||
#endif
|
||||
glyphFormat = defaultGlyphFormat;
|
||||
|
||||
if (traits & kCTFontItalicTrait)
|
||||
|
|
@ -648,9 +646,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
|
|||
CGContextSetTextPosition(ctx, pos_x + 0.5 * lineThickness().toReal(), pos_y);
|
||||
CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &CGSizeZero, 1);
|
||||
}
|
||||
}
|
||||
#if defined(Q_OS_IOS) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
else if (supportsColorGlyphs()) {
|
||||
} else {
|
||||
// CGContextSetTextMatrix does not work with color glyphs, so we use
|
||||
// the CTM instead. This means we must translate the CTM as well, to
|
||||
// set the glyph position, instead of using CGContextSetTextPosition.
|
||||
|
|
@ -661,7 +657,6 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
|
|||
// glyphs in the Apple Color Emoji font, so we use CTFontDrawGlyphs instead.
|
||||
CTFontDrawGlyphs(ctfont, &cgGlyph, &CGPointZero, 1, ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
CGContextRelease(ctx);
|
||||
CGColorSpaceRelease(colorspace);
|
||||
|
|
|
|||
|
|
@ -106,21 +106,6 @@ public:
|
|||
|
||||
QFontEngine::Properties properties() const Q_DECL_OVERRIDE;
|
||||
|
||||
static bool supportsColorGlyphs()
|
||||
{
|
||||
#if defined(Q_OS_IOS)
|
||||
return true;
|
||||
#elif MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
return &CTFontDrawGlyphs;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length);
|
||||
static QFont::Weight qtWeightFromCFWeight(float value);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue