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 934251636..c7062e6cf 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -3850,7 +3850,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 @@ -3988,7 +3988,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 @@ -4011,6 +4011,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 {