The FreeType Project - Bugs: bug #43271, Broken CFF fonts
You are not allowed to post comments on this tracker with your current authentication level.
bug #43271: Broken CFF fonts
Submitter: | Denis Simuntis <outqb> | ||
Submitted: | Sun 21 Sep 2014 02:42:52 PM UTC | ||
Severity: | 3 - Normal | Item Group: | Incorrect behaviour |
Status: | Fixed | Privacy: | Public |
Assigned to: | darnold | Open/Closed: | Closed |
Planned Release: | 2.5.4 |
Jump to the original submission
Thu 02 Oct 2014 10:17:41 PM UTC, comment #7: |
Dave Arnold <darnold> |
Thu 02 Oct 2014 04:35:53 AM UTC, comment #6: This is fixed in the git repository. Please test! And thanks for the report. |
Werner LEMBERG <wl> |
Thu 25 Sep 2014 11:24:08 PM UTC, comment #5: Good catch.
|
Dave Arnold <darnold> |
Wed 24 Sep 2014 06:58:40 PM UTC, comment #4: FT_DivFix is actually protected against the overflowing result: see ftcalc.c:301 in ft_div64by32. I am still not sure if this is the right approach though. It is not nice to be overflowing like this at very reasonable sizes. I think that the 1/1000th of a pixel as a huge overkill for the resolution in comparison to more common 1/64th in FreeType.
|
Alexei Podtelezhnikov <podtelez> |
Mon 22 Sep 2014 08:52:13 PM UTC, comment #3: Alexei, I haven't looked at why the results are wider than 32 bits (that might be another issue) but the fact is that overflow really occurs and it's not checked for properly. Once this is done correctly, font distortion goes away. |
Denis Simuntis <outqb> |
Mon 22 Sep 2014 08:33:06 PM UTC, comment #2: Dave, please have a look! |
Werner LEMBERG <wl> |
Mon 22 Sep 2014 05:07:20 PM UTC, comment #1: FT_MulFix does or emulates 64-bit calculations with 32-bit arguments and the result should 32-bits as well. Are you saying that the results are wider than 32-bits?
|
Alexei Podtelezhnikov <podtelez> |
Sun 21 Sep 2014 02:42:52 PM UTC, original submission:
Some CFF fonts get broken at particular sizes. The culprit function is cf2_computeDarkening(). It seems that scaledStem and stemWidthPer1000 are incorrectly checked for overflow. Examples of fonts that this problem can be reproduced with are "Adobe Garamond Pro Regular 601pt" and "Birch Std Regular 601pt". See attached screenshots showing the problem and the patch to fix it. |
Denis Simuntis <outqb> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2014-10-02 | wl | Status | None | Fixed | |
Open/Closed | Open | Closed | |||
Planned Release | None | 2.5.4 | |||
2014-09-22 | wl | Assigned to | None | darnold | |
2014-09-21 | outqb | Attached File | - | Added Adobe Garamond Pro Regular 601.png, #32155 | |
Attached File | - | Added cf2font.c.patch, #32156 | |||
Attached File | - | Added Birch Std Regular 601.png, #32157 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Just to follow up, the fix was to change the overflow detection to use approximate logarithms (FT_MSB) and to clamp scaledStem.