}
}
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
hb_codepoint_t glyph_id = IN_CURGLYPH ();
_hb_ot_layout_set_glyph_property (layout, substitute[n], property);
}
- inline bool substitute_sequence (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute_sequence (LOOKUP_ARGS_DEF) const {
if (HB_UNLIKELY (!substitute.len))
return false;
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
unsigned int index = (this+coverage) (IN_CURGLYPH ());
- return (this+sequence[index]).substitute_sequence (LOOKUP_ARGS, property);
+ return (this+sequence[index]).substitute_sequence (LOOKUP_ARGS);
}
private:
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
switch (u.substFormat) {
- case 1: return u.format1.substitute (LOOKUP_ARGS, property);
+ case 1: return u.format1.substitute (LOOKUP_ARGS);
default:return false;
}
}
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
hb_codepoint_t glyph_id = IN_CURGLYPH ();
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
switch (u.substFormat) {
- case 1: return u.format1.substitute (LOOKUP_ARGS, property);
+ case 1: return u.format1.substitute (LOOKUP_ARGS);
default:return false;
}
}
inline bool substitute_ligature (LOOKUP_ARGS_DEF, bool is_mark) const {
unsigned int i, j;
- unsigned int property;
unsigned int count = compCount;
if (HB_UNLIKELY (buffer->in_pos + count > buffer->in_length ||
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
hb_codepoint_t glyph_id = IN_CURGLYPH ();
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
switch (u.substFormat) {
- case 1: return u.format1.substitute (LOOKUP_ARGS, property);
+ case 1: return u.format1.substitute (LOOKUP_ARGS);
default:return false;
}
}
struct ContextSubst : Context {
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
return this->apply (LOOKUP_ARGS, substitute_lookup);
}
};
struct ChainContextSubstFormat1 {
/* TODO */
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
return false;
}
struct ChainContextSubstFormat2 {
/* TODO */
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
return false;
}
struct ChainContextSubstFormat3 {
/* TODO */
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
return false;
}
private:
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
switch (u.substFormat) {
- case 1: return u.format1.substitute (LOOKUP_ARGS, property);
- case 2: return u.format2.substitute (LOOKUP_ARGS, property);
- case 3: return u.format3.substitute (LOOKUP_ARGS, property);
+ case 1: return u.format1.substitute (LOOKUP_ARGS);
+ case 2: return u.format2.substitute (LOOKUP_ARGS);
+ case 3: return u.format3.substitute (LOOKUP_ARGS);
default:return false;
}
}
private:
inline unsigned int get_type (void) const { return extensionLookupType; }
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const;
+ inline bool substitute (LOOKUP_ARGS_DEF) const;
private:
USHORT substFormat; /* Format identifier. Set to 1. */
}
}
- inline bool substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+ inline bool substitute (LOOKUP_ARGS_DEF) const {
switch (u.substFormat) {
- case 1: return u.format1.substitute (LOOKUP_ARGS, property);
+ case 1: return u.format1.substitute (LOOKUP_ARGS);
default:return false;
}
}
friend struct SubstLookup;
inline bool substitute (LOOKUP_ARGS_DEF,
- unsigned int property,
unsigned int lookup_type) const {
switch (lookup_type) {
- case GSUB_Single: return u.single.substitute (LOOKUP_ARGS, property);
- case GSUB_Multiple: return u.multiple.substitute (LOOKUP_ARGS, property);
- case GSUB_Alternate: return u.alternate.substitute (LOOKUP_ARGS, property);
- case GSUB_Ligature: return u.ligature.substitute (LOOKUP_ARGS, property);
- case GSUB_Context: return u.context.substitute (LOOKUP_ARGS, property);
+ 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, property);
+ case GSUB_ChainingContext: return u.chainingContext.substitute (LOOKUP_ARGS);
*/
- case GSUB_Extension: return u.extension.substitute (LOOKUP_ARGS, property);
+ case GSUB_Extension: return u.extension.substitute (LOOKUP_ARGS);
/*
- case GSUB_ReverseChainingContextSingle: return u.reverseChainingContextSingle.substitute (LOOKUP_ARGS, property);
+ case GSUB_ReverseChainingContextSingle: return u.reverseChainingContextSingle.substitute (LOOKUP_ARGS);
*/
default:return false;
}
}
}
- inline bool substitute_once (hb_ot_layout_t *layout,
- hb_buffer_t *buffer,
- unsigned int context_length,
- unsigned int nesting_level_left) const {
-
+ inline bool substitute_subtables (hb_ot_layout_t *layout,
+ hb_buffer_t *buffer,
+ unsigned int context_length,
+ unsigned int nesting_level_left,
+ unsigned int property) const {
unsigned int lookup_type = get_type ();
unsigned int lookup_flag = get_flag ();
- unsigned int property;
- if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
- return false;
-
for (unsigned int i = 0; i < get_subtable_count (); i++)
if (get_subtable (i).substitute (LOOKUP_ARGS,
- property,
lookup_type))
return true;
return false;
}
+ inline bool substitute_once (hb_ot_layout_t *layout,
+ hb_buffer_t *buffer) const {
+
+ unsigned int lookup_flag = get_flag ();
+
+ unsigned int property;
+ if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
+ return false;
+
+ return substitute_subtables (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, property);
+ }
+
bool substitute_string (hb_ot_layout_t *layout,
hb_buffer_t *buffer,
hb_ot_layout_feature_mask_t mask) const {
while (buffer->in_pos < buffer->in_length) {
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
- substitute_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
+ substitute_once (layout, buffer))
ret = true;
else
_hb_buffer_next_glyph (buffer);
do {
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
- substitute_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
+ substitute_once (layout, buffer))
ret = true;
else
buffer->in_pos--;
/* Out-of-class implementation for methods chaining */
-inline bool ExtensionSubstFormat1::substitute (LOOKUP_ARGS_DEF, unsigned int property) const {
+inline bool ExtensionSubstFormat1::substitute (LOOKUP_ARGS_DEF) const {
/* XXX either check in sanitize or here that the lookuptype is not 7 again,
* or we can loop indefinitely. */
return (*(SubstLookupSubTable *)(((char *) this) + extensionOffset)).substitute (LOOKUP_ARGS,
- property,
get_type ());
}
if (HB_UNLIKELY (context_length < 1))
return false;
- return l.substitute_once (layout, buffer, context_length, nesting_level_left);
+ return l.substitute_subtables (layout, buffer, context_length, nesting_level_left, property);
}