#define BUFFER buffer
#endif
-/* convenience macros */
-#define IN_CURGLYPH() (BUFFER->in_string[BUFFER->in_pos].codepoint)
-
HB_END_DECLS
#endif /* HB_BUFFER_PRIVATE_H */
hb_position_t mark_x, mark_y, base_x, base_y;
- mark_anchor.get_anchor (c->layout, IN_CURGLYPH (), &mark_x, &mark_y);
+ mark_anchor.get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &mark_x, &mark_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];
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
if (unlikely (c->buffer->in_pos + 2 > end))
return false;
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
if (unlikely (c->buffer->in_pos + 2 > end))
return false;
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
unsigned int len2 = valueFormat2.get_len ();
unsigned int record_len = len1 + len2;
- unsigned int klass1 = (this+classDef1) (IN_CURGLYPH ());
+ unsigned int klass1 = (this+classDef1) (c->buffer->in_string[c->buffer->in_pos].codepoint);
unsigned int klass2 = (this+classDef2) (c->buffer->in_string[j].codepoint);
if (unlikely (klass1 >= class1Count || klass2 >= class2Count))
return false;
if (c->property == HB_OT_LAYOUT_GLYPH_CLASS_MARK)
return false;
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
goto end;
hb_position_t entry_x, entry_y;
- (this+record.entryAnchor).get_anchor (c->layout, IN_CURGLYPH (), &entry_x, &entry_y);
+ (this+record.entryAnchor).get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &entry_x, &entry_y);
/* TODO vertical */
if (record.exitAnchor)
{
gpi->last = c->buffer->in_pos;
- (this+record.exitAnchor).get_anchor (c->layout, IN_CURGLYPH (), &gpi->anchor_x, &gpi->anchor_y);
+ (this+record.exitAnchor).get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &gpi->anchor_x, &gpi->anchor_y);
}
c->buffer->in_pos++;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
+ unsigned int mark_index = (this+markCoverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (mark_index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
+ unsigned int mark_index = (this+markCoverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (mark_index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark1_index = (this+mark1Coverage) (IN_CURGLYPH ());
+ unsigned int mark1_index = (this+mark1Coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (mark1_index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = IN_CURGLYPH ();
+ hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = IN_CURGLYPH ();
+ hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
return false;
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = IN_CURGLYPH ();
+ hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
for ( i = 1; i < count; i++ )
{
while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[c->buffer->in_pos], c->lookup_flag, NULL))
- c->buffer->add_output_glyph (IN_CURGLYPH (), i, lig_id);
+ c->buffer->add_output_glyph (c->buffer->in_string[c->buffer->in_pos].codepoint, i, lig_id);
(c->buffer->in_pos)++;
}
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = IN_CURGLYPH ();
+ hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
bool first_is_mark = !!(c->property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
if (unlikely (c->context_length != NO_CONTEXT))
return false; /* No chaining to this type */
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
match_coverage, this,
1))
{
- IN_CURGLYPH () = substitute[index];
+ c->buffer->in_string[c->buffer->in_pos].codepoint = substitute[index];
c->buffer->in_pos--; /* Reverse! */
return true;
}
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
const ClassDef &class_def = this+classDef;
- index = class_def (IN_CURGLYPH ());
+ index = class_def (c->buffer->in_string[c->buffer->in_pos].codepoint);
const RuleSet &rule_set = this+ruleSet[index];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage[0]) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage[0]) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (IN_CURGLYPH ());
+ unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
const ClassDef &input_class_def = this+inputClassDef;
const ClassDef &lookahead_class_def = this+lookaheadClassDef;
- index = input_class_def (IN_CURGLYPH ());
+ index = input_class_def (c->buffer->in_string[c->buffer->in_pos].codepoint);
const ChainRuleSet &rule_set = this+ruleSet[index];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
TRACE_APPLY ();
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
- unsigned int index = (this+input[0]) (IN_CURGLYPH ());
+ unsigned int index = (this+input[0]) (c->buffer->in_string[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
count = buffer->in_length;
for (buffer->in_pos = 1; buffer->in_pos < count; buffer->in_pos++)
- if (buffer->unicode->get_general_category (IN_CURGLYPH()) == HB_CATEGORY_NON_SPACING_MARK)
+ if (buffer->unicode->get_general_category (buffer->in_string[buffer->in_pos].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
buffer->in_string[buffer->in_pos].cluster = buffer->in_string[buffer->in_pos - 1].cluster;
}
count = buffer->in_length;
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
- IN_CURGLYPH() = get_mirroring (IN_CURGLYPH());
+ buffer->in_string[buffer->in_pos].codepoint = get_mirroring (buffer->in_string[buffer->in_pos].codepoint);
}
}
count = buffer->in_length - 1;
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
if (unlikely (is_variation_selector (buffer->in_string[buffer->in_pos + 1].codepoint))) {
- IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), buffer->in_string[buffer->in_pos + 1].codepoint);
+ buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, buffer->in_string[buffer->in_pos + 1].codepoint);
buffer->in_pos++;
} else {
- IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
+ buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, 0);
}
}
- IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
+ buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, 0);
}
static void
count = buffer->in_length;
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
hb_glyph_metrics_t metrics;
- hb_font_get_glyph_metrics (font, face, IN_CURGLYPH(), &metrics);
+ hb_font_get_glyph_metrics (font, face, buffer->in_string[buffer->in_pos].codepoint, &metrics);
buffer->positions[buffer->in_pos].x_advance = metrics.x_advance;
buffer->positions[buffer->in_pos].y_advance = metrics.y_advance;
}
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, buffer->in_string[buffer->in_pos - 1].codepoint, IN_CURGLYPH());
+ kern = hb_font_get_kerning (font, face, buffer->in_string[buffer->in_pos - 1].codepoint, buffer->in_string[buffer->in_pos].codepoint);
kern1 = kern >> 1;
kern2 = kern - kern1;
buffer->positions[buffer->in_pos - 1].x_advance += kern1;