Am 2020-01-15 12:57, schrieb Nikolaus Waxweiler:
>
> Another random unproductive thought: Glyphs and probably Fontlab (7?)
> support a form of hinting that is less powerful than VTT, but can be
> properly stored in source control and may be good enough for the
> majority of cases. Imagine a ttfautohint that applies these hints to
> sources and then the compiler automatically applies them to static
> fonts and variable fonts. Imagine not having to deal with the
> brittleness of VTT TTX dumps anymore.
Neither FontLab 5 nor 7 produce hints that can be made variable. The
main problem with FontLab 5 is that the stem definitions (sizes at which
stems change their pixel width) are in the prep table, which has no
variable counterpart. FontLab 7 has other TT hinting bugs which make it
unusable at the moment.
Glyphs uses a proprietary compiler from graphical hints to assembly
code, so to be compiled outside of Glyphs, Georg would have to
open-source that, or an alternative implementation would have to be
built.
In my opinion, for run-of-the-mill cases, excluding variable deltas and
axis-position-specific instructions, a relatively simple way to hint
variable fonts would be this:
- Autohint the master font which has the most diverse stem widths, so
probably the heaviest weight
- Instead of only noting the absolute cvt values, save them as
references to font measurements/outline points, e.g. for a stem: "CVT 15
is the vertical distance between points 1 and 26 in glyph C", or for a
"zone": "CVT 5 is the vertical position of point 7 in glyph f".
- Measure the corresponding points in all other masters and build only a
cvt table for each master
- Transfer the font-level hinting and glyph-level hinting from the
hinted master to the default master
- Build a variable font with fonttools.varLib which will take the font
and glyph programs from the default master, and compiles the cvt tables
from all non-default masters into a cvar table
I have the goal to do it like this in my Python VTT reimplementation,
but am not at that point by far yet.
Cheers,
Jens