friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct PosLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
struct ContextPos : Context
{
+ friend struct PosLookupSubTable;
+
+ private:
inline bool apply (APPLY_ARG_DEF) const
{
return Context::apply (APPLY_ARG, position_lookup);
struct ChainContextPos : ChainContext
{
+ friend struct PosLookupSubTable;
+
+ private:
inline bool apply (APPLY_ARG_DEF) const
{
return ChainContext::apply (APPLY_ARG, position_lookup);
ASSERT_SIZE (ChainContextPos, 2);
-struct ExtensionPosFormat1
-{
- friend struct ExtensionPos;
-
- private:
- inline unsigned int get_type (void) const { return extensionLookupType; }
- inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; }
- inline bool apply (APPLY_ARG_DEF) const;
-
- private:
- USHORT format; /* Format identifier. Set to 1. */
- USHORT extensionLookupType; /* Lookup type of subtable referenced
- * by ExtensionOffset (i.e. the
- * extension subtable). */
- USHORT extensionOffset[2]; /* Offset to the extension subtable,
- * of lookup type subtable.
- * Defined as two shorts to avoid
- * alignment requirements. */
-};
-ASSERT_SIZE (ExtensionPosFormat1, 8);
-
-struct ExtensionPos
+struct ExtensionPos : Extension
{
- friend struct PosLookup;
friend struct PosLookupSubTable;
private:
-
- inline unsigned int get_type (void) const
- {
- switch (u.format) {
- case 1: return u.format1->get_type ();
- default:return 0;
- }
- }
-
- inline bool apply (APPLY_ARG_DEF) const
- {
- switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
- default:return false;
- }
- }
-
- private:
- union {
- USHORT format; /* Format identifier */
- ExtensionPosFormat1 format1[];
- } u;
+ inline bool apply (APPLY_ARG_DEF) const;
};
ASSERT_SIZE (ExtensionPos, 2);
+
/*
* PosLookup
*/
/* Out-of-class implementation for methods recursing */
-inline bool ExtensionPosFormat1::apply (APPLY_ARG_DEF) const
+inline bool ExtensionPos::apply (APPLY_ARG_DEF) const
{
unsigned int lookup_type = get_type ();
if (HB_UNLIKELY (lookup_type == PosLookupSubTable::Extension))
return false;
- return ((PosLookupSubTable&)*(((char *) this) + get_offset ())).apply (APPLY_ARG, lookup_type);
+ return ((PosLookupSubTable&) get_subtable ()).apply (APPLY_ARG, lookup_type);
}
static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
friend struct SingleSubst;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
hb_codepoint_t glyph_id = IN_CURGLYPH ();
friend struct SingleSubst;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
hb_codepoint_t glyph_id = IN_CURGLYPH ();
friend struct SubstLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct MultipleSubstFormat1;
private:
-
- inline void set_glyph_class (hb_ot_layout_t *layout, unsigned int property) const
- {
- unsigned int count = substitute.len;
- for (unsigned int n = 0; n < count; n++)
- _hb_ot_layout_set_glyph_property (layout, substitute[n], property);
- }
-
inline bool apply (APPLY_ARG_DEF) const
{
if (HB_UNLIKELY (!substitute.len))
if ( _hb_ot_layout_has_new_glyph_classes (layout) )
{
/* this is a guess only ... */
-
if ( property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE )
property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
- set_glyph_class (layout, property);
+ unsigned int count = substitute.len;
+ for (unsigned int n = 0; n < count; n++)
+ _hb_ot_layout_set_glyph_property (layout, substitute[n], property);
}
return true;
friend struct MultipleSubst;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
friend struct SubstLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct AlternateSubst;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
hb_codepoint_t glyph_id = IN_CURGLYPH ();
friend struct SubstLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
friend struct LigatureSubstFormat1;
private:
-
inline bool apply (APPLY_ARG_DEF, bool is_mark) const
{
unsigned int num_ligs = ligature.len;
friend struct LigatureSubst;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
hb_codepoint_t glyph_id = IN_CURGLYPH ();
friend struct SubstLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
struct ContextSubst : Context
{
+ friend struct SubstLookupSubTable;
+
+ private:
inline bool apply (APPLY_ARG_DEF) const
{
return Context::apply (APPLY_ARG, substitute_lookup);
struct ChainContextSubst : ChainContext
{
+ friend struct SubstLookupSubTable;
+
+ private:
inline bool apply (APPLY_ARG_DEF) const
{
return ChainContext::apply (APPLY_ARG, substitute_lookup);
ASSERT_SIZE (ChainContextSubst, 2);
-struct ExtensionSubstFormat1
-{
- friend struct ExtensionSubst;
-
- private:
- inline unsigned int get_type (void) const { return extensionLookupType; }
- inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; }
- inline bool apply (APPLY_ARG_DEF) const;
-
- private:
- USHORT format; /* Format identifier. Set to 1. */
- USHORT extensionLookupType; /* Lookup type of subtable referenced
- * by ExtensionOffset (i.e. the
- * extension subtable). */
- USHORT extensionOffset[2]; /* Offset to the extension subtable,
- * of lookup type subtable.
- * Defined as two shorts to avoid
- * alignment requirements. */
-};
-ASSERT_SIZE (ExtensionSubstFormat1, 8);
-
-struct ExtensionSubst
+struct ExtensionSubst : Extension
{
- friend struct SubstLookup;
friend struct SubstLookupSubTable;
private:
-
- inline unsigned int get_type (void) const
- {
- switch (u.format) {
- case 1: return u.format1->get_type ();
- default:return 0;
- }
- }
-
- inline bool apply (APPLY_ARG_DEF) const
- {
- switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
- default:return false;
- }
- }
-
- private:
- union {
- USHORT format; /* Format identifier */
- ExtensionSubstFormat1 format1[];
- } u;
+ inline bool apply (APPLY_ARG_DEF) const;
};
ASSERT_SIZE (ExtensionSubst, 2);
friend struct SubstLookupSubTable;
private:
-
inline bool apply (APPLY_ARG_DEF) const
{
switch (u.format) {
/* Out-of-class implementation for methods recursing */
-inline bool ExtensionSubstFormat1::apply (APPLY_ARG_DEF) const
+inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
{
unsigned int lookup_type = get_type ();
- if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
+ if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
return false;
- return ((SubstLookupSubTable&)*(((char *) this) + get_offset ())).apply (APPLY_ARG, lookup_type);
+ return ((SubstLookupSubTable&) get_subtable ()).apply (APPLY_ARG, lookup_type);
}
static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
ASSERT_SIZE (ChainContext, 2);
+struct ExtensionFormat1
+{
+ friend struct Extension;
+
+ private:
+ inline unsigned int get_type (void) const { return extensionLookupType; }
+ inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; }
+ inline const LookupSubTable& get_subtable (void) const
+ {
+ unsigned int offset = get_offset ();
+ if (HB_UNLIKELY (!offset)) return Null(LookupSubTable);
+ return (LookupSubTable&) *(((char *) this) + offset);
+ }
+
+ private:
+ USHORT format; /* Format identifier. Set to 1. */
+ USHORT extensionLookupType; /* Lookup type of subtable referenced
+ * by ExtensionOffset (i.e. the
+ * extension subtable). */
+ USHORT extensionOffset[2]; /* Offset to the extension subtable,
+ * of lookup type subtable.
+ * Defined as two shorts to avoid
+ * alignment requirements. */
+};
+ASSERT_SIZE (ExtensionFormat1, 8);
+
+struct Extension
+{
+ inline unsigned int get_type (void) const
+ {
+ switch (u.format) {
+ case 1: return u.format1->get_type ();
+ default:return 0;
+ }
+ }
+ inline const LookupSubTable& get_subtable (void) const
+ {
+ switch (u.format) {
+ case 1: return u.format1->get_subtable ();
+ default:return Null(LookupSubTable);
+ }
+ }
+
+ private:
+ union {
+ USHORT format; /* Format identifier */
+ ExtensionFormat1 format1[];
+ } u;
+};
+ASSERT_SIZE (Extension, 2);
+
+
/*
* GSUB/GPOS Common
*/