From d48af9f4403c76d98ca13214faf321e2e318b113 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 26 Jul 2013 12:06:52 +0200 Subject: Use unscaled metrics in xps_measure_font_glyph. --- source/xps/xps-glyphs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c index 52cc0042..02ed6fee 100644 --- a/source/xps/xps-glyphs.c +++ b/source/xps/xps-glyphs.c @@ -54,19 +54,18 @@ xps_encode_font_char(fz_font *font, int code) void xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx) { - int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM; + int mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; FT_Face face = font->ft_face; FT_Fixed hadv, vadv; fz_context *ctx = doc->ctx; fz_lock(ctx, FZ_LOCK_FREETYPE); - FT_Set_Char_Size(face, 64, 64, 72, 72); FT_Get_Advance(face, gid, mask, &hadv); FT_Get_Advance(face, gid, mask | FT_LOAD_VERTICAL_LAYOUT, &vadv); fz_unlock(ctx, FZ_LOCK_FREETYPE); - mtx->hadv = hadv / 65536.0f; - mtx->vadv = vadv / 65536.0f; + mtx->hadv = hadv / (float)face->units_per_EM; + mtx->vadv = vadv / (float)face->units_per_EM; mtx->vorg = face->ascender / (float) face->units_per_EM; } -- cgit v1.2.3