summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r--src/gui/text/qfontengine.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 29c48da7be..3b64ee0136 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -359,10 +359,8 @@ bool QFontEngine::supportsScript(QChar::Script script) const
// ### TODO: This only works for scripts that require OpenType. More generally
// for scripts that do not require OpenType we should just look at the list of
// supported writing systems in the font's OS/2 table.
- if (!((script >= QChar::Script_Syriac && script <= QChar::Script_Sinhala)
- || script == QChar::Script_Khmer || script == QChar::Script_Nko)) {
+ if (!scriptRequiresOpenType(script))
return true;
- }
#if QT_CONFIG(harfbuzz)
if (qt_useHarfbuzzNG()) {
@@ -994,13 +992,12 @@ void QFontEngine::removeGlyphFromCache(glyph_t)
QFontEngine::Properties QFontEngine::properties() const
{
Properties p;
- QByteArray psname = QFontEngine::convertToPostscriptFontFamilyName(fontDef.family.toUtf8());
- psname += '-';
- psname += QByteArray::number(fontDef.style);
- psname += '-';
- psname += QByteArray::number(fontDef.weight);
-
- p.postscriptName = psname;
+ p.postscriptName
+ = QFontEngine::convertToPostscriptFontFamilyName(fontDef.family.toUtf8())
+ + '-'
+ + QByteArray::number(fontDef.style)
+ + '-'
+ + QByteArray::number(fontDef.weight);
p.ascent = ascent();
p.descent = descent();
p.leading = leading();
@@ -1082,7 +1079,7 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(const void *context, GlyphFormat
{
const QHash<const void*, GlyphCaches>::const_iterator caches = m_glyphCaches.constFind(context);
if (caches == m_glyphCaches.cend())
- return Q_NULLPTR;
+ return nullptr;
for (GlyphCaches::const_iterator it = caches->begin(), end = caches->end(); it != end; ++it) {
QFontEngineGlyphCache *cache = it->cache.data();
@@ -1090,7 +1087,7 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(const void *context, GlyphFormat
return cache;
}
- return Q_NULLPTR;
+ return nullptr;
}
static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
@@ -1236,7 +1233,7 @@ int QFontEngine::glyphCount() const
Qt::HANDLE QFontEngine::handle() const
{
- return Q_NULLPTR;
+ return nullptr;
}
const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)