[type1,cid,type42] Minor improvements.

* src/type1/t1load.c (t1_parse_font_matrix): Scale units per EM only
when necessary. Refresh comments.
* src/cid/cidload.c (cid_parse_font_matrix): Ditto.
* src/type42/t42parse.c (t42_parse_font_matrix): Refresh comments.
This commit is contained in:
Alexei Podtelezhnikov 2015-08-10 23:05:02 -04:00
parent bd75a517dc
commit a37da21a49
4 changed files with 20 additions and 15 deletions

View File

@ -1,3 +1,12 @@
2015-08-10 Alexei Podtelezhnikov <apodtele@gmail.com>
[type1,cid,type42] Minor improvements.
* src/type1/t1load.c (t1_parse_font_matrix): Scale units per EM only
when necessary. Refresh comments.
* src/cid/cidload.c (cid_parse_font_matrix): Ditto.
* src/type42/t42parse.c (t42_parse_font_matrix): Refresh comments.
2015-08-08 Werner Lemberg <wl@gnu.org>
[type42] Fix glyph access.

View File

@ -167,6 +167,7 @@
matrix = &dict->font_matrix;
offset = &dict->font_offset;
/* input is scaled by 1000 to accomodate default FontMatrix */
result = cid_parser_to_fixed_array( parser, 6, temp, 3 );
if ( result < 6 )
@ -180,15 +181,12 @@
return FT_THROW( Invalid_File_Format );
}
/* 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] */
/* atypical case */
if ( temp_scale != 0x10000L )
{
/* set units per EM based on FontMatrix values */
root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
temp[0] = FT_DivFix( temp[0], temp_scale );
temp[1] = FT_DivFix( temp[1], temp_scale );
temp[2] = FT_DivFix( temp[2], temp_scale );

View File

@ -1107,6 +1107,7 @@
FT_Int result;
/* input is scaled by 1000 to accomodate default FontMatrix */
result = T1_ToFixedArray( parser, 6, temp, 3 );
if ( result < 6 )
@ -1124,15 +1125,12 @@
return;
}
/* 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_scale */
/* atypical case */
if ( temp_scale != 0x10000L )
{
/* set units per EM based on FontMatrix values */
root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
temp[0] = FT_DivFix( temp[0], temp_scale );
temp[1] = FT_DivFix( temp[1], temp_scale );
temp[2] = FT_DivFix( temp[2], temp_scale );

View File

@ -268,7 +268,7 @@
return;
}
/* we need to scale the values by 1.0/temp_scale */
/* atypical case */
if ( temp_scale != 0x10000L )
{
temp[0] = FT_DivFix( temp[0], temp_scale );