diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index 6dfc76456..2c9323276 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -356,8 +356,8 @@ struct cff1_path_param_t delta = delta_; } - void start_path () { path_open = true; } - void end_path () { /* funcs->end_path (); */ path_open = false; } + void start_path () { path_open = true; } + void end_path () { /* funcs->close_path (); */ path_open = false; } bool is_path_open () const { return path_open; } void move_to (const point_t &p) diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index 01ee17b8d..b51ea51a6 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -153,7 +153,7 @@ struct cff2_path_param_t } void start_path () { path_open = true; } - void end_path () { path_open = false; } + void end_path () { /* funcs->close_path (); */ path_open = false; } bool is_path_open () const { return path_open; } void move_to (const point_t &p) diff --git a/src/hb-ot-glyph.h b/src/hb-ot-glyph.h index 9c2cb9bc8..ee72c9e80 100644 --- a/src/hb-ot-glyph.h +++ b/src/hb-ot-glyph.h @@ -63,7 +63,7 @@ typedef struct hb_ot_glyph_decompose_funcs_t void *reserved1; } hb_ot_glyph_decompose_funcs_t; -hb_bool_t +HB_EXTERN hb_bool_t hb_ot_glyph_decompose (hb_font_t *font, hb_codepoint_t glyph, hb_ot_glyph_decompose_funcs_t *funcs, void *user_data); diff --git a/test/api/test-ot-face.c b/test/api/test-ot-face.c index 838c290d1..66e17815f 100644 --- a/test/api/test-ot-face.c +++ b/test/api/test-ot-face.c @@ -31,6 +31,22 @@ /* Unit tests for hb-ot-*.h */ +static void +move_to (hb_position_t to_x, hb_position_t to_y, void *user_data) {} + +static void +line_to (hb_position_t to_x, hb_position_t to_y, void *user_data) {} + +static void +conic_to (hb_position_t control_x, hb_position_t control_y, + hb_position_t to_x, hb_position_t to_y, + void *user_data) {} + +static void +cubic_to (hb_position_t control1_x, hb_position_t control1_y, + hb_position_t control2_x, hb_position_t control2_y, + hb_position_t to_x, hb_position_t to_y, + void *user_data) {} static void test_face (hb_face_t *face, @@ -109,8 +125,13 @@ test_face (hb_face_t *face, hb_ot_var_normalize_variations (face, NULL, 0, NULL, 0); hb_ot_var_normalize_coords (face, 0, NULL, NULL); - for (unsigned i = 0; i < 10; ++i) - hb_ot_glyph_path_destroy (hb_ot_glyph_path_create_from_font (font, 0)); + hb_ot_glyph_decompose_funcs_t funcs; + funcs.move_to = (hb_ot_glyph_decompose_move_to_func_t) move_to; + funcs.line_to = (hb_ot_glyph_decompose_line_to_func_t) line_to; + funcs.conic_to = (hb_ot_glyph_decompose_conic_to_func_t) conic_to; + funcs.cubic_to = (hb_ot_glyph_decompose_cubic_to_func_t) cubic_to; + for (unsigned gid = 0; gid < 10; ++gid) + hb_ot_glyph_decompose (font, gid, &funcs, NULL); hb_set_destroy (set); hb_font_destroy (font);