This addresses #25 and (partially) #42; fonts that we can't make derivative
works of are no longer checked in, and fonts that need to be renamed for
license compliance have been.
The build process is also now a bit more robust.
Rather than trying to infer the font name and weight from the filename,
ligaturizer now uses the metadata embedded in the font file and sticks
the desired prefix onto it.
Fonts usually let you look up the glyphs by name, but not always; all
they are *required* to support is lookup by codepoint. This fixes em
lookup and the www ligature on fonts that don't have nametables for
letter glyphs.
Fixes#16 and #21.
This scales all copied ligatures based on the ratio between the
ligature's horizontal advance and the target font's em width, then
corrects the horizontal advance.
Fira Code punctuation characters (a) vary in horizontal advance among
themselves and (b) may not match the horizontal advance or glyph width
of the target font. This change fixes the horizontal advance when
copying individual characters.
Depending on the width of the copied characters (relative to the input
font) and the setting of --scale-character-glyphs-threshold, it will
also either scale the copied glyphs horizontally, or simply center them
inside the now correctly sized hbox.
Note that this only applies to individual characters (and thus is a
no-op if the user hasn't turned on individual character copy with the
--copy-character-glyphs option); properly scaling ligatures is still a
work in progress.
Specifically, when you call generate(), it helpfully adjusts the underline
position by subtracting the underline line width. This means the underline
position for the generated font is lower than the underline position in the
original font, potentially low enough to push it into the next line of text.
This causes weird rendering glitches in (at least) Konsole when displaying
underlined text.
If fontforge crashes or is otherwise interrupted, you can just regenerate
the font; I think the risk of leaving a half-generated font file around is
less than the risk of unexpectedly overwriting something in the current
working directory, which is what the previous behaviour did.
This matches the behaviour of Fira Code, where long runs of identical
characters don't get ligaturized; for example, with this change,
`######` will get ligaturized as six `#` characters, rather than as
three `##` characters.
This updates the FiraCode OTFs to version 1.204, and makes ligaturize.py
infer which one to use based on the name of the output file; e.g. if you
name your output `Ligaturized-Bold` or `Ligaturized-BoldItalic`, it will
use `FiraCode-Bold.otf` as the ligature source.
It also lets the user explicitly specify the ligature source as a third
command line argument if the inference is wrong (which opens the door to
using non-Fira Code ligatures, too).
In particular, this means you can generate (e.g.)
'CousineLigatures-Regular.ttf' and 'CousineLigatures-Bold.ttf', and they
will both be in the font family 'Cousine Ligatures'.