bugThe FreeType Project - Bugs: bug #23973, Problem with font matrix in CFF...

 
 

bug #23973: Problem with font matrix in CFF fonts that contains integers

Submitted by:  None
Submitted on:  Fri 01 Aug 2008 08:08:29 AM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 04 Aug 2008 03:54:35 PM UTC, comment #2:

patch applied, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 03 Aug 2008 05:51:48 PM UTC, comment #1:

Thanks for the patch. Will test it soon.

Please send me a sample font file (to wl at gnu dot org)
which exhibits the problem.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 01 Aug 2008 08:08:29 AM UTC, original submission:

I encountered a problem when the font matrix of a cff font is expressed in integers instead of reals. Font matrix was (normal integers) 1 0 0 1 0 0, the resulting matrix in freetype (2.3.7) was (FT_Fixed) 0x10000 0 0 1 0 0.

The problem was tracked back to cffparse.cpp, cff_parse_fixed_scaled.

original:

/* read a floating point number, either integer or real, */
/* but return `10^scaling' times the number read in */
static FT_Fixed
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
{
return **d ==
30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: (FT_Fixed)FT_MulFix( cff_parse_integer( d[0], d[1] ) << 16,
power_tens[scaling] );
}

fix:

/* read a floating point number, either integer or real, */
/* but return `10^scaling' times the number read in */
static FT_Fixed
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
{
return **d ==
30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: (FT_Fixed)( ( cff_parse_integer( d[0], d[1] )*power_tens[scaling] ) << 16 );
}

Regards,
Bram Tassyns (bramt@enfocus.be)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 Aug 2008 03:54:35 PM UTCwlStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
    Sun 03 Aug 2008 05:51:48 PM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1