bugThe FreeType Project - Bugs: bug #28478, Problem using Incremental...

 
 

bug #28478: Problem using Incremental interface and TrueType fonts.

Submitted by:  Kenneth Sharp <kens>
Submitted on:  Mon 04 Jan 2010 10:33:27 AM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.12

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 04 Jan 2010 02:55:15 PM UTC, comment #1:

Applied, thanks!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 04 Jan 2010 10:33:27 AM UTC, original submission:

This only occurs when using the FT_CONFIG_OPTION_INCREMENTAL flag, and a TrueType font.

Starting from TT_Glyph_Load:

We have a local variable of type TT_LoaderRec, this is initialised in tt_loader_init (ttgload.c, line 2009). tt_loader_init specifically sets the 'glyf_offset' member of this structure to zero when using the incremental interface (compile time option at line 1885 of ttgload.c). Not sure if this is intended as a flag or to prevent problems with an uninitialised variable, this member is not apparently otherwise set by the incremental interface.

We then enter load_truetype_glyph, passing the TT_LoaderRec variable as a parameter. Again this function has a compile-time section for the incremental interface (ttgload.c, line 1248). This section calls out to the main application (Ghostscript in our case) to retrieve the glyph data. On return it sets the 'loader' variable (see above, type TT_LoaderRec) member 'byte_len' based on the data returned.

We then (line 1278) test the value of byte_len to see if its non-zero, if so we test the value of loader->glyf_offset and if it is 0 (which it is, because it is specifically set so in tt_loader_init) we raise an error.

Thus it seems there is no way to use the incremental interface with a TrueType font.

Since the compile-time section also has a run-time test for the incremental interface, I suggest adding a test to see if the interface is incremental while checking the glyf_offset.

Attached is a unified diff patch which makes this change. For me this fixes the problem described. It should be possible to reproduce this problem with any TrueType font by using the incremental interface option but I can supply PostScript or PDF files containing fonts which exercise this code if required.

Kenneth Sharp <kens>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #19410:  ttgload.diff added by kens (489B - application/octet-stream)

 

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)
  • -unavailable- added by kens (Submitted the item)
  • -unavailable- added by kens
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 Jan 2010 02:55:15 PM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.12
    Mon 04 Jan 2010 10:33:27 AM UTCkensAttached File-=>Added ttgload.diff, #19410
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1