const AnchorMatrix &anchors, unsigned int class_count,
unsigned int glyph_pos) const
{
+ APPLY_DEBUG ();
const MarkRecord &record = markRecord[mark_index];
unsigned int mark_class = record.klass;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
case 2: return u.format2->apply (APPLY_ARG);
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length);
if (HB_UNLIKELY (buffer->in_pos + 2 > end))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length);
if (HB_UNLIKELY (buffer->in_pos + 2 > end))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
case 2: return u.format2->apply (APPLY_ARG);
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
/* Now comes the messiest part of the whole OpenType
specification. At first glance, cursive connections seem easy
to understand, but there are pitfalls! The reason is that
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
if (HB_LIKELY (mark_index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
if (HB_LIKELY (mark_index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int mark1_index = (this+mark1Coverage) (IN_CURGLYPH ());
if (HB_LIKELY (mark1_index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF) const
- { return Context::apply (APPLY_ARG, position_lookup); }
+ {
+ APPLY_DEBUG ();
+ return Context::apply (APPLY_ARG, position_lookup);
+ }
};
ASSERT_SIZE (ContextPos, 2);
private:
inline bool apply (APPLY_ARG_DEF) const
- { return ChainContext::apply (APPLY_ARG, position_lookup); }
+ {
+ APPLY_DEBUG ();
+ return ChainContext::apply (APPLY_ARG, position_lookup);
+ }
};
ASSERT_SIZE (ChainContextPos, 2);
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
{
+ APPLY_DEBUG ();
switch (lookup_type) {
case Single: return u.single->apply (APPLY_ARG);
case Pair: return u.pair->apply (APPLY_ARG);
return false;
for (unsigned int i = 0; i < get_subtable_count (); i++)
- if (get_subtable (i).apply (APPLY_ARG, lookup_type))
+ if (get_subtable (i).apply (APPLY_ARG_INIT, lookup_type))
return true;
return false;
inline bool ExtensionPos::apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int lookup_type = get_type ();
if (HB_UNLIKELY (lookup_type == PosLookupSubTable::Extension))
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
unsigned int index = (this+coverage) (glyph_id);
if (HB_LIKELY (index == NOT_COVERED))
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
unsigned int index = (this+coverage) (glyph_id);
if (HB_LIKELY (index == NOT_COVERED))
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
case 2: return u.format2->apply (APPLY_ARG);
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
if (HB_UNLIKELY (!substitute.len))
return false;
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
unsigned int index = (this+coverage) (glyph_id);
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF, bool is_mark) const
{
+ APPLY_DEBUG ();
unsigned int i, j;
unsigned int count = component.len;
unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length);
private:
inline bool apply (APPLY_ARG_DEF, bool is_mark) const
{
+ APPLY_DEBUG ();
unsigned int num_ligs = ligature.len;
for (unsigned int i = 0; i < num_ligs; i++)
{
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
bool first_is_mark = !!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
private:
inline bool apply (APPLY_ARG_DEF) const
- { return Context::apply (APPLY_ARG, substitute_lookup); }
+ {
+ APPLY_DEBUG ();
+ return Context::apply (APPLY_ARG, substitute_lookup);
+ }
};
ASSERT_SIZE (ContextSubst, 2);
private:
inline bool apply (APPLY_ARG_DEF) const
- { return ChainContext::apply (APPLY_ARG, substitute_lookup); }
+ {
+ APPLY_DEBUG ();
+ return ChainContext::apply (APPLY_ARG, substitute_lookup);
+ }
};
ASSERT_SIZE (ChainContextSubst, 2);
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
if (HB_UNLIKELY (context_length != NO_CONTEXT))
return false; /* No chaining to this type */
private:
inline bool apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG);
default:return false;
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
{
+ APPLY_DEBUG ();
switch (lookup_type) {
case Single: return u.single->apply (APPLY_ARG);
case Multiple: return u.multiple->apply (APPLY_ARG);
unsigned int count = get_subtable_count ();
for (unsigned int i = 0; i < count; i++)
- if (get_subtable (i).apply (APPLY_ARG, lookup_type))
+ if (get_subtable (i).apply (APPLY_ARG_INIT, lookup_type))
return true;
return false;
inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
{
+ APPLY_DEBUG ();
unsigned int lookup_type = get_type ();
if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
#include "hb-ot-layout-gdef-private.hh"
+#ifndef HB_DEBUG_APPLY
+#define HB_DEBUG_APPLY HB_DEBUG
+#endif
+
+#if HB_DEBUG_APPLY
+#define APPLY_DEBUG_ARG_DEF , unsigned int apply_depth
+#define APPLY_DEBUG_ARG , apply_depth + 1
+#define APPLY_DEBUG_ARG_INIT , 1
+#define APPLY_DEBUG() \
+ HB_STMT_START { \
+ if (apply_depth < HB_DEBUG_APPLY) \
+ fprintf (stderr, "APPLY(%p) %-*d-> %s\n", \
+ (CONST_CHARP (this) == NullPool) ? 0 : this, \
+ apply_depth, apply_depth, \
+ __PRETTY_FUNCTION__); \
+ } HB_STMT_END
+#else
+#define APPLY_DEBUG_ARG_DEF
+#define APPLY_DEBUG_ARG
+#define APPLY_DEBUG_ARG_INIT
+#define APPLY_DEBUG() HB_STMT_START {} HB_STMT_END
+#endif
+
#define APPLY_ARG_DEF \
hb_ot_layout_context_t *context, \
hb_buffer_t *buffer, \
unsigned int context_length HB_GNUC_UNUSED, \
unsigned int nesting_level_left HB_GNUC_UNUSED, \
unsigned int lookup_flag, \
- unsigned int property HB_GNUC_UNUSED /* propety of first glyph */
+ unsigned int property HB_GNUC_UNUSED /* propety of first glyph */ \
+ APPLY_DEBUG_ARG_DEF
#define APPLY_ARG \
context, \
buffer, \
context_length, \
nesting_level_left, \
lookup_flag, \
- property
+ property \
+ APPLY_DEBUG_ARG
+#define APPLY_ARG_INIT \
+ context, \
+ buffer, \
+ context_length, \
+ nesting_level_left, \
+ lookup_flag, \
+ property \
+ APPLY_DEBUG_ARG_INIT
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, char *data);
private:
inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const
{
+ APPLY_DEBUG ();
const LookupRecord *lookupRecord = &CONST_CAST (LookupRecord, input, sizeof (input[0]) * (inputCount ? inputCount - 1 : 0));
return context_lookup (APPLY_ARG,
inputCount, input,
{
inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const
{
+ APPLY_DEBUG ();
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
{
private:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage[0]) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
protected:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG, apply_func);
case 2: return u.format2->apply (APPLY_ARG, apply_func);
private:
inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const
{
+ APPLY_DEBUG ();
const HeadlessArrayOf<USHORT> &input = CONST_NEXT (HeadlessArrayOf<USHORT>, backtrack);
const ArrayOf<USHORT> &lookahead = CONST_NEXT (ArrayOf<USHORT>, input);
const ArrayOf<LookupRecord> &lookup = CONST_NEXT (ArrayOf<LookupRecord>, lookahead);
{
inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const
{
+ APPLY_DEBUG ();
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
{
private:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
private:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
if (HB_LIKELY (index == NOT_COVERED))
return false;
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
const OffsetArrayOf<Coverage> &input = CONST_NEXT (OffsetArrayOf<Coverage>, backtrack);
unsigned int index = (this+input[0]) (IN_CURGLYPH ());
protected:
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
+ APPLY_DEBUG ();
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG, apply_func);
case 2: return u.format2->apply (APPLY_ARG, apply_func);