bugThe FreeType Project - Bugs: bug #52056, Wrong FT_Face::family_name for...

 
 

bug #52056: Wrong FT_Face::family_name for pure CFF fontdata

Submitted by:  John Tytgat <joty>
Submitted on:  Mon 18 Sep 2017 04:56:07 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.8.2

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 19 Sep 2017 05:14:08 AM UTC, comment #1:

Patch applied to git, thanks!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 18 Sep 2017 04:56:07 PM UTC, original submission:

I noticed that the FT_Face::family_name entry for pure CFF fontdata nearly always is the fontname itself, instead of the FamilyName entry in the CFF font (assuming there is one).

The code is in cff_face_init() where for family_name we (try to) start with the face name and, if available, the style gets determined based on the difference of the full name vs the FamilyName CFF entry (!) or the previously determined family_name if the former is not available. Strangely enough the FT_Face::family_name does not get updated if FamilyName in the CFF font is present so we end up with face name as FT_Face::family_name.

Attached a patch (against FreeType 2.6.1 but as far as I can see that part of the code is the same on trunk) which for FT_Face::family_name determination does:

1. If FamilyName in the CFF font is present, we use this for FT_Face::family_name.
2. If not, use face name and chop of any subset prefix.
3. If at this point we have a FT_Face::family_name use this together with the full name to determine the style.
If not, use CIDFontName as FT_Face::family_name.
4. If we don't have a valid style, use "Regular".

=> could this patch be applied on trunk ?

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 #41829:  ft_cff_family_name_fix.diff added by joty (3KiB - 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 joty (Submitted the item)
  •  

    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 19 Sep 2017 05:14:08 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.8.2
    Mon 18 Sep 2017 04:56:07 PM UTCjotyAttached File-=>Added ft_cff_family_name_fix.diff, #41829

    Back to the top


    Powered by Savane 3.1-cleanup1