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.
_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel