Prefix int types with HB

Such a headache that Windows defines UINT8, ...; Just prefix it.
This commit is contained in:
Behdad Esfahbod 2018-01-10 03:07:30 +01:00
parent 81e321c802
commit 6b19178ee3
24 changed files with 517 additions and 523 deletions

View File

@ -33,9 +33,6 @@
namespace AAT {
using namespace OT;
using OT::UINT8;
using OT::UINT16;
using OT::UINT32;
/*
@ -51,13 +48,13 @@ struct BinSearchHeader
return_trace (c->check_struct (this));
}
UINT16 unitSize; /* Size of a lookup unit for this search in bytes. */
UINT16 nUnits; /* Number of units of the preceding size to be searched. */
UINT16 searchRange; /* The value of unitSize times the largest power of 2
HBUINT16 unitSize; /* Size of a lookup unit for this search in bytes. */
HBUINT16 nUnits; /* Number of units of the preceding size to be searched. */
HBUINT16 searchRange; /* The value of unitSize times the largest power of 2
* that is less than or equal to the value of nUnits. */
UINT16 entrySelector; /* The log base 2 of the largest power of 2 less than
HBUINT16 entrySelector; /* The log base 2 of the largest power of 2 less than
* or equal to the value of nUnits. */
UINT16 rangeShift; /* The value of unitSize times the difference of the
HBUINT16 rangeShift; /* The value of unitSize times the difference of the
* value of nUnits minus the largest power of 2 less
* than or equal to the value of nUnits. */
public:
@ -137,7 +134,7 @@ struct BinSearchArrayOf
protected:
BinSearchHeader header;
UINT8 bytes[VAR];
HBUINT8 bytes[VAR];
public:
DEFINE_SIZE_ARRAY (10, bytes);
};
@ -199,7 +196,7 @@ struct LookupFormat0
}
protected:
UINT16 format; /* Format identifier--format = 0 */
HBUINT16 format; /* Format identifier--format = 0 */
UnsizedArrayOf<T>
arrayZ; /* Array of lookup values, indexed by glyph index. */
public:
@ -246,7 +243,7 @@ struct LookupFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
BinSearchArrayOf<LookupSegmentSingle<T> >
segments; /* The actual segments. These must already be sorted,
* according to the first word in each one (the last
@ -303,7 +300,7 @@ struct LookupFormat4
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
BinSearchArrayOf<LookupSegmentArray<T> >
segments; /* The actual segments. These must already be sorted,
* according to the first word in each one (the last
@ -348,7 +345,7 @@ struct LookupFormat6
}
protected:
UINT16 format; /* Format identifier--format = 6 */
HBUINT16 format; /* Format identifier--format = 6 */
BinSearchArrayOf<LookupSingle<T> >
entries; /* The actual entries, sorted by glyph index. */
public:
@ -373,9 +370,9 @@ struct LookupFormat8
}
protected:
UINT16 format; /* Format identifier--format = 6 */
HBUINT16 format; /* Format identifier--format = 6 */
GlyphID firstGlyph; /* First glyph index included in the trimmed array. */
UINT16 glyphCount; /* Total number of glyphs (equivalent to the last
HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last
* glyph minus the value of firstGlyph plus 1). */
UnsizedArrayOf<T>
valueArrayZ; /* The lookup values (indexed by the glyph index
@ -415,7 +412,7 @@ struct Lookup
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
LookupFormat0<T> format0;
LookupFormat2<T> format2;
LookupFormat4<T> format4;

View File

@ -37,9 +37,6 @@
namespace AAT {
using namespace OT;
using OT::UINT8;
using OT::UINT16;
using OT::UINT32;
struct RearrangementSubtable
@ -154,11 +151,11 @@ struct Feature
}
public:
UINT16 featureType; /* The type of feature. */
UINT16 featureSetting; /* The feature's setting (aka selector). */
UINT32 enableFlags; /* Flags for the settings that this feature
HBUINT16 featureType; /* The type of feature. */
HBUINT16 featureSetting; /* The feature's setting (aka selector). */
HBUINT32 enableFlags; /* Flags for the settings that this feature
* and setting enables. */
UINT32 disableFlags; /* Complement of flags for the settings that this
HBUINT32 disableFlags; /* Complement of flags for the settings that this
* feature and setting disable. */
public:
@ -166,11 +163,11 @@ struct Feature
};
template <typename UINT>
template <typename HBUINT>
struct ChainSubtable
{
template <typename> struct Chain;
friend struct Chain<UINT>;
friend struct Chain<HBUINT>;
inline unsigned int get_size (void) const { return length; }
inline unsigned int get_type (void) const { return coverage & 0xFF; }
@ -215,9 +212,9 @@ struct ChainSubtable
}
protected:
UINT length; /* Total subtable length, including this header. */
UINT coverage; /* Coverage flags and subtable type. */
UINT32 subFeatureFlags;/* The 32-bit mask identifying which subtable this is. */
HBUINT length; /* Total subtable length, including this header. */
HBUINT coverage; /* Coverage flags and subtable type. */
HBUINT32 subFeatureFlags;/* The 32-bit mask identifying which subtable this is. */
union {
RearrangementSubtable rearrangement;
ContextualSubtable contextual;
@ -226,20 +223,20 @@ struct ChainSubtable
InsertionSubtable insertion;
} u;
public:
DEFINE_SIZE_MIN (2 * sizeof (UINT) + 4);
DEFINE_SIZE_MIN (2 * sizeof (HBUINT) + 4);
};
template <typename UINT>
template <typename HBUINT>
struct Chain
{
inline void apply (hb_apply_context_t *c) const
{
const ChainSubtable<UINT> *subtable = &StructAtOffset<ChainSubtable<UINT> > (featureZ, featureZ[0].static_size * featureCount);
const ChainSubtable<HBUINT> *subtable = &StructAtOffset<ChainSubtable<HBUINT> > (featureZ, featureZ[0].static_size * featureCount);
unsigned int count = subtableCount;
for (unsigned int i = 0; i < count; i++)
{
subtable->apply (c);
subtable = &StructAfter<ChainSubtable<UINT> > (*subtable);
subtable = &StructAfter<ChainSubtable<HBUINT> > (*subtable);
}
}
@ -256,30 +253,30 @@ struct Chain
if (!c->check_array (featureZ, featureZ[0].static_size, featureCount))
return_trace (false);
const ChainSubtable<UINT> *subtable = &StructAtOffset<ChainSubtable<UINT> > (featureZ, featureZ[0].static_size * featureCount);
const ChainSubtable<HBUINT> *subtable = &StructAtOffset<ChainSubtable<HBUINT> > (featureZ, featureZ[0].static_size * featureCount);
unsigned int count = subtableCount;
for (unsigned int i = 0; i < count; i++)
{
if (!subtable->sanitize (c))
return_trace (false);
subtable = &StructAfter<ChainSubtable<UINT> > (*subtable);
subtable = &StructAfter<ChainSubtable<HBUINT> > (*subtable);
}
return_trace (true);
}
protected:
UINT32 defaultFlags; /* The default specification for subtables. */
UINT32 length; /* Total byte count, including this header. */
UINT featureCount; /* Number of feature subtable entries. */
UINT subtableCount; /* The number of subtables in the chain. */
HBUINT32 defaultFlags; /* The default specification for subtables. */
HBUINT32 length; /* Total byte count, including this header. */
HBUINT featureCount; /* Number of feature subtable entries. */
HBUINT subtableCount; /* The number of subtables in the chain. */
Feature featureZ[VAR]; /* Features. */
ChainSubtable<UINT> subtableX[VAR]; /* Subtables. */
ChainSubtable<HBUINT> subtableX[VAR]; /* Subtables. */
// subtableGlyphCoverageArray if major == 3
public:
DEFINE_SIZE_MIN (8 + 2 * sizeof (UINT));
DEFINE_SIZE_MIN (8 + 2 * sizeof (HBUINT));
};
@ -287,7 +284,7 @@ struct Chain
* The 'mort'/'morx' Tables
*/
template <typename UINT>
template <typename HBUINT>
struct mortmorx
{
static const hb_tag_t mortTag = HB_AAT_TAG_MORT;
@ -295,12 +292,12 @@ struct mortmorx
inline void apply (hb_apply_context_t *c) const
{
const Chain<UINT> *chain = chains;
const Chain<HBUINT> *chain = chains;
unsigned int count = chainCount;
for (unsigned int i = 0; i < count; i++)
{
chain->apply (c);
chain = &StructAfter<Chain<UINT> > (*chain);
chain = &StructAfter<Chain<HBUINT> > (*chain);
}
}
@ -308,17 +305,17 @@ struct mortmorx
{
TRACE_SANITIZE (this);
if (!version.sanitize (c) ||
version.major >> (sizeof (UINT) == 4) != 1 ||
version.major >> (sizeof (HBUINT) == 4) != 1 ||
!chainCount.sanitize (c))
return_trace (false);
const Chain<UINT> *chain = chains;
const Chain<HBUINT> *chain = chains;
unsigned int count = chainCount;
for (unsigned int i = 0; i < count; i++)
{
if (!chain->sanitize (c, version.major))
return_trace (false);
chain = &StructAfter<Chain<UINT> > (*chain);
chain = &StructAfter<Chain<HBUINT> > (*chain);
}
return_trace (true);
@ -327,20 +324,20 @@ struct mortmorx
protected:
FixedVersion<>version; /* Version number of the glyph metamorphosis table.
* 1 for mort, 2 or 3 for morx. */
UINT32 chainCount; /* Number of metamorphosis chains contained in this
HBUINT32 chainCount; /* Number of metamorphosis chains contained in this
* table. */
Chain<UINT> chains[VAR]; /* Chains. */
Chain<HBUINT> chains[VAR]; /* Chains. */
public:
DEFINE_SIZE_MIN (8);
};
struct mort : mortmorx<UINT16>
struct mort : mortmorx<HBUINT16>
{
static const hb_tag_t tableTag = HB_AAT_TAG_MORT;
};
struct morx : mortmorx<UINT32>
struct morx : mortmorx<HBUINT32>
{
static const hb_tag_t tableTag = HB_AAT_TAG_MORX;
};

View File

@ -64,9 +64,9 @@ typedef struct TableRecord
Tag tag; /* 4-byte identifier. */
CheckSum checkSum; /* CheckSum for this table. */
UINT32 offset; /* Offset from beginning of TrueType font
HBUINT32 offset; /* Offset from beginning of TrueType font
* file. */
UINT32 length; /* Length of this table. */
HBUINT32 length; /* Length of this table. */
public:
DEFINE_SIZE_STATIC (16);
} OpenTypeTable;
@ -154,7 +154,7 @@ struct TTCHeaderVersion1
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
FixedVersion<>version; /* Version of the TTC Header (1.0),
* 0x00010000u */
ArrayOf<LOffsetTo<OffsetTable>, UINT32>
ArrayOf<LOffsetTo<OffsetTable>, HBUINT32>
table; /* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
public:

View File

@ -643,22 +643,22 @@ struct IntType
DEFINE_SIZE_STATIC (Size);
};
typedef IntType<uint8_t, 1> UINT8; /* 8-bit unsigned integer. */
typedef IntType<int8_t, 1> INT8; /* 8-bit signed integer. */
typedef IntType<uint16_t, 2> UINT16; /* 16-bit unsigned integer. */
typedef IntType<int16_t, 2> INT16; /* 16-bit signed integer. */
typedef IntType<uint32_t, 4> UINT32; /* 32-bit unsigned integer. */
typedef IntType<int32_t, 4> INT32; /* 32-bit signed integer. */
typedef IntType<uint8_t, 1> HBUINT8; /* 8-bit unsigned integer. */
typedef IntType<int8_t, 1> HBINT8; /* 8-bit signed integer. */
typedef IntType<uint16_t, 2> HBUINT16; /* 16-bit unsigned integer. */
typedef IntType<int16_t, 2> HBINT16; /* 16-bit signed integer. */
typedef IntType<uint32_t, 4> HBUINT32; /* 32-bit unsigned integer. */
typedef IntType<int32_t, 4> HBINT32; /* 32-bit signed integer. */
typedef IntType<uint32_t, 3> UINT24; /* 24-bit unsigned integer. */
/* 16-bit signed integer (INT16) that describes a quantity in FUnits. */
typedef INT16 FWORD;
/* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */
typedef HBINT16 FWORD;
/* 16-bit unsigned integer (UINT16) that describes a quantity in FUnits. */
typedef UINT16 UFWORD;
/* 16-bit unsigned integer (HBUINT16) that describes a quantity in FUnits. */
typedef HBUINT16 UFWORD;
/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */
struct F2DOT14 : INT16
struct F2DOT14 : HBINT16
{
//inline float to_float (void) const { return ???; }
//inline void set_float (float f) { v.set (f * ???); }
@ -667,7 +667,7 @@ struct F2DOT14 : INT16
};
/* 32-bit signed fixed-point number (16.16). */
struct Fixed: INT32
struct Fixed: HBINT32
{
//inline float to_float (void) const { return ???; }
//inline void set_float (float f) { v.set (f * ???); }
@ -685,15 +685,15 @@ struct LONGDATETIME
return_trace (likely (c->check_struct (this)));
}
protected:
INT32 major;
UINT32 minor;
HBINT32 major;
HBUINT32 minor;
public:
DEFINE_SIZE_STATIC (8);
};
/* Array of four uint8s (length = 32 bits) used to identify a script, language
* system, feature, or baseline */
struct Tag : UINT32
struct Tag : HBUINT32
{
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
inline operator const char* (void) const { return reinterpret_cast<const char *> (&this->v); }
@ -704,10 +704,10 @@ struct Tag : UINT32
DEFINE_NULL_DATA (Tag, " ");
/* Glyph index number, same as uint16 (length = 16 bits) */
typedef UINT16 GlyphID;
typedef HBUINT16 GlyphID;
/* Script/language-system/feature index */
struct Index : UINT16 {
struct Index : HBUINT16 {
static const unsigned int NOT_FOUND_INDEX = 0xFFFFu;
};
DEFINE_NULL_DATA (Index, "\xff\xff");
@ -721,18 +721,18 @@ struct Offset : Type
DEFINE_SIZE_STATIC (sizeof(Type));
};
typedef Offset<UINT16> Offset16;
typedef Offset<UINT32> Offset32;
typedef Offset<HBUINT16> Offset16;
typedef Offset<HBUINT32> Offset32;
/* CheckSum */
struct CheckSum : UINT32
struct CheckSum : HBUINT32
{
/* This is reference implementation from the spec. */
static inline uint32_t CalcTableChecksum (const UINT32 *Table, uint32_t Length)
static inline uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length)
{
uint32_t Sum = 0L;
const UINT32 *EndPtr = Table+((Length+3) & ~3) / UINT32::static_size;
const HBUINT32 *EndPtr = Table+((Length+3) & ~3) / HBUINT32::static_size;
while (Table < EndPtr)
Sum += *Table++;
@ -741,7 +741,7 @@ struct CheckSum : UINT32
/* Note: data should be 4byte aligned and have 4byte padding at the end. */
inline void set_for_data (const void *data, unsigned int length)
{ set (CalcTableChecksum ((const UINT32 *) data, length)); }
{ set (CalcTableChecksum ((const HBUINT32 *) data, length)); }
public:
DEFINE_SIZE_STATIC (4);
@ -752,7 +752,7 @@ struct CheckSum : UINT32
* Version Numbers
*/
template <typename FixedType=UINT16>
template <typename FixedType=HBUINT16>
struct FixedVersion
{
inline uint32_t to_int (void) const { return (major << (sizeof(FixedType) * 8)) + minor; }
@ -776,7 +776,7 @@ struct FixedVersion
* Use: (base+offset)
*/
template <typename Type, typename OffsetType=UINT16>
template <typename Type, typename OffsetType=HBUINT16>
struct OffsetTo : Offset<OffsetType>
{
inline const Type& operator () (const void *base) const
@ -821,7 +821,7 @@ struct OffsetTo : Offset<OffsetType>
}
DEFINE_SIZE_STATIC (sizeof(OffsetType));
};
template <typename Type> struct LOffsetTo : OffsetTo<Type, UINT32> {};
template <typename Type> struct LOffsetTo : OffsetTo<Type, HBUINT32> {};
template <typename Base, typename OffsetType, typename Type>
static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
template <typename Base, typename OffsetType, typename Type>
@ -833,7 +833,7 @@ static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType> &offset)
*/
/* An array with a number of elements. */
template <typename Type, typename LenType=UINT16>
template <typename Type, typename LenType=HBUINT16>
struct ArrayOf
{
const Type *sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const
@ -943,10 +943,10 @@ struct ArrayOf
public:
DEFINE_SIZE_ARRAY (sizeof (LenType), array);
};
template <typename Type> struct LArrayOf : ArrayOf<Type, UINT32> {};
template <typename Type> struct LArrayOf : ArrayOf<Type, HBUINT32> {};
/* Array of Offset's */
template <typename Type, typename OffsetType=UINT16>
template <typename Type, typename OffsetType=HBUINT16>
struct OffsetArrayOf : ArrayOf<OffsetTo<Type, OffsetType> > {};
/* Array of offsets relative to the beginning of the array itself. */
@ -974,7 +974,7 @@ struct OffsetListOf : OffsetArrayOf<Type>
/* An array starting at second element. */
template <typename Type, typename LenType=UINT16>
template <typename Type, typename LenType=HBUINT16>
struct HeadlessArrayOf
{
inline const Type& operator [] (unsigned int i) const
@ -1036,7 +1036,7 @@ struct HeadlessArrayOf
/*
* An array with sorted elements. Supports binary searching.
*/
template <typename Type, typename LenType=UINT16>
template <typename Type, typename LenType=HBUINT16>
struct SortedArrayOf : ArrayOf<Type, LenType>
{
template <typename SearchType>
@ -1075,10 +1075,10 @@ struct BinSearchHeader
}
protected:
UINT16 len;
UINT16 searchRangeZ;
UINT16 entrySelectorZ;
UINT16 rangeShiftZ;
HBUINT16 len;
HBUINT16 searchRangeZ;
HBUINT16 entrySelectorZ;
HBUINT16 rangeShiftZ;
public:
DEFINE_SIZE_STATIC (8);

View File

@ -47,20 +47,20 @@ struct SmallGlyphMetrics
extents->height = -height;
}
UINT8 height;
UINT8 width;
INT8 bearingX;
INT8 bearingY;
UINT8 advance;
HBUINT8 height;
HBUINT8 width;
HBINT8 bearingX;
HBINT8 bearingY;
HBUINT8 advance;
DEFINE_SIZE_STATIC(5);
};
struct BigGlyphMetrics : SmallGlyphMetrics
{
INT8 vertBearingX;
INT8 vertBearingY;
UINT8 vertAdvance;
HBINT8 vertBearingX;
HBINT8 vertBearingY;
HBUINT8 vertAdvance;
DEFINE_SIZE_STATIC(8);
};
@ -73,18 +73,18 @@ struct SBitLineMetrics
return_trace (c->check_struct (this));
}
INT8 ascender;
INT8 decender;
UINT8 widthMax;
INT8 caretSlopeNumerator;
INT8 caretSlopeDenominator;
INT8 caretOffset;
INT8 minOriginSB;
INT8 minAdvanceSB;
INT8 maxBeforeBL;
INT8 minAfterBL;
INT8 padding1;
INT8 padding2;
HBINT8 ascender;
HBINT8 decender;
HBUINT8 widthMax;
HBINT8 caretSlopeNumerator;
HBINT8 caretSlopeDenominator;
HBINT8 caretOffset;
HBINT8 minOriginSB;
HBINT8 minAdvanceSB;
HBINT8 maxBeforeBL;
HBINT8 minAfterBL;
HBINT8 padding1;
HBINT8 padding2;
DEFINE_SIZE_STATIC(12);
};
@ -102,9 +102,9 @@ struct IndexSubtableHeader
return_trace (c->check_struct (this));
}
UINT16 indexFormat;
UINT16 imageFormat;
UINT32 imageDataOffset;
HBUINT16 indexFormat;
HBUINT16 imageFormat;
HBUINT32 imageDataOffset;
DEFINE_SIZE_STATIC(8);
};
@ -137,8 +137,8 @@ struct IndexSubtableFormat1Or3
DEFINE_SIZE_ARRAY(8, offsetArrayZ);
};
struct IndexSubtableFormat1 : IndexSubtableFormat1Or3<UINT32> {};
struct IndexSubtableFormat3 : IndexSubtableFormat1Or3<UINT16> {};
struct IndexSubtableFormat1 : IndexSubtableFormat1Or3<HBUINT32> {};
struct IndexSubtableFormat3 : IndexSubtableFormat1Or3<HBUINT16> {};
struct IndexSubtable
{
@ -214,8 +214,8 @@ struct IndexSubtableRecord
offset, length, format);
}
UINT16 firstGlyphIndex;
UINT16 lastGlyphIndex;
HBUINT16 firstGlyphIndex;
HBUINT16 lastGlyphIndex;
LOffsetTo<IndexSubtable> offsetToSubtable;
DEFINE_SIZE_STATIC(8);
@ -276,17 +276,17 @@ struct BitmapSizeTable
protected:
LOffsetTo<IndexSubtableArray> indexSubtableArrayOffset;
UINT32 indexTablesSize;
UINT32 numberOfIndexSubtables;
UINT32 colorRef;
HBUINT32 indexTablesSize;
HBUINT32 numberOfIndexSubtables;
HBUINT32 colorRef;
SBitLineMetrics horizontal;
SBitLineMetrics vertical;
UINT16 startGlyphIndex;
UINT16 endGlyphIndex;
UINT8 ppemX;
UINT8 ppemY;
UINT8 bitDepth;
INT8 flags;
HBUINT16 startGlyphIndex;
HBUINT16 endGlyphIndex;
HBUINT8 ppemX;
HBUINT8 ppemY;
HBUINT8 bitDepth;
HBINT8 flags;
public:
DEFINE_SIZE_STATIC(48);
@ -300,8 +300,8 @@ struct BitmapSizeTable
struct GlyphBitmapDataFormat17
{
SmallGlyphMetrics glyphMetrics;
UINT32 dataLen;
UINT8 dataZ[VAR];
HBUINT32 dataLen;
HBUINT8 dataZ[VAR];
DEFINE_SIZE_ARRAY(9, dataZ);
};
@ -460,7 +460,7 @@ struct CBDT
protected:
FixedVersion<>version;
UINT8 dataZ[VAR];
HBUINT8 dataZ[VAR];
public:
DEFINE_SIZE_ARRAY(4, dataZ);

View File

@ -58,10 +58,10 @@ struct CmapSubtableFormat0
}
protected:
UINT16 format; /* Format number is set to 0. */
UINT16 lengthZ; /* Byte length of this subtable. */
UINT16 languageZ; /* Ignore. */
UINT8 glyphIdArray[256];/* An array that maps character
HBUINT16 format; /* Format number is set to 0. */
HBUINT16 lengthZ; /* Byte length of this subtable. */
HBUINT16 languageZ; /* Ignore. */
HBUINT8 glyphIdArray[256];/* An array that maps character
* code to glyph index values. */
public:
DEFINE_SIZE_STATIC (6 + 256);
@ -88,8 +88,8 @@ struct CmapSubtableFormat4
/* Custom two-array bsearch. */
int min = 0, max = (int) thiz->segCount - 1;
const UINT16 *startCount = thiz->startCount;
const UINT16 *endCount = thiz->endCount;
const HBUINT16 *startCount = thiz->startCount;
const HBUINT16 *endCount = thiz->endCount;
unsigned int i;
while (min <= max)
{
@ -127,11 +127,11 @@ struct CmapSubtableFormat4
return true;
}
const UINT16 *endCount;
const UINT16 *startCount;
const UINT16 *idDelta;
const UINT16 *idRangeOffset;
const UINT16 *glyphIdArray;
const HBUINT16 *endCount;
const HBUINT16 *startCount;
const HBUINT16 *idDelta;
const HBUINT16 *idRangeOffset;
const HBUINT16 *glyphIdArray;
unsigned int segCount;
unsigned int glyphIdArrayLength;
};
@ -165,24 +165,24 @@ struct CmapSubtableFormat4
}
protected:
UINT16 format; /* Format number is set to 4. */
UINT16 length; /* This is the length in bytes of the
HBUINT16 format; /* Format number is set to 4. */
HBUINT16 length; /* This is the length in bytes of the
* subtable. */
UINT16 languageZ; /* Ignore. */
UINT16 segCountX2; /* 2 x segCount. */
UINT16 searchRangeZ; /* 2 * (2**floor(log2(segCount))) */
UINT16 entrySelectorZ; /* log2(searchRange/2) */
UINT16 rangeShiftZ; /* 2 x segCount - searchRange */
HBUINT16 languageZ; /* Ignore. */
HBUINT16 segCountX2; /* 2 x segCount. */
HBUINT16 searchRangeZ; /* 2 * (2**floor(log2(segCount))) */
HBUINT16 entrySelectorZ; /* log2(searchRange/2) */
HBUINT16 rangeShiftZ; /* 2 x segCount - searchRange */
UINT16 values[VAR];
HBUINT16 values[VAR];
#if 0
UINT16 endCount[segCount]; /* End characterCode for each segment,
HBUINT16 endCount[segCount]; /* End characterCode for each segment,
* last=0xFFFFu. */
UINT16 reservedPad; /* Set to 0. */
UINT16 startCount[segCount]; /* Start character code for each segment. */
INT16 idDelta[segCount]; /* Delta for all character codes in segment. */
UINT16 idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */
UINT16 glyphIdArray[VAR]; /* Glyph index array (arbitrary length) */
HBUINT16 reservedPad; /* Set to 0. */
HBUINT16 startCount[segCount]; /* Start character code for each segment. */
HBINT16 idDelta[segCount]; /* Delta for all character codes in segment. */
HBUINT16 idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */
HBUINT16 glyphIdArray[VAR]; /* Glyph index array (arbitrary length) */
#endif
public:
@ -208,9 +208,9 @@ struct CmapSubtableLongGroup
}
private:
UINT32 startCharCode; /* First character code in this group. */
UINT32 endCharCode; /* Last character code in this group. */
UINT32 glyphID; /* Glyph index; interpretation depends on
HBUINT32 startCharCode; /* First character code in this group. */
HBUINT32 endCharCode; /* Last character code in this group. */
HBUINT32 glyphID; /* Glyph index; interpretation depends on
* subtable format. */
public:
DEFINE_SIZE_STATIC (12);
@ -247,8 +247,8 @@ struct CmapSubtableTrimmed
DEFINE_SIZE_ARRAY (5 * sizeof (UINT), glyphIdArray);
};
struct CmapSubtableFormat6 : CmapSubtableTrimmed<UINT16> {};
struct CmapSubtableFormat10 : CmapSubtableTrimmed<UINT32 > {};
struct CmapSubtableFormat6 : CmapSubtableTrimmed<HBUINT16> {};
struct CmapSubtableFormat10 : CmapSubtableTrimmed<HBUINT32 > {};
template <typename T>
struct CmapSubtableLongSegmented
@ -269,11 +269,11 @@ struct CmapSubtableLongSegmented
}
protected:
UINT16 format; /* Subtable format; set to 12. */
UINT16 reservedZ; /* Reserved; set to 0. */
UINT32 lengthZ; /* Byte length of this subtable. */
UINT32 languageZ; /* Ignore. */
SortedArrayOf<CmapSubtableLongGroup, UINT32>
HBUINT16 format; /* Subtable format; set to 12. */
HBUINT16 reservedZ; /* Reserved; set to 0. */
HBUINT32 lengthZ; /* Byte length of this subtable. */
HBUINT32 languageZ; /* Ignore. */
SortedArrayOf<CmapSubtableLongGroup, HBUINT32>
groups; /* Groupings. */
public:
DEFINE_SIZE_ARRAY (16, groups);
@ -316,13 +316,13 @@ struct UnicodeValueRange
}
UINT24 startUnicodeValue; /* First value in this range. */
UINT8 additionalCount; /* Number of additional values in this
HBUINT8 additionalCount; /* Number of additional values in this
* range. */
public:
DEFINE_SIZE_STATIC (4);
};
typedef SortedArrayOf<UnicodeValueRange, UINT32> DefaultUVS;
typedef SortedArrayOf<UnicodeValueRange, HBUINT32> DefaultUVS;
struct UVSMapping
{
@ -343,7 +343,7 @@ struct UVSMapping
DEFINE_SIZE_STATIC (5);
};
typedef SortedArrayOf<UVSMapping, UINT32> NonDefaultUVS;
typedef SortedArrayOf<UVSMapping, HBUINT32> NonDefaultUVS;
struct VariationSelectorRecord
{
@ -405,9 +405,9 @@ struct CmapSubtableFormat14
}
protected:
UINT16 format; /* Format number is set to 14. */
UINT32 lengthZ; /* Byte length of this subtable. */
SortedArrayOf<VariationSelectorRecord, UINT32>
HBUINT16 format; /* Format number is set to 14. */
HBUINT32 lengthZ; /* Byte length of this subtable. */
SortedArrayOf<VariationSelectorRecord, HBUINT32>
record; /* Variation selector records; sorted
* in increasing order of `varSelector'. */
public:
@ -451,7 +451,7 @@ struct CmapSubtable
public:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
CmapSubtableFormat0 format0;
CmapSubtableFormat4 format4;
CmapSubtableFormat6 format6;
@ -484,8 +484,8 @@ struct EncodingRecord
subtable.sanitize (c, base));
}
UINT16 platformID; /* Platform ID. */
UINT16 encodingID; /* Platform-specific encoding ID. */
HBUINT16 platformID; /* Platform ID. */
HBUINT16 encodingID; /* Platform-specific encoding ID. */
LOffsetTo<CmapSubtable>
subtable; /* Byte offset from beginning of table to the subtable for this encoding. */
public:
@ -654,7 +654,7 @@ struct cmap
}
protected:
UINT16 version; /* Table version number (0). */
HBUINT16 version; /* Table version number (0). */
SortedArrayOf<EncodingRecord>
encodingRecord; /* Encoding tables. */
public:

View File

@ -54,7 +54,7 @@ struct loca
}
protected:
UINT8 dataX[VAR]; /* Location data. */
HBUINT8 dataX[VAR]; /* Location data. */
DEFINE_SIZE_ARRAY (0, dataX);
};
@ -80,7 +80,7 @@ struct glyf
struct GlyphHeader
{
INT16 numberOfContours; /* If the number of contours is
HBINT16 numberOfContours; /* If the number of contours is
* greater than or equal to zero,
* this is a simple glyph; if negative,
* this is a composite glyph. */
@ -131,13 +131,13 @@ struct glyf
unsigned int start_offset, end_offset;
if (short_offset)
{
const UINT16 *offsets = (const UINT16 *) loca_table->dataX;
const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataX;
start_offset = 2 * offsets[glyph];
end_offset = 2 * offsets[glyph + 1];
}
else
{
const UINT32 *offsets = (const UINT32 *) loca_table->dataX;
const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataX;
start_offset = offsets[glyph];
end_offset = offsets[glyph + 1];
}
@ -169,7 +169,7 @@ struct glyf
};
protected:
UINT8 dataX[VAR]; /* Glyphs data. */
HBUINT8 dataX[VAR]; /* Glyphs data. */
DEFINE_SIZE_ARRAY (0, dataX);
};

View File

@ -64,11 +64,11 @@ struct head
FixedVersion<>version; /* Version of the head table--currently
* 0x00010000u for version 1.0. */
FixedVersion<>fontRevision; /* Set by font manufacturer. */
UINT32 checkSumAdjustment; /* To compute: set it to 0, sum the
* entire font as UINT32, then store
HBUINT32 checkSumAdjustment; /* To compute: set it to 0, sum the
* entire font as HBUINT32, then store
* 0xB1B0AFBAu - sum. */
UINT32 magicNumber; /* Set to 0x5F0F3CF5u. */
UINT16 flags; /* Bit 0: Baseline for font at y=0;
HBUINT32 magicNumber; /* Set to 0x5F0F3CF5u. */
HBUINT16 flags; /* Bit 0: Baseline for font at y=0;
* Bit 1: Left sidebearing point at x=0;
* Bit 2: Instructions may depend on point size;
* Bit 3: Force ppem to integer values for all
@ -114,18 +114,18 @@ struct head
* encoded in the cmap subtables represent proper
* support for those code points.
* Bit 15: Reserved, set to 0. */
UINT16 unitsPerEm; /* Valid range is from 16 to 16384. This value
HBUINT16 unitsPerEm; /* Valid range is from 16 to 16384. This value
* should be a power of 2 for fonts that have
* TrueType outlines. */
LONGDATETIME created; /* Number of seconds since 12:00 midnight,
January 1, 1904. 64-bit integer */
LONGDATETIME modified; /* Number of seconds since 12:00 midnight,
January 1, 1904. 64-bit integer */
INT16 xMin; /* For all glyph bounding boxes. */
INT16 yMin; /* For all glyph bounding boxes. */
INT16 xMax; /* For all glyph bounding boxes. */
INT16 yMax; /* For all glyph bounding boxes. */
UINT16 macStyle; /* Bit 0: Bold (if set to 1);
HBINT16 xMin; /* For all glyph bounding boxes. */
HBINT16 yMin; /* For all glyph bounding boxes. */
HBINT16 xMax; /* For all glyph bounding boxes. */
HBINT16 yMax; /* For all glyph bounding boxes. */
HBUINT16 macStyle; /* Bit 0: Bold (if set to 1);
* Bit 1: Italic (if set to 1)
* Bit 2: Underline (if set to 1)
* Bit 3: Outline (if set to 1)
@ -133,16 +133,16 @@ struct head
* Bit 5: Condensed (if set to 1)
* Bit 6: Extended (if set to 1)
* Bits 7-15: Reserved (set to 0). */
UINT16 lowestRecPPEM; /* Smallest readable size in pixels. */
INT16 fontDirectionHint; /* Deprecated (Set to 2).
HBUINT16 lowestRecPPEM; /* Smallest readable size in pixels. */
HBINT16 fontDirectionHint; /* Deprecated (Set to 2).
* 0: Fully mixed directional glyphs;
* 1: Only strongly left to right;
* 2: Like 1 but also contains neutrals;
* -1: Only strongly right to left;
* -2: Like -1 but also contains neutrals. */
public:
INT16 indexToLocFormat; /* 0 for short offsets, 1 for long. */
INT16 glyphDataFormat; /* 0 for current format. */
HBINT16 indexToLocFormat; /* 0 for short offsets, 1 for long. */
HBINT16 glyphDataFormat; /* 0 for current format. */
DEFINE_SIZE_STATIC (54);
};

View File

@ -64,21 +64,21 @@ struct _hea
* (xMax - xMin)) for horizontal. */
FWORD maxExtent; /* horizontal: Max(lsb + (xMax - xMin)),
* vertical: minLeadingBearing+(yMax-yMin). */
INT16 caretSlopeRise; /* Used to calculate the slope of the
HBINT16 caretSlopeRise; /* Used to calculate the slope of the
* cursor (rise/run); 1 for vertical caret,
* 0 for horizontal.*/
INT16 caretSlopeRun; /* 0 for vertical caret, 1 for horizontal. */
INT16 caretOffset; /* The amount by which a slanted
HBINT16 caretSlopeRun; /* 0 for vertical caret, 1 for horizontal. */
HBINT16 caretOffset; /* The amount by which a slanted
* highlight on a glyph needs
* to be shifted to produce the
* best appearance. Set to 0 for
* non-slanted fonts. */
INT16 reserved1; /* Set to 0. */
INT16 reserved2; /* Set to 0. */
INT16 reserved3; /* Set to 0. */
INT16 reserved4; /* Set to 0. */
INT16 metricDataFormat; /* 0 for current format. */
UINT16 numberOfLongMetrics; /* Number of LongMetric entries in metric
HBINT16 reserved1; /* Set to 0. */
HBINT16 reserved2; /* Set to 0. */
HBINT16 reserved3; /* Set to 0. */
HBINT16 reserved4; /* Set to 0. */
HBINT16 metricDataFormat; /* 0 for current format. */
HBUINT16 numberOfLongMetrics; /* Number of LongMetric entries in metric
* table. */
public:
DEFINE_SIZE_STATIC (36);

View File

@ -104,8 +104,8 @@ struct KernClassTable
}
protected:
UINT16 firstGlyph; /* First glyph in class range. */
ArrayOf<UINT16> classes; /* Glyph classes. */
HBUINT16 firstGlyph; /* First glyph in class range. */
ArrayOf<HBUINT16> classes; /* Glyph classes. */
public:
DEFINE_SIZE_ARRAY (4, classes);
};
@ -136,7 +136,7 @@ struct KernSubTableFormat2
}
protected:
UINT16 rowWidth; /* The width, in bytes, of a row in the table. */
HBUINT16 rowWidth; /* The width, in bytes, of a row in the table. */
OffsetTo<KernClassTable>
leftClassTable; /* Offset from beginning of this subtable to
* left-hand class table. */
@ -275,19 +275,19 @@ struct KernOT : KernTable<KernOT>
};
protected:
UINT16 versionZ; /* Unused. */
UINT16 length; /* Length of the subtable (including this header). */
UINT8 format; /* Subtable format. */
UINT8 coverage; /* Coverage bits. */
HBUINT16 versionZ; /* Unused. */
HBUINT16 length; /* Length of the subtable (including this header). */
HBUINT8 format; /* Subtable format. */
HBUINT8 coverage; /* Coverage bits. */
KernSubTable subtable; /* Subtable data. */
public:
DEFINE_SIZE_MIN (6);
};
protected:
UINT16 version; /* Version--0x0000u */
UINT16 nTables; /* Number of subtables in the kerning table. */
UINT8 data[VAR];
HBUINT16 version; /* Version--0x0000u */
HBUINT16 nTables; /* Number of subtables in the kerning table. */
HBUINT8 data[VAR];
public:
DEFINE_SIZE_ARRAY (4, data);
};
@ -314,10 +314,10 @@ struct KernAAT : KernTable<KernAAT>
};
protected:
UINT32 length; /* Length of the subtable (including this header). */
UINT8 coverage; /* Coverage bits. */
UINT8 format; /* Subtable format. */
UINT16 tupleIndex; /* The tuple index (used for variations fonts).
HBUINT32 length; /* Length of the subtable (including this header). */
HBUINT8 coverage; /* Coverage bits. */
HBUINT8 format; /* Subtable format. */
HBUINT16 tupleIndex; /* The tuple index (used for variations fonts).
* This value specifies which tuple this subtable covers. */
KernSubTable subtable; /* Subtable data. */
public:
@ -325,9 +325,9 @@ struct KernAAT : KernTable<KernAAT>
};
protected:
UINT32 version; /* Version--0x00010000u */
UINT32 nTables; /* Number of subtables in the kerning table. */
UINT8 data[VAR];
HBUINT32 version; /* Version--0x00010000u */
HBUINT32 nTables; /* Number of subtables in the kerning table. */
HBUINT8 data[VAR];
public:
DEFINE_SIZE_ARRAY (8, data);
};
@ -380,7 +380,7 @@ struct kern
protected:
union {
UINT16 major;
HBUINT16 major;
KernOT ot;
KernAAT aat;
} u;

View File

@ -161,7 +161,7 @@ struct RangeRecord
GlyphID start; /* First GlyphID in the range */
GlyphID end; /* Last GlyphID in the range */
UINT16 value; /* Value */
HBUINT16 value; /* Value */
public:
DEFINE_SIZE_STATIC (6);
};
@ -175,7 +175,7 @@ struct IndexArray : ArrayOf<Index>
unsigned int *_indexes /* OUT */) const
{
if (_count) {
const UINT16 *arr = this->sub_array (start_offset, _count);
const HBUINT16 *arr = this->sub_array (start_offset, _count);
unsigned int count = *_count;
for (unsigned int i = 0; i < count; i++)
_indexes[i] = arr[i];
@ -218,7 +218,7 @@ struct LangSys
Offset16 lookupOrderZ; /* = Null (reserved for an offset to a
* reordering table) */
UINT16 reqFeatureIndex;/* Index of a feature required for this
HBUINT16 reqFeatureIndex;/* Index of a feature required for this
* language system--if no required features
* = 0xFFFFu */
IndexArray featureIndex; /* Array of indices into the FeatureList */
@ -343,12 +343,12 @@ struct FeatureParamsSize
return_trace (true);
}
UINT16 designSize; /* Represents the design size in 720/inch
HBUINT16 designSize; /* Represents the design size in 720/inch
* units (decipoints). The design size entry
* must be non-zero. When there is a design
* size but no recommended size range, the
* rest of the array will consist of zeros. */
UINT16 subfamilyID; /* Has no independent meaning, but serves
HBUINT16 subfamilyID; /* Has no independent meaning, but serves
* as an identifier that associates fonts
* in a subfamily. All fonts which share a
* Preferred or Font Family name and which
@ -358,7 +358,7 @@ struct FeatureParamsSize
* same subfamily value. If this value is
* zero, the remaining fields in the array
* will be ignored. */
UINT16 subfamilyNameID;/* If the preceding value is non-zero, this
HBUINT16 subfamilyNameID;/* If the preceding value is non-zero, this
* value must be set in the range 256 - 32767
* (inclusive). It records the value of a
* field in the name table, which must
@ -372,10 +372,10 @@ struct FeatureParamsSize
* subfamily in a menu. Applications will
* choose the appropriate version based on
* their selection criteria. */
UINT16 rangeStart; /* Large end of the recommended usage range
HBUINT16 rangeStart; /* Large end of the recommended usage range
* (inclusive), stored in 720/inch units
* (decipoints). */
UINT16 rangeEnd; /* Small end of the recommended usage range
HBUINT16 rangeEnd; /* Small end of the recommended usage range
(exclusive), stored in 720/inch units
* (decipoints). */
public:
@ -393,12 +393,12 @@ struct FeatureParamsStylisticSet
return_trace (c->check_struct (this));
}
UINT16 version; /* (set to 0): This corresponds to a “minor”
HBUINT16 version; /* (set to 0): This corresponds to a “minor”
* version number. Additional data may be
* added to the end of this Feature Parameters
* table in the future. */
UINT16 uiNameID; /* The 'name' table name ID that specifies a
HBUINT16 uiNameID; /* The 'name' table name ID that specifies a
* string (or strings, for multiple languages)
* for a user-interface label for this
* feature. The values of uiLabelNameId and
@ -426,25 +426,25 @@ struct FeatureParamsCharacterVariants
characters.sanitize (c));
}
UINT16 format; /* Format number is set to 0. */
UINT16 featUILableNameID; /* The name table name ID that
HBUINT16 format; /* Format number is set to 0. */
HBUINT16 featUILableNameID; /* The name table name ID that
* specifies a string (or strings,
* for multiple languages) for a
* user-interface label for this
* feature. (May be nullptr.) */
UINT16 featUITooltipTextNameID;/* The name table name ID that
HBUINT16 featUITooltipTextNameID;/* The name table name ID that
* specifies a string (or strings,
* for multiple languages) that an
* application can use for tooltip
* text for this feature. (May be
* nullptr.) */
UINT16 sampleTextNameID; /* The name table name ID that
HBUINT16 sampleTextNameID; /* The name table name ID that
* specifies sample text that
* illustrates the effect of this
* feature. (May be nullptr.) */
UINT16 numNamedParameters; /* Number of named parameters. (May
HBUINT16 numNamedParameters; /* Number of named parameters. (May
* be zero.) */
UINT16 firstParamUILabelNameID;/* The first name table name ID
HBUINT16 firstParamUILabelNameID;/* The first name table name ID
* used to specify strings for
* user-interface labels for the
* feature parameters. (Must be zero
@ -562,7 +562,7 @@ struct Feature
typedef RecordListOf<Feature> FeatureList;
struct LookupFlag : UINT16
struct LookupFlag : HBUINT16
{
enum Flags {
RightToLeft = 0x0001u,
@ -608,7 +608,7 @@ struct Lookup
unsigned int flag = lookupFlag;
if (unlikely (flag & LookupFlag::UseMarkFilteringSet))
{
const UINT16 &markFilteringSet = StructAfter<UINT16> (subTable);
const HBUINT16 &markFilteringSet = StructAfter<HBUINT16> (subTable);
flag += (markFilteringSet << 16);
}
return flag;
@ -640,7 +640,7 @@ struct Lookup
if (unlikely (!subTable.serialize (c, num_subtables))) return_trace (false);
if (lookupFlag & LookupFlag::UseMarkFilteringSet)
{
UINT16 &markFilteringSet = StructAfter<UINT16> (subTable);
HBUINT16 &markFilteringSet = StructAfter<HBUINT16> (subTable);
markFilteringSet.set (lookup_props >> 16);
}
return_trace (true);
@ -653,18 +653,18 @@ struct Lookup
if (!(c->check_struct (this) && subTable.sanitize (c))) return_trace (false);
if (lookupFlag & LookupFlag::UseMarkFilteringSet)
{
const UINT16 &markFilteringSet = StructAfter<UINT16> (subTable);
const HBUINT16 &markFilteringSet = StructAfter<HBUINT16> (subTable);
if (!markFilteringSet.sanitize (c)) return_trace (false);
}
return_trace (true);
}
private:
UINT16 lookupType; /* Different enumerations for GSUB and GPOS */
UINT16 lookupFlag; /* Lookup qualifiers */
HBUINT16 lookupType; /* Different enumerations for GSUB and GPOS */
HBUINT16 lookupFlag; /* Lookup qualifiers */
ArrayOf<Offset16>
subTable; /* Array of SubTables */
UINT16 markFilteringSetX[VAR]; /* Index (base 0) into GDEF mark glyph sets
HBUINT16 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:
@ -735,7 +735,7 @@ struct CoverageFormat1
private:
protected:
UINT16 coverageFormat; /* Format identifier--format = 1 */
HBUINT16 coverageFormat; /* Format identifier--format = 1 */
SortedArrayOf<GlyphID>
glyphArray; /* Array of GlyphIDs--in numerical order */
public:
@ -860,7 +860,7 @@ struct CoverageFormat2
private:
protected:
UINT16 coverageFormat; /* Format identifier--format = 2 */
HBUINT16 coverageFormat; /* Format identifier--format = 2 */
SortedArrayOf<RangeRecord>
rangeRecord; /* Array of glyph ranges--ordered by
* Start GlyphID. rangeCount entries
@ -987,7 +987,7 @@ struct Coverage
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
CoverageFormat1 format1;
CoverageFormat2 format2;
} u;
@ -1074,9 +1074,9 @@ struct ClassDefFormat1
}
protected:
UINT16 classFormat; /* Format identifier--format = 1 */
HBUINT16 classFormat; /* Format identifier--format = 1 */
GlyphID startGlyph; /* First GlyphID of the classValueArray */
ArrayOf<UINT16>
ArrayOf<HBUINT16>
classValue; /* Array of Class Values--one per GlyphID */
public:
DEFINE_SIZE_ARRAY (6, classValue);
@ -1148,7 +1148,7 @@ struct ClassDefFormat2
}
protected:
UINT16 classFormat; /* Format identifier--format = 2 */
HBUINT16 classFormat; /* Format identifier--format = 2 */
SortedArrayOf<RangeRecord>
rangeRecord; /* Array of glyph ranges--ordered by
* Start GlyphID */
@ -1210,7 +1210,7 @@ struct ClassDef
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ClassDefFormat1 format1;
ClassDefFormat2 format2;
} u;
@ -1296,8 +1296,8 @@ struct VarRegionList
}
protected:
UINT16 axisCount;
UINT16 regionCount;
HBUINT16 axisCount;
HBUINT16 regionCount;
VarRegionAxis axesZ[VAR];
public:
DEFINE_SIZE_ARRAY (4, axesZ);
@ -1321,19 +1321,19 @@ struct VarData
unsigned int count = regionIndices.len;
unsigned int scount = shortCount;
const UINT8 *bytes = &StructAfter<UINT8> (regionIndices);
const UINT8 *row = bytes + inner * (scount + count);
const HBUINT8 *bytes = &StructAfter<HBUINT8> (regionIndices);
const HBUINT8 *row = bytes + inner * (scount + count);
float delta = 0.;
unsigned int i = 0;
const INT16 *scursor = reinterpret_cast<const INT16 *> (row);
const HBINT16 *scursor = reinterpret_cast<const HBINT16 *> (row);
for (; i < scount; i++)
{
float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count);
delta += scalar * *scursor++;
}
const INT8 *bcursor = reinterpret_cast<const INT8 *> (scursor);
const HBINT8 *bcursor = reinterpret_cast<const HBINT8 *> (scursor);
for (; i < count; i++)
{
float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count);
@ -1349,15 +1349,15 @@ struct VarData
return_trace (c->check_struct (this) &&
regionIndices.sanitize(c) &&
shortCount <= regionIndices.len &&
c->check_array (&StructAfter<UINT8> (regionIndices),
c->check_array (&StructAfter<HBUINT8> (regionIndices),
get_row_size (), itemCount));
}
protected:
UINT16 itemCount;
UINT16 shortCount;
ArrayOf<UINT16> regionIndices;
UINT8 bytesX[VAR];
HBUINT16 itemCount;
HBUINT16 shortCount;
ArrayOf<HBUINT16> regionIndices;
HBUINT8 bytesX[VAR];
public:
DEFINE_SIZE_ARRAY2 (6, regionIndices, bytesX);
};
@ -1393,9 +1393,9 @@ struct VariationStore
}
protected:
UINT16 format;
HBUINT16 format;
LOffsetTo<VarRegionList> regions;
OffsetArrayOf<VarData, UINT32> dataSets;
OffsetArrayOf<VarData, HBUINT32> dataSets;
public:
DEFINE_SIZE_ARRAY (8, dataSets);
};
@ -1422,8 +1422,8 @@ struct ConditionFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
UINT16 axisIndex;
HBUINT16 format; /* Format identifier--format = 1 */
HBUINT16 axisIndex;
F2DOT14 filterRangeMinValue;
F2DOT14 filterRangeMaxValue;
public:
@ -1452,7 +1452,7 @@ struct Condition
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ConditionFormat1 format1;
} u;
public:
@ -1477,7 +1477,7 @@ struct ConditionSet
}
protected:
OffsetArrayOf<Condition, UINT32> conditions;
OffsetArrayOf<Condition, HBUINT32> conditions;
public:
DEFINE_SIZE_ARRAY (2, conditions);
};
@ -1493,7 +1493,7 @@ struct FeatureTableSubstitutionRecord
}
protected:
UINT16 featureIndex;
HBUINT16 featureIndex;
LOffsetTo<Feature> feature;
public:
DEFINE_SIZE_STATIC (6);
@ -1613,8 +1613,8 @@ struct HintingDevice
inline unsigned int get_size (void) const
{
unsigned int f = deltaFormat;
if (unlikely (f < 1 || f > 3 || startSize > endSize)) return 3 * UINT16::static_size;
return UINT16::static_size * (4 + ((endSize - startSize) >> (4 - f)));
if (unlikely (f < 1 || f > 3 || startSize > endSize)) return 3 * HBUINT16::static_size;
return HBUINT16::static_size * (4 + ((endSize - startSize) >> (4 - f)));
}
inline bool sanitize (hb_sanitize_context_t *c) const
@ -1659,14 +1659,14 @@ struct HintingDevice
}
protected:
UINT16 startSize; /* Smallest size to correct--in ppem */
UINT16 endSize; /* Largest size to correct--in ppem */
UINT16 deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3
HBUINT16 startSize; /* Smallest size to correct--in ppem */
HBUINT16 endSize; /* Largest size to correct--in ppem */
HBUINT16 deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3
* 1 Signed 2-bit value, 8 values per uint16
* 2 Signed 4-bit value, 4 values per uint16
* 3 Signed 8-bit value, 2 values per uint16
*/
UINT16 deltaValue[VAR]; /* Array of compressed data */
HBUINT16 deltaValue[VAR]; /* Array of compressed data */
public:
DEFINE_SIZE_ARRAY (6, deltaValue);
};
@ -1697,9 +1697,9 @@ struct VariationDevice
}
protected:
UINT16 outerIndex;
UINT16 innerIndex;
UINT16 deltaFormat; /* Format identifier for this table: 0x0x8000 */
HBUINT16 outerIndex;
HBUINT16 innerIndex;
HBUINT16 deltaFormat; /* Format identifier for this table: 0x0x8000 */
public:
DEFINE_SIZE_STATIC (6);
};
@ -1707,10 +1707,10 @@ struct VariationDevice
struct DeviceHeader
{
protected:
UINT16 reserved1;
UINT16 reserved2;
HBUINT16 reserved1;
HBUINT16 reserved2;
public:
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
public:
DEFINE_SIZE_STATIC (6);
};

View File

@ -41,7 +41,7 @@ namespace OT {
* Attachment List Table
*/
typedef ArrayOf<UINT16> AttachPoint; /* Array of contour point indices--in
typedef ArrayOf<HBUINT16> AttachPoint; /* Array of contour point indices--in
* increasing numerical order */
struct AttachList
@ -62,7 +62,7 @@ struct AttachList
const AttachPoint &points = this+attachPoint[index];
if (point_count) {
const UINT16 *array = points.sub_array (start_offset, point_count);
const HBUINT16 *array = points.sub_array (start_offset, point_count);
unsigned int count = *point_count;
for (unsigned int i = 0; i < count; i++)
point_array[i] = array[i];
@ -109,8 +109,8 @@ struct CaretValueFormat1
}
protected:
UINT16 caretValueFormat; /* Format identifier--format = 1 */
INT16 coordinate; /* X or Y value, in design units */
HBUINT16 caretValueFormat; /* Format identifier--format = 1 */
HBINT16 coordinate; /* X or Y value, in design units */
public:
DEFINE_SIZE_STATIC (4);
};
@ -136,8 +136,8 @@ struct CaretValueFormat2
}
protected:
UINT16 caretValueFormat; /* Format identifier--format = 2 */
UINT16 caretValuePoint; /* Contour point index on glyph */
HBUINT16 caretValueFormat; /* Format identifier--format = 2 */
HBUINT16 caretValuePoint; /* Contour point index on glyph */
public:
DEFINE_SIZE_STATIC (4);
};
@ -160,8 +160,8 @@ struct CaretValueFormat3
}
protected:
UINT16 caretValueFormat; /* Format identifier--format = 3 */
INT16 coordinate; /* X or Y value, in design units */
HBUINT16 caretValueFormat; /* Format identifier--format = 3 */
HBINT16 coordinate; /* X or Y value, in design units */
OffsetTo<Device>
deviceTable; /* Offset to Device table for X or Y
* value--from beginning of CaretValue
@ -199,7 +199,7 @@ struct CaretValue
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
CaretValueFormat1 format1;
CaretValueFormat2 format2;
CaretValueFormat3 format3;
@ -294,7 +294,7 @@ struct MarkGlyphSetsFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
ArrayOf<LOffsetTo<Coverage> >
coverage; /* Array of long offsets to mark set
* coverage tables */
@ -324,7 +324,7 @@ struct MarkGlyphSets
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
MarkGlyphSetsFormat1 format1;
} u;
public:

View File

@ -51,11 +51,11 @@ enum attach_type_t {
/* Shared Tables: ValueRecord, Anchor Table, and MarkArray */
typedef UINT16 Value;
typedef HBUINT16 Value;
typedef Value ValueRecord[VAR];
struct ValueFormat : UINT16
struct ValueFormat : HBUINT16
{
enum Flags {
xPlacement = 0x0001u, /* Includes horizontal adjustment for placement */
@ -74,14 +74,14 @@ struct ValueFormat : UINT16
/* All fields are options. Only those available advance the value pointer. */
#if 0
INT16 xPlacement; /* Horizontal adjustment for
HBINT16 xPlacement; /* Horizontal adjustment for
* placement--in design units */
INT16 yPlacement; /* Vertical adjustment for
HBINT16 yPlacement; /* Vertical adjustment for
* placement--in design units */
INT16 xAdvance; /* Horizontal adjustment for
HBINT16 xAdvance; /* Horizontal adjustment for
* advance--in design units (only used
* for horizontal writing) */
INT16 yAdvance; /* Vertical adjustment for advance--in
HBINT16 yAdvance; /* Vertical adjustment for advance--in
* design units (only used for vertical
* writing) */
Offset xPlaDevice; /* Offset to Device table for
@ -178,8 +178,8 @@ struct ValueFormat : UINT16
static inline const OffsetTo<Device>& get_device (const Value* value)
{ return *CastP<OffsetTo<Device> > (value); }
static inline const INT16& get_short (const Value* value)
{ return *CastP<INT16> (value); }
static inline const HBINT16& get_short (const Value* value)
{ return *CastP<HBINT16> (value); }
public:
@ -247,9 +247,9 @@ struct AnchorFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
INT16 xCoordinate; /* Horizontal value--in design units */
INT16 yCoordinate; /* Vertical value--in design units */
HBUINT16 format; /* Format identifier--format = 1 */
HBINT16 xCoordinate; /* Horizontal value--in design units */
HBINT16 yCoordinate; /* Vertical value--in design units */
public:
DEFINE_SIZE_STATIC (6);
};
@ -278,10 +278,10 @@ struct AnchorFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
INT16 xCoordinate; /* Horizontal value--in design units */
INT16 yCoordinate; /* Vertical value--in design units */
UINT16 anchorPoint; /* Index to glyph contour point */
HBUINT16 format; /* Format identifier--format = 2 */
HBINT16 xCoordinate; /* Horizontal value--in design units */
HBINT16 yCoordinate; /* Vertical value--in design units */
HBUINT16 anchorPoint; /* Index to glyph contour point */
public:
DEFINE_SIZE_STATIC (8);
};
@ -308,9 +308,9 @@ struct AnchorFormat3
}
protected:
UINT16 format; /* Format identifier--format = 3 */
INT16 xCoordinate; /* Horizontal value--in design units */
INT16 yCoordinate; /* Vertical value--in design units */
HBUINT16 format; /* Format identifier--format = 3 */
HBINT16 xCoordinate; /* Horizontal value--in design units */
HBINT16 yCoordinate; /* Vertical value--in design units */
OffsetTo<Device>
xDeviceTable; /* Offset to Device table for X
* coordinate-- from beginning of
@ -351,7 +351,7 @@ struct Anchor
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
AnchorFormat1 format1;
AnchorFormat2 format2;
AnchorFormat3 format3;
@ -382,7 +382,7 @@ struct AnchorMatrix
return_trace (true);
}
UINT16 rows; /* Number of rows */
HBUINT16 rows; /* Number of rows */
protected:
OffsetTo<Anchor>
matrixZ[VAR]; /* Matrix of offsets to Anchor tables--
@ -403,7 +403,7 @@ struct MarkRecord
}
protected:
UINT16 klass; /* Class defined for this mark */
HBUINT16 klass; /* Class defined for this mark */
OffsetTo<Anchor>
markAnchor; /* Offset to Anchor table--from
* beginning of MarkArray table */
@ -492,7 +492,7 @@ struct SinglePosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of subtable */
@ -544,13 +544,13 @@ struct SinglePosFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of subtable */
ValueFormat valueFormat; /* Defines the types of data in the
* ValueRecord */
UINT16 valueCount; /* Number of ValueRecords */
HBUINT16 valueCount; /* Number of ValueRecords */
ValueRecord values; /* Array of ValueRecords--positioning
* values applied to glyphs */
public:
@ -573,7 +573,7 @@ struct SinglePos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
SinglePosFormat1 format1;
SinglePosFormat2 format2;
} u;
@ -604,7 +604,7 @@ struct PairSet
TRACE_COLLECT_GLYPHS (this);
unsigned int len1 = valueFormats[0].get_len ();
unsigned int len2 = valueFormats[1].get_len ();
unsigned int record_size = UINT16::static_size * (1 + len1 + len2);
unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2);
const PairValueRecord *record = CastP<PairValueRecord> (arrayZ);
c->input->add_array (&record->secondGlyph, len, record_size);
@ -618,7 +618,7 @@ struct PairSet
hb_buffer_t *buffer = c->buffer;
unsigned int len1 = valueFormats[0].get_len ();
unsigned int len2 = valueFormats[1].get_len ();
unsigned int record_size = UINT16::static_size * (1 + len1 + len2);
unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2);
const PairValueRecord *record_array = CastP<PairValueRecord> (arrayZ);
unsigned int count = len;
@ -663,7 +663,7 @@ struct PairSet
{
TRACE_SANITIZE (this);
if (!(c->check_struct (this)
&& c->check_array (arrayZ, UINT16::static_size * closure->stride, len))) return_trace (false);
&& c->check_array (arrayZ, HBUINT16::static_size * closure->stride, len))) return_trace (false);
unsigned int count = len;
const PairValueRecord *record = CastP<PairValueRecord> (arrayZ);
@ -672,8 +672,8 @@ struct PairSet
}
protected:
UINT16 len; /* Number of PairValueRecords */
UINT16 arrayZ[VAR]; /* Array of PairValueRecords--ordered
HBUINT16 len; /* Number of PairValueRecords */
HBUINT16 arrayZ[VAR]; /* Array of PairValueRecords--ordered
* by GlyphID of the second glyph */
public:
DEFINE_SIZE_ARRAY (2, arrayZ);
@ -728,7 +728,7 @@ struct PairPosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of subtable */
@ -809,7 +809,7 @@ struct PairPosFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of subtable */
@ -827,9 +827,9 @@ struct PairPosFormat2
classDef2; /* Offset to ClassDef table--from
* beginning of PairPos subtable--for
* the second glyph of the pair */
UINT16 class1Count; /* Number of classes in ClassDef1
HBUINT16 class1Count; /* Number of classes in ClassDef1
* table--includes Class0 */
UINT16 class2Count; /* Number of classes in ClassDef2
HBUINT16 class2Count; /* Number of classes in ClassDef2
* table--includes Class0 */
ValueRecord values; /* Matrix of value pairs:
* class1-major, class2-minor,
@ -854,7 +854,7 @@ struct PairPos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
PairPosFormat1 format1;
PairPosFormat2 format2;
} u;
@ -1008,7 +1008,7 @@ struct CursivePosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of subtable */
@ -1034,7 +1034,7 @@ struct CursivePos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
CursivePosFormat1 format1;
} u;
};
@ -1099,14 +1099,14 @@ struct MarkBasePosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
markCoverage; /* Offset to MarkCoverage table--from
* beginning of MarkBasePos subtable */
OffsetTo<Coverage>
baseCoverage; /* Offset to BaseCoverage table--from
* beginning of MarkBasePos subtable */
UINT16 classCount; /* Number of classes defined for marks */
HBUINT16 classCount; /* Number of classes defined for marks */
OffsetTo<MarkArray>
markArray; /* Offset to MarkArray table--from
* beginning of MarkBasePos subtable */
@ -1132,7 +1132,7 @@ struct MarkBasePos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
MarkBasePosFormat1 format1;
} u;
};
@ -1216,7 +1216,7 @@ struct MarkLigPosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
markCoverage; /* Offset to Mark Coverage table--from
* beginning of MarkLigPos subtable */
@ -1224,7 +1224,7 @@ struct MarkLigPosFormat1
ligatureCoverage; /* Offset to Ligature Coverage
* table--from beginning of MarkLigPos
* subtable */
UINT16 classCount; /* Number of defined mark classes */
HBUINT16 classCount; /* Number of defined mark classes */
OffsetTo<MarkArray>
markArray; /* Offset to MarkArray table--from
* beginning of MarkLigPos subtable */
@ -1250,7 +1250,7 @@ struct MarkLigPos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
MarkLigPosFormat1 format1;
} u;
};
@ -1330,7 +1330,7 @@ struct MarkMarkPosFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
mark1Coverage; /* Offset to Combining Mark1 Coverage
* table--from beginning of MarkMarkPos
@ -1339,7 +1339,7 @@ struct MarkMarkPosFormat1
mark2Coverage; /* Offset to Combining Mark2 Coverage
* table--from beginning of MarkMarkPos
* subtable */
UINT16 classCount; /* Number of defined mark classes */
HBUINT16 classCount; /* Number of defined mark classes */
OffsetTo<MarkArray>
mark1Array; /* Offset to Mark1Array table--from
* beginning of MarkMarkPos subtable */
@ -1365,7 +1365,7 @@ struct MarkMarkPos
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
MarkMarkPosFormat1 format1;
} u;
};
@ -1424,7 +1424,7 @@ struct PosLookupSubTable
protected:
union {
UINT16 sub_format;
HBUINT16 sub_format;
SinglePos single;
PairPos pair;
CursivePos cursive;

View File

@ -110,11 +110,11 @@ struct SingleSubstFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
INT16 deltaGlyphID; /* Add to original GlyphID to get
HBINT16 deltaGlyphID; /* Add to original GlyphID to get
* substitute GlyphID */
public:
DEFINE_SIZE_STATIC (6);
@ -195,7 +195,7 @@ struct SingleSubstFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
@ -249,7 +249,7 @@ struct SingleSubst
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
SingleSubstFormat1 format1;
SingleSubstFormat2 format2;
} u;
@ -398,7 +398,7 @@ struct MultipleSubstFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
@ -440,7 +440,7 @@ struct MultipleSubst
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
MultipleSubstFormat1 format1;
} u;
};
@ -548,7 +548,7 @@ struct AlternateSubstFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
@ -590,7 +590,7 @@ struct AlternateSubst
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
AlternateSubstFormat1 format1;
} u;
};
@ -862,7 +862,7 @@ struct LigatureSubstFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
@ -912,7 +912,7 @@ struct LigatureSubst
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
LigatureSubstFormat1 format1;
} u;
};
@ -1007,11 +1007,11 @@ struct ReverseChainSingleSubstFormat1
unsigned int start_index = 0, end_index = 0;
if (match_backtrack (c,
backtrack.len, (UINT16 *) backtrack.array,
backtrack.len, (HBUINT16 *) backtrack.array,
match_coverage, this,
&start_index) &&
match_lookahead (c,
lookahead.len, (UINT16 *) lookahead.array,
lookahead.len, (HBUINT16 *) lookahead.array,
match_coverage, this,
1, &end_index))
{
@ -1039,7 +1039,7 @@ struct ReverseChainSingleSubstFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of table */
@ -1073,7 +1073,7 @@ struct ReverseChainSingleSubst
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ReverseChainSingleSubstFormat1 format1;
} u;
};
@ -1119,7 +1119,7 @@ struct SubstLookupSubTable
protected:
union {
UINT16 sub_format;
HBUINT16 sub_format;
SingleSubst single;
MultipleSubst multiple;
AlternateSubst alternate;

View File

@ -234,7 +234,7 @@ struct hb_apply_context_t :
match_func (nullptr),
match_data (nullptr) {};
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const UINT16 &value, const void *data);
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data);
inline void set_ignore_zwnj (bool ignore_zwnj_) { ignore_zwnj = ignore_zwnj_; }
inline void set_ignore_zwj (bool ignore_zwj_) { ignore_zwj = ignore_zwj_; }
@ -252,7 +252,7 @@ struct hb_apply_context_t :
};
inline may_match_t may_match (const hb_glyph_info_t &info,
const UINT16 *glyph_data) const
const HBUINT16 *glyph_data) const
{
if (!(info.mask & mask) ||
(syllable && syllable != info.syllable ()))
@ -315,7 +315,7 @@ struct hb_apply_context_t :
}
inline void set_match_func (matcher_t::match_func_t match_func_,
const void *match_data_,
const UINT16 glyph_data[])
const HBUINT16 glyph_data[])
{
matcher.set_match_func (match_func_, match_data_);
match_glyph_data = glyph_data;
@ -398,7 +398,7 @@ struct hb_apply_context_t :
protected:
hb_apply_context_t *c;
matcher_t matcher;
const UINT16 *match_glyph_data;
const HBUINT16 *match_glyph_data;
unsigned int num_items;
unsigned int end;
@ -568,9 +568,9 @@ struct hb_apply_context_t :
typedef bool (*intersects_func_t) (hb_set_t *glyphs, const UINT16 &value, const void *data);
typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, const UINT16 &value, const void *data);
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const UINT16 &value, const void *data);
typedef bool (*intersects_func_t) (hb_set_t *glyphs, const HBUINT16 &value, const void *data);
typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, const HBUINT16 &value, const void *data);
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data);
struct ContextClosureFuncs
{
@ -586,16 +586,16 @@ struct ContextApplyFuncs
};
static inline bool intersects_glyph (hb_set_t *glyphs, const UINT16 &value, const void *data HB_UNUSED)
static inline bool intersects_glyph (hb_set_t *glyphs, const HBUINT16 &value, const void *data HB_UNUSED)
{
return glyphs->has (value);
}
static inline bool intersects_class (hb_set_t *glyphs, const UINT16 &value, const void *data)
static inline bool intersects_class (hb_set_t *glyphs, const HBUINT16 &value, const void *data)
{
const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
return class_def.intersects_class (glyphs, value);
}
static inline bool intersects_coverage (hb_set_t *glyphs, const UINT16 &value, const void *data)
static inline bool intersects_coverage (hb_set_t *glyphs, const HBUINT16 &value, const void *data)
{
const OffsetTo<Coverage> &coverage = (const OffsetTo<Coverage>&)value;
return (data+coverage).intersects (glyphs);
@ -603,7 +603,7 @@ static inline bool intersects_coverage (hb_set_t *glyphs, const UINT16 &value, c
static inline bool intersects_array (hb_closure_context_t *c,
unsigned int count,
const UINT16 values[],
const HBUINT16 values[],
intersects_func_t intersects_func,
const void *intersects_data)
{
@ -614,16 +614,16 @@ static inline bool intersects_array (hb_closure_context_t *c,
}
static inline void collect_glyph (hb_set_t *glyphs, const UINT16 &value, const void *data HB_UNUSED)
static inline void collect_glyph (hb_set_t *glyphs, const HBUINT16 &value, const void *data HB_UNUSED)
{
glyphs->add (value);
}
static inline void collect_class (hb_set_t *glyphs, const UINT16 &value, const void *data)
static inline void collect_class (hb_set_t *glyphs, const HBUINT16 &value, const void *data)
{
const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
class_def.add_class (glyphs, value);
}
static inline void collect_coverage (hb_set_t *glyphs, const UINT16 &value, const void *data)
static inline void collect_coverage (hb_set_t *glyphs, const HBUINT16 &value, const void *data)
{
const OffsetTo<Coverage> &coverage = (const OffsetTo<Coverage>&)value;
(data+coverage).add_coverage (glyphs);
@ -631,7 +631,7 @@ static inline void collect_coverage (hb_set_t *glyphs, const UINT16 &value, cons
static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
hb_set_t *glyphs,
unsigned int count,
const UINT16 values[],
const HBUINT16 values[],
collect_glyphs_func_t collect_func,
const void *collect_data)
{
@ -640,16 +640,16 @@ static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
}
static inline bool match_glyph (hb_codepoint_t glyph_id, const UINT16 &value, const void *data HB_UNUSED)
static inline bool match_glyph (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data HB_UNUSED)
{
return glyph_id == value;
}
static inline bool match_class (hb_codepoint_t glyph_id, const UINT16 &value, const void *data)
static inline bool match_class (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data)
{
const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
return class_def.get_class (glyph_id) == value;
}
static inline bool match_coverage (hb_codepoint_t glyph_id, const UINT16 &value, const void *data)
static inline bool match_coverage (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data)
{
const OffsetTo<Coverage> &coverage = (const OffsetTo<Coverage>&)value;
return (data+coverage).get_coverage (glyph_id) != NOT_COVERED;
@ -657,7 +657,7 @@ static inline bool match_coverage (hb_codepoint_t glyph_id, const UINT16 &value,
static inline bool would_match_input (hb_would_apply_context_t *c,
unsigned int count, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
match_func_t match_func,
const void *match_data)
{
@ -672,7 +672,7 @@ static inline bool would_match_input (hb_would_apply_context_t *c,
}
static inline bool match_input (hb_apply_context_t *c,
unsigned int count, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
match_func_t match_func,
const void *match_data,
unsigned int *end_offset,
@ -896,7 +896,7 @@ static inline bool ligate_input (hb_apply_context_t *c,
static inline bool match_backtrack (hb_apply_context_t *c,
unsigned int count,
const UINT16 backtrack[],
const HBUINT16 backtrack[],
match_func_t match_func,
const void *match_data,
unsigned int *match_start)
@ -918,7 +918,7 @@ static inline bool match_backtrack (hb_apply_context_t *c,
static inline bool match_lookahead (hb_apply_context_t *c,
unsigned int count,
const UINT16 lookahead[],
const HBUINT16 lookahead[],
match_func_t match_func,
const void *match_data,
unsigned int offset,
@ -949,9 +949,9 @@ struct LookupRecord
return_trace (c->check_struct (this));
}
UINT16 sequenceIndex; /* Index into current glyph
HBUINT16 sequenceIndex; /* Index into current glyph
* sequence--first glyph = 0 */
UINT16 lookupListIndex; /* Lookup to apply to that
HBUINT16 lookupListIndex; /* Lookup to apply to that
* position--zero--based */
public:
DEFINE_SIZE_STATIC (4);
@ -1112,7 +1112,7 @@ struct ContextApplyLookupContext
static inline void context_closure_lookup (hb_closure_context_t *c,
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ContextClosureLookupContext &lookup_context)
@ -1126,7 +1126,7 @@ static inline void context_closure_lookup (hb_closure_context_t *c,
static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ContextCollectGlyphsLookupContext &lookup_context)
@ -1140,7 +1140,7 @@ static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c
static inline bool context_would_apply_lookup (hb_would_apply_context_t *c,
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookupCount HB_UNUSED,
const LookupRecord lookupRecord[] HB_UNUSED,
ContextApplyLookupContext &lookup_context)
@ -1151,7 +1151,7 @@ static inline bool context_would_apply_lookup (hb_would_apply_context_t *c,
}
static inline bool context_apply_lookup (hb_apply_context_t *c,
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ContextApplyLookupContext &lookup_context)
@ -1217,11 +1217,11 @@ struct Rule
}
protected:
UINT16 inputCount; /* Total number of glyphs in input
HBUINT16 inputCount; /* Total number of glyphs in input
* glyph sequence--includes the first
* glyph */
UINT16 lookupCount; /* Number of LookupRecords */
UINT16 inputZ[VAR]; /* Array of match inputs--start with
HBUINT16 lookupCount; /* Number of LookupRecords */
HBUINT16 inputZ[VAR]; /* Array of match inputs--start with
* second glyph */
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
* design order */
@ -1361,7 +1361,7 @@ struct ContextFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of table */
@ -1454,7 +1454,7 @@ struct ContextFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of table */
@ -1483,7 +1483,7 @@ struct ContextFormat3
this
};
context_closure_lookup (c,
glyphCount, (const UINT16 *) (coverageZ + 1),
glyphCount, (const HBUINT16 *) (coverageZ + 1),
lookupCount, lookupRecord,
lookup_context);
}
@ -1500,7 +1500,7 @@ struct ContextFormat3
};
context_collect_glyphs_lookup (c,
glyphCount, (const UINT16 *) (coverageZ + 1),
glyphCount, (const HBUINT16 *) (coverageZ + 1),
lookupCount, lookupRecord,
lookup_context);
}
@ -1514,7 +1514,7 @@ struct ContextFormat3
{match_coverage},
this
};
return_trace (context_would_apply_lookup (c, glyphCount, (const UINT16 *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
return_trace (context_would_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
}
inline const Coverage &get_coverage (void) const
@ -1533,7 +1533,7 @@ struct ContextFormat3
{match_coverage},
this
};
return_trace (context_apply_lookup (c, glyphCount, (const UINT16 *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
return_trace (context_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
@ -1550,10 +1550,10 @@ struct ContextFormat3
}
protected:
UINT16 format; /* Format identifier--format = 3 */
UINT16 glyphCount; /* Number of glyphs in the input glyph
HBUINT16 format; /* Format identifier--format = 3 */
HBUINT16 glyphCount; /* Number of glyphs in the input glyph
* sequence */
UINT16 lookupCount; /* Number of LookupRecords */
HBUINT16 lookupCount; /* Number of LookupRecords */
OffsetTo<Coverage>
coverageZ[VAR]; /* Array of offsets to Coverage
* table in glyph sequence order */
@ -1580,7 +1580,7 @@ struct Context
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ContextFormat1 format1;
ContextFormat2 format2;
ContextFormat3 format3;
@ -1610,11 +1610,11 @@ struct ChainContextApplyLookupContext
static inline void chain_context_closure_lookup (hb_closure_context_t *c,
unsigned int backtrackCount,
const UINT16 backtrack[],
const HBUINT16 backtrack[],
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookaheadCount,
const UINT16 lookahead[],
const HBUINT16 lookahead[],
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ChainContextClosureLookupContext &lookup_context)
@ -1634,11 +1634,11 @@ static inline void chain_context_closure_lookup (hb_closure_context_t *c,
static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
unsigned int backtrackCount,
const UINT16 backtrack[],
const HBUINT16 backtrack[],
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookaheadCount,
const UINT16 lookahead[],
const HBUINT16 lookahead[],
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ChainContextCollectGlyphsLookupContext &lookup_context)
@ -1658,11 +1658,11 @@ static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_contex
static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c,
unsigned int backtrackCount,
const UINT16 backtrack[] HB_UNUSED,
const HBUINT16 backtrack[] HB_UNUSED,
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookaheadCount,
const UINT16 lookahead[] HB_UNUSED,
const HBUINT16 lookahead[] HB_UNUSED,
unsigned int lookupCount HB_UNUSED,
const LookupRecord lookupRecord[] HB_UNUSED,
ChainContextApplyLookupContext &lookup_context)
@ -1675,11 +1675,11 @@ static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c
static inline bool chain_context_apply_lookup (hb_apply_context_t *c,
unsigned int backtrackCount,
const UINT16 backtrack[],
const HBUINT16 backtrack[],
unsigned int inputCount, /* Including the first glyph (not matched) */
const UINT16 input[], /* Array of input values--start with second glyph */
const HBUINT16 input[], /* Array of input values--start with second glyph */
unsigned int lookaheadCount,
const UINT16 lookahead[],
const HBUINT16 lookahead[],
unsigned int lookupCount,
const LookupRecord lookupRecord[],
ChainContextApplyLookupContext &lookup_context)
@ -1710,8 +1710,8 @@ struct ChainRule
inline void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const
{
TRACE_CLOSURE (this);
const HeadlessArrayOf<UINT16> &input = StructAfter<HeadlessArrayOf<UINT16> > (backtrack);
const ArrayOf<UINT16> &lookahead = StructAfter<ArrayOf<UINT16> > (input);
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
chain_context_closure_lookup (c,
backtrack.len, backtrack.array,
@ -1724,8 +1724,8 @@ struct ChainRule
inline void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const
{
TRACE_COLLECT_GLYPHS (this);
const HeadlessArrayOf<UINT16> &input = StructAfter<HeadlessArrayOf<UINT16> > (backtrack);
const ArrayOf<UINT16> &lookahead = StructAfter<ArrayOf<UINT16> > (input);
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
chain_context_collect_glyphs_lookup (c,
backtrack.len, backtrack.array,
@ -1738,8 +1738,8 @@ struct ChainRule
inline bool would_apply (hb_would_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
{
TRACE_WOULD_APPLY (this);
const HeadlessArrayOf<UINT16> &input = StructAfter<HeadlessArrayOf<UINT16> > (backtrack);
const ArrayOf<UINT16> &lookahead = StructAfter<ArrayOf<UINT16> > (input);
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
return_trace (chain_context_would_apply_lookup (c,
backtrack.len, backtrack.array,
@ -1751,8 +1751,8 @@ struct ChainRule
inline bool apply (hb_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
{
TRACE_APPLY (this);
const HeadlessArrayOf<UINT16> &input = StructAfter<HeadlessArrayOf<UINT16> > (backtrack);
const ArrayOf<UINT16> &lookahead = StructAfter<ArrayOf<UINT16> > (input);
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
return_trace (chain_context_apply_lookup (c,
backtrack.len, backtrack.array,
@ -1765,23 +1765,23 @@ struct ChainRule
{
TRACE_SANITIZE (this);
if (!backtrack.sanitize (c)) return_trace (false);
const HeadlessArrayOf<UINT16> &input = StructAfter<HeadlessArrayOf<UINT16> > (backtrack);
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
if (!input.sanitize (c)) return_trace (false);
const ArrayOf<UINT16> &lookahead = StructAfter<ArrayOf<UINT16> > (input);
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
if (!lookahead.sanitize (c)) return_trace (false);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
return_trace (lookup.sanitize (c));
}
protected:
ArrayOf<UINT16>
ArrayOf<HBUINT16>
backtrack; /* Array of backtracking values
* (to be matched before the input
* sequence) */
HeadlessArrayOf<UINT16>
HeadlessArrayOf<HBUINT16>
inputX; /* Array of input values (start with
* second glyph) */
ArrayOf<UINT16>
ArrayOf<HBUINT16>
lookaheadX; /* Array of lookahead values's (to be
* matched after the input sequence) */
ArrayOf<LookupRecord>
@ -1918,7 +1918,7 @@ struct ChainContextFormat1
}
protected:
UINT16 format; /* Format identifier--format = 1 */
HBUINT16 format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of table */
@ -2033,7 +2033,7 @@ struct ChainContextFormat2
}
protected:
UINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of table */
@ -2073,9 +2073,9 @@ struct ChainContextFormat3
{this, this, this}
};
chain_context_closure_lookup (c,
backtrack.len, (const UINT16 *) backtrack.array,
input.len, (const UINT16 *) input.array + 1,
lookahead.len, (const UINT16 *) lookahead.array,
backtrack.len, (const HBUINT16 *) backtrack.array,
input.len, (const HBUINT16 *) input.array + 1,
lookahead.len, (const HBUINT16 *) lookahead.array,
lookup.len, lookup.array,
lookup_context);
}
@ -2094,9 +2094,9 @@ struct ChainContextFormat3
{this, this, this}
};
chain_context_collect_glyphs_lookup (c,
backtrack.len, (const UINT16 *) backtrack.array,
input.len, (const UINT16 *) input.array + 1,
lookahead.len, (const UINT16 *) lookahead.array,
backtrack.len, (const HBUINT16 *) backtrack.array,
input.len, (const HBUINT16 *) input.array + 1,
lookahead.len, (const HBUINT16 *) lookahead.array,
lookup.len, lookup.array,
lookup_context);
}
@ -2113,9 +2113,9 @@ struct ChainContextFormat3
{this, this, this}
};
return_trace (chain_context_would_apply_lookup (c,
backtrack.len, (const UINT16 *) backtrack.array,
input.len, (const UINT16 *) input.array + 1,
lookahead.len, (const UINT16 *) lookahead.array,
backtrack.len, (const HBUINT16 *) backtrack.array,
input.len, (const HBUINT16 *) input.array + 1,
lookahead.len, (const HBUINT16 *) lookahead.array,
lookup.len, lookup.array, lookup_context));
}
@ -2140,9 +2140,9 @@ struct ChainContextFormat3
{this, this, this}
};
return_trace (chain_context_apply_lookup (c,
backtrack.len, (const UINT16 *) backtrack.array,
input.len, (const UINT16 *) input.array + 1,
lookahead.len, (const UINT16 *) lookahead.array,
backtrack.len, (const HBUINT16 *) backtrack.array,
input.len, (const HBUINT16 *) input.array + 1,
lookahead.len, (const HBUINT16 *) lookahead.array,
lookup.len, lookup.array, lookup_context));
}
@ -2160,7 +2160,7 @@ struct ChainContextFormat3
}
protected:
UINT16 format; /* Format identifier--format = 3 */
HBUINT16 format; /* Format identifier--format = 3 */
OffsetArrayOf<Coverage>
backtrack; /* Array of coverage tables
* in backtracking sequence, in glyph
@ -2197,7 +2197,7 @@ struct ChainContext
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ChainContextFormat1 format1;
ChainContextFormat2 format2;
ChainContextFormat3 format3;
@ -2234,11 +2234,11 @@ struct ExtensionFormat1
}
protected:
UINT16 format; /* Format identifier. Set to 1. */
UINT16 extensionLookupType; /* Lookup type of subtable referenced
HBUINT16 format; /* Format identifier. Set to 1. */
HBUINT16 extensionLookupType; /* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
UINT32 extensionOffset; /* Offset to the extension subtable,
HBUINT32 extensionOffset; /* Offset to the extension subtable,
* of lookup type subtable. */
public:
DEFINE_SIZE_STATIC (8);
@ -2276,7 +2276,7 @@ struct Extension
protected:
union {
UINT16 format; /* Format identifier */
HBUINT16 format; /* Format identifier */
ExtensionFormat1<T> format1;
} u;
};

View File

@ -48,7 +48,7 @@ struct MathValueRecord
}
protected:
INT16 value; /* The X or Y value in design units */
HBINT16 value; /* The X or Y value in design units */
OffsetTo<Device> deviceTable; /* Offset to the device table - from the
* beginning of parent table. May be nullptr.
* Suggested format for device table is 1. */
@ -154,10 +154,10 @@ struct MathConstants
}
protected:
INT16 percentScaleDown[2];
UINT16 minHeight[2];
HBINT16 percentScaleDown[2];
HBUINT16 minHeight[2];
MathValueRecord mathValueRecords[51];
INT16 radicalDegreeBottomRaisePercent;
HBINT16 radicalDegreeBottomRaisePercent;
public:
DEFINE_SIZE_STATIC (214);
@ -279,7 +279,7 @@ struct MathKern
}
protected:
UINT16 heightCount;
HBUINT16 heightCount;
MathValueRecord mathValueRecords[VAR]; /* Array of correction heights at
* which the kern value changes.
* Sorted by the height value in
@ -425,7 +425,7 @@ struct MathGlyphVariantRecord
protected:
GlyphID variantGlyph; /* Glyph ID for the variant. */
UINT16 advanceMeasurement; /* Advance width/height, in design units, of the
HBUINT16 advanceMeasurement; /* Advance width/height, in design units, of the
* variant, in the direction of requested
* glyph extension. */
@ -433,7 +433,7 @@ struct MathGlyphVariantRecord
DEFINE_SIZE_STATIC (4);
};
struct PartFlags : UINT16
struct PartFlags : HBUINT16
{
enum Flags {
Extender = 0x0001u, /* If set, the part can be skipped or repeated. */
@ -473,15 +473,15 @@ struct MathGlyphPartRecord
protected:
GlyphID glyph; /* Glyph ID for the part. */
UINT16 startConnectorLength; /* Advance width/ height of the straight bar
HBUINT16 startConnectorLength; /* Advance width/ height of the straight bar
* connector material, in design units, is at
* the beginning of the glyph, in the
* direction of the extension. */
UINT16 endConnectorLength; /* Advance width/ height of the straight bar
HBUINT16 endConnectorLength; /* Advance width/ height of the straight bar
* connector material, in design units, is at
* the end of the glyph, in the direction of
* the extension. */
UINT16 fullAdvance; /* Full advance width/height for this part,
HBUINT16 fullAdvance; /* Full advance width/height for this part,
* in the direction of the extension.
* In design units. */
PartFlags partFlags; /* Part qualifiers. */
@ -651,7 +651,7 @@ struct MathVariants
}
protected:
UINT16 minConnectorOverlap; /* Minimum overlap of connecting
HBUINT16 minConnectorOverlap; /* Minimum overlap of connecting
* glyphs during glyph construction,
* in design units. */
OffsetTo<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
@ -660,10 +660,10 @@ struct MathVariants
OffsetTo<Coverage> horizGlyphCoverage; /* Offset to Coverage table -
* from the beginning of MathVariants
* table. */
UINT16 vertGlyphCount; /* Number of glyphs for which
HBUINT16 vertGlyphCount; /* Number of glyphs for which
* information is provided for
* vertically growing variants. */
UINT16 horizGlyphCount; /* Number of glyphs for which
HBUINT16 horizGlyphCount; /* Number of glyphs for which
* information is provided for
* horizontally growing variants. */

View File

@ -60,7 +60,7 @@ struct maxp
protected:
FixedVersion<>version; /* Version of the maxp table (0.5 or 1.0),
* 0x00005000u or 0x00010000u. */
UINT16 numGlyphs; /* The number of glyphs in the font. */
HBUINT16 numGlyphs; /* The number of glyphs in the font. */
public:
DEFINE_SIZE_STATIC (6);
};

View File

@ -65,12 +65,12 @@ struct NameRecord
return_trace (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
}
UINT16 platformID; /* Platform ID. */
UINT16 encodingID; /* Platform-specific encoding ID. */
UINT16 languageID; /* Language ID. */
UINT16 nameID; /* Name ID. */
UINT16 length; /* String length (in bytes). */
UINT16 offset; /* String offset from start of storage area (in bytes). */
HBUINT16 platformID; /* Platform ID. */
HBUINT16 encodingID; /* Platform-specific encoding ID. */
HBUINT16 languageID; /* Language ID. */
HBUINT16 nameID; /* Name ID. */
HBUINT16 length; /* String length (in bytes). */
HBUINT16 offset; /* String offset from start of storage area (in bytes). */
public:
DEFINE_SIZE_STATIC (12);
};
@ -123,8 +123,8 @@ struct name
}
/* We only implement format 0 for now. */
UINT16 format; /* Format selector (=0/1). */
UINT16 count; /* Number of name records. */
HBUINT16 format; /* Format selector (=0/1). */
HBUINT16 count; /* Number of name records. */
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:

View File

@ -50,50 +50,50 @@ struct os2
}
public:
UINT16 version;
HBUINT16 version;
/* Version 0 */
INT16 xAvgCharWidth;
UINT16 usWeightClass;
UINT16 usWidthClass;
UINT16 fsType;
INT16 ySubscriptXSize;
INT16 ySubscriptYSize;
INT16 ySubscriptXOffset;
INT16 ySubscriptYOffset;
INT16 ySuperscriptXSize;
INT16 ySuperscriptYSize;
INT16 ySuperscriptXOffset;
INT16 ySuperscriptYOffset;
INT16 yStrikeoutSize;
INT16 yStrikeoutPosition;
INT16 sFamilyClass;
UINT8 panose[10];
UINT32 ulUnicodeRange[4];
HBINT16 xAvgCharWidth;
HBUINT16 usWeightClass;
HBUINT16 usWidthClass;
HBUINT16 fsType;
HBINT16 ySubscriptXSize;
HBINT16 ySubscriptYSize;
HBINT16 ySubscriptXOffset;
HBINT16 ySubscriptYOffset;
HBINT16 ySuperscriptXSize;
HBINT16 ySuperscriptYSize;
HBINT16 ySuperscriptXOffset;
HBINT16 ySuperscriptYOffset;
HBINT16 yStrikeoutSize;
HBINT16 yStrikeoutPosition;
HBINT16 sFamilyClass;
HBUINT8 panose[10];
HBUINT32 ulUnicodeRange[4];
Tag achVendID;
UINT16 fsSelection;
UINT16 usFirstCharIndex;
UINT16 usLastCharIndex;
INT16 sTypoAscender;
INT16 sTypoDescender;
INT16 sTypoLineGap;
UINT16 usWinAscent;
UINT16 usWinDescent;
HBUINT16 fsSelection;
HBUINT16 usFirstCharIndex;
HBUINT16 usLastCharIndex;
HBINT16 sTypoAscender;
HBINT16 sTypoDescender;
HBINT16 sTypoLineGap;
HBUINT16 usWinAscent;
HBUINT16 usWinDescent;
/* Version 1 */
//UINT32 ulCodePageRange1;
//UINT32 ulCodePageRange2;
//HBUINT32 ulCodePageRange1;
//HBUINT32 ulCodePageRange2;
/* Version 2 */
//INT16 sxHeight;
//INT16 sCapHeight;
//UINT16 usDefaultChar;
//UINT16 usBreakChar;
//UINT16 usMaxContext;
//HBINT16 sxHeight;
//HBINT16 sCapHeight;
//HBUINT16 usDefaultChar;
//HBUINT16 usBreakChar;
//HBUINT16 usMaxContext;
/* Version 5 */
//UINT16 usLowerOpticalPointSize;
//UINT16 usUpperOpticalPointSize;
//HBUINT16 usLowerOpticalPointSize;
//HBUINT16 usUpperOpticalPointSize;
public:
DEFINE_SIZE_STATIC (78);

View File

@ -56,10 +56,10 @@ struct postV2Tail
return_trace (glyphNameIndex.sanitize (c));
}
ArrayOf<UINT16>glyphNameIndex; /* This is not an offset, but is the
ArrayOf<HBUINT16>glyphNameIndex; /* This is not an offset, but is the
* ordinal number of the glyph in 'post'
* string tables. */
UINT8 namesX[VAR]; /* Glyph names with length bytes [variable]
HBUINT8 namesX[VAR]; /* Glyph names with length bytes [variable]
* (a Pascal string). */
DEFINE_SIZE_ARRAY2 (2, glyphNameIndex, namesX);
@ -234,7 +234,7 @@ struct post
private:
hb_blob_t *blob;
uint32_t version;
const ArrayOf<UINT16> *glyphNameIndex;
const ArrayOf<HBUINT16> *glyphNameIndex;
hb_prealloced_array_t<uint32_t, 1> index_to_offset;
const uint8_t *pool;
mutable uint16_t *gids_sorted_by_name;
@ -261,16 +261,16 @@ struct post
* from the value of this field. */
FWORD underlineThickness; /* Suggested values for the underline
thickness. */
UINT32 isFixedPitch; /* Set to 0 if the font is proportionally
HBUINT32 isFixedPitch; /* Set to 0 if the font is proportionally
* spaced, non-zero if the font is not
* proportionally spaced (i.e. monospaced). */
UINT32 minMemType42; /* Minimum memory usage when an OpenType font
HBUINT32 minMemType42; /* Minimum memory usage when an OpenType font
* is downloaded. */
UINT32 maxMemType42; /* Maximum memory usage when an OpenType font
HBUINT32 maxMemType42; /* Maximum memory usage when an OpenType font
* is downloaded. */
UINT32 minMemType1; /* Minimum memory usage when an OpenType font
HBUINT32 minMemType1; /* Minimum memory usage when an OpenType font
* is downloaded as a Type 1 font. */
UINT32 maxMemType1; /* Maximum memory usage when an OpenType font
HBUINT32 maxMemType1; /* Maximum memory usage when an OpenType font
* is downloaded as a Type 1 font. */
/*postV2Tail v2[VAR];*/
DEFINE_SIZE_STATIC (32);

View File

@ -133,8 +133,8 @@ struct avar
protected:
FixedVersion<>version; /* Version of the avar table
* initially set to 0x00010000u */
UINT16 reserved; /* This field is permanently reserved. Set to 0. */
UINT16 axisCount; /* The number of variation axes in the font. This
HBUINT16 reserved; /* This field is permanently reserved. Set to 0. */
HBUINT16 axisCount; /* The number of variation axes in the font. This
* must be the same number as axisCount in the
* 'fvar' table. */
SegmentMaps axisSegmentMapsZ;

View File

@ -42,11 +42,11 @@ struct InstanceRecord
}
protected:
UINT16 subfamilyNameID;/* The name ID for entries in the 'name' table
HBUINT16 subfamilyNameID;/* The name ID for entries in the 'name' table
* that provide subfamily names for this instance. */
UINT16 reserved; /* Reserved for future use — set to 0. */
HBUINT16 reserved; /* Reserved for future use — set to 0. */
Fixed coordinates[VAR];/* The coordinates array for this instance. */
//UINT16 postScriptNameIDX;/*Optional. The name ID for entries in the 'name'
//HBUINT16 postScriptNameIDX;/*Optional. The name ID for entries in the 'name'
// * table that provide PostScript names for this
// * instance. */
@ -67,8 +67,8 @@ struct AxisRecord
Fixed minValue; /* The minimum coordinate value for the axis. */
Fixed defaultValue; /* The default coordinate value for the axis. */
Fixed maxValue; /* The maximum coordinate value for the axis. */
UINT16 reserved; /* Reserved for future use — set to 0. */
UINT16 axisNameID; /* The name ID for entries in the 'name' table that
HBUINT16 reserved; /* Reserved for future use — set to 0. */
HBUINT16 axisNameID; /* The name ID for entries in the 'name' table that
* provide a display name for this axis. */
public:
@ -188,14 +188,14 @@ struct fvar
* initially set to 0x00010000u */
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
HBUINT16 reserved; /* This field is permanently reserved. Set to 2. */
HBUINT16 axisCount; /* The number of variation axes in the font (the
* number of records in the axes array). */
UINT16 axisSize; /* The size in bytes of each VariationAxisRecord —
HBUINT16 axisSize; /* The size in bytes of each VariationAxisRecord —
* set to 20 (0x0014) for this version. */
UINT16 instanceCount; /* The number of named instances defined in the font
HBUINT16 instanceCount; /* The number of named instances defined in the font
* (the number of records in the instances array). */
UINT16 instanceSize; /* The size in bytes of each InstanceRecord — set
HBUINT16 instanceSize; /* The size in bytes of each InstanceRecord — set
* to either axisCount * sizeof(Fixed) + 4, or to
* axisCount * sizeof(Fixed) + 6. */

View File

@ -55,7 +55,7 @@ struct DeltaSetIndexMap
unsigned int u = 0;
{ /* Fetch it. */
unsigned int w = get_width ();
const UINT8 *p = mapData + w * v;
const HBUINT8 *p = mapData + w * v;
for (; w; w--)
u = (u << 8) + *p++;
}
@ -78,10 +78,10 @@ struct DeltaSetIndexMap
{ return (format & 0xF) + 1; }
protected:
UINT16 format; /* A packed field that describes the compressed
HBUINT16 format; /* A packed field that describes the compressed
* representation of delta-set indices. */
UINT16 mapCount; /* The number of mapping entries. */
UINT8 mapData[VAR]; /* The delta-set index mapping data. */
HBUINT16 mapCount; /* The number of mapping entries. */
HBUINT8 mapData[VAR]; /* The delta-set index mapping data. */
public:
DEFINE_SIZE_ARRAY (4, mapData);

View File

@ -43,7 +43,7 @@ struct VariationValueRecord
public:
Tag valueTag; /* Four-byte tag identifying a font-wide measure. */
UINT32 varIdx; /* Outer/inner index into VariationStore item. */
HBUINT32 varIdx; /* Outer/inner index into VariationStore item. */
public:
DEFINE_SIZE_STATIC (8);
@ -95,13 +95,13 @@ protected:
protected:
FixedVersion<>version; /* Version of the metrics variation table
* initially set to 0x00010000u */
UINT16 reserved; /* Not used; set to 0. */
UINT16 valueRecordSize;/* The size in bytes of each value record —
HBUINT16 reserved; /* Not used; set to 0. */
HBUINT16 valueRecordSize;/* The size in bytes of each value record —
* must be greater than zero. */
UINT16 valueRecordCount;/* The number of value records — may be zero. */
HBUINT16 valueRecordCount;/* The number of value records — may be zero. */
OffsetTo<VariationStore>
varStore; /* Offset to item variation store table. */
UINT8 values[VAR]; /* Array of value records. The records must be
HBUINT8 values[VAR]; /* Array of value records. The records must be
* in binary order of their valueTag field. */
public: