From c624e18a24311c66737dde4ce515aa1eca892b94 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Aug 2018 09:19:20 -0700 Subject: [PATCH] [OT] Move code around --- src/hb-ot-layout-gsub-table.hh | 18 ------------------ src/hb-ot-layout.cc | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 8911a5e..11fe7cf 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1308,8 +1308,6 @@ struct GSUB : GSUBGPOS inline const SubstLookup& get_lookup (unsigned int i) const { return CastR (GSUBGPOS::get_lookup (i)); } - static inline void substitute_start (hb_font_t *font, hb_buffer_t *buffer); - inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -1322,22 +1320,6 @@ struct GSUB : GSUBGPOS }; -void -GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer) -{ - _hb_buffer_assert_gsubgpos_vars (buffer); - - const GDEF &gdef = _get_gdef (font->face); - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - { - _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint)); - _hb_glyph_info_clear_lig_props (&buffer->info[i]); - buffer->info[i].syllable() = 0; - } -} - - /* Out-of-class implementation for methods recursing */ /*static*/ inline bool ExtensionSubst::is_reverse (void) const diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 4d2aeee..2763532 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -213,6 +213,24 @@ OT::GDEF::accelerator_t::init (hb_face_t *face) table = this->blob->as (); } +static void +_hb_ot_layout_set_glyph_props (hb_font_t *font, + hb_buffer_t *buffer) +{ + _hb_buffer_assert_gsubgpos_vars (buffer); + + const OT::GDEF &gdef = _get_gdef (font->face); + unsigned int count = buffer->len; + for (unsigned int i = 0; i < count; i++) + { + _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint)); + _hb_glyph_info_clear_lig_props (&buffer->info[i]); + buffer->info[i].syllable() = 0; + } +} + +/* Public API */ + hb_bool_t hb_ot_layout_has_glyph_classes (hb_face_t *face) { @@ -902,9 +920,10 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t *face, } void -hb_ot_layout_substitute_start (hb_font_t *font, hb_buffer_t *buffer) +hb_ot_layout_substitute_start (hb_font_t *font, + hb_buffer_t *buffer) { - OT::GSUB::substitute_start (font, buffer); +_hb_ot_layout_set_glyph_props (font, buffer); } /** -- 2.7.4