freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Autohinter: stem darkening, first rough prototype


From: Nikolaus Waxweiler
Subject: Re: [ft-devel] Autohinter: stem darkening, first rough prototype
Date: Thu, 27 Aug 2015 18:25:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

I pushed some changes to https://github.com/madig/freetype2/tree/stem-darkening-autohinter. I have that branch installed system-wide for proper dog-fooding ;)

I changed the strategy to get the standard_width of a face. Instead of relying on the hard-to-follow workings of the style analyzers, first see if the font defines a stdVW by itself (Postscript fonts, once I figure out how to get at SFNT->CFF->PrivateDict without instantiating a CFF_Decoder also OpenType/CFF fonts). If it doesn't, in the future, set the style analyzers on it in some controlled way to determine the standard_width the hard way. Currently the code sets the standard_width arbitrarily like Dave suggested by looking at the weight class in the OS/2 table (light, regular, bold: 50, 75, 110). How well this works depends on how far off that value is from the "real" stdVW. I compared some article with the Linux Libertine font, because it comes with differently named .otf and .ttf fonts for quick comparison and it's dominant stem width is approximately 79, close to the 75 of it's weight class: http://postimg.org/gallery/32jipb0bi/0fb77538/ (Gamma correction through modified pixman). Alternating quickly between both shows that stem contrast is almost the same, so the default CFF darkening parameters seem a good fit there. If you look at the developer console though, you'll see that the font there (Liberation Mono) appears too thick vertically (stdVW =~ 88).

Another interesting thing when comparing Adobe's CFF engine with the emboldening autohinter: text is fairly readable at very small sizes with Adobe's engine while I have to skew the emboldening computation below 9(pt?) because emboldening makes stuff less readable there: http://postimg.org/image/my3w9aerp/91a87a2d/. Top is Linux Libertine .otf -> Adobe CFF, bottom is .ttf -> autohinter.

What I now want to do:
- Find out how to access SFNT->CFF->PrivateDict.
- Find out how to to run style analyzers over the face in a controlled way to compute real standard_widths.

Once that is done, I think the prototype should be closer to merging to master. The last hurdle should be performance testing and optimization.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]