diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 75c71dad0..ca85b505d 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -528,7 +528,6 @@ hb_ot_glyph_decompose_conic_to_func_t hb_ot_glyph_decompose_cubic_to_func_t hb_ot_glyph_decompose_line_to_func_t hb_ot_glyph_decompose_move_to_func_t -hb_ot_glyph_decompose_open_path_func_t hb_ot_glyph_decompose hb_ot_glyph_decompose_funcs_create hb_ot_glyph_decompose_funcs_destroy @@ -538,7 +537,6 @@ hb_ot_glyph_decompose_funcs_set_conic_to_func hb_ot_glyph_decompose_funcs_set_cubic_to_func hb_ot_glyph_decompose_funcs_set_line_to_func hb_ot_glyph_decompose_funcs_set_move_to_func -hb_ot_glyph_decompose_funcs_set_open_path_func
diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index d7e85b9f3..5fb14f71b 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -358,7 +358,7 @@ struct cff1_path_param_t } ~cff1_path_param_t () { end_path (); } - void start_path () { funcs->open_path (user_data); path_open = true; } + void start_path () { path_open = true; } void end_path () { if (path_open) funcs->close_path (user_data); path_open = false; } bool is_path_open () const { return path_open; } diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index 9484fc0a4..194b08e65 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -154,7 +154,7 @@ struct cff2_path_param_t } ~cff2_path_param_t () { end_path (); } - void start_path () { funcs->open_path (user_data); path_open = true; } + void start_path () { path_open = true; } void end_path () { if (path_open) funcs->close_path (user_data); path_open = false; } bool is_path_open () const { return path_open; } diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 7dff4df0e..06eb303db 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -1059,7 +1059,6 @@ struct glyf /* Learnt from https://github.com/opentypejs/opentype.js/blob/4e0bb99/src/tables/glyf.js#L222 */ while (contour_start < points.length) { - funcs->open_path (user_data); unsigned contour_length = 0; for (unsigned i = contour_start; i < points.length; ++i) { diff --git a/src/hb-ot-glyph.cc b/src/hb-ot-glyph.cc index 6a4505013..0ef565a80 100644 --- a/src/hb-ot-glyph.cc +++ b/src/hb-ot-glyph.cc @@ -100,23 +100,6 @@ hb_ot_glyph_decompose_funcs_set_cubic_to_func (hb_ot_glyph_decompose_funcs_t funcs->cubic_to = cubic_to; } -/** - * hb_ot_glyph_decompose_funcs_set_open_path_func: - * @funcs: decompose functions object - * @open_path: open-path callback - * - * Sets open-path callback to the decompose functions object. - * - * Since: REPLACEME - **/ -void -hb_ot_glyph_decompose_funcs_set_open_path_func (hb_ot_glyph_decompose_funcs_t *funcs, - hb_ot_glyph_decompose_open_path_func_t open_path) -{ - if (unlikely (funcs == &Null (hb_ot_glyph_decompose_funcs_t))) return; - funcs->open_path = open_path; -} - /** * hb_ot_glyph_decompose_funcs_set_close_path_func: * @funcs: decompose functions object @@ -135,7 +118,10 @@ hb_ot_glyph_decompose_funcs_set_close_path_func (hb_ot_glyph_decompose_funcs_t } static void -_move_line_to_nil (hb_position_t to_x HB_UNUSED, hb_position_t to_y HB_UNUSED, void *user_data HB_UNUSED) {} +_move_to_nil (hb_position_t to_x HB_UNUSED, hb_position_t to_y HB_UNUSED, void *user_data HB_UNUSED) {} + +static void +_line_to_nil (hb_position_t to_x HB_UNUSED, hb_position_t to_y HB_UNUSED, void *user_data HB_UNUSED) {} static void _conic_to_nil (hb_position_t control_x HB_UNUSED, hb_position_t control_y HB_UNUSED, @@ -148,7 +134,7 @@ _cubic_to_nil (hb_position_t control1_x HB_UNUSED, hb_position_t control1_y HB_U void *user_data HB_UNUSED) {} static void -_open_close_path_nil (void *user_data HB_UNUSED) {} +_close_path_nil (void *user_data HB_UNUSED) {} /** * hb_ot_glyph_decompose_funcs_create: @@ -164,12 +150,11 @@ hb_ot_glyph_decompose_funcs_create () if (unlikely (!(funcs = hb_object_create ()))) return const_cast (&Null (hb_ot_glyph_decompose_funcs_t)); - funcs->move_to = (hb_ot_glyph_decompose_move_to_func_t) _move_line_to_nil; - funcs->line_to = (hb_ot_glyph_decompose_line_to_func_t) _move_line_to_nil; + funcs->move_to = (hb_ot_glyph_decompose_move_to_func_t) _move_to_nil; + funcs->line_to = (hb_ot_glyph_decompose_line_to_func_t) _line_to_nil; funcs->conic_to = (hb_ot_glyph_decompose_conic_to_func_t) _conic_to_nil; funcs->cubic_to = (hb_ot_glyph_decompose_cubic_to_func_t) _cubic_to_nil; - funcs->open_path = (hb_ot_glyph_decompose_open_path_func_t) _open_close_path_nil; - funcs->close_path = (hb_ot_glyph_decompose_close_path_func_t) _open_close_path_nil; + funcs->close_path = (hb_ot_glyph_decompose_close_path_func_t) _close_path_nil; return funcs; } diff --git a/src/hb-ot-glyph.h b/src/hb-ot-glyph.h index f975d465b..56238f88e 100644 --- a/src/hb-ot-glyph.h +++ b/src/hb-ot-glyph.h @@ -42,7 +42,6 @@ typedef void (*hb_ot_glyph_decompose_cubic_to_func_t) (hb_position_t control1_x, hb_position_t control2_x, hb_position_t control2_y, hb_position_t to_x, hb_position_t to_y, void *user_data); -typedef void (*hb_ot_glyph_decompose_open_path_func_t) (void *user_data); typedef void (*hb_ot_glyph_decompose_close_path_func_t) (void *user_data); /** @@ -70,10 +69,6 @@ HB_EXTERN void hb_ot_glyph_decompose_funcs_set_cubic_to_func (hb_ot_glyph_decompose_funcs_t *funcs, hb_ot_glyph_decompose_cubic_to_func_t cubic_to); -HB_EXTERN void -hb_ot_glyph_decompose_funcs_set_open_path_func (hb_ot_glyph_decompose_funcs_t *funcs, - hb_ot_glyph_decompose_open_path_func_t open_path); - HB_EXTERN void hb_ot_glyph_decompose_funcs_set_close_path_func (hb_ot_glyph_decompose_funcs_t *funcs, hb_ot_glyph_decompose_close_path_func_t close_path); diff --git a/src/hb-ot-glyph.hh b/src/hb-ot-glyph.hh index 561bbfab6..6b1acb0f0 100644 --- a/src/hb-ot-glyph.hh +++ b/src/hb-ot-glyph.hh @@ -38,7 +38,6 @@ struct hb_ot_glyph_decompose_funcs_t hb_ot_glyph_decompose_line_to_func_t line_to; hb_ot_glyph_decompose_conic_to_func_t conic_to; hb_ot_glyph_decompose_cubic_to_func_t cubic_to; - hb_ot_glyph_decompose_open_path_func_t open_path; hb_ot_glyph_decompose_close_path_func_t close_path; }; diff --git a/src/test-ot-glyph.cc b/src/test-ot-glyph.cc index 2c2307c06..63fb144a2 100644 --- a/src/test-ot-glyph.cc +++ b/src/test-ot-glyph.cc @@ -98,6 +98,7 @@ main (int argc, char **argv) hb_ot_glyph_decompose_funcs_set_line_to_func (funcs, (hb_ot_glyph_decompose_line_to_func_t) line_to); hb_ot_glyph_decompose_funcs_set_conic_to_func (funcs, (hb_ot_glyph_decompose_conic_to_func_t) conic_to); hb_ot_glyph_decompose_funcs_set_cubic_to_func (funcs, (hb_ot_glyph_decompose_cubic_to_func_t) cubic_to); + hb_ot_glyph_decompose_funcs_set_close_path_func (funcs, (hb_ot_glyph_decompose_close_path_func_t) close_path); for (unsigned int face_index = 0; face_index < hb_face_count (blob); face_index++) { diff --git a/test/api/test-ot-glyph.c b/test/api/test-ot-glyph.c index cbdc7ab5f..ee22ce28d 100644 --- a/test/api/test-ot-glyph.c +++ b/test/api/test-ot-glyph.c @@ -74,9 +74,6 @@ cubic_to (hb_position_t control1_x, hb_position_t control1_y, to_x, to_y); } -static void -open_path (user_data_t *user_data HB_UNUSED) {} - static void close_path (user_data_t *user_data) { @@ -212,7 +209,6 @@ main (int argc, char **argv) hb_ot_glyph_decompose_funcs_set_line_to_func (funcs, (hb_ot_glyph_decompose_line_to_func_t) line_to); hb_ot_glyph_decompose_funcs_set_conic_to_func (funcs, (hb_ot_glyph_decompose_conic_to_func_t) conic_to); hb_ot_glyph_decompose_funcs_set_cubic_to_func (funcs, (hb_ot_glyph_decompose_cubic_to_func_t) cubic_to); - hb_ot_glyph_decompose_funcs_set_open_path_func (funcs, (hb_ot_glyph_decompose_open_path_func_t) open_path); hb_ot_glyph_decompose_funcs_set_close_path_func (funcs, (hb_ot_glyph_decompose_close_path_func_t) close_path); hb_test_init (&argc, &argv);