diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2012-11-27 21:36:20 -0500 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2012-11-27 21:36:20 -0500 |
commit | 79180ad049b3e1ecf9f0348fb284d3b49554b568 (patch) | |
tree | eeb3f7f87fc63d87e9e2031cc3e00b15a2328ee1 | |
parent | 72e976d41565bdae7025cb4fda4f25acec92b022 (diff) | |
download | freetype2-79180ad049b3e1ecf9f0348fb284d3b49554b568.tar.gz |
[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.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/cid/cidload.c | 10 | ||||
-rw-r--r-- | src/type1/t1load.c | 3 | ||||
-rw-r--r-- | src/type42/t42parse.c | 3 |
4 files changed, 16 insertions, 9 deletions
@@ -1,5 +1,14 @@ 2012-11-27 Alexei Podtelezhnikov <apodtele@gmail.com> + [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 <apodtele@gmail.com> + [ftstroke] Minor improvement. * src/base/ftstroke.c: Replace nested FT_DivFix and FT_MulFix with 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 ) |