From d60419d2bc831756ecfc6cb93b535da9cdfe05ab Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 30 Nov 2013 08:14:43 +0100 Subject: [PATCH] Fix handling of non-square pixels, part 1. Depending on the direction of the projection vector, CVT values as returned by RCVT might differ. The same is true for the MPPEM opcode. --- lib/tafpgm.c | 25 +++++++++++++------------ lib/taprep.c | 5 ++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/tafpgm.c b/lib/tafpgm.c index 417c6d2..4503c37 100644 --- a/lib/tafpgm.c +++ b/lib/tafpgm.c @@ -1631,6 +1631,9 @@ unsigned char FPGM(bci_create_segments) [] = bci_create_segments, FDEF, + /* all our measurements are taken along the y axis */ + SVTCA_y, + /* only do something if we are not a subglyph */ PUSHB_2, 0, @@ -1638,9 +1641,6 @@ unsigned char FPGM(bci_create_segments) [] = RCVT, EQ, IF, - /* all our measurements are taken along the y axis */ - SVTCA_y, - PUSHB_1, sal_num_packed_segments, SWAP, @@ -1892,6 +1892,9 @@ unsigned char FPGM(bci_create_segments_composite) [] = bci_create_segments_composite, FDEF, + /* all our measurements are taken along the y axis */ + SVTCA_y, + PUSHB_1, bci_decrement_component_counter, CALL, @@ -1903,9 +1906,6 @@ unsigned char FPGM(bci_create_segments_composite) [] = RCVT, EQ, IF, - /* all our measurements are taken along the y axis */ - SVTCA_y, - PUSHB_1, sal_num_packed_segments, SWAP, @@ -2337,6 +2337,9 @@ unsigned char FPGM(bci_scale_glyph) [] = bci_scale_glyph, FDEF, + /* all our measurements are taken along the y axis */ + SVTCA_y, + /* only do something if we are not a subglyph */ PUSHB_2, 0, @@ -2344,9 +2347,6 @@ unsigned char FPGM(bci_scale_glyph) [] = RCVT, EQ, IF, - /* all our measurements are taken along the y axis */ - SVTCA_y, - PUSHB_1, 1, SZPS, /* set zp0, zp1, and zp2 to normal zone 1 */ @@ -2388,6 +2388,9 @@ unsigned char FPGM(bci_scale_composite_glyph) [] = bci_scale_composite_glyph, FDEF, + /* all our measurements are taken along the y axis */ + SVTCA_y, + PUSHB_1, bci_decrement_component_counter, CALL, @@ -2399,9 +2402,6 @@ unsigned char FPGM(bci_scale_composite_glyph) [] = RCVT, EQ, IF, - /* all our measurements are taken along the y axis */ - SVTCA_y, - PUSHB_1, 1, SZPS, /* set zp0, zp1, and zp2 to normal zone 1 */ @@ -2499,6 +2499,7 @@ unsigned char FPGM(bci_shift_subglyph) [] = bci_shift_subglyph, FDEF, + /* all our measurements are taken along the y axis */ SVTCA_y, PUSHB_1, diff --git a/lib/taprep.c b/lib/taprep.c index a1828d9..8b9cd69 100644 --- a/lib/taprep.c +++ b/lib/taprep.c @@ -22,8 +22,11 @@ unsigned char PREP(hinting_limit_a) [] = { - /* first of all, check whether we do hinting at all */ + /* all our measurements are taken along the y axis, */ + /* including the ppem and CVT values */ + SVTCA_y, + /* first of all, check whether we do hinting at all */ MPPEM, PUSHW_1, -- 2.11.4.GIT