[>64k:layout] Templatize GSUBGPOSFormat1

This commit is contained in:
Behdad Esfahbod 2022-07-11 13:10:04 -06:00
parent f6c2aaeea4
commit 5fd0a3f0b9
2 changed files with 10 additions and 8 deletions

View File

@ -1404,7 +1404,8 @@ struct Lookup
DEFINE_SIZE_ARRAY (6, subTable); DEFINE_SIZE_ARRAY (6, subTable);
}; };
typedef List16OfOffset16To<Lookup> LookupList; template <typename Types>
using LookupList = List16OfOffsetTo<Lookup, typename Types::HBUINT>;
template <typename TLookup> template <typename TLookup>
struct LookupOffsetList : List16OfOffset16To<TLookup> struct LookupOffsetList : List16OfOffset16To<TLookup>

View File

@ -3983,18 +3983,19 @@ struct hb_ot_layout_lookup_accelerator_t
#endif #endif
}; };
struct GSUBGPOSVersion1 template <typename Types>
struct GSUBGPOSVersion1_2
{ {
friend struct GSUBGPOS; friend struct GSUBGPOS;
protected: protected:
FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set
* to 0x00010000u */ * to 0x00010000u */
Offset16To<ScriptList> typename Types:: template OffsetTo<ScriptList>
scriptList; /* ScriptList table */ scriptList; /* ScriptList table */
Offset16To<FeatureList> typename Types::template OffsetTo<FeatureList>
featureList; /* FeatureList table */ featureList; /* FeatureList table */
Offset16To<LookupList> typename Types::template OffsetTo<LookupList<Types>>
lookupList; /* LookupList table */ lookupList; /* LookupList table */
Offset32To<FeatureVariations> Offset32To<FeatureVariations>
featureVars; /* Offset to Feature Variations featureVars; /* Offset to Feature Variations
@ -4002,7 +4003,7 @@ struct GSUBGPOSVersion1
* (may be NULL). Introduced * (may be NULL). Introduced
* in version 0x00010001. */ * in version 0x00010001. */
public: public:
DEFINE_SIZE_MIN (10); DEFINE_SIZE_MIN (4 + 3 * Types::size);
unsigned int get_size () const unsigned int get_size () const
{ {
@ -4311,7 +4312,7 @@ struct GSUBGPOS
protected: protected:
union { union {
FixedVersion<> version; /* Version identifier */ FixedVersion<> version; /* Version identifier */
GSUBGPOSVersion1 version1; GSUBGPOSVersion1_2<SmallTypes> version1;
} u; } u;
public: public:
DEFINE_SIZE_MIN (4); DEFINE_SIZE_MIN (4);