bugThe FreeType Project - Bugs: bug #25781, Rejection TT cmap 4 too strong ?

 
 

bug #25781: Rejection TT cmap 4 too strong ?

Submitted by:  John Tytgat <joty>
Submitted on:  Fri 06 Mar 2009 07:05:44 PM UTC  
 
Severity: 3 - NormalItem Group: Crash
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.

 

Wed 11 Mar 2009 06:48:48 AM UTC, comment #3:

Applied, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 10 Mar 2009 06:59:24 PM UTC, comment #2:

The patch #17624 fixes indeed this problem and I don't see any regressions with it so far.

John Tytgat <joty>
Mon 09 Mar 2009 08:26:54 AM UTC, comment #1:

Attached is a patch. It now simply checks for a valid `offset',
no longer handling `delta = 1' specially.

Please test.

(file #17624)

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 06 Mar 2009 07:05:44 PM UTC, original submission:

Attached two files:
- Simple PDF file containing a subsetted TrueType font Helvetica57-Condensed showing the line "qualita" whom the last "a" is in fact "agrave".
- The extracted subsetted TrueType font Helvetica57-Condensed as embedded in above mentioned PDF file.

When processing the TrueType font with FreeType I notice that its cmap 4 gets rejected "tt_face_build_cmaps: broken cmap sub-table ignored!" (triggered by a test in tt_cmap4_validate) and that the "agrave" character can't be accessed by FT. When I overrule the rejection, "agrave" is accessible and the line "qualita" (with "agrave" at the end) gets rendered ok.

Looking more closely at the cmap 4 data itself:

--8<--
Subtable 2. Platform ID: 3
Specific ID: 1
'cmap' Offset: 0x0000011A
->Format: 4 : Segment mapping to delta values
Length: 412
Version: 0
segCount: 19 (X2 = 38)
searchRange: 32
entrySelector: 4
rangeShift: 6
Seg 1 : St = 0020, En = 007E, D = -31, RO = 0, gId# = N/A
Seg 2 : St = 00A0, En = 00FF, D = 0, RO = 36, gId# = 0
Seg 3 : St = 0152, En = 0153, D = 0, RO = 226, gId# = 96
Seg 4 : St = 0160, En = 0161, D = 0, RO = 228, gId# = 98
Seg 5 : St = 0178, En = 0178, D = 0, RO = 230, gId# = 100
Seg 6 : St = 0192, En = 0192, D = 0, RO = 230, gId# = 101
Seg 7 : St = 02C6, En = 02C6, D = 0, RO = 230, gId# = 102
Seg 8 : St = 02DC, En = 02DC, D = 0, RO = 230, gId# = 103
Seg 9 : St = 2013, En = 2014, D = 0, RO = 230, gId# = 104
Seg 10 : St = 2018, En = 201A, D = 0, RO = 232, gId# = 106
Seg 11 : St = 201C, En = 201E, D = 0, RO = 236, gId# = 109
Seg 12 : St = 2020, En = 2022, D = 0, RO = 240, gId# = 112
Seg 13 : St = 2026, En = 2026, D = 0, RO = 244, gId# = 115
Seg 14 : St = 2030, En = 2030, D = 0, RO = 244, gId# = 116
Seg 15 : St = 2039, En = 203A, D = 0, RO = 244, gId# = 117
Seg 16 : St = 2122, En = 2122, D = 0, RO = 246, gId# = 119
Seg 17 : St = 2212, En = 2212, D = 0, RO = 246, gId# = 120
Seg 18 : St = 2219, En = 2219, D = 0, RO = 246, gId# = 121
Seg 19 : St = FFFF, En = FFFF, D = 12590, RO = 28773, gId# = 14385
--8<--

The rejection is because D is not 1 for the 19th segement with Start = 0xFFFF and End = 0xFFFF but a bogus 12590 value. So I'm wondering if this check is not too strong and we should ignore D value and always map char 0xFFFF to glyph 0 ?

John Tytgat <joty>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #17624:  ttcmap.c.diff added by wl (11KiB - text/x-patch)
file #17604:  PP_ARTIGIANACOMPENSATI_small03.pdf added by joty (22KiB - application/pdf)
file #17605:  Helvetica57-Condensed.ttf added by joty (17KiB - 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 (Updated the item)
  • -unavailable- added by wl
  • -unavailable- added by joty (Submitted the item)
  • -unavailable- added by joty
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 11 Mar 2009 06:48:48 AM UTCwlStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.9
    Mon 09 Mar 2009 08:26:54 AM UTCwlAttached File-=>Added ttcmap.c.diff, #17624
      Item GroupNone=>Crash
      StatusNone=>Ready For Test
      Assigned toNone=>wl
      Carbon-Copy-=>Added martin mcbride
    Fri 06 Mar 2009 07:05:44 PM UTCjotyAttached File-=>Added PP_ARTIGIANACOMPENSATI_small03.pdf, #17604
      Attached File-=>Added Helvetica57-Condensed.ttf, #17605
      Carbon-Copy-=>Added bramt

    Back to the top


    Powered by Savane 3.1-cleanup1