#include <hb-ot.h>
static void
-test_ot_layout_get_ligature_carets_aat_lcar (void)
-{
- hb_face_t *face = hb_test_open_font_file ("fonts/lcar.ttf");
- hb_font_t *font = hb_font_create (face);
- hb_font_set_scale (font, hb_face_get_upem (face) * 2, hb_face_get_upem (face) * 4);
-
- hb_position_t caret_array[16];
-
- /* a normal call */
- {
- unsigned caret_count = 16;
- g_assert_cmpuint (2, ==, hb_ot_layout_get_ligature_carets (font, HB_DIRECTION_LTR,
- 98, 0, &caret_count,
- caret_array));
-
- g_assert_cmpuint (2, ==, caret_count);
- g_assert_cmpuint (1130, ==, caret_array[0]);
- g_assert_cmpuint (2344, ==, caret_array[1]);
- }
-
- /* RTL, maybe needs to be tweaked however */
- {
- unsigned caret_count = 16;
- g_assert_cmpuint (2, ==, hb_ot_layout_get_ligature_carets (font, HB_DIRECTION_RTL,
- 98, 0, &caret_count,
- caret_array));
-
- g_assert_cmpuint (2, ==, caret_count);
- g_assert_cmpuint (1130, ==, caret_array[0]);
- g_assert_cmpuint (2344, ==, caret_array[1]);
- }
-
- /* bottom to top call, bigger caret positions as the specified scaling */
- {
- unsigned caret_count = 16;
- g_assert_cmpuint (2, ==, hb_ot_layout_get_ligature_carets (font, HB_DIRECTION_BTT,
- 98, 0, &caret_count,
- caret_array));
-
- g_assert_cmpuint (2, ==, caret_count);
- g_assert_cmpuint (2260, ==, caret_array[0]);
- g_assert_cmpuint (4688, ==, caret_array[1]);
- }
-
- /* the same glyph as above but with offset */
- {
- caret_array[1] = 123;
-
- unsigned caret_count = 16;
- g_assert_cmpuint (2, ==, hb_ot_layout_get_ligature_carets (font, HB_DIRECTION_BTT,
- 98, 1, &caret_count,
- caret_array));
-
- g_assert_cmpuint (1, ==, caret_count);
- g_assert_cmpuint (4688, ==, caret_array[0]);
-
- g_assert_cmpuint (123, ==, caret_array[1]);
- }
-
- /* empty carets */
- {
- unsigned caret_count = 16;
- g_assert_cmpuint (0, ==, hb_ot_layout_get_ligature_carets (font, HB_DIRECTION_LTR,
- 97, 0, &caret_count,
- caret_array));
-
- g_assert_cmpuint (0, ==, caret_count);
- }
-
- hb_font_destroy (font);
- hb_face_destroy (face);
-}
-
-static void
-test_ot_layout_get_ligature_carets_ot_gsub (void)
+test_ot_layout_get_ligature_carets_ot_gdef (void)
{
hb_face_t *face = hb_test_open_font_file ("fonts/NotoNastaliqUrdu-Regular.ttf");
hb_font_t *font = hb_font_create (face);
{
g_test_init (&argc, &argv, NULL);
- hb_test_add (test_ot_layout_get_ligature_carets_aat_lcar);
- hb_test_add (test_ot_layout_get_ligature_carets_ot_gsub);
+ hb_test_add (test_ot_layout_get_ligature_carets_ot_gdef);
hb_test_add (test_ot_layout_get_ligature_carets_empty);
return hb_test_run ();