return this+coverage;
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- return c->len == 1 && (this+coverage) (c->first) != NOT_COVERED;
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
return this+coverage;
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- return c->len == 1 && (this+coverage) (c->first) != NOT_COVERED;
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
}
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- switch (u.format) {
- case 1: return u.format1.would_apply (c);
- case 2: return u.format2.would_apply (c);
- default:return false;
- }
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
return this+coverage;
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- return c->len == 1 && (this+coverage) (c->first) != NOT_COVERED;
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
}
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- switch (u.format) {
- case 1: return u.format1.would_apply (c);
- default:return false;
- }
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
return this+coverage;
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- return c->len == 1 && (this+coverage) (c->first) != NOT_COVERED;
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
}
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- switch (u.format) {
- case 1: return u.format1.would_apply (c);
- default:return false;
- }
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
inline bool would_apply (hb_would_apply_context_t *c) const
{
- unsigned int index;
- return (index = (this+coverage) (c->first)) != NOT_COVERED &&
- (this+ligatureSet[index]).would_apply (c);
+ return (this+ligatureSet[(this+coverage) (c->first)]).would_apply (c);
}
inline bool apply (hb_apply_context_t *c) const
return this+coverage;
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- return c->len == 1 && (this+coverage) (c->first) != NOT_COVERED;
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
}
}
- inline bool would_apply (hb_would_apply_context_t *c) const
- {
- switch (u.format) {
- case 1: return u.format1.would_apply (c);
- default:return false;
- }
- }
-
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
unsigned int lookup_type) const
{
TRACE_WOULD_APPLY ();
+ if (get_coverage (lookup_type).get_coverage (c->first) == NOT_COVERED) return false;
+ if (c->len == 1) return true; /* Done! */
+
+ /* Only need to look further for lookups that support substitutions
+ * of input longer than 1. */
switch (lookup_type) {
- case Single: return u.single.would_apply (c);
- case Multiple: return u.multiple.would_apply (c);
- case Alternate: return u.alternate.would_apply (c);
case Ligature: return u.ligature.would_apply (c);
case Context: return u.context.would_apply (c);
case ChainContext: return u.chainContext.would_apply (c);
case Extension: return u.extension.would_apply (c);
- case ReverseChainSingle: return u.reverseChainContextSingle.would_apply (c);
default: return false;
}
}
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- unsigned int index = (this+coverage) (c->first);
- if (likely (index == NOT_COVERED))
- return TRACE_RETURN (false);
- const RuleSet &rule_set = this+ruleSet[index];
+ const RuleSet &rule_set = this+ruleSet[(this+coverage) (c->first)];
struct ContextApplyLookupContext lookup_context = {
{match_glyph, NULL},
NULL
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- unsigned int index = (this+coverage) (c->first);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
const ClassDef &class_def = this+classDef;
- index = class_def (c->first);
+ unsigned int index = class_def (c->first);
const RuleSet &rule_set = this+ruleSet[index];
struct ContextApplyLookupContext lookup_context = {
{match_class, NULL},
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- unsigned int index = (this+coverage[0]) (c->first);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, coverage[0].static_size * glyphCount);
struct ContextApplyLookupContext lookup_context = {
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- unsigned int index = (this+coverage) (c->first);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
- const ChainRuleSet &rule_set = this+ruleSet[index];
+ const ChainRuleSet &rule_set = this+ruleSet[(this+coverage) (c->first)];
struct ChainContextApplyLookupContext lookup_context = {
{match_glyph, NULL},
{NULL, NULL, NULL}
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- unsigned int index = (this+coverage) (c->first);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
const ClassDef &input_class_def = this+inputClassDef;
- index = input_class_def (c->first);
+ unsigned int index = input_class_def (c->first);
const ChainRuleSet &rule_set = this+ruleSet[index];
struct ChainContextApplyLookupContext lookup_context = {
{match_class, NULL},
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY ();
- const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
-
- unsigned int index = (this+input[0]) (c->first);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
struct ChainContextApplyLookupContext lookup_context = {