struct OffsetTable;
struct TTCHeader;
+
typedef struct TableDirectory
{
inline bool sanitize (hb_sanitize_context_t *context) {
return context->check_struct (this);
}
- DEFINE_SIZE_STATIC (16);
-
Tag tag; /* 4-byte identifier. */
CheckSum checkSum; /* CheckSum for this table. */
ULONG offset; /* Offset from beginning of TrueType font
* file. */
ULONG length; /* Length of this table. */
+ public:
+ DEFINE_SIZE_STATIC (16);
} OpenTypeTable;
typedef struct OffsetTable
USHORT entrySelector; /* Log2(maximum power of 2 <= numTables). */
USHORT rangeShift; /* NumTables x 16-searchRange. */
TableDirectory tableDir[VAR]; /* TableDirectory entries. numTables items */
+ public:
+ DEFINE_SIZE_VAR (12, TableDirectory);
} OpenTypeFontFace;
-ASSERT_SIZE_VAR (OffsetTable, 12, TableDirectory);
+
/*
* TrueType Collections
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); } \
static const unsigned int min_size = (size)
-#define DEFINE_SIZE_VAR2(_type, size, _var_type1, _var_type2) \
+#define DEFINE_SIZE_VAR2(size, _var_type1, _var_type2) \
inline void _size_assertion (void) const \
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); } \
static const unsigned int min_size = (size)
TRACE_SANITIZE ();
return context->check_struct (this);
}
+ private:
+ BEInt<Type, sizeof (Type)> v;
+ public:
DEFINE_SIZE_STATIC (sizeof (Type));
- private: BEInt<Type, sizeof (Type)> v;
};
typedef IntType<uint16_t> USHORT; /* 16-bit unsigned integer. */
&& offset.sanitize (context, base);
}
- DEFINE_SIZE_STATIC (6);
-
Tag tag; /* 4-byte Tag identifier */
OffsetTo<Type>
offset; /* Offset from beginning of object holding
* the Record */
+ public:
+ DEFINE_SIZE_STATIC (6);
};
template <typename Type>
&& featureIndex.sanitize (context);
}
- DEFINE_SIZE_STATIC (6);
-
Offset lookupOrder; /* = Null (reserved for an offset to a
* reordering table) */
USHORT reqFeatureIndex;/* Index of a feature required for this
* language system--if no required features
* = 0xFFFF */
IndexArray featureIndex; /* Array of indices into the FeatureList */
+ public:
+ DEFINE_SIZE_STATIC (6);
};
DEFINE_NULL_DATA (LangSys, "\0\0\xFF\xFF");
USHORT markFilteringSetX[VAR]; /* Index (base 0) into GDEF mark glyph sets
* structure. This field is only present if bit
* UseMarkFilteringSet of lookup flags is set. */
+ public:
+ DEFINE_SIZE_VAR (6, USHORT);
};
-ASSERT_SIZE_VAR (Lookup, 6, USHORT);
typedef OffsetListOf<Lookup> LookupList;
ASSERT_SIZE (LookupList, 2);
return context->check_struct (this);
}
- DEFINE_SIZE_STATIC (6);
-
private:
GlyphID start; /* First GlyphID in the range */
GlyphID end; /* Last GlyphID in the range */
USHORT startCoverageIndex; /* Coverage Index of first GlyphID in
* range */
+ public:
+ DEFINE_SIZE_STATIC (6);
};
DEFINE_NULL_DATA (CoverageRangeRecord, "\000\001");
return context->check_struct (this);
}
- DEFINE_SIZE_STATIC (6);
-
private:
GlyphID start; /* First GlyphID in the range */
GlyphID end; /* Last GlyphID in the range */
USHORT classValue; /* Applied to all glyphs in the range */
+ public:
+ DEFINE_SIZE_STATIC (6);
};
DEFINE_NULL_DATA (ClassRangeRecord, "\000\001");
* 3 Signed 8-bit value, 2 values per uint16
*/
USHORT deltaValue[VAR]; /* Array of compressed data */
+ public:
+ DEFINE_SIZE_VAR (6, USHORT);
};
-ASSERT_SIZE_VAR (Device, 6, USHORT);
#endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */
* definitions--from beginning of GDEF
* header (may be NULL). Introduced
* in version 00010002. */
+ public:
+ DEFINE_SIZE_VAR (12, OffsetTo<MarkGlyphSets>);
};
-ASSERT_SIZE_VAR (GDEF, 12, OffsetTo<MarkGlyphSets>);
#endif /* HB_OT_LAYOUT_GDEF_PRIVATE_HH */
typedef USHORT Value;
typedef Value ValueRecord[VAR0];
-ASSERT_SIZE_VAR (ValueRecord, 0, Value);
struct ValueFormat : USHORT
{
OffsetTo<Anchor>
matrix[VAR]; /* Matrix of offsets to Anchor tables--
* from beginning of AnchorMatrix table */
+ public:
+ DEFINE_SIZE_VAR (2, OffsetTo<Anchor>);
};
-ASSERT_SIZE_VAR (AnchorMatrix, 2, OffsetTo<Anchor>);
struct MarkRecord
&& markAnchor.sanitize (context, base);
}
- DEFINE_SIZE_STATIC (4);
-
private:
USHORT klass; /* Class defined for this mark */
OffsetTo<Anchor>
markAnchor; /* Offset to Anchor table--from
* beginning of MarkArray table */
+ public:
+ DEFINE_SIZE_STATIC (4);
};
struct MarkArray
ValueRecord values; /* Defines positioning
* value(s)--applied to all glyphs in
* the Coverage table */
+ public:
+ DEFINE_SIZE_VAR (6, ValueRecord);
};
-ASSERT_SIZE_VAR (SinglePosFormat1, 6, ValueRecord);
struct SinglePosFormat2
{
USHORT valueCount; /* Number of ValueRecords */
ValueRecord values; /* Array of ValueRecords--positioning
* values applied to glyphs */
+ public:
+ DEFINE_SIZE_VAR (8, ValueRecord);
};
-ASSERT_SIZE_VAR (SinglePosFormat2, 8, ValueRecord);
struct SinglePos
{
* Coverage table */
ValueRecord values; /* Positioning data for the first glyph
* followed by for second glyph */
+ public:
+ DEFINE_SIZE_VAR (2, ValueRecord);
};
-ASSERT_SIZE_VAR (PairValueRecord, 2, ValueRecord);
struct PairSet
{
PairValueRecord
array[VAR]; /* Array of PairValueRecords--ordered
* by GlyphID of the second glyph */
+ public:
+ DEFINE_SIZE_VAR (2, PairValueRecord);
};
-ASSERT_SIZE_VAR (PairSet, 2, PairValueRecord);
struct PairPosFormat1
{
ValueRecord values; /* Matrix of value pairs:
* class1-major, class2-minor,
* Each entry has value1 and value2 */
+ public:
+ DEFINE_SIZE_VAR (16, ValueRecord);
};
-ASSERT_SIZE_VAR (PairPosFormat2, 16, ValueRecord);
struct PairPos
{
struct EntryExitRecord
{
+ friend struct CursivePosFormat1;
+
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
TRACE_SANITIZE ();
return entryAnchor.sanitize (context, base)
&& exitAnchor.sanitize (context, base);
}
- DEFINE_SIZE_STATIC (4);
-
+ private:
OffsetTo<Anchor>
entryAnchor; /* Offset to EntryAnchor table--from
* beginning of CursivePos
exitAnchor; /* Offset to ExitAnchor table--from
* beginning of CursivePos
* subtable--may be NULL */
+ public:
+ DEFINE_SIZE_STATIC (4);
};
struct CursivePosFormat1
return context->check_struct (this);
}
- DEFINE_SIZE_STATIC (4);
-
USHORT sequenceIndex; /* Index into current glyph
* sequence--first glyph = 0 */
USHORT lookupListIndex; /* Lookup to apply to that
* position--zero--based */
+ public:
+ DEFINE_SIZE_STATIC (4);
};
static inline bool apply_lookup (hb_apply_context_t *context,
* second glyph */
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
* design order */
+ public:
+ DEFINE_SIZE_VAR2 (4, USHORT, LookupRecord);
};
-ASSERT_SIZE_VAR2 (Rule, 4, USHORT, LookupRecord);
struct RuleSet
{
* table in glyph sequence order */
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
* design order */
+ public:
+ DEFINE_SIZE_VAR2 (6, OffsetTo<Coverage>, LookupRecord);
};
-ASSERT_SIZE_VAR2 (ContextFormat3, 6, OffsetTo<Coverage>, LookupRecord);
struct Context
{
#define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
-/* Size signifying variable-sized array */
-#define VAR 1
-
-#define VAR0 (VAR+0)
-#define ASSERT_SIZE_VAR(_type, _size, _var_type) \
- ASSERT_STATIC (sizeof (_type) == (_size) + VAR0 * sizeof (_var_type))
-#define ASSERT_SIZE_VAR2(_type, _size, _var_type1, _var_type2) \
- ASSERT_STATIC (sizeof (_type) == (_size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _HB_BOOLEAN_EXPR(expr) \