[why]
If the license file is not in the same folder as the font file or its
parent directory it will not be copied.
Example:
├── AUTHORS.txt
├── config.cfg
├── copyall.sh
├── Ligatures
│ ├── Bold
│ │ └── JetBrainsMono-Bold.ttf
│ ├── BoldItalic
│ │ └── JetBrainsMono-BoldItalic.ttf
├── OFL.txt
└── README.md
When processing one font file (.ttf) the OFL.txt is neither in the same
nor in the parent directory (but rather in the parent's parent.
[how]
Collect all license-ish files for a complete font set and copy them all
over each other into all appropriate destinations in patched-fonts.o
Note that in situations like this:
├── fonts.dir
├── fonts.scale
├── L
│ ├── Bold
│ │ └── Meslo LG L Bold for Powerline.ttf
│ ├── config.cfg
│ └── LICENSE.txt
├── LICENSE.txt
└── README.rst
All LICENSE.txt files will be copied, but only the last one will 'win'.
So make sure all license files are identical.
Fixes: #1068
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
For some reason we work with strange paths like "root/a/b/../../c/d/e"
instead of "root/c/d/e".
[how]
Use dirname to go directories up.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When running with --info on a completely empty patch-destination some
directories are missing and are never created. They would have been
created by the actual patching that is suppressed now.
[how]
Check and create the needed subdirs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Somehow the license file is missing from the release run.
It is present if I run it on the local machine.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We added a lot of glyphs in Seti + Custom and the new range Material
Design Icons.
[how]
Create new graphics with generator, see README.md.
Use Inkscape to implant into old image.
Note:
In the totals just the new Material Design Icons are included, the old
(obsolete, to be removed) range is not counted at all anymore.
Also did not change the distribution of the diagram. When we would
create a real sankey diagram (with the actual numbers) all the other
sets would be dwarfted by the new Material Design Icons.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The font was always called 3270.
Having a big company's name in the fontname is scary 😬
See
https://github.com/rbanffy/3270font/issues/60
[how]
Add renaming rule.
Fixes: #1012
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Somehow the `IBM 3270 SemiCondensed` font turn out as
`IBM3270Semi Nerd Font Condensed`.
The 3270 font always had the quirk to have a non-standard style with a
dash. We have specific code to circumvent that.
[how]
After updating 3270 the 'Narrow' had been renamed to 'Condensed' and so
our specific patch did not work anymore.
Adapt the regex to find the new style that needs correction.
[note]
https://github.com/ryanoasis/nerd-fonts/issues/1012#issuecomment-1385497230
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Although commit
69e8c0e Add current Material Design Icons
claims that we updated the Cheat Sheet after adding the new Material
Design Icons, that actually did not happen.
[how]
Add new MDI's i_*.sh file to all. That is used by the generate-css that
also generates the cheat sheet web page.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The info-only option broke with the latest changes.
[how]
Set something to the variable that determines the info only mode.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Material Design Icons has grown quite a bit.
[how]
Add the icons at their original position which is in PUA1.
Use the desktop font instead of the webfont.
Add cheat cheat file.
Fixes: #365
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We want to differentiate between the old, problematic Material Design
Icons (problematic because we map them to unicode blocks that we should
not), and a future new and updated set of Material Design Icons.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.
[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.
Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.
[note]
This was only a problem with the old naming engine. --makegroups got
this right always.
Fixes: #1046
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The messages from parallel font-patcher runs can be very confusing, so
it has been disabled some time ago (without a comment in that commit?!).
However, if someone wants to repatch multiple fonts on a local machine
it might be beneficial to run more than one process to have work on all
cores.
[how]
Add option to select multiple processes in parallel.
Limit the amout to 8, which might be a good value for typical end-user
machines with 4 cores and 8 threads.
Patching Cascadia Code (12 fonts) took these times on my machine:
1 job: 21m 55s
4 jobs: 6m 24s
8 jobs: 5m 14s (this runs 8 and then the remaining 4)
16 jobs: 4m 48s (this runs 12 in parallel)
Adding a proper `-j` that takes a numeric argument is rather too much
work for my taste, so we stick with 8 for now.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Running gotta-patch-em-all creates a lot of output that is most likely
not wanted.
[how]
Add --verbose option to gotta-patch-em-all.
Hide debugging information unless it is wanted by specifying this option.
Also change font-patcher to produce less verbose output and respect
--quite in more places.
This includes a change that we try to tweak the font flags only if
source and destination font are ttf or otf, because we can not read the
other raw font files anyhow.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When working on the font-patcher the developer needs to test the changes
on a number of fonts. This is usually a manual call of `font-patcher`
and afterwards a 'diff' of the newly created font with the 'old' font in
the patched-fonts/ directory with fontforge (which has a font-compare
option).
If you run gotta-patch-em-all normally the newly generated font will
replace the existing font and git will ALWAYS show it as different. The
reason is that at least the timestamp in the generated font has changed.
Far more easy would be if the new gotta-patch-em-all run could keep the
previous timestamps, in that way one can immediately see that the old
and new fonts are bitwise equal (via git).
Furthermore if you expect a change and want to show the differences of
old and new font in fontforge you need both fonts in the filesystem.
But a normal gotta-patch-em-all run replaces the font. A different
destination folder would help here.
[how]
Introduce two new (independent) options to
a) keep the timestamp equal to previous patch run
b) generate the fonts in a different directory
While b) is straight forward, a) is a bit more complicated, esp because
filenames can change and so on. So the script examines just one (1)
random font in the specific font directory and uses its timestamp. In
most cases this is correct enough if the developer uses gotta-patch-em-all
consequently.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
All the fonts will have different timestamps, and within each font the
creation and modification date might also differ. That is quite
confusing and makes automated testing very complicated.
[how]
Use one date-time for ALL fonts and for creation and modification date
in the font file.
But do not change the date-time if we already set that somewhere before :-}
Also remove the 'special' properitary fontforge timestamp tables FFTM from
the patched fonts. This is only possible since FontForge 20th Anniversary
Edition.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Oh boy do I hate the boilerplate code needed with optargs, but without
it every parameter becomes a burden.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we want to patch all fonts by calling the script without any
options it fails.
[how]
Give the correct regex to find all directories.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The generated svg's canvas is far too big.
I remember shadowy that one had to resize the canvas manually...
[how]
Switch back from Actions to Verbs, because only there we can resize the
canvas automatically.
Note commit
3444b5755 generate-font-image-previews: Fix and Refactor [skip-ci]
Verbs seem to be still possible. There is currently no Action for the
same thing.
So we revert 3444b5755 to Ryan's original code (in principle) with the
same verbs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We do not have a preview for the Symbols Only font.
The Symbols Only font appears two times (with 1000 and with 2048 EM).
[how]
Remove one of the occurences of NerdFontSymbolsOnly in the fonts.json.
The font matrix (for CI) still works, and we get only one entry in the
fonts list on the gh-pages.
Change the entry details accordingly.
Create special svg template that includes lots of symbols.
Change the destination filename to be imagePreviewFont instead of the
patchedName + "Nerd Font". The website (gh-pages) expects the former
file names.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
There are two svg tempates, one with and one without Inkscape metadata.
[how]
The metadataless files is fine and opens ok in Inkscape.
There are no real differences between the two templates.
Drop the Inkscape one.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
From the name we used the non-Mono Symbols font for the webfonts. But in
the Cheat Sheet we want to display the icons all in nice boxes, all with
the same size. That is not the case for the non-Mono font, here all
glyphs are unscaled and thus do not match each other.
[how]
Use the Nerd Font Mono variant for the webfont, as the icons here all
have the same size and are surrounded by their bounding box, making
working with them a lot easier.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The webfonts are needed for the cheat sheet. When we update the sheet
code we probably need also new fonts.
The fonts might contain fixes also if there is no need for a new sheet,
so they have to be updated on every release.
[how]
Add mini-script that generates the woff's from the latest 'ttf'.
This makes it easier to check the woffs manually.
Let the workflow create the woffs, and push them to the gh-pages.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Although we automatically create a new up to date i_seti.sh on all
original-source.otf updates, we do not push it to the repo together with
the font.
[note]
Also include up-to-date i_seti.sh because the workflow will not trigger
until we have new icons and the font does actually change.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Normally the release zip files have a flat directory structure, i.e. all
files are in the base directory and there are no subdirs. The existing
subdirectory structure is removed on zip creation via `archive-fonts.sh`.
If the patch results have two fonts with identical name these flat
archives can not be generated. The `archive-fonts.sh` reports:
Could not create archive with the path junked (-j option) - likely
same font names for different paths, zip status: $zipStatus
Retrying with full path
But now the problem is only delayed. When the font file has the name
name the Family and SubFamily are most likely also the same for both
font files. If we install both the user (and the system) can not really
distinguish the font files anymore.
This turned up with [1] when doing a `brew style *nerd-font*` that
complains in fact about duplicate fonts to install. At that point we had
the additional problem that the subdir-path had been missing in the cask
files. So I'm not sure if it would work from a Cask standpoint (i.e.
font files are installed in subdirs).
Anyhow, this will fail when the user wants to select the font files,
because normally this is done on a Family-name basis. And identical file
name usually means identical Family-SubFamily.
Note that this ONLY happens with GohuFont, which has these subdirs:
11/complete
14/complete
uni-11/complete
uni-14/complete
The font has embedded bitmaps, but only one size. The "11" ones have
11px bitmap fonts and the "14" ones 14px bitmaps.
The "uni-" variant has much more glyphs.
Otherwise the differences are slim. From the font creation date the
"uni-" ones are newer.
[how]
Each font filename added to a cask is memorized. When the next fontfile
is to be added to the cask it is checked if we already have that
filename installed. Duplicates are then skipped.
If we have a deep archive, the fonts are added to the cask with full
relative path.
In case of Gohu that means the 11/complete variant is added (because all
files are alphabetically sorted before adding). By chance this is the
same variant that has historically been in the Cask, so no change here.
Fixes:
https://github.com/ryanoasis/nerd-fonts/pull/1008#issuecomment-1351170552https://github.com/Homebrew/homebrew-cask-fonts/pull/6758#issuecomment-1350791208
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Now we can create the casks of some specific release ('latest' in this
case) at will, based purely on the artifact files and on nothing in the
repo. We do not even need to fetch the repo.
This is still some kind of WIP, because we do not have the secrets and
not even a proper homebrew fork in our organization.
THIS WILL NOT WORK out of the box. Refer to PR #1008 to get instruction
on additional steps needed to make this run.
[note]
Remove cask generation from normal release workflow.
Later on the release workflow has to trigger the cask workflow.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
It does not really make sense to couple the casks, which checksums are
based on the zip files in the archive directory to files currently
existing in the repo. They could be different from the archived ones.
[how]
Use solely the archives. For this they must be unpacked temporarely so
that the fonts can be examined for family names.
We do not try to automatically determine the release tag of the archive
files. They could in principle we different for each. Instead it usually
has to be specified on the command line.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The json file is transported to jq via pipe AND as file.
That is not needed of course.
[how]
Just use the filename.
[note]
Also some whitespace changes.
Also remove debug output.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
It does not really make sense to couple the names of the download files
to some currently existing directories in the repo. They could be
different, especially if current version and requested version differ.
[how]
Complete rewrite. Fetch the release data from Github and examine the
release database.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
It fetches the release we did last, which can be a release candidate.
But we want the latest release, or some other specified one.
[how]
Add parameter for the version tag.
[note]
Also correct some docs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
ProFontWindows is missing from the cask, just ProFontIIx is included.
According to their documentation ProFontWindows has been created
specifically for MS Windows, but it can also be useful on Linux or
MacOS. [1]
[how]
Make the filter more strict, so that we only filter out our own Windows
versions and not all fonts that contain "Windows" in the name.
[note]
I'm not sure this ProFontWindows font is useful at all ;-}
[1] https://tobiasjung.name/profont/ paragraph "ProFont for Windows"
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The symbols only font has two entries in the fonts.json and that breaks
generation of the cask.
[how]
Do the queries on a 'first wins' strategy; ignore further entries in the
fonts.json.
[note]
I guess we should remove one of the two instances of Symbols Only from
the database; I have still not figured out why there are two distinct
entries.
And why there are two fonts at all 😬
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Sometimes the shortest Family is not a meaningful name, for example
iMWritingDuo
iMWritingDuospace
iMWritingMono
iMWritingQuattro
Obviously the shortest name is not adequate.
[how]
Instead we find the shortest word stem of the name. The common beginning
of all names. In the example above that is `iMWriting`.
If we have such a case we show in the name that there are multiple
families in the cask, by adding "families" to the name.
[note]
Also always capitalize the font name. Some fonts have a
all-small-letters name, but that seems a bit out of place and has been
changed with the manual naming (previously) already to Capitalized Name.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some fonts have different and not consistent Family names set,
especially (only) if the `--makegroups` option has not been used for
patching.
Example:
$ fc-query --format='%{family}\n' patched-fonts/Hasklig/Black/complete/Hasklug\ Black\ Nerd\ Font\ Complete.otf
Hasklug Nerd Font,Hasklig Black
See also previous commit's message, bottom.
[how]
We want to use only one of the Family names (fc-query reports all as
csv, unless we specify an index), so query one by one.
Check that it is 'our' name (that contains "Nerd") and not a leftover
from uncomplete patching.
[note]
Also whitespace change: One tab to spaces.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>