3 ms·
Yes, Skrifa executes TrueType hints and has a new autohinting implementation written in Rust. We use these modes in Chrome.
by drott 2y ago
Yes, Skrifa executes TrueType hints and has a new autohinting implementation written in Rust. We use these modes in Chrome.
- maxdamantus 2y agoHmm.. I tried using the "tools/viewer/viewer --slide GM_typeface_fontations_roboto" example in the skia repository earlier (swapping out the Roboto font for DejaVuSans, since the Roboto font doesn't seem to properly hint horizontally [0]), but the result [1] seems to only be hinted vertically, so similar to the FreeType "v40" interpreter, which supposedly ignores horizontal hints. Admittedly I haven't looked into how the setup is configured, and haven't tried it in Chrome, so maybe it's still possible to enable full hinting as intended by the font somehow. [0] https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b299e8b1eaa524aab8e1bd/raw/173c5cc188ada43301b4adcdb128e950fdeeb5e7/zzz_dejavu_vs_roboto.png https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b29... [1] https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b299e8b1eaa524aab8e1bd/raw/07de7d7e3cde648191f70aaeb70222a481a2cd37/zzz_skrifa.png https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b29...
- drott 2y agoIn the viewer, press '/' and configure hinting to full, or modify the source in gm/fontations.cpp and call SkFont::setHinting(SkFontHinting::kFull) or kNormal.
- maxdamantus 2y agoThanks for the reply. I was able to play around with the settings there, but even when enabling full hinting it's still only hinting vertically (I think this is what it was doing by default, as in my screenshot—this is similar to what the FreeType v40 hinter does, which is used by default from 2.7 as mentioned in my first post). EDIT: looking into the FreeType code, it looks like the v35 mode turns on the `NO_SUBPIXEL_HINTING` flag [0], which might have also been ported over to skrifa [1]? Though there are "(always enabled)" comments throughout the code suggesting that it can't be configured. Maybe later I'll try forcing the option and see what happens. [0] https://github.com/freetype/freetype/blob/5d4e649f740c675426fbe4cdaffc53ee2a4cb954/src/truetype/ttinterp.c#L50 https://github.com/freetype/freetype/blob/5d4e649f740c675426... [1] https://github.com/googlefonts/fontations/blob/f808570ce1939bd6267fc6e5519ff59c405c51a7/skrifa/src/outline/glyf/hint/engine/misc.rs#L153 https://github.com/googlefonts/fontations/blob/f808570ce1939...