diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index acbda8de5..009db20ae 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -30,7 +30,6 @@ #include "hb-font-private.hh" -#include "hb-ot-layout-base-table.hh" #include "hb-ot-cmap-table.hh" #include "hb-ot-cbdt-table.hh" #include "hb-ot-glyf-table.hh" diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index 8ad01fe32..b3c0927b1 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -109,7 +109,7 @@ struct MinMaxTable { ArrayOf featMinMaxRecordTable; public: - DEFINE_SIZE_ARRAY (6, featMinMaxRecordTable); + DEFINE_SIZE_ARRAY (8, featMinMaxRecordTable); }; @@ -127,10 +127,10 @@ struct BaseValuesTable { protected: USHORT defaultIndex; USHORT baseCoordCount; - ArrayOf baseCoordTable; + OffsetArrayOf baseCoordTable; public: - DEFINE_SIZE_ARRAY (4, baseCoordTable); + DEFINE_SIZE_ARRAY (6, baseCoordTable); }; @@ -142,7 +142,7 @@ struct BaseScriptTable { ArrayOf baseLangSysRecordTable; public: - DEFINE_SIZE_ARRAY (6, baseLangSysRecordTable); + DEFINE_SIZE_ARRAY (8, baseLangSysRecordTable); }; @@ -153,7 +153,7 @@ struct BaseScriptRecord { OffsetTo baseScript; public: - DEFINE_SIZE_STATIC (4); + DEFINE_SIZE_STATIC (6); }; struct BaseScriptList { @@ -163,7 +163,7 @@ struct BaseScriptList { ArrayOf baseScriptRecordTable; public: - DEFINE_SIZE_ARRAY (2, baseScriptRecordTable); + DEFINE_SIZE_ARRAY (4, baseScriptRecordTable); }; @@ -182,10 +182,10 @@ struct BaseTagList protected: USHORT baseTagCount; - ArrayOf BaseTagListTable; + ArrayOf baseTagListTable; public: - DEFINE_SIZE_STATIC (4); + DEFINE_SIZE_ARRAY (4, baseTagListTable); }; struct VertAxis @@ -210,6 +210,32 @@ struct HorizAxis DEFINE_SIZE_STATIC (4); }; + +struct BASEFormat1_1 +{ + + protected: + FixedVersion<>version; + OffsetTo horizAxis; + OffsetTo vertAxis; + LOffsetTo itemVarStore; + + public: + DEFINE_SIZE_STATIC (12); +}; + +struct BASEFormat1_0 +{ + + protected: + FixedVersion<>version; + OffsetTo horizAxis; + OffsetTo vertAxis; + + public: + DEFINE_SIZE_STATIC (8); +}; + struct BASE { static const hb_tag_t tableTag = HB_OT_TAG_BASE; @@ -217,18 +243,19 @@ struct BASE inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (version.sanitize (c) && - likely (version.major == 1)); + return_trace (u.version.sanitize (c) && + likely (u.version.major == 1)); } protected: - FixedVersion<>version; /* Version of the BASE table: 1.0 or 1.1 */ - OffsetTo horizAxis; - OffsetTo vertAxis; - //LOffsetTo itemVarStore; + union { + FixedVersion<>version; /* Version of the BASE table: 1.0 or 1.1 */ + BASEFormat1_0 format1_0; + BASEFormat1_1 format1_1; + } u; public: - DEFINE_SIZE_MIN (6); + DEFINE_SIZE_UNION (4, version); }; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index a1682a5f9..3511810ac 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -31,6 +31,7 @@ #include "hb-open-type-private.hh" #include "hb-ot-layout-private.hh" +#include "hb-ot-layout-base-table.hh" #include "hb-ot-layout-gdef-table.hh" #include "hb-ot-layout-gsub-table.hh" #include "hb-ot-layout-gpos-table.hh"