From b0e6a26a10ccca70ebc88a9e158a89ccfab0add5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 2 Aug 2012 08:11:14 -0400 Subject: [PATCH] [OT] Hide some API It was impossible to meaningfully use them from the outside these days. --- src/hb-ot-layout-private.hh | 40 ++++++++++++++++++++++++++++++++-------- src/hb-ot-layout.cc | 20 -------------------- src/hb-ot-layout.h | 34 ---------------------------------- src/hb-ot-map.cc | 8 ++++---- 4 files changed, 36 insertions(+), 66 deletions(-) diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index ea2e64d..ac0d9a7 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -143,17 +143,41 @@ hb_ot_layout_would_substitute_lookup_fast (hb_face_t *face, unsigned int glyphs_length, unsigned int lookup_index); + +/* Should be called before all the substitute_lookup's are done. */ +HB_INTERNAL void +hb_ot_layout_substitute_start (hb_face_t *face, + hb_buffer_t *buffer); + HB_INTERNAL hb_bool_t -hb_ot_layout_substitute_lookup_fast (hb_face_t *face, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask); +hb_ot_layout_substitute_lookup (hb_face_t *face, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask); + +/* Should be called after all the substitute_lookup's are done */ +HB_INTERNAL void +hb_ot_layout_substitute_finish (hb_face_t *face, + hb_buffer_t *buffer); + + +/* Should be called before all the position_lookup's are done. Resets positions to zero. */ +HB_INTERNAL void +hb_ot_layout_position_start (hb_font_t *font, + hb_buffer_t *buffer); HB_INTERNAL hb_bool_t -hb_ot_layout_position_lookup_fast (hb_font_t *font, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask); +hb_ot_layout_position_lookup (hb_font_t *font, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask); + +/* Should be called after all the position_lookup's are done */ +HB_INTERNAL void +hb_ot_layout_position_finish (hb_font_t *font, + hb_buffer_t *buffer, + hb_bool_t zero_width_attached_marks); + /* diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 63f3095..31b3abb 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -433,16 +433,6 @@ hb_ot_layout_substitute_lookup (hb_face_t *face, unsigned int lookup_index, hb_mask_t mask) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return false; - return hb_ot_layout_substitute_lookup_fast (face, buffer, lookup_index, mask); -} - -hb_bool_t -hb_ot_layout_substitute_lookup_fast (hb_face_t *face, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask) -{ if (unlikely (lookup_index >= hb_ot_layout_from_face (face)->gsub_lookup_count)) return false; hb_apply_context_t c (NULL, face, buffer, mask, &hb_ot_layout_from_face (face)->gsub_digests[lookup_index]); return hb_ot_layout_from_face (face)->gsub->substitute_lookup (&c, lookup_index); @@ -485,16 +475,6 @@ hb_ot_layout_position_lookup (hb_font_t *font, unsigned int lookup_index, hb_mask_t mask) { - if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return false; - return hb_ot_layout_position_lookup_fast (font, buffer, lookup_index, mask); -} - -hb_bool_t -hb_ot_layout_position_lookup_fast (hb_font_t *font, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask) -{ if (unlikely (lookup_index >= hb_ot_layout_from_face (font->face)->gpos_lookup_count)) return false; hb_apply_context_t c (font, font->face, buffer, mask, &hb_ot_layout_from_face (font->face)->gpos_digests[lookup_index]); return hb_ot_layout_from_face (font->face)->gpos->position_lookup (&c, lookup_index); diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index d663ab0..e14cde8 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -176,23 +176,6 @@ hb_ot_layout_would_substitute_lookup (hb_face_t *face, unsigned int glyphs_length, unsigned int lookup_index); -/* Should be called before all the substitute_lookup's are done. */ -void -hb_ot_layout_substitute_start (hb_face_t *face, - hb_buffer_t *buffer); - -hb_bool_t -hb_ot_layout_substitute_lookup (hb_face_t *face, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask); - -/* Should be called after all the substitute_lookup's are done */ -void -hb_ot_layout_substitute_finish (hb_face_t *face, - hb_buffer_t *buffer); - - void hb_ot_layout_substitute_closure_lookup (hb_face_t *face, hb_set_t *glyphs, @@ -205,23 +188,6 @@ hb_ot_layout_substitute_closure_lookup (hb_face_t *face, hb_bool_t hb_ot_layout_has_positioning (hb_face_t *face); -/* Should be called before all the position_lookup's are done. Resets positions to zero. */ -void -hb_ot_layout_position_start (hb_font_t *font, - hb_buffer_t *buffer); - -hb_bool_t -hb_ot_layout_position_lookup (hb_font_t *font, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_mask_t mask); - -/* Should be called after all the position_lookup's are done */ -void -hb_ot_layout_position_finish (hb_font_t *font, - hb_buffer_t *buffer, - hb_bool_t zero_width_attached_marks); - HB_END_DECLS diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index ae0cb61..1bab186 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -85,7 +85,7 @@ void hb_ot_map_t::substitute (hb_face_t *face, hb_buffer_t *buffer) const for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) { const pause_map_t *pause = &pauses[table_index][pause_index]; for (; i < pause->num_lookups; i++) - hb_ot_layout_substitute_lookup_fast (face, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); + hb_ot_layout_substitute_lookup (face, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); buffer->clear_output (); @@ -94,7 +94,7 @@ void hb_ot_map_t::substitute (hb_face_t *face, hb_buffer_t *buffer) const } for (; i < lookups[table_index].len; i++) - hb_ot_layout_substitute_lookup_fast (face, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); + hb_ot_layout_substitute_lookup (face, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); } void hb_ot_map_t::position (hb_font_t *font, hb_buffer_t *buffer) const @@ -105,14 +105,14 @@ void hb_ot_map_t::position (hb_font_t *font, hb_buffer_t *buffer) const for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) { const pause_map_t *pause = &pauses[table_index][pause_index]; for (; i < pause->num_lookups; i++) - hb_ot_layout_position_lookup_fast (font, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); + hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); if (pause->callback.func) pause->callback.func (this, font, buffer, pause->callback.user_data); } for (; i < lookups[table_index].len; i++) - hb_ot_layout_position_lookup_fast (font, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); + hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index, lookups[table_index][i].mask); } void hb_ot_map_t::substitute_closure (hb_face_t *face, -- 2.7.4