diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-12-22 00:39:38 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-12-22 00:39:38 +0000 |
commit | aefa260469999e53f3b8ea263fda94cdddef8ce3 (patch) | |
tree | e1182a668216a25f19d5f18ffcfec27cc7925b96 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh | |
parent | 27205aecce351fee6bb1ad9a7c43d4b542e28a1a (diff) |
harfbuzz-2.3.0
git-svn-id: svn://tug.org/texlive/trunk@49473 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh | 146 |
1 files changed, 82 insertions, 64 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh index a0ae27e75cb..3099fb96a80 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh @@ -46,10 +46,10 @@ typedef ArrayOf<HBUINT16> AttachPoint; /* Array of contour point indices--in struct AttachList { - inline unsigned int get_attach_points (hb_codepoint_t glyph_id, - unsigned int start_offset, - unsigned int *point_count /* IN/OUT */, - unsigned int *point_array /* OUT */) const + unsigned int get_attach_points (hb_codepoint_t glyph_id, + unsigned int start_offset, + unsigned int *point_count /* IN/OUT */, + unsigned int *point_array /* OUT */) const { unsigned int index = (this+coverage).get_coverage (glyph_id); if (index == NOT_COVERED) @@ -72,7 +72,7 @@ struct AttachList return points.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && attachPoint.sanitize (c, this)); @@ -98,12 +98,12 @@ struct CaretValueFormat1 friend struct CaretValue; private: - inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction) const + hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction) const { return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -121,14 +121,14 @@ struct CaretValueFormat2 friend struct CaretValue; private: - inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const + hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const { hb_position_t x, y; font->get_glyph_contour_point_for_origin (glyph_id, caretValuePoint, direction, &x, &y); return HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -145,14 +145,15 @@ struct CaretValueFormat3 { friend struct CaretValue; - inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, const VariationStore &var_store) const + hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, + const VariationStore &var_store) const { return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) : font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && deviceTable.sanitize (c, this)); @@ -171,7 +172,7 @@ struct CaretValueFormat3 struct CaretValue { - inline hb_position_t get_caret_value (hb_font_t *font, + hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, const VariationStore &var_store) const @@ -184,7 +185,7 @@ struct CaretValue } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -209,13 +210,13 @@ struct CaretValue struct LigGlyph { - inline unsigned int get_lig_carets (hb_font_t *font, - hb_direction_t direction, - hb_codepoint_t glyph_id, - const VariationStore &var_store, - unsigned int start_offset, - unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph_id, + const VariationStore &var_store, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const { if (caret_count) { @@ -228,7 +229,7 @@ struct LigGlyph return carets.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (carets.sanitize (c, this)); @@ -245,13 +246,13 @@ struct LigGlyph struct LigCaretList { - inline unsigned int get_lig_carets (hb_font_t *font, - hb_direction_t direction, - hb_codepoint_t glyph_id, - const VariationStore &var_store, - unsigned int start_offset, - unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph_id, + const VariationStore &var_store, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const { unsigned int index = (this+coverage).get_coverage (glyph_id); if (index == NOT_COVERED) @@ -264,7 +265,7 @@ struct LigCaretList return lig_glyph.get_lig_carets (font, direction, glyph_id, var_store, start_offset, caret_count, caret_array); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this)); @@ -284,10 +285,10 @@ struct LigCaretList struct MarkGlyphSetsFormat1 { - inline bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const + bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const { return (this+coverage[set_index]).get_coverage (glyph_id) != NOT_COVERED; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this)); @@ -304,7 +305,7 @@ struct MarkGlyphSetsFormat1 struct MarkGlyphSets { - inline bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const + bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const { switch (u.format) { case 1: return u.format1.covers (set_index, glyph_id); @@ -312,7 +313,7 @@ struct MarkGlyphSets } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -340,7 +341,7 @@ struct MarkGlyphSets struct GDEF { - static const hb_tag_t tableTag = HB_OT_TAG_GDEF; + enum { tableTag = HB_OT_TAG_GDEF }; enum GlyphClasses { UnclassifiedGlyph = 0, @@ -350,47 +351,47 @@ struct GDEF ComponentGlyph = 4 }; - inline bool has_data (void) const { return version.to_int (); } - inline bool has_glyph_classes (void) const { return glyphClassDef != 0; } - inline unsigned int get_glyph_class (hb_codepoint_t glyph) const + bool has_data () const { return version.to_int (); } + bool has_glyph_classes () const { return glyphClassDef != 0; } + unsigned int get_glyph_class (hb_codepoint_t glyph) const { return (this+glyphClassDef).get_class (glyph); } - inline void get_glyphs_in_class (unsigned int klass, hb_set_t *glyphs) const + void get_glyphs_in_class (unsigned int klass, hb_set_t *glyphs) const { (this+glyphClassDef).add_class (glyphs, klass); } - inline bool has_mark_attachment_types (void) const { return markAttachClassDef != 0; } - inline unsigned int get_mark_attachment_type (hb_codepoint_t glyph) const + bool has_mark_attachment_types () const { return markAttachClassDef != 0; } + unsigned int get_mark_attachment_type (hb_codepoint_t glyph) const { return (this+markAttachClassDef).get_class (glyph); } - inline bool has_attach_points (void) const { return attachList != 0; } - inline unsigned int get_attach_points (hb_codepoint_t glyph_id, - unsigned int start_offset, - unsigned int *point_count /* IN/OUT */, - unsigned int *point_array /* OUT */) const + bool has_attach_points () const { return attachList != 0; } + unsigned int get_attach_points (hb_codepoint_t glyph_id, + unsigned int start_offset, + unsigned int *point_count /* IN/OUT */, + unsigned int *point_array /* OUT */) const { return (this+attachList).get_attach_points (glyph_id, start_offset, point_count, point_array); } - inline bool has_lig_carets (void) const { return ligCaretList != 0; } - inline unsigned int get_lig_carets (hb_font_t *font, - hb_direction_t direction, - hb_codepoint_t glyph_id, - unsigned int start_offset, - unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + bool has_lig_carets () const { return ligCaretList != 0; } + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph_id, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const { return (this+ligCaretList).get_lig_carets (font, direction, glyph_id, get_var_store(), start_offset, caret_count, caret_array); } - inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } - inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const + bool has_mark_sets () const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } + bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef).covers (set_index, glyph_id); } - inline bool has_var_store (void) const { return version.to_int () >= 0x00010003u && varStore != 0; } - inline const VariationStore &get_var_store (void) const + bool has_var_store () const { return version.to_int () >= 0x00010003u && varStore != 0; } + const VariationStore &get_var_store () const { return version.to_int () >= 0x00010003u ? this+varStore : Null(VariationStore); } /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing * glyph class and other bits, and high 8-bit the mark attachment type (if any). * Not to be confused with lookup_props which is very similar. */ - inline unsigned int get_glyph_props (hb_codepoint_t glyph) const + unsigned int get_glyph_props (hb_codepoint_t glyph) const { unsigned int klass = get_glyph_class (glyph); @@ -413,7 +414,7 @@ struct GDEF struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { this->table = hb_sanitize_context_t().reference_table<GDEF> (face); if (unlikely (this->table->is_blacklisted (this->table.get_blob (), face))) @@ -423,22 +424,39 @@ struct GDEF } } - inline void fini (void) - { - this->table.destroy (); - } + void fini () { this->table.destroy (); } hb_blob_ptr_t<GDEF> table; }; - inline unsigned int get_size (void) const + unsigned int get_size () const { return min_size + (version.to_int () >= 0x00010002u ? markGlyphSetsDef.static_size : 0) + (version.to_int () >= 0x00010003u ? varStore.static_size : 0); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + struct GDEF *out = c->serializer->embed (*this); + if (unlikely (!out)) return_trace (false); + + out->glyphClassDef.serialize_subset (c, this+glyphClassDef, out); + out->attachList.set (0);//TODO(subset) serialize_subset (c, this+attachList, out); + out->ligCaretList.set (0);//TODO(subset) serialize_subset (c, this+ligCaretList, out); + out->markAttachClassDef.serialize_subset (c, this+markAttachClassDef, out); + + if (version.to_int () >= 0x00010002u) + out->markGlyphSetsDef.set (0);// TODO(subset) serialize_subset (c, this+markGlyphSetsDef, out); + + if (version.to_int () >= 0x00010003u) + out->varStore.set (0);// TODO(subset) serialize_subset (c, this+varStore, out); + + return_trace (true); + } + + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (version.sanitize (c) && |