Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Automatic symbols only font generation #801

Merged
merged 4 commits into from
Aug 20, 2022

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Mar 3, 2022

Description

[why]
The symbol only fonts Symbols-1000-em Nerd Font Complete.ttf
and 2048-em in NerdFontsSymbolsOnly/ are generated from
some 'almost' empty source fonts, that are assumable in turn generated
from the sfd font descriptions in src/glyphs/?

The process is not documented and we have issues in the generated font
(for example the glyph for capital E is defined (and empty) #581 #765).

[how]
Use the existing font definitions from src/glyphs/*.sfd directly as
source font. That needs a change in font-patcher because the empty
fonts have no glyphs that can be used to orient the scaling upon. In
that case scale on the source font definitions EM.

Then we need patch-em-all to also patch *.sfd fonts.

And finally we need patch-em-all to take a font specific command line
switch for font-patcher (compare 9e2bc9a of #723) to instruct it to
create a ttf rather than a sfd front file.

In the sfd file we additionally set the Panose type.
And the UnderlinePosition is adjusted to match the current patched font.

[note]
Also fix wrong glob pattern in patch-em-all *.[o,t]tf. The comma is
for sure some leftover from a '{}' shell pattern, that is not used
anymore.

Requirements / Checklist

What does this Pull Request (PR) do?

Autogenerate the symbols only fonts from the sdf templates and not the ttf templates.

How should this be manually tested?

Any background context you can provide?

Automatic generation from ttf files: #479
Issues with ttf files: #581 #765

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

@Finii Finii added the Bug fix label Mar 3, 2022
@Finii
Copy link
Collaborator Author

Finii commented Mar 3, 2022

I guess the empty E letter comes from the problem that font-patcher needs (*) at least one valid glyph in the basic range (0000 - 017F to determine the font metrics. So probably Ryan added an empty E, patched, and then removed the E - all manually?

That does not make much sense either ;-) Whatever.

*: Well, it does not need it anymore with the PR, if no glyph is existing the EM is used

@Finii Finii force-pushed the bugfix/symbols-only-font-generation branch from a16b373 to affbbf1 Compare March 3, 2022 16:26
@Finii
Copy link
Collaborator Author

Finii commented Mar 3, 2022

I consistently typed front instead of font in the commit messages :->

Fixed and force push to get rid of that embarrassment.

@Finii Finii added this to the v2.2.0 milestone Aug 20, 2022
[why]
We want to patch some fonts with different font-patcher options.

[how]
Use the config.cfg file that each source font can have to specify one
arbitrary option to the font-patcher calls.

[note]
This is partially commit 9e2bc9a from #723.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The symbol only fonts Symbols-1000-em Nerd Font Complete.ttf
and 2048-em in `NerdFontsSymbolsOnly/` are generated from
some 'almost' empty source fonts, that are assumable in turn generated
from the sfd font descriptions in `src/glyphs/`?

The process is not documented and we have issues in the generated font
(for example the glyph for capital `E` is defined (and empty) #581 #765).

[how]
Use the existing font definitions from `src/glyphs/*.sfd` directly as
source font. That needs a change in font-patcher because the empty
fonts have no glyphs that can be used to orient the scaling upon. In
that case scale on the source font definitions EM.

Then we need patch-em-all to also patch *.sfd fonts.

And finally we need patch-em-all to take a font specific command line
switch for font-patcher (compare 9e2bc9a of #723) to instruct it to
create a ttf rather than a sfd font file.

In the sfd file we additionally set the Panose type.
And the UnderlinePosition is adjusted to match the current patched font.

[note]
Also fix wrong glob pattern in patch-em-all `*.[o,t]tf`. The comma is
for sure some leftover from a '{}' shell pattern, that is not used
anymore. (This comment is probably outdated, due to rebasing.)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Not sure why they are here, all patched fonts reside now in the
`patched-fonts/` folder.

So we have two times two different symbols only font sets?

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii force-pushed the bugfix/symbols-only-font-generation branch from affbbf1 to 38f0e87 Compare August 20, 2022 17:06
@Finii
Copy link
Collaborator Author

Finii commented Aug 20, 2022

Rebase on master, resolve conflicts by changing to -iregex, force push

[why]
The detection if all fonts of a given directory are to be processed is
broken if the font files contain blanks
(like 'Symbols-1000-em Nerd Font Complete Mono Windows Compatible.ttf')

[how]
Need to put name argument in quotes...
Also fix counting for sfd files (but we never generate them anyhow)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii merged commit 953ec87 into master Aug 20, 2022
@Finii Finii deleted the bugfix/symbols-only-font-generation branch August 20, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant