|
From: | Nikolaus Waxweiler |
Subject: | Re: [ft-devel] Autohinter: stem darkening, first rough prototype |
Date: | Mon, 31 Aug 2015 01:12:03 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
Normal Type1 fonts work like that. CFF, on the other hand, can have different stdVW values for subfonts – and large, high-quality CJK fonts like HiraKakuPro contain *a lot* of subfonts:
CID-keyed (and other?) CFF fonts have multiple FontDict's (aka FD).
multiple private DICTs (subfonts) and therefore multiple Std?W values per font for CID fonts
Alright, alright, I stand corrected ;)Doing it per script actually made things easier. Everyone who cares please have a look at https://github.com/madig/freetype2/tree/stem-darkening-autohinter.
The darkening amount is now lazily computed per size AND per standard width of the glyph's script. This means that each time a glyph is loaded by the autohinter and its' standard width as determined by the script analyzer changed compared to the glyph before it, the darkening is recomputed.
And I only had to extend the writing system class by typedef void (*AF_WritingSystem_GetStdWidthsFunc)( AF_StyleMetrics metrics, FT_Pos* stdHW, FT_Pos* stdVW ); :)Okay, what remains? More comments maybe, af_loader_compute_darkening() cleanup and testing.
I had a quick look at various fonts and darkening seemed fine, but CJK glyphs (SourceHanSansCN-Regular.otf) appeared a bit thin compared to the CFF engine. Will investigate... some other time.
[Prev in Thread] | Current Thread | [Next in Thread] |