From 5efda13f60d5845d5df6437f2b8d3f55898393fe Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 15 May 2017 21:26:01 +0200 Subject: [PATCH] [sfnt] Return proper scaling values for SBIX bitmaps. Problem reported by Hin-Tak Leung . * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it. --- ChangeLog | 8 ++++++++ src/sfnt/ttsbit.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad8ef9506..c78412264 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-05-15 Werner Lemberg + + [sfnt] Return proper scaling values for SBIX bitmaps. + + Problem reported by Hin-Tak Leung . + + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it. + 2017-05-15 Werner Lemberg [truetype] Fix error handling for embedded bitmaps. diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index 0c76a5577..59b2168bb 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -448,6 +448,15 @@ metrics->max_advance = FT_MulDiv( hori->advance_Width_Max, ppem_ * 64, upem ); + /* set the scale values (in 16.16 units) so advances */ + /* from the hmtx and vmtx table are scaled correctly */ + metrics->x_scale = FT_MulDiv( metrics->x_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + metrics->y_scale = FT_MulDiv( metrics->y_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + return error; }