[sfnt] Return proper scaling values for SBIX bitmaps. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/ChangeLog b/ChangeLog
index ad8ef95..c784122 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2017-05-15 Werner Lemberg <wl@gnu.org>
+ [sfnt] Return proper scaling values for SBIX bitmaps.
+
+ Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
+
+ * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
+
+2017-05-15 Werner Lemberg <wl@gnu.org>
+
[truetype] Fix error handling for embedded bitmaps.
Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 0c76a55..59b2168 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;
}