commit bcc74f4dafee25ea89f1d3144646cba7e30f9908
Author: Werner Lemberg <wl@gnu.org>
Date: Thu Mar 30 13:14:43 2017 +0200
[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.
diff --git ChangeLog ChangeLog
index f6de03c78e954a163969fc5fbdb4b0509e3da7c9..18555a6c4f62c5b69923c67076e09eca59b44541 100644
|
|
|
1758 | 1758 | glyph indices larger than `mapCount' as described in the |
1759 | 1759 | specification. |
1760 | 1760 | |
1761 | | 2017-03-30 Werner Lemberg <wl@gnu.org> |
| 1761 | 2017-03-30 Werner Lemberg <wl@gnu.org> REVERTED |
1762 | 1762 | |
1763 | 1763 | [truetype] Allow linear scaling for unhinted rendering (#50470). |
1764 | 1764 | |
diff --git src/truetype/ttdriver.c src/truetype/ttdriver.c
index a1653b241cabfc3b051b05c8fc7daf7d6d3010c7..0259de80ceb08f882433320db79c205e56c2a8e8 100644
|
|
|
356 | 356 | |
357 | 357 | if ( FT_IS_SCALABLE( size->face ) ) |
358 | 358 | { |
359 | | error = tt_size_reset( ttsize, 0 ); |
| 359 | error = tt_size_reset( ttsize, 0 ); |
| 360 | ttsize->root.metrics = *ttsize->metrics; |
360 | 361 | |
361 | 362 | #ifdef TT_USE_BYTECODE_INTERPRETER |
362 | 363 | /* for the `MPS' bytecode instruction we need the point size */ |
diff --git src/truetype/ttgload.c src/truetype/ttgload.c
index 5e102c615190dc02d73f0c37f9333f567e0b4c29..6cc1105749ae77bcc284be048bd4a5c34d78f793 100644
|
|
|
2035 | 2035 | |
2036 | 2036 | y_scale = 0x10000L; |
2037 | 2037 | if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) |
2038 | | y_scale = size->metrics->y_scale; |
| 2038 | y_scale = size->root.metrics.y_scale; |
2039 | 2039 | |
2040 | 2040 | if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE ) |
2041 | 2041 | FT_Outline_Get_CBox( &glyph->outline, &bbox ); |
… |
… |
|
2067 | 2067 | |
2068 | 2068 | |
2069 | 2069 | widthp = tt_face_get_device_metrics( face, |
2070 | | size->metrics->x_ppem, |
| 2070 | size->root.metrics.x_ppem, |
2071 | 2071 | glyph_index ); |
2072 | 2072 | |
2073 | 2073 | #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY |
… |
… |
|
2698 | 2698 | if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance ) |
2699 | 2699 | glyph->metrics.horiAdvance = |
2700 | 2700 | FT_MulFix( glyph->linearHoriAdvance, |
2701 | | size->metrics->x_scale ); |
| 2701 | size->root.metrics.x_scale ); |
2702 | 2702 | if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance ) |
2703 | 2703 | glyph->metrics.vertAdvance = |
2704 | 2704 | FT_MulFix( glyph->linearVertAdvance, |
2705 | | size->metrics->y_scale ); |
| 2705 | size->root.metrics.y_scale ); |
2706 | 2706 | } |
2707 | 2707 | |
2708 | 2708 | return FT_Err_Ok; |
… |
… |
|
2798 | 2798 | /* TrueType glyphs at all sizes using the bytecode interpreter. */ |
2799 | 2799 | /* */ |
2800 | 2800 | if ( !( load_flags & FT_LOAD_NO_SCALE ) && |
2801 | | size->metrics->y_ppem < 24 ) |
| 2801 | size->root.metrics.y_ppem < 24 ) |
2802 | 2802 | glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; |
2803 | 2803 | |
2804 | 2804 | Exit: |