[>64k:layout] Templatize MarkBasePos/MarkMarkPos/MarkLigPos

This commit is contained in:
Behdad Esfahbod 2022-07-08 12:22:16 -06:00
parent f0d6dda5a6
commit 4b43070e2f
6 changed files with 27 additions and 24 deletions

View File

@ -11,8 +11,8 @@ struct MarkBasePos
{ {
protected: protected:
union { union {
HBUINT16 format; /* Format identifier */ HBUINT16 format; /* Format identifier */
MarkBasePosFormat1 format1; MarkBasePosFormat1_2<SmallTypes> format1;
} u; } u;
public: public:

View File

@ -12,26 +12,27 @@ typedef AnchorMatrix BaseArray; /* base-major--
* mark-minor-- * mark-minor--
* ordered by class--zero-based. */ * ordered by class--zero-based. */
struct MarkBasePosFormat1 template <typename Types>
struct MarkBasePosFormat1_2
{ {
protected: protected:
HBUINT16 format; /* Format identifier--format = 1 */ HBUINT16 format; /* Format identifier--format = 1 */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
markCoverage; /* Offset to MarkCoverage table--from markCoverage; /* Offset to MarkCoverage table--from
* beginning of MarkBasePos subtable */ * beginning of MarkBasePos subtable */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
baseCoverage; /* Offset to BaseCoverage table--from baseCoverage; /* Offset to BaseCoverage table--from
* beginning of MarkBasePos subtable */ * beginning of MarkBasePos subtable */
HBUINT16 classCount; /* Number of classes defined for marks */ HBUINT16 classCount; /* Number of classes defined for marks */
Offset16To<MarkArray> typename Types::template OffsetTo<MarkArray>
markArray; /* Offset to MarkArray table--from markArray; /* Offset to MarkArray table--from
* beginning of MarkBasePos subtable */ * beginning of MarkBasePos subtable */
Offset16To<BaseArray> typename Types::template OffsetTo<BaseArray>
baseArray; /* Offset to BaseArray table--from baseArray; /* Offset to BaseArray table--from
* beginning of MarkBasePos subtable */ * beginning of MarkBasePos subtable */
public: public:
DEFINE_SIZE_STATIC (12); DEFINE_SIZE_STATIC (4 + 4 * Types::size);
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ {

View File

@ -11,8 +11,8 @@ struct MarkLigPos
{ {
protected: protected:
union { union {
HBUINT16 format; /* Format identifier */ HBUINT16 format; /* Format identifier */
MarkLigPosFormat1 format1; MarkLigPosFormat1_2<SmallTypes> format1;
} u; } u;
public: public:

View File

@ -8,26 +8,27 @@ namespace Layout {
namespace GPOS_impl { namespace GPOS_impl {
struct MarkLigPosFormat1 template <typename Types>
struct MarkLigPosFormat1_2
{ {
protected: protected:
HBUINT16 format; /* Format identifier--format = 1 */ HBUINT16 format; /* Format identifier--format = 1 */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
markCoverage; /* Offset to Mark Coverage table--from markCoverage; /* Offset to Mark Coverage table--from
* beginning of MarkLigPos subtable */ * beginning of MarkLigPos subtable */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
ligatureCoverage; /* Offset to Ligature Coverage ligatureCoverage; /* Offset to Ligature Coverage
* table--from beginning of MarkLigPos * table--from beginning of MarkLigPos
* subtable */ * subtable */
HBUINT16 classCount; /* Number of defined mark classes */ HBUINT16 classCount; /* Number of defined mark classes */
Offset16To<MarkArray> typename Types::template OffsetTo<MarkArray>
markArray; /* Offset to MarkArray table--from markArray; /* Offset to MarkArray table--from
* beginning of MarkLigPos subtable */ * beginning of MarkLigPos subtable */
Offset16To<LigatureArray> typename Types::template OffsetTo<LigatureArray>
ligatureArray; /* Offset to LigatureArray table--from ligatureArray; /* Offset to LigatureArray table--from
* beginning of MarkLigPos subtable */ * beginning of MarkLigPos subtable */
public: public:
DEFINE_SIZE_STATIC (12); DEFINE_SIZE_STATIC (4 + 4 * Types::size);
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ {

View File

@ -11,8 +11,8 @@ struct MarkMarkPos
{ {
protected: protected:
union { union {
HBUINT16 format; /* Format identifier */ HBUINT16 format; /* Format identifier */
MarkMarkPosFormat1 format1; MarkMarkPosFormat1_2<SmallTypes> format1;
} u; } u;
public: public:

View File

@ -12,27 +12,28 @@ typedef AnchorMatrix Mark2Array; /* mark2-major--
* mark1-minor-- * mark1-minor--
* ordered by class--zero-based. */ * ordered by class--zero-based. */
struct MarkMarkPosFormat1 template <typename Types>
struct MarkMarkPosFormat1_2
{ {
protected: protected:
HBUINT16 format; /* Format identifier--format = 1 */ HBUINT16 format; /* Format identifier--format = 1 */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
mark1Coverage; /* Offset to Combining Mark1 Coverage mark1Coverage; /* Offset to Combining Mark1 Coverage
* table--from beginning of MarkMarkPos * table--from beginning of MarkMarkPos
* subtable */ * subtable */
Offset16To<Coverage> typename Types::template OffsetTo<Coverage>
mark2Coverage; /* Offset to Combining Mark2 Coverage mark2Coverage; /* Offset to Combining Mark2 Coverage
* table--from beginning of MarkMarkPos * table--from beginning of MarkMarkPos
* subtable */ * subtable */
HBUINT16 classCount; /* Number of defined mark classes */ HBUINT16 classCount; /* Number of defined mark classes */
Offset16To<MarkArray> typename Types::template OffsetTo<MarkArray>
mark1Array; /* Offset to Mark1Array table--from mark1Array; /* Offset to Mark1Array table--from
* beginning of MarkMarkPos subtable */ * beginning of MarkMarkPos subtable */
Offset16To<Mark2Array> typename Types::template OffsetTo<Mark2Array>
mark2Array; /* Offset to Mark2Array table--from mark2Array; /* Offset to Mark2Array table--from
* beginning of MarkMarkPos subtable */ * beginning of MarkMarkPos subtable */
public: public:
DEFINE_SIZE_STATIC (12); DEFINE_SIZE_STATIC (4 + 4 * Types::size);
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ {