table; /* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
public:
- DEFINE_SIZE_STATIC (12);
+ DEFINE_SIZE_VAR (12, LongOffset);
};
struct TTCHeader
#define VAR 1
#define VAR0 (VAR+0)
-#define DEFINE_SIZE_VAR0(size) \
- _DEFINE_SIZE_ASSERTION (size); \
+#define DEFINE_SIZE_MIN(size) \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_VAR(size, _var_type) \
inline const Type& Null<Type> () { \
return *CastP<Type> (_Null##Type); \
} /* The following line really exists such that we end in a place needing semicolon */ \
-ASSERT_STATIC (sizeof (Type) + 1 <= sizeof (_Null##Type))
+ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
/* Accessor macro. */
#define Null(Type) Null<Type>()
public:
LenType len;
-/*Type array[VAR];*/
+ private:
+ Type arrayX[VAR];
public:
- DEFINE_SIZE_VAR0 (sizeof (LenType));
+ DEFINE_SIZE_VAR (sizeof (LenType), Type);
};
/* An array with a USHORT number of elements. */
* = 0xFFFF */
IndexArray featureIndex; /* Array of indices into the FeatureList */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, USHORT);
};
DEFINE_NULL_DATA (LangSys, "\0\0\xFF\xFF");
langSys; /* Array of LangSysRecords--listed
* alphabetically by LangSysTag */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, Record<LangSys>);
};
typedef RecordListOf<Script> ScriptList;
* if not required */
IndexArray lookupIndex; /* Array of LookupList indices */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, USHORT);
};
typedef RecordListOf<Feature> FeatureList;
* structure. This field is only present if bit
* UseMarkFilteringSet of lookup flags is set. */
public:
- DEFINE_SIZE_VAR (6, USHORT);
+ DEFINE_SIZE_VAR2 (6, Offset, USHORT);
};
typedef OffsetListOf<Lookup> LookupList;
ArrayOf<GlyphID>
glyphArray; /* Array of GlyphIDs--in numerical order */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, GlyphID);
};
struct CoverageRangeRecord
* Start GlyphID. rangeCount entries
* long */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, CoverageRangeRecord);
};
struct Coverage
ArrayOf<USHORT>
classValue; /* Array of Class Values--one per GlyphID */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, USHORT);
};
struct ClassRangeRecord
rangeRecord; /* Array of glyph ranges--ordered by
* Start GlyphID */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, ClassRangeRecord);
};
struct ClassDef
attachPoint; /* Array of AttachPoint tables
* in Coverage Index order */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, OffsetTo<AttachPoint>);
};
/*
* --from beginning of LigGlyph table
* --in increasing coordinate order */
public:
- DEFINE_SIZE_STATIC (2);
+ DEFINE_SIZE_VAR (2, OffsetTo<CaretValue>);
};
struct LigCaretList
ligGlyph; /* Array of LigGlyph tables
* in Coverage Index order */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, OffsetTo<LigGlyph>);
};
coverage; /* Array of long offsets to mark set
* coverage tables */
public:
- DEFINE_SIZE_STATIC (4);
+ DEFINE_SIZE_VAR (4, LongOffsetTo<Coverage>);
};
struct MarkGlyphSets
DEFINE_SIZE_STATIC (4);
};
-struct MarkArray
+struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage order */
{
inline bool apply (hb_apply_context_t *context,
unsigned int mark_index, unsigned int glyph_index,
unsigned int glyph_pos) const
{
TRACE_APPLY ();
- const MarkRecord &record = markRecord[mark_index];
+ const MarkRecord &record = ArrayOf<MarkRecord>::operator[](mark_index);
unsigned int mark_class = record.klass;
const Anchor& mark_anchor = this + record.markAnchor;
inline bool sanitize (hb_sanitize_context_t *context) {
TRACE_SANITIZE ();
- return markRecord.sanitize (context, this);
+ return ArrayOf<MarkRecord>::sanitize (context, this);
}
-
- private:
- ArrayOf<MarkRecord>
- markRecord; /* Array of MarkRecords--in Coverage order */
- public:
- DEFINE_SIZE_STATIC (2);
};
pairSet; /* Array of PairSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (10);
+ DEFINE_SIZE_VAR (10, OffsetTo<PairSet>);
};
struct PairPosFormat2
entryExitRecord; /* Array of EntryExit records--in
* Coverage Index order */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, EntryExitRecord);
};
struct CursivePos
substitute; /* Array of substitute
* GlyphIDs--ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, GlyphID);
};
struct SingleSubst
ArrayOf<GlyphID>
substitute; /* String of GlyphIDs to substitute */
public:
- DEFINE_SIZE_STATIC (2);
+ DEFINE_SIZE_VAR (2, GlyphID);
};
struct MultipleSubstFormat1
sequence; /* Array of Sequence tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, OffsetTo<Sequence>);
};
struct MultipleSubst
alternateSet; /* Array of AlternateSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, OffsetTo<AlternateSet>);
};
struct AlternateSubst
ligature; /* Array LigatureSet tables
* ordered by preference */
public:
- DEFINE_SIZE_STATIC (2);
+ DEFINE_SIZE_VAR (2, OffsetTo<Ligature>);
};
struct LigatureSubstFormat1
ligatureSet; /* Array LigatureSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, OffsetTo<LigatureSet>);
};
struct LigatureSubst
substituteX; /* Array of substitute
* GlyphIDs--ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (10);
+ DEFINE_SIZE_MIN (10);
};
struct ReverseChainSingleSubst
ruleSet; /* Array of RuleSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, OffsetTo<RuleSet>);
};
ruleSet; /* Array of RuleSet tables
* ordered by class */
public:
- DEFINE_SIZE_STATIC (8);
+ DEFINE_SIZE_VAR (8, OffsetTo<RuleSet>);
};
lookupX; /* Array of LookupRecords--in
* design order) */
public:
- DEFINE_SIZE_STATIC (8);
+ DEFINE_SIZE_MIN (8);
};
struct ChainRuleSet
rule; /* Array of ChainRule tables
* ordered by preference */
public:
- DEFINE_SIZE_STATIC (2);
+ DEFINE_SIZE_VAR (2, OffsetTo<ChainRule>);
};
struct ChainContextFormat1
ruleSet; /* Array of ChainRuleSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_STATIC (6);
+ DEFINE_SIZE_VAR (6, OffsetTo<ChainRuleSet>);
};
struct ChainContextFormat2
ruleSet; /* Array of ChainRuleSet tables
* ordered by class */
public:
- DEFINE_SIZE_STATIC (12);
+ DEFINE_SIZE_VAR (12, OffsetTo<ChainRuleSet>);
};
struct ChainContextFormat3
lookupX; /* Array of LookupRecords--in
* design order) */
public:
- DEFINE_SIZE_STATIC (10);
+ DEFINE_SIZE_MIN (10);
};
struct ChainContext