bugThe FreeType Project - Bugs: bug #25669, FT_Get_Advance on CFF fonts is...

 
 

bug #25669: FT_Get_Advance on CFF fonts is broken.

Submitted by:  None
Submitted on:  Sun 22 Feb 2009 01:03:17 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.9

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 24 Feb 2009 09:36:35 PM UTC, comment #1:

Fixed, thanks. Please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 22 Feb 2009 01:03:17 PM UTC, original submission:

FT_Get_Advance gives slightly different results from the advance that is given by FT_Load_Glyph on TrueType fonts, but the difference is fairly minor. However on CFF fonts (both raw and embedded in OpenType) the FT_Get_Advance returns completely fictional numbers.

I've attached an example program that calls FT_Get_Advance and compares the result with the advance given by FT_Load_Glyph. It appears that the FT_Get_Advance result on CFF fonts depends on the previous glyph that was loaded with FT_Load_Glyph.

With an OpenType/CFF font:

casper ~/src/ftadvbug # ./a.out bemomt.otf
char 'H'
advance before load-glyph = 0 (0)
advance given by load-glyph = 1014 (15.8438)
advance after load-glyph = 1329069 (20.28)
char 'e'
advance before load-glyph = 1329069 (20.28)
advance given by load-glyph = 559 (8.73438)
advance after load-glyph = 732692 (11.18)
char 'l'
advance before load-glyph = 732692 (11.18)
advance given by load-glyph = 307 (4.79688)
advance after load-glyph = 402391 (6.14)
char 'l'
advance before load-glyph = 402391 (6.14)
advance given by load-glyph = 307 (4.79688)
advance after load-glyph = 402391 (6.14)
char 'o'
advance before load-glyph = 402391 (6.14)
advance given by load-glyph = 667 (10.4219)
advance after load-glyph = 874249 (13.34)
char '!'
advance before load-glyph = 874249 (13.34)
advance given by load-glyph = 333 (5.20312)
advance after load-glyph = 436469 (6.65999)

And with a plain TrueType font:

casper ~/src/ftadvbug # ./a.out arial.ttf
char 'H'
advance before load-glyph = 946560 (14.4434)
advance given by load-glyph = 925 (14.4531)
advance after load-glyph = 946560 (14.4434)
char 'e'
advance before load-glyph = 728960 (11.123)
advance given by load-glyph = 712 (11.125)
advance after load-glyph = 728960 (11.123)
char 'l'
advance before load-glyph = 291200 (4.44336)
advance given by load-glyph = 284 (4.4375)
advance after load-glyph = 291200 (4.44336)
char 'l'
advance before load-glyph = 291200 (4.44336)
advance given by load-glyph = 284 (4.4375)
advance after load-glyph = 291200 (4.44336)
char 'o'
advance before load-glyph = 728960 (11.123)
advance given by load-glyph = 712 (11.125)
advance after load-glyph = 728960 (11.123)
char '!'
advance before load-glyph = 364160 (5.55664)
advance given by load-glyph = 356 (5.5625)
advance after load-glyph = 364160 (5.55664)

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #17498:  ftadvbug.c added by None (1KiB)

 

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
    Tue 24 Feb 2009 09:36:35 PM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.9
    Sun 22 Feb 2009 01:03:17 PM UTCNoneAttached File-=>Added ftadvbug.c, #17498

    Back to the top


    Powered by Savane 3.1-cleanup1