diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-09-10 17:17:47 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-13 02:29:01 +0200 |
commit | 02651060b6ce5b16b06721378a239a6d2bd9f528 (patch) | |
tree | 48688cacc0def0cc6ea1bbd73189adb0ef7e9e45 /src/gui | |
parent | 741737b080cb50a99fd6c72be9128ffb41f6c66a (diff) |
Decrease code duplication in QFontDatabase-s
Move scriptRequiresOpenType() body right into QFontEngine::supportsScript(),
thus centralizing use of this performance cheat.
Change-Id: I5f494b086f8f900b631c491f41e9cb800002c0f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 297bc5129a..810b51b9c4 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -309,6 +309,14 @@ void *QFontEngine::harfbuzzFace() const 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)) { + return true; + } + #ifdef QT_ENABLE_HARFBUZZ_NG if (useHarfbuzzNG) { bool ret = false; |