[test] Update to API changes
diff --git a/test/test-font.c b/test/test-font.c
index 0e81b0e..2bf5224 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -117,18 +117,17 @@
hb_glyph_extents_t extents;
x = y = 13;
- g_assert (!hb_font_get_contour_point (font, 17, 2, HB_DIRECTION_LTR, &x, &y));
+ g_assert (!hb_font_get_glyph_contour_point (font, 17, 2, &x, &y));
g_assert_cmpint (x, ==, 0);
g_assert_cmpint (y, ==, 0);
- x = y = 13;
- hb_font_get_glyph_h_advance (font, 17, &x, &y);
+ x = 13;
+ hb_font_get_glyph_h_advance (font, 17, &x);
g_assert_cmpint (x, ==, 0);
- g_assert_cmpint (y, ==, 0);
extents.x_bearing = extents.y_bearing = 13;
extents.width = extents.height = 15;
- hb_font_get_glyph_extents (font, 17, HB_DIRECTION_LTR, &extents);
+ hb_font_get_glyph_extents (font, 17, &extents);
g_assert_cmpint (extents.x_bearing, ==, 0);
g_assert_cmpint (extents.y_bearing, ==, 0);
g_assert_cmpint (extents.width, ==, 0);
@@ -138,10 +137,9 @@
g_assert (!hb_font_get_glyph (font, 17, 2, &glyph));
g_assert_cmpint (glyph, ==, 0);
- x = y = 13;
- hb_font_get_h_kerning (font, 17, 19, &x, &y);
+ x = 13;
+ hb_font_get_glyph_h_kerning (font, 17, 19, &x);
g_assert_cmpint (x, ==, 0);
- g_assert_cmpint (y, ==, 0);
}
static void
@@ -205,12 +203,9 @@
static hb_bool_t
contour_point_func1 (hb_font_t *font, void *font_data,
hb_codepoint_t glyph, unsigned int point_index,
- hb_bool_t *vertical,
hb_position_t *x, hb_position_t *y,
void *user_data)
{
- *vertical = FALSE;
-
if (glyph == 1) {
*x = 2;
*y = 3;
@@ -228,7 +223,6 @@
static hb_bool_t
contour_point_func2 (hb_font_t *font, void *font_data,
hb_codepoint_t glyph, unsigned int point_index,
- hb_bool_t *vertical,
hb_position_t *x, hb_position_t *y,
void *user_data)
{
@@ -238,23 +232,19 @@
return TRUE;
}
- return hb_font_get_contour_point (hb_font_get_parent (font),
- glyph, point_index, vertical, x, y);
+ return hb_font_get_glyph_contour_point (hb_font_get_parent (font),
+ glyph, point_index, x, y);
}
-static hb_bool_t
+static void
glyph_h_advance_func1 (hb_font_t *font, void *font_data,
hb_codepoint_t glyph,
- hb_position_t *x_advance, hb_position_t *y_advance,
+ hb_position_t *advance,
void *user_data)
{
if (glyph == 1) {
- *x_advance = 8;
- *y_advance = 9;
- return TRUE;
+ *advance = 8;
}
-
- return FALSE;
}
static void
@@ -282,27 +272,25 @@
/* setup font1 */
ffuncs1 = hb_font_funcs_create ();
- hb_font_funcs_set_contour_point_func (ffuncs1, contour_point_func1, NULL, NULL);
+ hb_font_funcs_set_glyph_contour_point_func (ffuncs1, contour_point_func1, NULL, NULL);
hb_font_funcs_set_glyph_h_advance_func (ffuncs1, glyph_h_advance_func1, NULL, NULL);
hb_font_set_funcs (font1, ffuncs1, NULL, NULL);
hb_font_funcs_destroy (ffuncs1);
x = y = 1;
- g_assert (hb_font_get_contour_point_for_direction (font1, 1, 2, HB_DIRECTION_LTR, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font1, 1, 2, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 2);
g_assert_cmpint (y, ==, 3);
- g_assert (hb_font_get_contour_point_for_direction (font1, 2, 5, HB_DIRECTION_LTR, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font1, 2, 5, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 4);
g_assert_cmpint (y, ==, 5);
- g_assert (!hb_font_get_contour_point_for_direction (font1, 3, 7, HB_DIRECTION_RTL, &x, &y));
+ g_assert (!hb_font_get_glyph_contour_point_for_origin (font1, 3, 7, HB_DIRECTION_RTL, &x, &y));
g_assert_cmpint (x, ==, 0);
g_assert_cmpint (y, ==, 0);
- hb_font_get_glyph_h_advance (font1, 1, &x, &y);
+ hb_font_get_glyph_h_advance (font1, 1, &x);
g_assert_cmpint (x, ==, 8);
- g_assert_cmpint (y, ==, 9);
- hb_font_get_glyph_h_advance (font1, 2, &x, &y);
+ hb_font_get_glyph_h_advance (font1, 2, &x);
g_assert_cmpint (x, ==, 0);
- g_assert_cmpint (y, ==, 0);
font2 = hb_font_create_sub_font (font1);
@@ -311,26 +299,24 @@
/* setup font2 to override some funcs */
ffuncs2 = hb_font_funcs_create ();
- hb_font_funcs_set_contour_point_func (ffuncs2, contour_point_func2, NULL, NULL);
+ hb_font_funcs_set_glyph_contour_point_func (ffuncs2, contour_point_func2, NULL, NULL);
hb_font_set_funcs (font2, ffuncs2, NULL, NULL);
hb_font_funcs_destroy (ffuncs2);
x = y = 1;
- g_assert (hb_font_get_contour_point_for_direction (font2, 1, 2, HB_DIRECTION_LTR, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font2, 1, 2, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 6);
g_assert_cmpint (y, ==, 7);
- g_assert (hb_font_get_contour_point_for_direction (font2, 2, 5, HB_DIRECTION_RTL, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font2, 2, 5, HB_DIRECTION_RTL, &x, &y));
g_assert_cmpint (x, ==, 4);
g_assert_cmpint (y, ==, 5);
- g_assert (!hb_font_get_contour_point_for_direction (font2, 3, 7, HB_DIRECTION_LTR, &x, &y));
+ g_assert (!hb_font_get_glyph_contour_point_for_origin (font2, 3, 7, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 0);
g_assert_cmpint (y, ==, 0);
- hb_font_get_glyph_h_advance (font2, 1, &x, &y);
+ hb_font_get_glyph_h_advance (font2, 1, &x);
g_assert_cmpint (x, ==, 8);
- g_assert_cmpint (y, ==, 9);
- hb_font_get_glyph_h_advance (font2, 2, &x, &y);
+ hb_font_get_glyph_h_advance (font2, 2, &x);
g_assert_cmpint (x, ==, 0);
- g_assert_cmpint (y, ==, 0);
font3 = hb_font_create_sub_font (font2);
@@ -341,21 +327,19 @@
hb_font_set_scale (font3, 20, 30);
x = y = 1;
- g_assert (hb_font_get_contour_point_for_direction (font3, 1, 2, HB_DIRECTION_RTL, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font3, 1, 2, HB_DIRECTION_RTL, &x, &y));
g_assert_cmpint (x, ==, 6*2);
g_assert_cmpint (y, ==, 7*3);
- g_assert (hb_font_get_contour_point_for_direction (font3, 2, 5, HB_DIRECTION_LTR, &x, &y));
+ g_assert (hb_font_get_glyph_contour_point_for_origin (font3, 2, 5, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 4*2);
g_assert_cmpint (y, ==, 5*3);
- g_assert (!hb_font_get_contour_point_for_direction (font3, 3, 7, HB_DIRECTION_LTR, &x, &y));
+ g_assert (!hb_font_get_glyph_contour_point_for_origin (font3, 3, 7, HB_DIRECTION_LTR, &x, &y));
g_assert_cmpint (x, ==, 0*2);
g_assert_cmpint (y, ==, 0*3);
- hb_font_get_glyph_h_advance (font3, 1, &x, &y);
+ hb_font_get_glyph_h_advance (font3, 1, &x);
g_assert_cmpint (x, ==, 8*2);
- g_assert_cmpint (y, ==, 9*3);
- hb_font_get_glyph_h_advance (font3, 2, &x, &y);
+ hb_font_get_glyph_h_advance (font3, 2, &x);
g_assert_cmpint (x, ==, 0*2);
- g_assert_cmpint (y, ==, 0*3);
hb_font_destroy (font3);