Add hb_script_from_string()

This commit is contained in:
Behdad Esfahbod 2011-04-15 19:07:10 -04:00
parent 8f0d7e0c3f
commit 0e8d35c093
3 changed files with 11 additions and 1 deletions

View File

@ -492,6 +492,12 @@ hb_script_from_iso15924_tag (hb_tag_t tag)
return HB_SCRIPT_UNKNOWN;
}
hb_script_t
hb_script_from_string (const char *s)
{
return hb_script_from_iso15924_tag (hb_tag_from_string (s));
}
hb_tag_t
hb_script_to_iso15924_tag (hb_script_t script)
{

View File

@ -295,6 +295,10 @@ hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
hb_script_t
hb_script_from_iso15924_tag (hb_tag_t tag);
/* suger for tag_from_string() then script_from_iso15924_tag */
hb_script_t
hb_script_from_string (const char *s);
hb_tag_t
hb_script_to_iso15924_tag (hb_script_t script);

View File

@ -354,7 +354,7 @@ _hb_cr_text_glyphs (cairo_t *cr,
hb_buffer_add_utf8 (hb_buffer, text, len, 0, len);
if (script)
hb_buffer_set_script (hb_buffer, hb_script_from_iso15924_tag (hb_tag_from_string (script)));
hb_buffer_set_script (hb_buffer, hb_script_from_string (script));
else
hb_buffer_set_script (hb_buffer, HB_SCRIPT_INVALID);
hb_buffer_set_direction (hb_buffer, HB_DIRECTION_INVALID);