[why]
IBM Plex uses some abbreviations also in the fullname and we do not try
abbreviations when resolving weights.
[how]
As this is the only font that has such specials we handle it beforehand
and do not try all combinations of abbreviated and long keywords.
And then their abbreviations are also not standard - at least not used
by us or Adobe, etc.
For such a small amount of affected font files it seems in order to
specifically just fix them instead of a general solution.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The 'Text' weight of Plex is handled as 'other', means that this is
added to the font's name and is a distrinct own family.
But in the original font it is used as weight.
[how]
Remove special handling of 'text' in the font name.
Add 'Text' to known_weights list.
"Text" is not a standard naming, but I see no problems when we handle it
as one. This keeps the family relationships in Blex like Plex.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Function get_name_token has a Cognitive Complexity of 12 (exceeds 9 allowed).
Consider refactoring.
[how]
Remove not really needed special case.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some fonts might have a non-standard (i.e. broken) weight naming scheme:
They put a blank or a dash between the modifier and the weight, for
example "Extra Bold" or "Demi-Condensed", when they mean "ExtraBold"
resp "DemiCondensed".
The former happens with CartographCF, the later with IBM3270.
[how]
Automatically allow a dash between modifier and weight, which comes up
as CamelCase boundary. Insert an optional dash (r'-?') into such
boundaries.
For the further lookup we need to remove the dash in the found keyword,
if there is any, to get back to standard naming.
This might break if the font name ends in a modifier. So we can not
really distinguish
Font Name Extra Bold Italic
=> Font Name - ExtraBold Italic
=> Font Name Extra - Bold Italic
The known modifiers are 'Demi', 'Ultra', 'Semi', 'Extra'.
It is possible but unlikely that a font name ends in one of these.
For example "Modern Ultra - Bold".
[note]
The question arises if we should not parse the PSname instead of the
Fullname; and stick to the dash there as boundary.
The problem might be prepatched fonts with broken naming, that would be
parsed completely wrong then. So maybe the current approach is still the
best, with the caveat given above (fontnames ending in a modifier).
[note 2]
Funny enough the variable allow_regex_token was not used at all :->
Some leftover? Anyhow we use it now.
[note 3]
We can still not remove the special handling for IBM3270, because the
font initially looks like a PSname and this is parsed as such, which
breaks the name in the incorrect place:
PSname template = "Name-StylesWeights"
Fullname of 3270 = "IBM 3270 Semi-Condensed"
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The code is obviously wrong. No effect has been seen, though.
First we check if a certain string is a key in the dict.
If it is, we retrieve the value with the string lower-cased as key.
This does not make sense.
[how]
All the keys are lower case anyhow, so the code seems unneeded. Maybe it
is a leftover. The styles that go into it _and are in the dict_ all come
from a regex-enabled search and thus are lower-cased.
Whatever, to have the correct code we use the lower-cased string for
both, checking for existance and retrieving the value - this is the only
sane approach.
Also change to dict.get() method instead of a self made if code.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Patching CartographCF-Bold.ttf creates this naming:
Family (ID 1) : CartographF Nerd Font Condensed
SubFamily (ID 2) : Bold
Fullname (ID 4) : CartographF Nerd Font Condensed Bold
PSN (ID 6) : CartographFNF-CondensedBold
PrefFamily (ID 16) : CartographF Nerd Font
PrefStyles (ID 17) : Condensed Bold
CartographF Nerd Font Condensed Bold
\===> 'CartographFNerdFont-CondensedBold.ttf'
[how]
The font-patcher historically used the file name of the to-be-patched
font to come up with the new name. When the FontnameParser has been
developed that mechanics has been copied at least for fallback. The
earliest tests compared old and new naming with all the filenames.
Later, when the FontnameParser has been used to really apply name
changes it has always based the parsing on the Fullname or the PSname,
because they really hold the information (or at least should hold);
while the filename might be completely random.
Still code the dealt with specific problems in FILEnames prevailed. The
Ubuntu font for example has a file name like 'Ubuntu-C.ttf', and we
needed to convert the C to Condensed.
As that requirement vanished we can drop all the code that has been
added specifically only for parsing the Ubuntu font filenames.
Side note: USUALLY font filenames should be roughly equal to the PSname.
Fixes: #1258
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
For fonts that have no Italic but an Oblique - i.e. when Oblique shall
replace the Italic role in RIBBI font grouping (classic group of 4) -
that grouping fails.
This affects DejaVu on Putty.
[how]
For RIBBI grouping only the classic bits are considered. That means that
for fonts that have Oblique instead of Italic (and not additionally) we
need to set the ITALIC bit and the OBLIQUE bit. This has been
overlooked.
Cite from the specs:
> This bit, unlike the ITALIC bit (bit 0), is not related to style-linking
> in applications that assume a four-member font-family model comprised
> of regular, italic, bold and bold italic. It may be set or unset
> independently of the ITALIC bit. In most cases, if OBLIQUE is set, then
> ITALIC will also be set, though this is not required.
[note]
Also increase font-patcher version.
Fixes: #1249
Reported-by: Huifeng Shen <liaoya@gmail.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Casks without zap stanza are flagged; all casks should contain them.
The font casks do not really need zap.
[how]
What is the right way to say 'we considered zap, but do not need it'?
It seems that other people add a comment (the same comment).
For example here:
https://github.com/Homebrew/homebrew-cask/pull/119090
And that seems rather widespread.
git/homebrew-cask/Casks$ git grep '# No zap stanza required' | wc -l
101
Include the same in our casks.
[note]
https://github.com/Homebrew/homebrew-cask/issues/88469
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
After changing something in the patch process it is unclear if all the
prepatched fonts will look ok later. It would be nice to produce one
font from each input font (and not the complete set of each of the faces
of that font) to have some hopefully representative example how symbols will
blend into the font.
[how]
Add a script with explicit list of representative fonts.
Evaluate the config.cfg and execute one patcher run.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The config.cfg settings can be wrong if the to-be-patched font does not
set its own. The previous settings are never cleared, so that the flags
leak into the next font(s).
This is only relevant when the run is not parallel (i.e. no -j given) and
all fonts are patched sequentially in the same shell.
On parallel runs (like the release process) this is not a problem
because each patcher runs in its own subshell.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The Seti and Custom icons are smaller than in ancient Nerd Font versions
and can seem a bit flimsy. In fact we add about 25% of padding (12% left
and 12% right) to each icon, which seems a bit generous.
This does not show in Nerd Font Mono fonts, because the icons will be
rescaled there, but in the other fonts.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Just run ./generate.
Compare commit
7764e05 Create new octicons.ttf (update to v18.3.0) (2/2)
Fixes: 1213
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Maybe it is not a good idea to always create the log file, as most
people will never look into it. The main reason for it was the
gotta-patch-em script so that one can check after lots of runs what the
details were.
[how]
Introduce parameter to --debug option.
0 = no debug output
1 = log to file only (previously always selected)
2 = log to stdout only
3 = log to file and stdout (previous default for --debug)
Just specifying --default equals now --debug 2.
The gotta-patch-em runs now with --debug 1.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Compare commit
7d265161f Make Symbols-Only webfonts available stand alone
Suggestion via Gitter by @Mikle-Bond
Suggested-by: Michael <Mikle_Bond@mail.ru>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
With v3.0.0 we removed some icons and some codepoints have been reused
for a different (expanding) set. We want to show the old (removed) icons
correctly and the new ones also, so we need the old and the new font for
the webpage and reference it accordingly.
For the a new style .nfold (read: nd-olf) is introduced and utilized.
See pairing commit in the gh-pages branch:
Date: Thu May 4 06:01:33 2023 +0200
Update cheat sheet WITH removed icons
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some sourcefonts, even that are monospaced, have a `fi` and/or `fl`
ligature that maps into one cell. That looks very strange.
[how]
Partially revert commit
148b0c445 Sunset ligature removal
for the cases that have a one-cell `fi`, `fl`, etc ligature, or a `ldot`
related ligature - that is active by default. Discretionary ligatures or
Stylistic Sets are not changed.
Do the removal on all patched fonts for consistency, not just `Nerd Font Mono`.
[note]
On Noto different subtables are needed for Sans, Serif and Sans-Mono. We
can not set up different configs for each, so all are tried in all fonts
and might fail (this is normal).
Same holds for OpenDyslexic Alta, Regular, Mono, Bold...
Fixes: #1187
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
No casks are created.
We have no "Complete" in the path anymore.
And there is no Windows Compatible.
[how]
Drop all the now-unneeded filtering.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If we do not have a license file an error will be output, but the
complete script will continue and return success.
[how]
Set mode to exit on error.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When running without -j the README.md files are not created.
[how]
Allow scripts to be run with any PWD.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The destination has been purged too often, thus loosing already newly
patched fonts.
[how]
Always quote variables in shell tests :->
Fixes: 1182
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The Bold font is bad?
The repo is not maintained?
[how]
The ComicShannsMono is not monospaced ... fix it.
It has Overlapping contours ... fix it.
Create a useful BOLD face.
This was originally PR #1004
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
After all the renames.
Keep the webfont filename the same as before because ppl might use it
directly.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we run gotta-patch-em with -c the font files and the licenses will
end up in check-fonts/ and not in patched_fonts/.
Since gotta-patch-em calls standardize to add the readmes, the readmes
will always end up in patched_fonts/, even on check runs.
[how]
Add option to standardize, that transports the destrination tree root.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Since we do not have any other variations anymore it does not make sense
to keep that directory. The renaming with 3.0.0 is a good point in time
to drop it as the filename scheme changes anyhow.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We have no license files in the patched-fonts dir.
Sometimes we have no README.md either.
[how]
Well, fix code for extradeep directory structures.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The intend was to drop 'Sans Mono' in the renaming process, because the
name is just too long.
ERROR: VeraMono-Italic.ttf ====-< Shortening too long PS family name: BitstromWeraSansM Nerd Font Mono -> BitstromWeraSansM Nerd Font Mon
ERROR: VeraMono-Italic.ttf ====-< Family (ID 1) too long (32 > 31): BitstromWeraSansM Nerd Font Mono
[how]
Include the whole name in the replacement pattern.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The license of Bitstream Vera requires patched fonts to contain neither
"Bitstream" nor "Vera" in the name. It explicitly requires that also
for fonts that (only) add some glyphs.
Yes, we are rather late to notice this :-( Sorry.
[how]
Rename Bitstream Vera to BitstromWera, and also drop the Sans Mono part
of the name. The new name looks and sounds similar enough to get the
reference, while being shorter and somewhat logical.
Fixes: #1173
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The variation lists are very long and noone will ever look at them.
Instead we have a font-info.md file, for what reasons?
[how]
Replace the function the font-info.md file had with README.md.
Drop all the variation lists.
Automatically call the readme creation in the gotta-patch-em instead of
just hinting that one should call that (standardize-and-complete-readmes.sh).
[why]
The file is a mix auf indentation via two blanks and single tabs.
Tabs usually render as 8 positions.
Also it is strange to not-stick to one indent style.
[how]
<vi>:
:set ts=2
:set et
:retab
:wq
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When creating the readmes the config.cfg are checked for details on a
possible RFN renaming. There are specific variables that need to be
filled in these cases: config_rfn and config_rfn_substitue.
The same RFN information is already stored in the fonts.json database.
Having the information stored in two locations is always problematic and
can easily lead to inconsistencies.
[how]
Remove information from config.cfg file and use data stored in
fonts.json instead.
Drop config.cfg files that are empty afterwards.
Also fix some patchedName in fonts.json en passant.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
A lot of fonts have a wrong RFN statement and name substitude in their
created info file, for example IBM3270:
```
--- a/patched-fonts/3270/Condensed/font-info.md
+++ b/patched-fonts/3270/Condensed/font-info.md
@@ -1,6 +1,20 @@
# 3270
+## Why `Anonymice Pro` and not `Anonymous Pro`?
+
+What's in a name? The reason for the name change is to comply with the SIL Ope
```
[how]
The rfn information is stored in the config.cfg files - i.e. variables.
They are reset if the next font does not have a config.cfg file; but
they are not reset if the next font DOES have a config.cfg file but does
not set anything.
Reset the values before reading the config.cfg file.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The special Hack postprocessing does this:
* Add a dummy signature
* Set fsType to zero
* run ttfautohint on the font
There once has been reason to do this (probably), but on currently
supported fontforges this is not needed anymore.
* Fonts run fine without the signature
* fsType is anyhow zero, set by fontforge
* the preexisting hinting is kept by fontforge
(furthermore: We do not want hints for the symbols usually)
Double-checked source and patched font with ttx, instructions (hints)
are definitively existing and equal in the patched font.
So we do not need any of this special postprocessing anymore.
See also commit
e9d84b6c0 Adds WIP scripts and logic for post processing patched fonts (WIP for fixing #70)
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit does the actual update of the octicons.ttf font file.
The script to update is 'generate'. It uses the mapping file from the
previous commit to create a new compatible font.
Some icons have meanwhile been dropped. We use their codepoints for new
icons.
Also fix a little bug in the GlyphInfo writer.
Following the output of the actual script run.
$ ./generate feature/update-octicons ● 1 … 5 ⚑ 5
Reading mapping file
Found 172 entries
Fetching octicons archive "v18.3.0.tar.gz"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 550k 0 550k 0 0 504k 0 --:--:-- 0:00:01 --:--:-- 919k
Unpacking octicons archive
Found 576 svgs
Found 309 icons after de-duplicating
Renamed cloud-download -> download
Renamed cloud-upload -> upload
Renamed clippy -> paste
Renamed mail-read -> read
Renamed primitive-dot -> dot-fill
Renamed primitive-square -> square-fill
Renamed settings -> sliders
Renamed dashboard -> meter
Renamed trashcan -> trash
Renamed paintcan -> paintbrush
Missing octoface
Missing keyboard
Missing gist
Missing file-text
Missing file-pdf
Missing jersey
Missing radio-tower
Missing repo-force-push
Missing mail-reply
Missing arrow-small-right
Missing gist-secret
Missing no-newline
Missing arrow-small-up
Missing arrow-small-down
Missing arrow-small-left
Missing file-symlink-directory
Missing circuit-board
Missing watch
Missing text-size
Missing ellipses
Missing plus-small
Found 151 (of 172, missing 21) and new 158
Filled in missing, remaining new 137
Appended remaining new, total new mapping 309
Generating octicons.ttf with 309 glyphs
Generating GlyphInfo i_oct.sh
Finished
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Because we do not know if a complete family of fonts has an italic face
we must always assume it does. To get clean RIBBI families in ID1/2 we
create a different family for the oblique slant.
But that is not needed if the font does not have an italic slant, but
just an oblique one (like Bitstream Vera and descendants).
[how]
Add new command line option for font-patcher that specifies if the
family of fonts should be patched under the assumption that there might
be an italic face (default), or if we are sure there is none (and we can
leave oblique in the RIBBI group).
This is then applied to the config.cfg files.
Note that this does not take into account any other of the known_slants.
But they are not encountered in any of our prepatched fonts.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Oblique is not detected correctly anymore.
[how]
With commit
ae656bad8 name-parser: Further formalize style handling
'Oblique' has been taken out of the direct 'known_names' which has been
replaced by a more detailed list of known name parts. It ended up in
known_slopes.
But known_sloped is not taken into consideration as 'weight' when parsing
the font name - no it ends up in 'rest'.
This has been obviously overlooked.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>