From c6173a392cfaa3d339c768836e8cddf3ae4adc53 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 14 Nov 2017 21:09:03 -0800 Subject: [PATCH] Add Offset16 and Offset32 --- src/hb-open-type-private.hh | 5 ++++- src/hb-ot-layout-common-private.hh | 4 ++-- src/hb-ot-name-table.hh | 2 +- src/hb-ot-var-fvar-table.hh | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 6ad3c0f..2f4e1b9 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -705,7 +705,7 @@ struct Index : UINT16 { DEFINE_NULL_DATA (Index, "\xff\xff"); /* Offset, Null offset = 0 */ -template +template struct Offset : Type { inline bool is_null (void) const { return 0 == *this; } @@ -713,6 +713,9 @@ struct Offset : Type DEFINE_SIZE_STATIC (sizeof(Type)); }; +typedef Offset Offset16; +typedef Offset Offset32; + /* CheckSum */ struct CheckSum : UINT32 diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index dfbcf1e..86a74cc 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -216,7 +216,7 @@ struct LangSys return_trace (c->check_struct (this) && featureIndex.sanitize (c)); } - Offset<> lookupOrderZ; /* = Null (reserved for an offset to a + Offset16 lookupOrderZ; /* = Null (reserved for an offset to a * reordering table) */ UINT16 reqFeatureIndex;/* Index of a feature required for this * language system--if no required features @@ -662,7 +662,7 @@ struct Lookup private: UINT16 lookupType; /* Different enumerations for GSUB and GPOS */ UINT16 lookupFlag; /* Lookup qualifiers */ - ArrayOf > + ArrayOf subTable; /* Array of SubTables */ UINT16 markFilteringSetX[VAR]; /* Index (base 0) into GDEF mark glyph sets * structure. This field is only present if bit diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index e90e46c..4c5b3c0 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -125,7 +125,7 @@ struct name /* We only implement format 0 for now. */ UINT16 format; /* Format selector (=0/1). */ UINT16 count; /* Number of name records. */ - Offset<> stringOffset; /* Offset to start of string storage (from start of table). */ + Offset16 stringOffset; /* Offset to start of string storage (from start of table). */ NameRecord nameRecord[VAR]; /* The name records where count is the number of records. */ public: DEFINE_SIZE_ARRAY (6, nameRecord); diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh index ab7d35b..2a9357a 100644 --- a/src/hb-ot-var-fvar-table.hh +++ b/src/hb-ot-var-fvar-table.hh @@ -186,7 +186,7 @@ struct fvar protected: FixedVersion<>version; /* Version of the fvar table * initially set to 0x00010000u */ - Offset<> things; /* Offset in bytes from the beginning of the table + Offset16 things; /* Offset in bytes from the beginning of the table * to the start of the AxisRecord array. */ UINT16 reserved; /* This field is permanently reserved. Set to 2. */ UINT16 axisCount; /* The number of variation axes in the font (the -- 2.7.4