From f0fc1df8fc949739b68d55948741016081b69c3a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 31 Jul 2012 22:43:32 -0400 Subject: [PATCH] [hb-old] Implement getGlyphMetrics() Still working on it. --- src/hb-old.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hb-old.cc b/src/hb-old.cc index 5285b7f15..84a431cdc 100644 --- a/src/hb-old.cc +++ b/src/hb-old.cc @@ -143,7 +143,18 @@ hb_old_getGlyphMetrics (HB_Font old_font, HB_Glyph glyph, HB_GlyphMetrics *metrics) { - // TODO + hb_font_t *font = (hb_font_t *) old_font->userData; + + hb_glyph_extents_t extents; + + hb_font_get_glyph_extents (font, glyph, &extents); + + metrics->xOffset = extents.x_bearing; + metrics->yOffset = extents.y_bearing; + metrics->width = extents.width; + metrics->height = extents.height; + metrics->x = hb_font_get_glyph_h_advance (font, glyph); + metrics->y = 0; } static HB_Fixed