Rename apply_context -> context
This commit is contained in:
parent
b4c7fab762
commit
6617eada95
|
@ -566,7 +566,7 @@ struct PairPosFormat1
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned int j = buffer->in_pos + 1;
|
unsigned int j = buffer->in_pos + 1;
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j == end))
|
if (HB_UNLIKELY (j == end))
|
||||||
return false;
|
return false;
|
||||||
|
@ -658,7 +658,7 @@ struct PairPosFormat2
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned int j = buffer->in_pos + 1;
|
unsigned int j = buffer->in_pos + 1;
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j == end))
|
if (HB_UNLIKELY (j == end))
|
||||||
return false;
|
return false;
|
||||||
|
@ -913,7 +913,7 @@ struct CursivePosFormat1
|
||||||
gpi->last = HB_OT_LAYOUT_GPOS_NO_LAST;
|
gpi->last = HB_OT_LAYOUT_GPOS_NO_LAST;
|
||||||
|
|
||||||
/* We don't handle mark glyphs here. */
|
/* We don't handle mark glyphs here. */
|
||||||
if (apply_context->property == HB_OT_LAYOUT_GLYPH_CLASS_MARK)
|
if (context->property == HB_OT_LAYOUT_GLYPH_CLASS_MARK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned int index = (this+coverage) (IN_CURGLYPH ());
|
unsigned int index = (this+coverage) (IN_CURGLYPH ());
|
||||||
|
@ -941,7 +941,7 @@ struct CursivePosFormat1
|
||||||
POSITION (last_pos)->x_advance = gpi->anchor_x - entry_x;
|
POSITION (last_pos)->x_advance = gpi->anchor_x - entry_x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apply_context->lookup_flag & LookupFlag::RightToLeft)
|
if (context->lookup_flag & LookupFlag::RightToLeft)
|
||||||
{
|
{
|
||||||
POSITION (last_pos)->cursive_chain = last_pos - buffer->in_pos;
|
POSITION (last_pos)->cursive_chain = last_pos - buffer->in_pos;
|
||||||
POSITION (last_pos)->y_offset = entry_y - gpi->anchor_y;
|
POSITION (last_pos)->y_offset = entry_y - gpi->anchor_y;
|
||||||
|
@ -1252,7 +1252,7 @@ struct MarkMarkPosFormat1
|
||||||
if (HB_UNLIKELY (!j))
|
if (HB_UNLIKELY (!j))
|
||||||
return false;
|
return false;
|
||||||
j--;
|
j--;
|
||||||
} while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), apply_context->lookup_flag, &property));
|
} while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), context->lookup_flag, &property));
|
||||||
|
|
||||||
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
|
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
|
||||||
return false;
|
return false;
|
||||||
|
@ -1457,12 +1457,12 @@ struct PosLookup : Lookup
|
||||||
unsigned int apply_depth) const
|
unsigned int apply_depth) const
|
||||||
{
|
{
|
||||||
unsigned int lookup_type = get_type ();
|
unsigned int lookup_type = get_type ();
|
||||||
hb_apply_context_t apply_context[1];
|
hb_apply_context_t context[1];
|
||||||
|
|
||||||
apply_context->nesting_level_left = nesting_level_left;
|
context->nesting_level_left = nesting_level_left;
|
||||||
apply_context->lookup_flag = get_flag ();
|
context->lookup_flag = get_flag ();
|
||||||
|
|
||||||
if (!_hb_ot_layout_check_glyph_property (layout_context->face, IN_CURINFO (), apply_context->lookup_flag, &apply_context->property))
|
if (!_hb_ot_layout_check_glyph_property (layout_context->face, IN_CURINFO (), context->lookup_flag, &context->property))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
||||||
|
@ -1567,13 +1567,13 @@ static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
||||||
const GPOS &gpos = *(layout_context->face->ot_layout.gpos);
|
const GPOS &gpos = *(layout_context->face->ot_layout.gpos);
|
||||||
const PosLookup &l = gpos.get_lookup (lookup_index);
|
const PosLookup &l = gpos.get_lookup (lookup_index);
|
||||||
|
|
||||||
if (HB_UNLIKELY (apply_context->nesting_level_left == 0))
|
if (HB_UNLIKELY (context->nesting_level_left == 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (HB_UNLIKELY (context_length < 1))
|
if (HB_UNLIKELY (context_length < 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return l.apply_once (layout_context, buffer, context_length, apply_context->nesting_level_left - 1, apply_depth + 1);
|
return l.apply_once (layout_context, buffer, context_length, context->nesting_level_left - 1, apply_depth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct SingleSubstFormat1
|
||||||
|
|
||||||
/* We inherit the old glyph class to the substituted glyph */
|
/* We inherit the old glyph class to the substituted glyph */
|
||||||
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
||||||
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, apply_context->property);
|
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, context->property);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ struct SingleSubstFormat2
|
||||||
|
|
||||||
/* We inherit the old glyph class to the substituted glyph */
|
/* We inherit the old glyph class to the substituted glyph */
|
||||||
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
||||||
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, apply_context->property);
|
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, context->property);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ struct Sequence
|
||||||
/* This is a guess only ... */
|
/* This is a guess only ... */
|
||||||
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
||||||
{
|
{
|
||||||
unsigned int property = apply_context->property;
|
unsigned int property = context->property;
|
||||||
if (property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE)
|
if (property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE)
|
||||||
property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
|
property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ struct AlternateSubstFormat1
|
||||||
|
|
||||||
/* We inherit the old glyph class to the substituted glyph */
|
/* We inherit the old glyph class to the substituted glyph */
|
||||||
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
if (_hb_ot_layout_has_new_glyph_classes (layout_context->face))
|
||||||
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, apply_context->property);
|
_hb_ot_layout_set_glyph_property (layout_context->face, glyph_id, context->property);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ struct Ligature
|
||||||
for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
|
for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
|
||||||
{
|
{
|
||||||
unsigned int property;
|
unsigned int property;
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), apply_context->lookup_flag, &property))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), context->lookup_flag, &property))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j + count - i == end))
|
if (HB_UNLIKELY (j + count - i == end))
|
||||||
return false;
|
return false;
|
||||||
|
@ -407,7 +407,7 @@ struct Ligature
|
||||||
|
|
||||||
for ( i = 1; i < count; i++ )
|
for ( i = 1; i < count; i++ )
|
||||||
{
|
{
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_CURINFO (), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_CURINFO (), context->lookup_flag, NULL))
|
||||||
_hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i, lig_id);
|
_hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i, lig_id);
|
||||||
|
|
||||||
(buffer->in_pos)++;
|
(buffer->in_pos)++;
|
||||||
|
@ -474,7 +474,7 @@ struct LigatureSubstFormat1
|
||||||
TRACE_APPLY ();
|
TRACE_APPLY ();
|
||||||
hb_codepoint_t glyph_id = IN_CURGLYPH ();
|
hb_codepoint_t glyph_id = IN_CURGLYPH ();
|
||||||
|
|
||||||
bool first_is_mark = !!(apply_context->property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
|
bool first_is_mark = !!(context->property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
|
||||||
|
|
||||||
unsigned int index = (this+coverage) (glyph_id);
|
unsigned int index = (this+coverage) (glyph_id);
|
||||||
if (HB_LIKELY (index == NOT_COVERED))
|
if (HB_LIKELY (index == NOT_COVERED))
|
||||||
|
@ -766,12 +766,12 @@ struct SubstLookup : Lookup
|
||||||
unsigned int apply_depth) const
|
unsigned int apply_depth) const
|
||||||
{
|
{
|
||||||
unsigned int lookup_type = get_type ();
|
unsigned int lookup_type = get_type ();
|
||||||
hb_apply_context_t apply_context[1];
|
hb_apply_context_t context[1];
|
||||||
|
|
||||||
apply_context->nesting_level_left = nesting_level_left;
|
context->nesting_level_left = nesting_level_left;
|
||||||
apply_context->lookup_flag = get_flag ();
|
context->lookup_flag = get_flag ();
|
||||||
|
|
||||||
if (!_hb_ot_layout_check_glyph_property (layout_context->face, IN_CURINFO (), apply_context->lookup_flag, &apply_context->property))
|
if (!_hb_ot_layout_check_glyph_property (layout_context->face, IN_CURINFO (), context->lookup_flag, &context->property))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
|
if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
|
||||||
|
@ -910,13 +910,13 @@ static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
||||||
const GSUB &gsub = *(layout_context->face->ot_layout.gsub);
|
const GSUB &gsub = *(layout_context->face->ot_layout.gsub);
|
||||||
const SubstLookup &l = gsub.get_lookup (lookup_index);
|
const SubstLookup &l = gsub.get_lookup (lookup_index);
|
||||||
|
|
||||||
if (HB_UNLIKELY (apply_context->nesting_level_left == 0))
|
if (HB_UNLIKELY (context->nesting_level_left == 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (HB_UNLIKELY (context_length < 1))
|
if (HB_UNLIKELY (context_length < 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return l.apply_once (layout_context, buffer, context_length, apply_context->nesting_level_left - 1, apply_depth + 1);
|
return l.apply_once (layout_context, buffer, context_length, context->nesting_level_left - 1, apply_depth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,13 @@
|
||||||
|
|
||||||
|
|
||||||
#define APPLY_ARG_DEF \
|
#define APPLY_ARG_DEF \
|
||||||
hb_apply_context_t *apply_context, \
|
hb_apply_context_t *context, \
|
||||||
hb_ot_layout_context_t *layout_context, \
|
hb_ot_layout_context_t *layout_context, \
|
||||||
hb_buffer_t *buffer, \
|
hb_buffer_t *buffer, \
|
||||||
unsigned int context_length HB_GNUC_UNUSED, \
|
unsigned int context_length HB_GNUC_UNUSED, \
|
||||||
unsigned int apply_depth HB_GNUC_UNUSED
|
unsigned int apply_depth HB_GNUC_UNUSED
|
||||||
#define APPLY_ARG \
|
#define APPLY_ARG \
|
||||||
apply_context, \
|
context, \
|
||||||
layout_context, \
|
layout_context, \
|
||||||
buffer, \
|
buffer, \
|
||||||
context_length, \
|
context_length, \
|
||||||
|
@ -105,7 +105,7 @@ static inline bool match_input (APPLY_ARG_DEF,
|
||||||
|
|
||||||
for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
|
for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
|
||||||
{
|
{
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_INFO (j), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j + count - i == end))
|
if (HB_UNLIKELY (j + count - i == end))
|
||||||
return false;
|
return false;
|
||||||
|
@ -132,7 +132,7 @@ static inline bool match_backtrack (APPLY_ARG_DEF,
|
||||||
|
|
||||||
for (unsigned int i = 0, j = buffer->out_pos - 1; i < count; i++, j--)
|
for (unsigned int i = 0, j = buffer->out_pos - 1; i < count; i++, j--)
|
||||||
{
|
{
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, OUT_INFO (j), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, OUT_INFO (j), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j + 1 == count - i))
|
if (HB_UNLIKELY (j + 1 == count - i))
|
||||||
return false;
|
return false;
|
||||||
|
@ -160,7 +160,7 @@ static inline bool match_lookahead (APPLY_ARG_DEF,
|
||||||
|
|
||||||
for (i = 0, j = buffer->in_pos + offset; i < count; i++, j++)
|
for (i = 0, j = buffer->in_pos + offset; i < count; i++, j++)
|
||||||
{
|
{
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, OUT_INFO (j), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, OUT_INFO (j), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (j + count - i == end))
|
if (HB_UNLIKELY (j + count - i == end))
|
||||||
return false;
|
return false;
|
||||||
|
@ -210,7 +210,7 @@ static inline bool apply_lookup (APPLY_ARG_DEF,
|
||||||
*/
|
*/
|
||||||
for (unsigned int i = 0; i < count; /* NOP */)
|
for (unsigned int i = 0; i < count; /* NOP */)
|
||||||
{
|
{
|
||||||
while (_hb_ot_layout_skip_mark (layout_context->face, IN_CURINFO (), apply_context->lookup_flag, NULL))
|
while (_hb_ot_layout_skip_mark (layout_context->face, IN_CURINFO (), context->lookup_flag, NULL))
|
||||||
{
|
{
|
||||||
if (HB_UNLIKELY (buffer->in_pos == end))
|
if (HB_UNLIKELY (buffer->in_pos == end))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue