bugThe FreeType Project - Bugs: bug #37856, Limit BlueScale value

 
 

bug #37856: Limit BlueScale value

Submitted by:  John Tytgat <joty>
Submitted on:  Mon 03 Dec 2012 07:53:53 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.11

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 05 Dec 2012 10:17:57 AM UTC, comment #3:

Applied (with slight formatting), thanks!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 04 Dec 2012 04:48:52 PM UTC, comment #2:

The clamping happens at psh_globals_new() time, not psh_blues_snap_stem(). Did I wrongly generate my patch ?

Anyway, yes, I think the best place is in psh_global_new() because there the PSH_Globals structure gets created for PS hinting use afterwards.

There are several places where T1_Private::blue_scale is set, in CFF (cff_make_private_dict()), in PFR (pfr_phy_font_load()) and during PS CID and PS Type 1 private dict token parsing. So doing the blue_scale clamping at all those cases would be less favorable.

John Tytgat <joty>
Tue 04 Dec 2012 04:35:39 PM UTC, comment #1:

Is psh_blues_snap_stem the best place to do it? Why not run this sanity check at the time when priv->blue_scale is set, rather than the time when it is used?

Alexei Podtelezhnikov <podtelez>
Project Member
Mon 03 Dec 2012 07:53:53 PM UTC, original submission:

Attached cff subset font has a BlueScale value of 3.73134. This is unrealistic too high and even confuses the PS hinter code resulting in bad outlines (looks like being clipped, squashed, etc.)

I suggest to explicitly clamp the BlueScale value to 1. / maximum blue zone heights (based on info in section 5.6 of the "Adobe Type 1 Font Format").

Attached patch implements this and which solves the problem for this font.

2012-12-03 John Tytgat <John.Tytgat@esko.com>

[pshinter] Clamp BlueScale value.

* src/pshinter/pshglob.c (psh_calc_max_height): Add.
(psh_globals_new): Limit BlueScale value to 1. / max_of_blue_zone_heights.

John.

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 #27029:  embedded_font_joty.cff added by joty (1KiB - application/octet-stream)
file #27030:  bluescale.patch added by joty (2KiB - 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 podtelez (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 05 Dec 2012 10:17:57 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.4.11
    Mon 03 Dec 2012 07:53:53 PM UTCjotyAttached File-=>Added embedded_font_joty.cff, #27029
      Attached File-=>Added bluescale.patch, #27030

    Back to the top


    Powered by Savane 3.1-cleanup1