summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-07-26 12:06:52 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-08-20 12:15:37 +0200
commitd48af9f4403c76d98ca13214faf321e2e318b113 (patch)
tree6e27a80a64698c782423481486c42bdedb78e1a2
parentdf424210e662c660dafa50be00148a117ef8d95c (diff)
downloadmupdf-d48af9f4403c76d98ca13214faf321e2e318b113.tar.xz
Use unscaled metrics in xps_measure_font_glyph.
-rw-r--r--source/xps/xps-glyphs.c7
1 files 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;
}