{
switch (u.header.version) {
case 2: /* version 2 is compatible with version 1 */
- case 1: return u.version1->get_face_count ();
+ case 1: return u.version1.get_face_count ();
default:return 0;
}
}
{
switch (u.header.version) {
case 2: /* version 2 is compatible with version 1 */
- case 1: return u.version1->get_face (i);
+ case 1: return u.version1.get_face (i);
default:return Null(OpenTypeFontFace);
}
}
if (!u.header.version.sanitize (context)) return false;
switch (u.header.version) {
case 2: /* version 2 is compatible with version 1 */
- case 1: return u.version1->sanitize (context);
+ case 1: return u.version1.sanitize (context);
default:return true;
}
}
FixedVersion version; /* Version of the TTC Header (1.0 or 2.0),
* 0x00010000 or 0x00020000 */
} header;
- TTCHeaderVersion1 version1[VAR];
+ TTCHeaderVersion1 version1;
} u;
};
case TrueTag:
case Typ1Tag:
case TrueTypeTag: return 1;
- case TTCTag: return u.ttcHeader->get_face_count ();
+ case TTCTag: return u.ttcHeader.get_face_count ();
default: return 0;
}
}
case CFFTag: /* All the non-collection tags */
case TrueTag:
case Typ1Tag:
- case TrueTypeTag: return u.fontFace[0];
- case TTCTag: return u.ttcHeader->get_face (i);
+ case TrueTypeTag: return u.fontFace;
+ case TTCTag: return u.ttcHeader.get_face (i);
default: return Null(OpenTypeFontFace);
}
}
case CFFTag: /* All the non-collection tags */
case TrueTag:
case Typ1Tag:
- case TrueTypeTag: return u.fontFace->sanitize (context);
- case TTCTag: return u.ttcHeader->sanitize (context);
+ case TrueTypeTag: return u.fontFace.sanitize (context);
+ case TTCTag: return u.ttcHeader.sanitize (context);
default: return true;
}
}
private:
union {
Tag tag; /* 4-byte identifier. */
- OpenTypeFontFace fontFace[VAR];
- TTCHeader ttcHeader[VAR];
+ OpenTypeFontFace fontFace;
+ TTCHeader ttcHeader;
} u;
+ public:
+ DEFINE_SIZE_UNION (4, tag);
};
inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
{
switch (u.format) {
- case 1: return u.format1->get_coverage(glyph_id);
- case 2: return u.format2->get_coverage(glyph_id);
+ case 1: return u.format1.get_coverage(glyph_id);
+ case 2: return u.format2.get_coverage(glyph_id);
default:return NOT_COVERED;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- CoverageFormat1 format1[VAR];
- CoverageFormat2 format2[VAR];
+ CoverageFormat1 format1;
+ CoverageFormat2 format2;
} u;
public:
DEFINE_SIZE_UNION (2, format);
inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const
{
switch (u.format) {
- case 1: return u.format1->get_class(glyph_id);
- case 2: return u.format2->get_class(glyph_id);
+ case 1: return u.format1.get_class(glyph_id);
+ case 2: return u.format2.get_class(glyph_id);
default:return 0;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- ClassDefFormat1 format1[VAR];
- ClassDefFormat2 format2[VAR];
+ ClassDefFormat1 format1;
+ ClassDefFormat2 format2;
} u;
public:
DEFINE_SIZE_UNION (2, format);
inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
switch (u.format) {
- case 1: return u.format1->get_caret_value (context, glyph_id);
- case 2: return u.format2->get_caret_value (context, glyph_id);
- case 3: return u.format3->get_caret_value (context, glyph_id);
+ case 1: return u.format1.get_caret_value (context, glyph_id);
+ case 2: return u.format2.get_caret_value (context, glyph_id);
+ case 3: return u.format3.get_caret_value (context, glyph_id);
default:return 0;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
- case 3: return u.format3->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
+ case 3: return u.format3.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- CaretValueFormat1 format1[VAR];
- CaretValueFormat2 format2[VAR];
- CaretValueFormat3 format3[VAR];
+ CaretValueFormat1 format1;
+ CaretValueFormat2 format2;
+ CaretValueFormat3 format3;
} u;
public:
DEFINE_SIZE_UNION (2, format);
inline bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const
{
switch (u.format) {
- case 1: return u.format1->covers (set_index, glyph_id);
+ case 1: return u.format1.covers (set_index, glyph_id);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- MarkGlyphSetsFormat1 format1[VAR];
+ MarkGlyphSetsFormat1 format1;
} u;
public:
DEFINE_SIZE_UNION (2, format);
{
*x = *y = 0;
switch (u.format) {
- case 1: u.format1->get_anchor (layout, glyph_id, x, y); return;
- case 2: u.format2->get_anchor (layout, glyph_id, x, y); return;
- case 3: u.format3->get_anchor (layout, glyph_id, x, y); return;
+ case 1: u.format1.get_anchor (layout, glyph_id, x, y); return;
+ case 2: u.format2.get_anchor (layout, glyph_id, x, y); return;
+ case 3: u.format3.get_anchor (layout, glyph_id, x, y); return;
default: return;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
- case 3: return u.format3->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
+ case 3: return u.format3.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- AnchorFormat1 format1[VAR];
- AnchorFormat2 format2[VAR];
- AnchorFormat3 format3[VAR];
+ AnchorFormat1 format1;
+ AnchorFormat2 format2;
+ AnchorFormat3 format3;
} u;
public:
DEFINE_SIZE_UNION (2, format);
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
- case 2: return u.format2->apply (context);
+ case 1: return u.format1.apply (context);
+ case 2: return u.format2.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- SinglePosFormat1 format1[VAR];
- SinglePosFormat2 format2[VAR];
+ SinglePosFormat1 format1;
+ SinglePosFormat2 format2;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
- case 2: return u.format2->apply (context);
+ case 1: return u.format1.apply (context);
+ case 2: return u.format2.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- PairPosFormat1 format1[VAR];
- PairPosFormat2 format2[VAR];
+ PairPosFormat1 format1;
+ PairPosFormat2 format2;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- CursivePosFormat1 format1[VAR];
+ CursivePosFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- MarkBasePosFormat1 format1[VAR];
+ MarkBasePosFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- MarkLigPosFormat1 format1[VAR];
+ MarkLigPosFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- MarkMarkPosFormat1 format1[VAR];
+ MarkMarkPosFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (lookup_type) {
- case Single: return u.single->apply (context);
- case Pair: return u.pair->apply (context);
- case Cursive: return u.cursive->apply (context);
- case MarkBase: return u.markBase->apply (context);
- case MarkLig: return u.markLig->apply (context);
- case MarkMark: return u.markMark->apply (context);
- case Context: return u.context->apply (context);
- case ChainContext: return u.chainContext->apply (context);
- case Extension: return u.extension->apply (context);
+ case Single: return u.single.apply (context);
+ case Pair: return u.pair.apply (context);
+ case Cursive: return u.cursive.apply (context);
+ case MarkBase: return u.markBase.apply (context);
+ case MarkLig: return u.markLig.apply (context);
+ case MarkMark: return u.markMark.apply (context);
+ case Context: return u.context.apply (context);
+ case ChainContext: return u.chainContext.apply (context);
+ case Extension: return u.extension.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case Single: return u.single->sanitize (context);
- case Pair: return u.pair->sanitize (context);
- case Cursive: return u.cursive->sanitize (context);
- case MarkBase: return u.markBase->sanitize (context);
- case MarkLig: return u.markLig->sanitize (context);
- case MarkMark: return u.markMark->sanitize (context);
- case Context: return u.context->sanitize (context);
- case ChainContext: return u.chainContext->sanitize (context);
- case Extension: return u.extension->sanitize (context);
+ case Single: return u.single.sanitize (context);
+ case Pair: return u.pair.sanitize (context);
+ case Cursive: return u.cursive.sanitize (context);
+ case MarkBase: return u.markBase.sanitize (context);
+ case MarkLig: return u.markLig.sanitize (context);
+ case MarkMark: return u.markMark.sanitize (context);
+ case Context: return u.context.sanitize (context);
+ case ChainContext: return u.chainContext.sanitize (context);
+ case Extension: return u.extension.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format;
- SinglePos single[VAR];
- PairPos pair[VAR];
- CursivePos cursive[VAR];
- MarkBasePos markBase[VAR];
- MarkLigPos markLig[VAR];
- MarkMarkPos markMark[VAR];
- ContextPos context[VAR];
- ChainContextPos chainContext[VAR];
- ExtensionPos extension[VAR];
+ SinglePos single;
+ PairPos pair;
+ CursivePos cursive;
+ MarkBasePos markBase;
+ MarkLigPos markLig;
+ MarkMarkPos markMark;
+ ContextPos context;
+ ChainContextPos chainContext;
+ ExtensionPos extension;
} u;
public:
DEFINE_SIZE_UNION (2, format);
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
- case 2: return u.format2->apply (context);
+ case 1: return u.format1.apply (context);
+ case 2: return u.format2.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- SingleSubstFormat1 format1[VAR];
- SingleSubstFormat2 format2[VAR];
+ SingleSubstFormat1 format1;
+ SingleSubstFormat2 format2;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- MultipleSubstFormat1 format1[VAR];
+ MultipleSubstFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- AlternateSubstFormat1 format1[VAR];
+ AlternateSubstFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- LigatureSubstFormat1 format1[VAR];
+ LigatureSubstFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context);
+ case 1: return u.format1.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- ReverseChainSingleSubstFormat1 format1[VAR];
+ ReverseChainSingleSubstFormat1 format1;
} u;
};
{
TRACE_APPLY ();
switch (lookup_type) {
- case Single: return u.single->apply (context);
- case Multiple: return u.multiple->apply (context);
- case Alternate: return u.alternate->apply (context);
- case Ligature: return u.ligature->apply (context);
- case Context: return u.context->apply (context);
- case ChainContext: return u.chainContext->apply (context);
- case Extension: return u.extension->apply (context);
- case ReverseChainSingle: return u.reverseChainContextSingle->apply (context);
+ case Single: return u.single.apply (context);
+ case Multiple: return u.multiple.apply (context);
+ case Alternate: return u.alternate.apply (context);
+ case Ligature: return u.ligature.apply (context);
+ case Context: return u.context.apply (context);
+ case ChainContext: return u.chainContext.apply (context);
+ case Extension: return u.extension.apply (context);
+ case ReverseChainSingle: return u.reverseChainContextSingle.apply (context);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case Single: return u.single->sanitize (context);
- case Multiple: return u.multiple->sanitize (context);
- case Alternate: return u.alternate->sanitize (context);
- case Ligature: return u.ligature->sanitize (context);
- case Context: return u.context->sanitize (context);
- case ChainContext: return u.chainContext->sanitize (context);
- case Extension: return u.extension->sanitize (context);
- case ReverseChainSingle: return u.reverseChainContextSingle->sanitize (context);
+ case Single: return u.single.sanitize (context);
+ case Multiple: return u.multiple.sanitize (context);
+ case Alternate: return u.alternate.sanitize (context);
+ case Ligature: return u.ligature.sanitize (context);
+ case Context: return u.context.sanitize (context);
+ case ChainContext: return u.chainContext.sanitize (context);
+ case Extension: return u.extension.sanitize (context);
+ case ReverseChainSingle: return u.reverseChainContextSingle.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format;
- SingleSubst single[VAR];
- MultipleSubst multiple[VAR];
- AlternateSubst alternate[VAR];
- LigatureSubst ligature[VAR];
- ContextSubst context[VAR];
- ChainContextSubst chainContext[VAR];
- ExtensionSubst extension[VAR];
- ReverseChainSingleSubst reverseChainContextSingle[VAR];
+ SingleSubst single;
+ MultipleSubst multiple;
+ AlternateSubst alternate;
+ LigatureSubst ligature;
+ ContextSubst context;
+ ChainContextSubst chainContext;
+ ExtensionSubst extension;
+ ReverseChainSingleSubst reverseChainContextSingle;
} u;
public:
DEFINE_SIZE_UNION (2, format);
* This is rather slow to do this here for every glyph,
* but it's easiest, and who uses extension lookups anyway?!*/
unsigned int count = get_subtable_count ();
- unsigned int type = get_subtable(0).u.extension->get_type ();
+ unsigned int type = get_subtable(0).u.extension.get_type ();
for (unsigned int i = 1; i < count; i++)
- if (get_subtable(i).u.extension->get_type () != type)
+ if (get_subtable(i).u.extension.get_type () != type)
return false;
}
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context, apply_func);
- case 2: return u.format2->apply (context, apply_func);
- case 3: return u.format3->apply (context, apply_func);
+ case 1: return u.format1.apply (context, apply_func);
+ case 2: return u.format2.apply (context, apply_func);
+ case 3: return u.format3.apply (context, apply_func);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
- case 3: return u.format3->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
+ case 3: return u.format3.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- ContextFormat1 format1[VAR];
- ContextFormat2 format2[VAR];
- ContextFormat3 format3[VAR];
+ ContextFormat1 format1;
+ ContextFormat2 format2;
+ ContextFormat3 format3;
} u;
};
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (context, apply_func);
- case 2: return u.format2->apply (context, apply_func);
- case 3: return u.format3->apply (context, apply_func);
+ case 1: return u.format1.apply (context, apply_func);
+ case 2: return u.format2.apply (context, apply_func);
+ case 3: return u.format3.apply (context, apply_func);
default:return false;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
- case 2: return u.format2->sanitize (context);
- case 3: return u.format3->sanitize (context);
+ case 1: return u.format1.sanitize (context);
+ case 2: return u.format2.sanitize (context);
+ case 3: return u.format3.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- ChainContextFormat1 format1[VAR];
- ChainContextFormat2 format2[VAR];
- ChainContextFormat3 format3[VAR];
+ ChainContextFormat1 format1;
+ ChainContextFormat2 format2;
+ ChainContextFormat3 format3;
} u;
};
inline unsigned int get_type (void) const
{
switch (u.format) {
- case 1: return u.format1->get_type ();
+ case 1: return u.format1.get_type ();
default:return 0;
}
}
inline unsigned int get_offset (void) const
{
switch (u.format) {
- case 1: return u.format1->get_offset ();
+ case 1: return u.format1.get_offset ();
default:return 0;
}
}
TRACE_SANITIZE ();
if (!u.format.sanitize (context)) return false;
switch (u.format) {
- case 1: return u.format1->sanitize (context);
+ case 1: return u.format1.sanitize (context);
default:return true;
}
}
private:
union {
USHORT format; /* Format identifier */
- ExtensionFormat1 format1[VAR];
+ ExtensionFormat1 format1;
} u;
};