From 8d611a7fd06dc2600cb9f9c8b94d305285686f84 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 22 Jul 2022 22:49:40 +0000 Subject: [PATCH] [repacker] remove temporary visibility overrides in gsubgpos. --- src/graph/gsubgpos-graph.hh | 23 ++++++++++++++++------- src/hb-ot-layout-gsubgpos.hh | 9 +++++++-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/graph/gsubgpos-graph.hh b/src/graph/gsubgpos-graph.hh index f67701e31..73abc3e70 100644 --- a/src/graph/gsubgpos-graph.hh +++ b/src/graph/gsubgpos-graph.hh @@ -55,6 +55,17 @@ struct make_extension_context_t HB_INTERNAL unsigned num_non_ext_subtables (); }; +template +struct ExtensionFormat1 : public OT::ExtensionFormat1 +{ + void reset(unsigned type) + { + this->format = 1; + this->extensionLookupType = type; + this->extensionOffset = 0; + } +}; + struct Lookup : public OT::Lookup { unsigned number_of_subtables () const @@ -114,11 +125,9 @@ struct Lookup : public OT::Lookup if (!c.buffer.resize (c.buffer.length + extension_size)) return false; - OT::ExtensionFormat1* extension = - (OT::ExtensionFormat1*) &c.buffer[start]; - extension->format = 1; - extension->extensionLookupType = type; - extension->extensionOffset = 0; + ExtensionFormat1* extension = + (ExtensionFormat1*) &c.buffer[start]; + extension->reset (type); unsigned ext_index = c.graph.new_node (&c.buffer.arrayZ[start], &c.buffer.arrayZ[end]); @@ -189,9 +198,9 @@ struct GSTAR : public OT::GSUBGPOS const void* get_lookup_list_field_offset () const { switch (u.version.major) { - case 1: return &(u.version1.lookupList); + case 1: return u.version1.get_lookup_list_offset (); #ifndef HB_NO_BORING_EXPANSION - case 2: return &(u.version2.lookupList); + case 2: return u.version2.get_lookup_list_offset (); #endif default: return 0; } diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c3f49c973..c77ec12fb 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -3868,7 +3868,7 @@ struct ExtensionFormat1 return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ())); } - public: // TODO + protected: HBUINT16 format; /* Format identifier. Set to 1. */ HBUINT16 extensionLookupType; /* Lookup type of subtable referenced * by ExtensionOffset (i.e. the @@ -4006,7 +4006,7 @@ struct GSUBGPOSVersion1_2 { friend struct GSUBGPOS; - public: // TODO + protected: FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set * to 0x00010000u */ typename Types:: template OffsetTo @@ -4029,6 +4029,11 @@ struct GSUBGPOSVersion1_2 (version.to_int () >= 0x00010001u ? featureVars.static_size : 0); } + const typename Types::template OffsetTo>* get_lookup_list_offset () const + { + return &lookupList; + } + template bool sanitize (hb_sanitize_context_t *c) const {