Fix broken ligature glyphs in monospaced font #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[why]
For some reason reading a font into fontforge looses data on glyphs. As
a workaround their
font-patcher
script has the switch--mono
toascertain an equal width of all glyphs. We want to (and need to) use
that mode of the script to get a new font that is detected as monospaced
by Windows.
Sometimes that workaround fails. For example it breaks ligature glyphs
in some circumstances; they seem to be moved sideways.
[how]
The workaround is done in two steps: First each glyph is checked for
negative bearings. If these are found they are set to fixed zero.
Afterwards the glyph width is set to the font global width.
The ligature glyphs have already the correct width, they just have
negative bearings that they indeed need. There is no reason to change
the (correct) bearings to get a monospaced font. In strict monospaced
fonts that would be impossible, but the ligatures are only used in
applications that could work with negative bearings and so they should
be there. Strict monospaced usage does ignore the bearings anyhow.
So what is needed is a change in the font-patcher script. This can be
done in two ways:
--mono
and instead implement it aspart of our rename script or additional script
Of course the best solution would be to fix upstream font-patcher. But
that might take some time. Meanwhile we can patch the font-patcher as it
is rather stable (no recent commits) and our patch will most likely not
fail in the near future.
Forking font-patcher is not desirable I think.
[note]
There is some work in progress regarding Cascadia Code in Nerd Font's
repository, but that seems slow ;) Project too big.
Fixes: #3
Signed-off-by: Fini Jastrow ulf.fini.jastrow@desy.de