[test] hb_ot_layout_table_find_script()
This commit is contained in:
parent
f60caad7ff
commit
2f88ea5a20
|
@ -68,10 +68,34 @@ test_ot_layout_table_get_script_tags (void)
|
||||||
hb_face_destroy (face);
|
hb_face_destroy (face);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_ot_layout_table_find_script (void)
|
||||||
|
{
|
||||||
|
hb_face_t *face = hb_test_open_font_file ("fonts/NotoNastaliqUrdu-Regular.ttf");
|
||||||
|
unsigned int index;
|
||||||
|
|
||||||
|
g_assert (hb_ot_layout_table_find_script (face, HB_OT_TAG_GSUB, HB_TAG ('a','r','a','b'), &index));
|
||||||
|
g_assert_cmpuint (0, ==, index);
|
||||||
|
g_assert (hb_ot_layout_table_find_script (face, HB_OT_TAG_GSUB, HB_TAG ('d','f','l','t'), &index));
|
||||||
|
g_assert_cmpuint (1, ==, index);
|
||||||
|
g_assert (hb_ot_layout_table_find_script (face, HB_OT_TAG_GSUB, HB_TAG ('l','a','t','n'), &index));
|
||||||
|
g_assert_cmpuint (2, ==, index);
|
||||||
|
|
||||||
|
g_assert (hb_ot_layout_table_find_script (face, HB_OT_TAG_GPOS, HB_TAG ('a','r','a','b'), &index));
|
||||||
|
g_assert_cmpuint (0, ==, index);
|
||||||
|
g_assert (!hb_ot_layout_table_find_script (face, HB_OT_TAG_GPOS, HB_TAG ('d','f','l','t'), &index));
|
||||||
|
g_assert_cmpuint (0xFFFF, ==, index);
|
||||||
|
g_assert (!hb_ot_layout_table_find_script (face, HB_OT_TAG_GPOS, HB_TAG ('l','a','t','n'), &index));
|
||||||
|
g_assert_cmpuint (0xFFFF, ==, index);
|
||||||
|
|
||||||
|
hb_face_destroy (face);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
hb_test_init (&argc, &argv);
|
hb_test_init (&argc, &argv);
|
||||||
hb_test_add (test_ot_layout_table_get_script_tags);
|
hb_test_add (test_ot_layout_table_get_script_tags);
|
||||||
|
hb_test_add (test_ot_layout_table_find_script);
|
||||||
return hb_test_run ();
|
return hb_test_run ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue