From 79180ad049b3e1ecf9f0348fb284d3b49554b568 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Tue, 27 Nov 2012 21:36:20 -0500 Subject: [PATCH] [cid, type1, type42] Clean up units_per_EM calculations. * src/cid/cidload.c (cid_parse_font_matrix): Updated. * src/type1/t1load.c (t1_parse_font_matrix): Updated. * src/type42/t42parse.c (t42_parse_font_matrix): Updated. --- ChangeLog | 9 +++++++++ src/cid/cidload.c | 10 +++++----- src/type1/t1load.c | 3 +-- src/type42/t42parse.c | 3 +-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3116bc151..d1be2ad89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-11-27 Alexei Podtelezhnikov + + [cid, type1, type42] Clean up units_per_EM calculations. + + * src/cid/cidload.c (cid_parse_font_matrix): Updated. + * src/type1/t1load.c (t1_parse_font_matrix): Updated. + * src/type42/t42parse.c (t42_parse_font_matrix): Updated. + + 2012-11-27 Alexei Podtelezhnikov [ftstroke] Minor improvement. diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 3b840b73b..cbb59850f 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -168,11 +168,11 @@ temp_scale = FT_ABS( temp[3] ); - /* Set units per EM based on FontMatrix values. We set the value to */ - /* `1000/temp_scale', because temp_scale was already multiplied by */ - /* 1000 (in `t1_tofixed', from psobjs.c). */ - root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L, - FT_DivFix( temp_scale, 1000 ) ) ); + /* Set Units per EM based on FontMatrix values. We set the value to */ + /* 1000 / temp_scale, because temp_scale was already multiplied by */ + /* 1000 (in t1_tofixed, from psobjs.c). */ + + root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); /* we need to scale the values by 1.0/temp[3] */ if ( temp_scale != 0x10000L ) diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 4b4217cea..76f025068 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -1131,8 +1131,7 @@ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ - root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, - temp_scale ) >> 16 ); + root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); /* we need to scale the values by 1.0/temp_scale */ if ( temp_scale != 0x10000L ) diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index 468b46334..2b2824030 100644 --- a/src/type42/t42parse.c +++ b/src/type42/t42parse.c @@ -265,8 +265,7 @@ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ - root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, - temp_scale ) >> 16 ); + root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); /* we need to scale the values by 1.0/temp_scale */ if ( temp_scale != 0x10000L )