[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>
[why]
It's not nessecary to shorten the PSname so much when no shortening is
in place otherwise. This has been thought of as a good idea, because
noone really cares about the PSname and we can avoid any problems. But
checking with the current set of sourcefonts and using the current
shortening options, keeping it longer is never a problem.
It would be a problem for the Fullname ID4 before, and so we always
shorten more.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The systematic evaluation of all fonts is finished and we do not need
any comparison with the old naming anymore.
This can partially replaced by something like
NERDFONTS='--debug --dry --makegroups 1' ./gotta-patch-em-all-font-patcher\!.sh -cv /iA-Writer | grep '==='
[note]
Also update query_names helper to what I used recently with length
indicators.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We have both
iA Writer Duospace
iA Writer Duo S
These are the same fonts, Duospace is just the former name of Duo S.
Duospace is version 1.005
Duo S (and Mono and Quattro) is version 2.000
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
It is hard to grep for all naming related errors, because there is no
common format.
[how]
Make them also visually similar and error cases easily spotted.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
After skipping the creation of 'Windows Compatible' fonts we have room
to finally add 'Nerd Font Propo' to the release patch sets as first
class citizen.
[note]
Also add undocumented feature that environment variable $NERDFONTS can be
used to supply additional or differing options (last option wins).
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The fonts generated with --makegroups work on all platforms, so there is
no need for options --windows and --also-windows anymore.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some fonts have so long base names that we can not, even very
abbreviated as 'NF', add the Nerd Font designator anymore.
In this case we need to rename the font even if it has no RFN just to
make it shorter.
[note]
As '(TTF)' is dropped now from Terminus we do not need to handle it
specifically anymore.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We use a prepatched font not the original Anonymous Pro.
The prepatched font contains no bitmaps and is thus like
Anonymous Pro Minus. Also some font internals that fontforge does not
copy out of the box are differing.
And we miss the Bold and Italic variants.
[how]
Crossgrade to original Anonymous Pro as source and add the missing
weight/style.
Add Anonymous to SIL.
Handle 'Pro' naming parts (do not detect 'r' as short for 'Regular').
[note]
Maybe related: #1174
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If the font name is changed in a way where it now ends in a blank (for
example because 'Name Momo' got 'Momo' dropped: 'Name '), that blank is
not removed immediately.
Well, it is later on, but anyhow.
This can only happen on malformed SIL entries. But we want to have a
correct replacement anyhow.
[how]
Remove trailing whitespace after replacements.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
CodeClimate does not allow 'complicated' functions. In a previous commit
we added more if-s to a function that afterwards was rejected by
CodeClimate. To fix that the if-s have been replaced with arithmetic.
That is
a) less readable than if-s
b) has a bug
[how]
Change the code back to if-s but put them into yet another function.
Hopefully we do not blow up CodeClimate's maximum number of functions
per file limit now...
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The shortened name is not as expected "BigBlueTerminal437 Nerd Font"
but some obscure "c7 Nerd Font".
[how]
The backreference marker `\1` is directly in front of the string `437`
which yields the replacement `\1437`. Python is not smart enough to
correctly handle that (but 'sed' for example is).
Instead use a named backreference which does not clash with the
following digits.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we have a weight/width that can take a modifier, and a modifier is
present we always take the shortest form of the weight/width.
This is not how it is customarily done.
Experienced:
ExtraCondensed ExtraBold -> ExtCd ExtBd
Expected:
ExtraCondensed ExtraBold -> ExtCond ExtBd
[how]
In case a modifier is present:
Use the shortest form for weights.
Use the longer short form for widths.
[note]
Also circumvent CodeClimate issue by replacing if-s with formulas.
And adding one nonsense entry to the data tables, because they were
too 'similar' :rolleyes:
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We want to keep "Nerd Font" in the font name if possible and instead
shorten the weight part with accepted abbreviations. But these abbrevs
are hard to read and sometimes a more mild abbreviating might be
sufficient to get the desired name length.
[how]
Introduce a new shortening method for the weight parts of a family name.
It takes a longer word (often un-shortened) when a weight stands on its
own, but when a modifier is used together with the weight the more
aggressive two-letter abbreviations are used.
That new shortening method becomes the default and all the functions get
a new parameter to enforce completely aggressive shortening, i.e. always
use the shortest possible form.
The new way to shorten is exposed all the way out to the font-patcher
user who can select the shortening method as parameter to the
--makegroups option. That option is undocumented because I expect some
changes later on, still.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some name parts occur in several fonts but they take too much length
that we need to add 'Nerd Font' to the font name.
This can be handled as 'generic' SIL table parts, but the algorithm
stops searching for replacements one it has found one.
[how]
Always evaluate all rules of the SIL table.
Add entries for generics to the SIL table.
Add rule for BigBlueTerminal (437TT).
Also fix rule for MPlus that underwent a naming change with its update.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
In a lot fonts when Oblique is moved to the base part of the name the
family gets too long. Since the base part is never shortened it will
stay there and make some fonts will end up with too ong bas families:
DejaVuSansMonoOblique
IosevkaTermOblique
OpenDyslexicOblique
ProggyCleanOblique
[how]
If the name is shortened, take the short form of oblique and add that to
the base name.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The name parts of a font are rather restricted in length. Most
systems/applications do not have any problems with long strings, but
some will complain or ignore such fonts.
At the moment each font needs to be checked individually manually after
patching for length violations, which is hard.
[how]
Issue a message if one name in longer than endorsed.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The outputs while patching are very ad-hoc and not grouped
systematically.
If run via gotta-patch-em the output is hard to process afterwards
automatically.
[how]
Use the logging module which outputs the messages and also writes a
run-log with all vital information.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Cognitive burden of shorten_style_name() is 13 (allowed 9).
Duplicate code
if self.use_short_families[1]:
weights = FontnameTools.short_styles(weights)
styles = FontnameTools.short_styles(styles)
[how]
I do not really buy the duplicate code issue (but circumvent it anyway).
shorten_style_name() was really hard to grasp, maybe use of a helper
function makes it more readable.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The old naming is the reason for a lot problems. It creates a lot of
duplicate names and breaks bigger font families.
[how]
After introducing --makegroups we now enable it for all fonts.
Remove special cases from config.cfg files.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We created two fonts, one 'normal' and one 'Windows Compatible'. The
later one used shorter names because there are some Microsoft
applications that can not work with long (family-) names.
But it would be better to have universally usable fonts, like all our
sourcefonts. It would reduce confusion and also reduce the size of
installation packages.
[how]
ID 1 (Family) family()
Unchanged
Take the short form font name. Appends depending on mode short or long
weight.
ID 2 (SubFamily) subfamily()
Unchanged
Transmogifies Oblique to Italic.
Returns long form styles (i.e. RIBBI)
ID 4 (Fullname) CFF.Fullname fullname()
Take the short form font name (instead of long).
Depending on mode take short or long styles.
This is now in line with ID 4 = ID 1 + ID 2
ID 6 (PS Fullname) CFF.FontName psname()
We limited the length to 31 characters, which is sometimes too short
to have different names for fonts of one same family.
Now we take the short forms of name suffix and styles, for example
VictorMonoNFM-BdIt
ID 16 (Typogr. Family) preferred_family()
The name itself is unchanged (short form name plus verbose suffix),
but the suppression check has been fixed to really compare the
resulting name with the ID 1 name.
ID 17 (Typogr. Subfamily) preferred_styles()
This is unchanged (long form styles) but the suppression check has been
fixed to really compare the resulting string with ID 2.
CFF.Familyname ps_familyname()
Uses ID 16 now and ID 1 as fallback. Was always ID 1 before, which is
wrong.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Specifying an empty string as prefix unexpectedly does not enable short
family names for all fonts - but for no font at all.
Usually an empty prefix matches all strings (font names).
This makes it hard to enable short families for all fonts no matter
what.
[how]
Fix detection if the prefix is False or a string.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>