Rename [xy]_pos to [xy]_offset since we don't accumulate positions
diff --git a/src/hb-buffer-private.h b/src/hb-buffer-private.h
index f40b1c5..f98f768 100644
--- a/src/hb-buffer-private.h
+++ b/src/hb-buffer-private.h
@@ -47,10 +47,10 @@
} hb_internal_glyph_info_t;
typedef struct _hb_internal_glyph_position_t {
- hb_position_t x_pos;
- hb_position_t y_pos;
hb_position_t x_advance;
hb_position_t y_advance;
+ hb_position_t x_offset;
+ hb_position_t y_offset;
uint32_t new_advance :1; /* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index 7bb7a5a..5c9d408 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -52,10 +52,10 @@
} hb_glyph_info_t;
typedef struct _hb_glyph_position_t {
- hb_position_t x_pos;
- hb_position_t y_pos;
hb_position_t x_advance;
hb_position_t y_advance;
+ hb_position_t x_offset;
+ hb_position_t y_offset;
/* XXX these should all be replaced by "uint32_t internal" */
uint32_t new_advance :1; /* if set, the advance width values are
absolute, i.e., they won't be
diff --git a/src/hb-font.h b/src/hb-font.h
index 9a8e5ad..a47b601 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -94,10 +94,10 @@
typedef struct _hb_glyph_metrics_t
{
- hb_position_t x_pos;
- hb_position_t y_pos;
hb_position_t x_advance;
hb_position_t y_advance;
+ hb_position_t x_offset;
+ hb_position_t y_offset;
hb_position_t width;
hb_position_t height;
} hb_glyph_metrics_t;
diff --git a/src/hb-ft.c b/src/hb-ft.c
index fa212e6..146fd3c 100644
--- a/src/hb-ft.c
+++ b/src/hb-ft.c
@@ -82,18 +82,18 @@
/* TODO: load_flags, embolden, etc */
- metrics->x_pos = metrics->y_pos = 0;
metrics->x_advance = metrics->y_advance = 0;
+ metrics->x_offset = metrics->y_offset = 0;
metrics->width = metrics->height = 0;
if (HB_LIKELY (!FT_Load_Glyph (ft_face, glyph, load_flags)))
{
/* TODO: A few negations should be in order here, not sure. */
- metrics->x_pos = ft_face->glyph->metrics.horiBearingX;
- metrics->y_pos = ft_face->glyph->metrics.horiBearingY;
- metrics->width = ft_face->glyph->metrics.width;
- metrics->height = ft_face->glyph->metrics.height;
metrics->x_advance = ft_face->glyph->advance.x;
metrics->y_advance = ft_face->glyph->advance.y;
+ metrics->x_offset = ft_face->glyph->metrics.horiBearingX;
+ metrics->y_offset = ft_face->glyph->metrics.horiBearingY;
+ metrics->width = ft_face->glyph->metrics.width;
+ metrics->height = ft_face->glyph->metrics.height;
}
}
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index deea9b9..2c88f53 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -103,41 +103,25 @@
x_scale = context->font->x_scale;
y_scale = context->font->y_scale;
/* design units -> fractional pixel */
- if (format & xPlacement)
- glyph_pos->x_pos += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++);
- if (format & yPlacement)
- glyph_pos->y_pos += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++);
- if (format & xAdvance)
- glyph_pos->x_advance += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++);
- if (format & yAdvance)
- glyph_pos->y_advance += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++);
+ if (format & xPlacement) glyph_pos->x_offset += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++);
+ if (format & yPlacement) glyph_pos->y_offset += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++);
+ if (format & xAdvance) glyph_pos->x_advance += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++);
+ if (format & yAdvance) glyph_pos->y_advance += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++);
x_ppem = context->font->x_ppem;
y_ppem = context->font->y_ppem;
/* pixel -> fractional pixel */
if (format & xPlaDevice) {
- if (x_ppem)
- glyph_pos->x_pos += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6;
- else
- values++;
+ if (x_ppem) glyph_pos->x_offset += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6; else values++;
}
if (format & yPlaDevice) {
- if (y_ppem)
- glyph_pos->y_pos += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6;
- else
- values++;
+ if (y_ppem) glyph_pos->y_offset += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6; else values++;
}
if (format & xAdvDevice) {
- if (x_ppem)
- glyph_pos->x_advance += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6;
- else
- values++;
+ if (x_ppem) glyph_pos->x_advance += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 6; else values++;
}
if (format & yAdvDevice) {
- if (y_ppem)
- glyph_pos->y_advance += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6;
- else
- values++;
+ if (y_ppem) glyph_pos->y_advance += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 6; else values++;
}
}
};
@@ -330,10 +314,10 @@
glyph_anchor.get_anchor (context, IN_GLYPH (glyph_pos), &base_x, &base_y);
hb_internal_glyph_position_t *o = POSITION (buffer->in_pos);
- o->x_pos = base_x - mark_x;
- o->y_pos = base_y - mark_y;
o->x_advance = 0;
o->y_advance = 0;
+ o->x_offset = base_x - mark_x;
+ o->y_offset = base_y - mark_y;
o->back = buffer->in_pos - glyph_pos;
buffer->in_pos++;
@@ -868,12 +852,12 @@
if (lookup_flag & LookupFlag::RightToLeft)
{
POSITION (last_pos)->cursive_chain = last_pos - buffer->in_pos;
- POSITION (last_pos)->y_pos = entry_y - gpi->anchor_y;
+ POSITION (last_pos)->y_offset = entry_y - gpi->anchor_y;
}
else
{
POSITION (buffer->in_pos)->cursive_chain = buffer->in_pos - last_pos;
- POSITION (buffer->in_pos)->y_pos = gpi->anchor_y - entry_y;
+ POSITION (buffer->in_pos)->y_offset = gpi->anchor_y - entry_y;
}
end:
diff --git a/src/hb-shape.c b/src/hb-shape.c
index 9043f98..23391f9 100644
--- a/src/hb-shape.c
+++ b/src/hb-shape.c
@@ -38,8 +38,8 @@
}
static void
-map_glyphs (hb_face_t *face,
- hb_font_t *font,
+map_glyphs (hb_font_t *font,
+ hb_face_t *face,
hb_buffer_t *buffer)
{
unsigned int count;
@@ -48,19 +48,19 @@
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
if (HB_UNLIKELY (is_variation_selector (IN_NEXTGLYPH()))) {
- IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), IN_NEXTGLYPH());
+ IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), IN_NEXTGLYPH());
buffer->in_pos++;
} else {
- IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), 0);
+ IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
}
}
- IN_CURGLYPH() = hb_font_get_glyph (face, font, IN_CURGLYPH(), 0);
+ IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
}
void
-hb_shape (hb_face_t *face,
- hb_font_t *font,
+hb_shape (hb_font_t *font,
+ hb_face_t *face,
hb_buffer_t *buffer,
hb_feature_t *features,
unsigned int num_features)
diff --git a/src/hb-shape.h b/src/hb-shape.h
index be20592..714fe97 100644
--- a/src/hb-shape.h
+++ b/src/hb-shape.h
@@ -41,8 +41,8 @@
} hb_feature_t;
void
-hb_shape (hb_face_t *face,
- hb_font_t *font,
+hb_shape (hb_font_t *font,
+ hb_face_t *face,
hb_buffer_t *buffer,
hb_feature_t *features,
unsigned int num_features);