[truetype] Allow linear scaling for unhinted rendering (#50470). * src/truetype/ttdriver.c (tt_size_request): Revert change from 2011-07-16; the intended metrics fix seems now to be implemented in a different way, making the patch unnecessary. Note that this change was usually patched out by all major GNU/Linux distributions due to heavy side effects. * src/truetype/ttgload.c (compute_glyph_metrics, TT_Load_Glyph): Refer to the metrics of the `TT_Size' object.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/ChangeLog b/ChangeLog
index 9dc20c0..65c492e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-03-30 Werner Lemberg <wl@gnu.org>
+
+ [truetype] Allow linear scaling for unhinted rendering (#50470).
+
+ * src/truetype/ttdriver.c (tt_size_request): Revert change from
+ 2011-07-16; the intended metrics fix seems now to be implemented in
+ a different way, making the patch unnecessary. Note that this
+ change was usually patched out by all major GNU/Linux distributions
+ due to heavy side effects.
+
+ * src/truetype/ttgload.c (compute_glyph_metrics, TT_Load_Glyph):
+ Refer to the metrics of the `TT_Size' object.
+
2017-03-29 Werner Lemberg <wl@gnu.org>
[truetype] Fix thinko related to PS name of default named instance.
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 4ec78e2..9bf0f84 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -356,8 +356,7 @@
if ( FT_IS_SCALABLE( size->face ) )
{
- error = tt_size_reset( ttsize, 0 );
- ttsize->root.metrics = ttsize->metrics;
+ error = tt_size_reset( ttsize, 0 );
#ifdef TT_USE_BYTECODE_INTERPRETER
/* for the `MPS' bytecode instruction we need the point size */
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 35b62d0..b225190 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2037,7 +2037,7 @@
y_scale = 0x10000L;
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
- y_scale = size->root.metrics.y_scale;
+ y_scale = size->metrics.y_scale;
if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE )
FT_Outline_Get_CBox( &glyph->outline, &bbox );
@@ -2069,7 +2069,7 @@
widthp = tt_face_get_device_metrics( face,
- size->root.metrics.x_ppem,
+ size->metrics.x_ppem,
glyph_index );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -2636,11 +2636,11 @@
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
glyph->metrics.horiAdvance =
FT_MulFix( glyph->linearHoriAdvance,
- size->root.metrics.x_scale );
+ size->metrics.x_scale );
if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
glyph->metrics.vertAdvance =
FT_MulFix( glyph->linearVertAdvance,
- size->root.metrics.y_scale );
+ size->metrics.y_scale );
}
return FT_Err_Ok;
@@ -2736,7 +2736,7 @@
/* TrueType glyphs at all sizes using the bytecode interpreter. */
/* */
if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
- size->root.metrics.y_ppem < 24 )
+ size->metrics.y_ppem < 24 )
glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
Exit: