#include "hb-ot-layout-gsubgpos-private.h"
+/* XXX */
+#include "harfbuzz-impl.h"
+HB_INTERNAL HB_Error
+_hb_buffer_add_output_glyph_ids( HB_Buffer buffer,
+ HB_UShort num_in,
+ HB_UShort num_out,
+ const GlyphID *glyph_data,
+ HB_UShort component,
+ HB_UShort ligID );
+
struct SingleSubstFormat1 {
friend struct SingleSubst;
}
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
}
private:
- USHORT substFormat; /* Format identifier--format = 2 */
+ USHORT format; /* Format identifier--format = 2 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
}
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
}
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
}
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
}
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
Offset coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
USHORT chainSubRuleSetCount; /* Number of ChainSubRuleSet
}
private:
- USHORT substFormat; /* Format identifier--format = 2 */
+ USHORT format; /* Format identifier--format = 2 */
Offset coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
Offset backtrackClassDef; /* Offset to glyph ClassDef table
}
private:
- USHORT substFormat; /* Format identifier--format = 3 */
+ USHORT format; /* Format identifier--format = 3 */
USHORT backtrackGlyphCount; /* Number of glyphs in the backtracking
* sequence */
Offset backtrackCoverage[]; /* Array of offsets to coverage tables
inline bool substitute (LOOKUP_ARGS_DEF) const;
private:
- USHORT substFormat; /* Format identifier. Set to 1. */
+ USHORT format; /* Format identifier. Set to 1. */
USHORT extensionLookupType; /* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
/* TODO */
private:
- USHORT substFormat; /* Format identifier--format = 1 */
+ USHORT format; /* Format identifier--format = 1 */
Offset coverage; /* Offset to Coverage table -- from
* beginning of Substitution table */
USHORT backtrackGlyphCount; /* Number of glyphs in the backtracking
unsigned int lookup_type) const {
switch (lookup_type) {
- case GSUB_Single: return u.single.substitute (LOOKUP_ARGS);
- case GSUB_Multiple: return u.multiple.substitute (LOOKUP_ARGS);
- case GSUB_Alternate: return u.alternate.substitute (LOOKUP_ARGS);
- case GSUB_Ligature: return u.ligature.substitute (LOOKUP_ARGS);
- case GSUB_Context: return u.context.substitute (LOOKUP_ARGS);
+ case GSUB_Single: return u.single->substitute (LOOKUP_ARGS);
+ case GSUB_Multiple: return u.multiple->substitute (LOOKUP_ARGS);
+ case GSUB_Alternate: return u.alternate->substitute (LOOKUP_ARGS);
+ case GSUB_Ligature: return u.ligature->substitute (LOOKUP_ARGS);
+ case GSUB_Context: return u.context->substitute (LOOKUP_ARGS);
/*
- case GSUB_ChainingContext: return u.chainingContext.substitute (LOOKUP_ARGS);
+ case GSUB_ChainingContext: return u.chainingContext->substitute (LOOKUP_ARGS);
*/
- case GSUB_Extension: return u.extension.substitute (LOOKUP_ARGS);
+ case GSUB_Extension: return u.extension->substitute (LOOKUP_ARGS);
/*
- case GSUB_ReverseChainingContextSingle: return u.reverseChainingContextSingle.substitute (LOOKUP_ARGS);
+ case GSUB_ReverseChainingContextSingle: return u.reverseChainingContextSingle->substitute (LOOKUP_ARGS);
*/
default:return false;
}
private:
union {
- USHORT substFormat;
- SingleSubst single;
- MultipleSubst multiple;
- AlternateSubst alternate;
- LigatureSubst ligature;
- ContextSubst context;
+ USHORT format;
+ SingleSubst single[];
+ MultipleSubst multiple[];
+ AlternateSubst alternate[];
+ LigatureSubst ligature[];
+ ContextSubst context[];
/*
- ChainingContextSubst chainingContext;
+ ChainingContextSubst chainingContext[];
*/
- ExtensionSubst extension;
+ ExtensionSubst extension[];
/*
- ReverseChainingContextSingleSubst reverseChainingContextSingle;
+ ReverseChainingContextSingleSubst reverseChainingContextSingle[];
*/
} u;
};
+ASSERT_SIZE (SubstLookupSubTable, 2);
struct SubstLookup : Lookup {
/* Return lookup type of first extension subtable.
* The spec says all of them should have the same type.
* XXX check for that somehow */
- type = get_subtable(0).u.extension.get_type ();
+ type = get_subtable(0).u.extension->get_type ();
}
return type;
return ret;
}
};
+ASSERT_SIZE (SubstLookup, 6);
/*
}
};
-
-
+ASSERT_SIZE (GSUB, 10);
/* Out-of-class implementation for methods chaining */
};
ASSERT_SIZE (Context, 2);
+/*
+ * GSUB/GPOS Common
+ */
+
+struct GSUBGPOS {
+ static const hb_tag_t GSUBTag = HB_TAG ('G','S','U','B');
+ static const hb_tag_t GPOSTag = HB_TAG ('G','P','O','S');
+
+ STATIC_DEFINE_GET_FOR_DATA (GSUBGPOS);
+ /* XXX check version here? */
+
+ DEFINE_TAG_LIST_INTERFACE (Script, script ); /* get_script_count (), get_script (i), get_script_tag (i) */
+ DEFINE_TAG_LIST_INTERFACE (Feature, feature); /* get_feature_count(), get_feature(i), get_feature_tag(i) */
+ DEFINE_LIST_INTERFACE (Lookup, lookup ); /* get_lookup_count (), get_lookup (i) */
+
+ // LONGTERMTODO bsearch
+ DEFINE_TAG_FIND_INTERFACE (Script, script ); /* find_script_index (), get_script_by_tag (tag) */
+ DEFINE_TAG_FIND_INTERFACE (Feature, feature); /* find_feature_index(), get_feature_by_tag(tag) */
+
+ private:
+ Fixed_Version version; /* Version of the GSUB/GPOS table--initially set
+ * to 0x00010000 */
+ OffsetTo<ScriptList>
+ scriptList; /* ScriptList table */
+ OffsetTo<FeatureList>
+ featureList; /* FeatureList table */
+ OffsetTo<LookupList>
+ lookupList; /* LookupList table */
+};
+ASSERT_SIZE (GSUBGPOS, 10);
#endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_H */
};
ASSERT_SIZE (Device, 6);
-/*
- * GSUB/GPOS Common
- */
-
-struct GSUBGPOS {
- static const hb_tag_t GSUBTag = HB_TAG ('G','S','U','B');
- static const hb_tag_t GPOSTag = HB_TAG ('G','P','O','S');
-
- STATIC_DEFINE_GET_FOR_DATA (GSUBGPOS);
- /* XXX check version here? */
-
- DEFINE_TAG_LIST_INTERFACE (Script, script ); /* get_script_count (), get_script (i), get_script_tag (i) */
- DEFINE_TAG_LIST_INTERFACE (Feature, feature); /* get_feature_count(), get_feature(i), get_feature_tag(i) */
- DEFINE_LIST_INTERFACE (Lookup, lookup ); /* get_lookup_count (), get_lookup (i) */
-
- // LONGTERMTODO bsearch
- DEFINE_TAG_FIND_INTERFACE (Script, script ); /* find_script_index (), get_script_by_tag (tag) */
- DEFINE_TAG_FIND_INTERFACE (Feature, feature); /* find_feature_index(), get_feature_by_tag(tag) */
-
- private:
- Fixed_Version version; /* Version of the GSUB/GPOS table--initially set
- * to 0x00010000 */
- OffsetTo<ScriptList>
- scriptList; /* ScriptList table */
- OffsetTo<FeatureList>
- featureList; /* FeatureList table */
- OffsetTo<LookupList>
- lookupList; /* LookupList table */
-};
-ASSERT_SIZE (GSUBGPOS, 10);
-
-/* XXX */
-#include "harfbuzz-impl.h"
-HB_INTERNAL HB_Error
-_hb_buffer_add_output_glyph_ids( HB_Buffer buffer,
- HB_UShort num_in,
- HB_UShort num_out,
- const GlyphID *glyph_data,
- HB_UShort component,
- HB_UShort ligID );
-
#endif /* HB_OT_LAYOUT_OPEN_PRIVATE_H */