From 5fd0a3f0b9235a50a72e3a89fb8ae41a28fc049e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 11 Jul 2022 13:10:04 -0600 Subject: [PATCH] [>64k:layout] Templatize GSUBGPOSFormat1 --- src/hb-ot-layout-common.hh | 3 ++- src/hb-ot-layout-gsubgpos.hh | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 7f1514edc..0d13e4bbc 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1404,7 +1404,8 @@ struct Lookup DEFINE_SIZE_ARRAY (6, subTable); }; -typedef List16OfOffset16To LookupList; +template +using LookupList = List16OfOffsetTo; template struct LookupOffsetList : List16OfOffset16To diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c1ed59ca6..df2a3febf 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -3983,18 +3983,19 @@ struct hb_ot_layout_lookup_accelerator_t #endif }; -struct GSUBGPOSVersion1 +template +struct GSUBGPOSVersion1_2 { friend struct GSUBGPOS; protected: FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set * to 0x00010000u */ - Offset16To + typename Types:: template OffsetTo scriptList; /* ScriptList table */ - Offset16To + typename Types::template OffsetTo featureList; /* FeatureList table */ - Offset16To + typename Types::template OffsetTo> lookupList; /* LookupList table */ Offset32To featureVars; /* Offset to Feature Variations @@ -4002,7 +4003,7 @@ struct GSUBGPOSVersion1 * (may be NULL). Introduced * in version 0x00010001. */ public: - DEFINE_SIZE_MIN (10); + DEFINE_SIZE_MIN (4 + 3 * Types::size); unsigned int get_size () const { @@ -4310,8 +4311,8 @@ struct GSUBGPOS protected: union { - FixedVersion<> version; /* Version identifier */ - GSUBGPOSVersion1 version1; + FixedVersion<> version; /* Version identifier */ + GSUBGPOSVersion1_2 version1; } u; public: DEFINE_SIZE_MIN (4);