Remove the IN_GLYPH() macro
This commit is contained in:
parent
01feb74c78
commit
6e489cdf76
|
@ -156,7 +156,6 @@ struct _hb_buffer_t {
|
|||
#endif
|
||||
|
||||
/* convenience macros */
|
||||
#define IN_GLYPH(pos) (BUFFER->in_string[(pos)].codepoint)
|
||||
#define IN_INFO(pos) (&BUFFER->in_string[(pos)])
|
||||
#define IN_CURGLYPH() (BUFFER->in_string[BUFFER->in_pos].codepoint)
|
||||
#define IN_NEXTGLYPH() (BUFFER->in_string[BUFFER->in_pos + 1].codepoint)
|
||||
|
|
|
@ -404,7 +404,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
|
|||
hb_position_t mark_x, mark_y, base_x, base_y;
|
||||
|
||||
mark_anchor.get_anchor (c->layout, IN_CURGLYPH (), &mark_x, &mark_y);
|
||||
glyph_anchor.get_anchor (c->layout, IN_GLYPH (glyph_pos), &base_x, &base_y);
|
||||
glyph_anchor.get_anchor (c->layout, c->buffer->in_string[glyph_pos].codepoint, &base_x, &base_y);
|
||||
|
||||
hb_internal_glyph_position_t &o = c->buffer->positions[c->buffer->in_pos];
|
||||
o.x_advance = 0;
|
||||
|
@ -574,7 +574,7 @@ struct PairSet
|
|||
const PairValueRecord *record = CastP<PairValueRecord> (array);
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
if (IN_GLYPH (pos) == record->secondGlyph)
|
||||
if (c->buffer->in_string[pos].codepoint == record->secondGlyph)
|
||||
{
|
||||
valueFormats[0].apply_value (c->layout, this, &record->values[0], c->buffer->positions[c->buffer->in_pos]);
|
||||
valueFormats[1].apply_value (c->layout, this, &record->values[len1], c->buffer->positions[pos]);
|
||||
|
@ -706,7 +706,7 @@ struct PairPosFormat2
|
|||
unsigned int record_len = len1 + len2;
|
||||
|
||||
unsigned int klass1 = (this+classDef1) (IN_CURGLYPH ());
|
||||
unsigned int klass2 = (this+classDef2) (IN_GLYPH (j));
|
||||
unsigned int klass2 = (this+classDef2) (c->buffer->in_string[j].codepoint);
|
||||
if (unlikely (klass1 >= class1Count || klass2 >= class2Count))
|
||||
return false;
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ struct MarkBasePosFormat1
|
|||
if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH))
|
||||
return false;
|
||||
|
||||
unsigned int base_index = (this+baseCoverage) (IN_GLYPH (j));
|
||||
unsigned int base_index = (this+baseCoverage) (c->buffer->in_string[j].codepoint);
|
||||
if (base_index == NOT_COVERED)
|
||||
return false;
|
||||
|
||||
|
@ -1187,7 +1187,7 @@ struct MarkLigPosFormat1
|
|||
if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE))
|
||||
return false;
|
||||
|
||||
unsigned int lig_index = (this+ligatureCoverage) (IN_GLYPH (j));
|
||||
unsigned int lig_index = (this+ligatureCoverage) (c->buffer->in_string[j].codepoint);
|
||||
if (lig_index == NOT_COVERED)
|
||||
return false;
|
||||
|
||||
|
@ -1312,7 +1312,7 @@ struct MarkMarkPosFormat1
|
|||
(c->buffer->in_string[j].component && c->buffer->in_string[j].lig_id != c->buffer->in_string[c->buffer->in_pos].lig_id))
|
||||
return false;
|
||||
|
||||
unsigned int mark2_index = (this+mark2Coverage) (IN_GLYPH (j));
|
||||
unsigned int mark2_index = (this+mark2Coverage) (c->buffer->in_string[j].codepoint);
|
||||
if (mark2_index == NOT_COVERED)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ struct Ligature
|
|||
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
|
||||
is_mark = false;
|
||||
|
||||
if (likely (IN_GLYPH (j) != component[i]))
|
||||
if (likely (c->buffer->in_string[j].codepoint != component[i]))
|
||||
return false;
|
||||
}
|
||||
/* This is just a guess ... */
|
||||
|
|
|
@ -106,7 +106,7 @@ static inline bool match_input (hb_apply_context_t *c,
|
|||
j++;
|
||||
}
|
||||
|
||||
if (likely (!match_func (IN_GLYPH (j), input[i - 1], match_data)))
|
||||
if (likely (!match_func (c->buffer->in_string[j].codepoint, input[i - 1], match_data)))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ static inline bool match_lookahead (hb_apply_context_t *c,
|
|||
j++;
|
||||
}
|
||||
|
||||
if (likely (!match_func (IN_GLYPH (j), lookahead[i], match_data)))
|
||||
if (likely (!match_func (c->buffer->in_string[j].codepoint, lookahead[i], match_data)))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ hb_truetype_kern (hb_font_t *font,
|
|||
count = buffer->in_length;
|
||||
for (buffer->in_pos = 1; buffer->in_pos < count; buffer->in_pos++) {
|
||||
hb_position_t kern, kern1, kern2;
|
||||
kern = hb_font_get_kerning (font, face, IN_GLYPH(buffer->in_pos - 1), IN_CURGLYPH());
|
||||
kern = hb_font_get_kerning (font, face, buffer->in_string[buffer->in_pos - 1].codepoint, IN_CURGLYPH());
|
||||
kern1 = kern >> 1;
|
||||
kern2 = kern - kern1;
|
||||
buffer->positions[buffer->in_pos - 1].x_advance += kern1;
|
||||
|
|
Loading…
Reference in New Issue