diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2020-03-18 05:36:49 +0300 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2020-03-28 13:44:19 +0300 |
commit | e3d01840656a07f17549864da163b67094c03c0e (patch) | |
tree | d33ef5d42ec2542a9b22d94b6ca13cc22b382367 /src/gui/text/qfontengine.cpp | |
parent | 8de62d34321cd827e60b0a7b6e7434070de301ae (diff) |
Follow bundled Harfbuzz update
as we raised the minimum requirement for harfbuzz to version 2.6.0:
* use new HB_SCRIPT values instead of tags
* get rid of deprecated (and no-more-used) callbacks
* replace deprecated hb_ot_tags_from_script() usage with a more
flexible and up-to-date hb_ot_tags_from_script_and_language()
Change-Id: I0eafdd2d2028c353fa3a93f5868efceccd364a70
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r-- | src/gui/text/qfontengine.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 126c085521..70cc20cbe6 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -232,20 +232,17 @@ bool QFontEngine::supportsScript(QChar::Script script) const if (getSfntTableData(MAKE_TAG('m','o','r','t'), 0, &len) || getSfntTableData(MAKE_TAG('m','o','r','x'), 0, &len)) return true; - bool ret = false; if (hb_face_t *face = hb_qt_face_get_for_engine(const_cast<QFontEngine *>(this))) { - hb_tag_t script_tag_1, script_tag_2; - hb_ot_tags_from_script(hb_qt_script_to_script(script), &script_tag_1, &script_tag_2); - - unsigned int script_index; - ret = hb_ot_layout_table_find_script(face, HB_OT_TAG_GSUB, script_tag_1, &script_index); - if (!ret) { - ret = hb_ot_layout_table_find_script(face, HB_OT_TAG_GSUB, script_tag_2, &script_index); - if (!ret && script_tag_2 != HB_OT_TAG_DEFAULT_SCRIPT) - ret = hb_ot_layout_table_find_script(face, HB_OT_TAG_GSUB, HB_OT_TAG_DEFAULT_SCRIPT, &script_index); - } + unsigned int script_count = HB_OT_MAX_TAGS_PER_SCRIPT; + hb_tag_t script_tags[HB_OT_MAX_TAGS_PER_SCRIPT]; + + hb_ot_tags_from_script_and_language(hb_qt_script_to_script(script), HB_LANGUAGE_INVALID, + &script_count, script_tags, + nullptr, nullptr); + + if (hb_ot_layout_table_select_script(face, HB_OT_TAG_GSUB, script_count, script_tags, nullptr, nullptr)) + return true; } - return ret; } #endif return false; |