[pango/harfbuzz-ng: 10/17] [GSUB] Minor refactoring
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Subject: [pango/harfbuzz-ng: 10/17] [GSUB] Minor refactoring
- Date: Tue, 12 May 2009 03:31:08 -0400 (EDT)
commit e3d3752ed67492358212ecff6f2e3ea71537b4b8
Author: Behdad Esfahbod <behdad behdad org>
Date: Tue May 5 16:22:02 2009 -0400
[GSUB] Minor refactoring
---
pango/opentype/hb-ot-layout-gsub-private.h | 42 +++++++++++++++------------
1 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/pango/opentype/hb-ot-layout-gsub-private.h b/pango/opentype/hb-ot-layout-gsub-private.h
index d141823..f697036 100644
--- a/pango/opentype/hb-ot-layout-gsub-private.h
+++ b/pango/opentype/hb-ot-layout-gsub-private.h
@@ -183,6 +183,28 @@ struct Sequence {
_hb_ot_layout_set_glyph_property (layout, substitute[n], property);
}
+ inline bool substitute_sequence (SUBTABLE_SUBSTITUTE_ARGS_DEF, unsigned int property) const {
+
+ if (HB_UNLIKELY (!get_len ()))
+ return false;
+
+ _hb_buffer_add_output_glyph_ids (buffer, 1,
+ glyphCount, substitute,
+ 0xFFFF, 0xFFFF);
+
+ if ( _hb_ot_layout_has_new_glyph_classes (layout) )
+ {
+ /* this is a guess only ... */
+
+ if ( property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE )
+ property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
+
+ set_glyph_class (layout, property);
+ }
+
+ return true;
+ }
+
private:
USHORT glyphCount; /* Number of GlyphIDs in the Substitute
* array. This should always be
@@ -215,25 +237,7 @@ struct MultipleSubstFormat1 {
unsigned int index = get_glyph_coverage (glyph_id);
const Sequence &seq = (*this)[index];
-
- if (HB_UNLIKELY (!seq.get_len ()))
- return false;
-
- _hb_buffer_add_output_glyph_ids (buffer, 1,
- seq.glyphCount, seq.substitute,
- 0xFFFF, 0xFFFF);
-
- if ( _hb_ot_layout_has_new_glyph_classes (layout) )
- {
- /* this is a guess only ... */
-
- if ( property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE )
- property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
-
- seq.set_glyph_class (layout, property);
- }
-
- return true;
+ return seq.substitute_sequence (SUBTABLE_SUBSTITUTE_ARGS, property);
}
private:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]