Commit graph

289 commits

Author SHA1 Message Date
Fini Jastrow
28dd7f2679 Revert "DEBUG: "commits
[why]
The commits needed to be in the master branch, but that is protected, so
we can not force push the commits away after debugging.

Revert "DEBUG: Show directory contents"
Revert "DEBUG: archive-fonts.sh"
Revert "DEBUG: Add more of original workflow"

This reverts commit 40f6990282.
This reverts commit 9e3fdefeba.
This reverts commit 5e8b8c6ed5.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-24 13:49:32 +01:00
Fini Jastrow
8a749ab210 patch-em-all: Fix missing licenses
[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>
2023-01-24 13:42:09 +01:00
Fini Jastrow
00752430e3 gotta-patch-em-all: Rename repo-root-dir variable
[why]
The name `parent_dir` is a bit misleading and not precise.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-24 13:38:46 +01:00
Fini Jastrow
d9a2f1ad28 gotta-patch-em-all: Simplify pathnames
[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>
2023-01-24 13:38:46 +01:00
Fini Jastrow
1bada00ed6 gotta-patch-em-all: Allow initial -i runs
[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>
2023-01-24 13:38:46 +01:00
Fini Jastrow
5e8b8c6ed5 DEBUG: archive-fonts.sh
[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>
2023-01-24 00:16:09 +01:00
Finii
62842ec851 [ci] Bump release version 2023-01-23 14:41:11 +00:00
Fini Jastrow
337a2a2759 Update sankey diagram
[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>
2023-01-23 12:40:10 +01:00
Fini Jastrow
50a1893171 Correct i_xxx.sh
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-19 08:32:00 +01:00
Finii
1cc7631da3 [ci] Bump release version 2023-01-17 19:02:09 +00:00
Finii
e3051ccfa6 [ci] Rebuild original-source font 2023-01-17 17:05:27 +01:00
Fini Jastrow
e5d835080e Drop 'IBM' from 3270's names
[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>
2023-01-17 15:44:20 +01:00
Fini Jastrow
b52f0a7cb1 Fix 3270 naming
[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>
2023-01-17 15:31:59 +01:00
Fini Jastrow
fec587385a Update mononoki to 1.5
Mononoki is now a RFN; but under conditions mentioned in [1]
we can use that name for the patched font.

[1] https://github.com/ryanoasis/nerd-fonts/issues/575#issuecomment-1385308049

Fixes: #575

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-17 13:28:27 +01:00
Fini Jastrow
e6c01bc5fb Fix Cheat Sheet for new MDI [skip ci]
[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>
2023-01-16 23:48:35 +01:00
Fini Jastrow
f922619734 gotta-patch-em-all: Drop explicit combinations list
[why]
The list is very long and has very little meaning.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 21:37:37 +01:00
Fini Jastrow
be04d53d85 gotta-patch-em-all: Fix --info
[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>
2023-01-15 21:22:14 +01:00
Fini Jastrow
69e8c0e033 Add current Material Design Icons
[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>
2023-01-13 12:59:53 +01:00
Fini Jastrow
7cb227c7e0 Rename "Material Design" to "Material Design Legacy"
[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>
2023-01-13 12:59:53 +01:00
Fini Jastrow
5ec943aa13 Update generate-glyph-info-from-set to Python 3
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:59:53 +01:00
Zach DeCook
91ae09a203 material design icons: Update documentation 2023-01-13 12:59:53 +01:00
Fini Jastrow
6f0b1fbf4f doc: Better document how the Cheat Sheet is generated [skip ci]
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:07:50 +01:00
Finii
4c76918895 [ci] Rebuild original-source font 2023-01-13 10:47:20 +00:00
Fini Jastrow
e97e7959d6 font-patcher: Fix unexpected 'Book' SubFamily
[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>
2023-01-13 08:41:47 +01:00
Fini Jastrow
8d78b63764 gotta-patch-em-all: Fix --help option
[why]
Somehow the option is mentioned but not implemented.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 16:33:37 +01:00
Fini Jastrow
129e114ddf gotta-patch-em-all: Reactivate parallel processing
[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>
2023-01-06 08:32:48 +01:00
Fini Jastrow
257d6882fa Make output less verbose (with option)
[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>
2023-01-06 08:32:48 +01:00
Fini Jastrow
3c4fa008c1 gotta-patch-em-all: Add options to simplify patcher testing
[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>
2023-01-06 08:32:48 +01:00
Fini Jastrow
40ded7c2f0 gotta-patch-em-all: Create all fonts with unified release timestamp
[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>
2023-01-06 08:32:48 +01:00
Fini Jastrow
a577d7261a gotta-patch-em-all: Switch to proper parameter handling
[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>
2023-01-05 20:02:18 +01:00
Fini Jastrow
f448eba396 gotta-patch-em-all: Fix unfiltered (all) patch run
[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>
2023-01-05 20:02:18 +01:00
Fini Jastrow
0e434c2b9a generate-font-image-previews: Fit svg canvas to drawing [skip ci]
[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>
2022-12-19 21:19:29 +01:00
Fini Jastrow
2597b4ef3f generate-font-image-previews: Generate Symbols Only preview
[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>
2022-12-19 21:09:29 +01:00
Fini Jastrow
7aa717a05e generate-font-image-previews: Cleanup
[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>
2022-12-19 17:07:20 +01:00
Fini Jastrow
3b1329aefb CI: Fix: Automatically deploy webfonts [skip ci]
[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>
2022-12-16 19:08:53 +01:00
Fini Jastrow
aef01c4f4f CI: Automatically deploy webfonts [skip ci]
[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>
2022-12-16 17:14:30 +01:00
Fini Jastrow
4fba05a738 CI: Keep i_seti.sh in sync with autogenerated font
[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>
2022-12-16 12:23:16 +01:00
Fini Jastrow
3b93c99637 casks: Fix cask generation for 'deep' archives [skip ci]
[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-1351170552
https://github.com/Homebrew/homebrew-cask-fonts/pull/6758#issuecomment-1350791208

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-14 18:49:32 +01:00
Fini Jastrow
4a9282743a casks: Correct some variables to local
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-14 16:30:02 +01:00
Fini Jastrow
762be5b638 CI: Add new workflow to create all casks [skip-ci]
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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
1cbe7a1813 generate-casks: Decouple from patched-fonts dir
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
c5cb976db8 generate-casks: Simplify jq call
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
a1c9300076 fetch-archives: Decouple from patched-fonts dir
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
44629bf663 fetch-archives: Add option to specify release tag
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
2c7c1f53f5 casks: Fix ProFont
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
a4500e21a8 fonts.json: Correct Meslo name
[why]
It is in fact Meslo LG that we consume and produce.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-14 09:45:59 +01:00
Fini Jastrow
d5d35456e9 casks: Fix naming of Symbols Only font
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
5cda467ce3 casks: Improve cask names
[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>
2022-12-14 09:45:59 +01:00
Fini Jastrow
dd75219729 Add script to download release artifacts
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-14 09:45:59 +01:00
Fini Jastrow
9da563c54a casks: Finalizing touches
Add some more documentation / comments.
Increase version number.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-14 09:45:59 +01:00