[ot-glyphs] fix the tests
This commit is contained in:
parent
084a8182fb
commit
06a1fcb3b4
|
@ -357,7 +357,7 @@ struct cff1_path_param_t
|
||||||
}
|
}
|
||||||
|
|
||||||
void start_path () { path_open = true; }
|
void start_path () { path_open = true; }
|
||||||
void end_path () { /* funcs->end_path (); */ path_open = false; }
|
void end_path () { /* funcs->close_path (); */ path_open = false; }
|
||||||
bool is_path_open () const { return path_open; }
|
bool is_path_open () const { return path_open; }
|
||||||
|
|
||||||
void move_to (const point_t &p)
|
void move_to (const point_t &p)
|
||||||
|
|
|
@ -153,7 +153,7 @@ struct cff2_path_param_t
|
||||||
}
|
}
|
||||||
|
|
||||||
void start_path () { path_open = true; }
|
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; }
|
bool is_path_open () const { return path_open; }
|
||||||
|
|
||||||
void move_to (const point_t &p)
|
void move_to (const point_t &p)
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct hb_ot_glyph_decompose_funcs_t
|
||||||
void *reserved1;
|
void *reserved1;
|
||||||
} hb_ot_glyph_decompose_funcs_t;
|
} 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 (hb_font_t *font, hb_codepoint_t glyph,
|
||||||
hb_ot_glyph_decompose_funcs_t *funcs, void *user_data);
|
hb_ot_glyph_decompose_funcs_t *funcs, void *user_data);
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,22 @@
|
||||||
|
|
||||||
/* Unit tests for hb-ot-*.h */
|
/* 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
|
static void
|
||||||
test_face (hb_face_t *face,
|
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_variations (face, NULL, 0, NULL, 0);
|
||||||
hb_ot_var_normalize_coords (face, 0, NULL, NULL);
|
hb_ot_var_normalize_coords (face, 0, NULL, NULL);
|
||||||
|
|
||||||
for (unsigned i = 0; i < 10; ++i)
|
hb_ot_glyph_decompose_funcs_t funcs;
|
||||||
hb_ot_glyph_path_destroy (hb_ot_glyph_path_create_from_font (font, 0));
|
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_set_destroy (set);
|
||||||
hb_font_destroy (font);
|
hb_font_destroy (font);
|
||||||
|
|
Loading…
Reference in New Issue