[OT] Move code around
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 26 Aug 2018 16:19:20 +0000 (09:19 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 26 Aug 2018 16:19:20 +0000 (09:19 -0700)
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout.cc

index 8911a5e..11fe7cf 100644 (file)
@@ -1308,8 +1308,6 @@ struct GSUB : GSUBGPOS
   inline const SubstLookup& get_lookup (unsigned int i) const
   { return CastR<SubstLookup> (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
index 4d2aeee..2763532 100644 (file)
@@ -213,6 +213,24 @@ OT::GDEF::accelerator_t::init (hb_face_t *face)
   table = this->blob->as<GDEF> ();
 }
 
+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);
 }
 
 /**