diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-01 13:19:05 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-01 13:19:05 +0000 |
commit | d15702c43770f8ce99145e02a85a54b213885986 (patch) | |
tree | c4ea1eec3ca4f9a9b55e51d3931727d5c70c632f /pango | |
parent | 589af36865e5277f64b033d501741b6d365d01ce (diff) | |
parent | 1f6541f93126da92c552aa286e1d0c4c92969be8 (diff) | |
download | pango-d15702c43770f8ce99145e02a85a54b213885986.tar.gz |
Merge branch 'replace-deprecated-hb-api' into 'master'
Replace deprecated Harfbuzz API
See merge request GNOME/pango!39
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-ot-tag.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/pango/pango-ot-tag.c b/pango/pango-ot-tag.c index 610b59d7..1cb58c88 100644 --- a/pango/pango-ot-tag.c +++ b/pango/pango-ot-tag.c @@ -46,9 +46,18 @@ PangoOTTag pango_ot_tag_from_script (PangoScript script) { - hb_tag_t tag1, tag2; - hb_ot_tags_from_script (hb_glib_script_to_script (script), &tag1, &tag2); - return (PangoOTTag) tag1; + unsigned int count = 1; + hb_tag_t tags[1]; + + hb_ot_tags_from_script_and_language (hb_glib_script_to_script (script), + HB_LANGUAGE_INVALID, + &count, + tags, + NULL, NULL); + if (count > 0) + return (PangoOTTag) tags[0]; + + return PANGO_OT_TAG_DEFAULT_SCRIPT; } /** @@ -94,7 +103,18 @@ pango_ot_tag_to_script (PangoOTTag script_tag) PangoOTTag pango_ot_tag_from_language (PangoLanguage *language) { - return (PangoOTTag) hb_ot_tag_from_language (hb_language_from_string (pango_language_to_string (language), -1)); + unsigned int count = 1; + hb_tag_t tags[1]; + + hb_ot_tags_from_script_and_language (HB_SCRIPT_UNKNOWN, + hb_language_from_string (pango_language_to_string (language), -1), + NULL, NULL, + &count, tags); + + if (count > 0) + return (PangoOTTag) tags[0]; + + return PANGO_OT_TAG_DEFAULT_LANGUAGE; } /** |