[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>
[why]
The code takes the FamilyName out of the first patched font file and
puts that into the cask name field.
This has two problems:
After we joined Mono and non-Mono fonts into one cask the first font
might be a "Nerd Font Complete Mono" and we certainly do not want that
FamilyName in a cask that also contains the non-Mono variants.
We have some fonts with more than one Family, for example
CaskaydiaCove Nerd Font SemiLight
CaskaydiaCove Nerd Font Light
CaskaydiaCove Nerd Font
CaskaydiaCove Nerd Font ExtraLight
Taking the first encountered Family name is most certainly not want we
want.
[how]
Examine all patched fonts and collect their FamilyName and use the
shortest of them, as that usually is the base stem.
This still fails for somem fonts, like Hasklug
Hasklig Black
Hasklig ExtraLight
Hasklig Light
Hasklig Medium
Hasklig Semibold
Hasklug Nerd Font
But that font's FamilyName is broken anyhow, note that the RFN renaming
does not really work consistently. It would be fixed by using
`font-patcher` with option `--makegroups`, which should become the
default soon.
This will be tackled by the next commit.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We want to replace the existing casks. But they do not have a consistent
way to name the casks. Sometimes blanks are preserved (as dashes):
"unpatchedName": "DejaVu Sans Mono",
"patchedName": "DejaVuSansMono",
"caskName": "dejavu-sans-mono",
The above looks like cask-name == unpatched-name.
Here they introduce blanks out of thin air (the original name does not
have blanks):
"unpatchedName": "DaddyTimeMono",
"patchedName": "DaddyTimeMono",
"caskName": "daddy-time-mono",
Here they add something to the name??!:
"unpatchedName": "Gohu",
"patchedName": "Gohu",
"caskName": "gohufont",
Here the cask-name follows the RFN renaming:
"unpatchedName": "Hasklig",
"patchedName": "Hasklug",
"caskName": "hasklug",
Here they do not follow the RFN renaming:
"unpatchedName": "Liberation",
"patchedName": "LiterationMono",
"caskName": "liberation",
And there are a lot more ... strangenesses.
I guess the casks have been created by different people following
different ideas.
[how]
All these inconsistencies makes setting up rules how to determine the
cask name from the other names very complicated and brittle.
If we want to preserve the existing cask names the simplest and most
stable approach is to explicitely specify them in the fonts.json
database:
Introduce a new data field "caskName", like shown above.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The existing Casks _all_ contain both the Mono and non-Mono variants.
I believe splitting would be a good idea, but that would break existing
uses.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
People might want to know how the original/unpatched font really is
called. This is done for most current casks.
[how]
Utilize jq and the fonts.json database to retrieve the name (which is
stored nowhere else). Put it in the parens in the name field.
Update some `unpatchedName`s.
[note]
Examples from current casks:
homebrew-cask-fonts/Casks$ find . -name '*nerd-font*' -exec grep " name" {} \; | sort
name "3270 Nerd Font (3270)"
name "Agave Nerd Font (Agave)"
name "Anonymice Nerd Font (Anonymous Pro)"
name "Arimo Nerd Font (Arimo)"
name "AurulentSansMono Nerd Font (Aurulent Sans Mono)"
name "BigBlue_Terminal Nerd Font families (BigBlue Terminal)"
name "BitstreamVeraSansMono Nerd Font (Bitstream Vera Sans Mono)"
name "BlexMono Nerd Font (IBM Plex Mono)"
name "CaskaydiaCove Nerd Font (Caskaydia code)"
name "CodeNewRoman Nerd Font (Code New Roman)"
name "Cousine Nerd Font (Cousine)"
name "DaddyTimeMono Nerd Font (DaddyTimeMono)"
name "DejaVuSansMono Nerd Font (DejaVu Sans Mono)"
name "DroidSansMono Nerd Font (Droid Sans Mono)"
name "FantasqueSansMono Nerd Font (Fantasque Sans Mono)"
name "FiraCode Nerd Font (Fira Code)"
name "FiraMono Nerd Font (Fira)"
name "GohuFont Nerd Font (Gohu)"
name "GoMono Nerd Font (Go)"
name "Hack Nerd Font (Hack)"
name "Hasklug Nerd Font (Hasklig)"
name "HeavyData Nerd Font (Heavy Data)"
name "Hurmit Nerd Font (Hermit)"
name "iMWriting Nerd Font families (iA Writer)"
name "InconsolataGo Nerd Font (Inconsolata Go)"
name "InconsolataLGC Nerd Font (Inconsolata LGC)"
name "Inconsolata Nerd Font (Inconsolata)"
name "Iosevka Nerd Font (Iosevka)"
name "JetBrainsMono Nerd Font (JetBrains Mono)"
name "Lekton Nerd Font (Lekton)"
name "Literation Nerd Font families (Liberation)"
name "MesloLG Nerd Font families (Meslo LG)"
name "Monofur Nerd Font (Monofur)"
name "Monoid Nerd Font (Monoid)"
name "Mononoki Nerd Font (Mononoki)"
name "mplus Nerd Font (M+)"
name "Nerd Font Symbols Template (Symbols Only)"
name "Noto Nerd Font families (Noto)"
name "OpenDyslexic Nerd Font families (OpenDyslexic)"
name "Overpass Nerd Font (Overpass)"
name "ProFont Nerd Font families (ProFont)"
name "ProggyCleanTT Nerd Font families (ProggyCleanTT)"
name "RobotoMono Nerd Font (RobotoMono)"
name "SauceCodePro Nerd Font (Source Code Pro)"
name "ShureTechMono Nerd Font (Share Tech Mono)"
name "SpaceMono Nerd Font (Space Mono)"
name "TerminessTTF Nerd Font (Terminus)"
name "Tinos Nerd Font (Tinos)"
name "UbuntuMono Nerd Font (Ubuntu Mono)"
name "Ubuntu Nerd Font (Ubuntu)"
name "VictorMono Nerd Font (Victor Mono)"
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
* Remove appcast
* Process fonts in alphabetical order
* Skip fonts where no checksum can be determined
* Add livecheck
* Add description
* Fail generation on any error in the script
[notes]
* The code to work without checksum (:no_check) did not work anyhow
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Several different indentations methods used here. That confuses me and I
want to edit this file.
[how]
Unify to '4 blanks' as used in other (recently edited) files.
Unify if-then and while-do syntax.
Also replace single quotes with double quite in the cask file.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some fonts in the readme source font tables are marked as 'no RFN' while
they infact have a RFN (and we act on that, so that is just a
documentation issue).
[how]
Also add updated fonts.json, that contains RFN information and correct
unpatchedFont names, compare gh-pages commit
4f78d656 download: Fix RFN detection
The updated fonts.json is also needed for an upcoming Casks creation
fix.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Old (renamed) license files are not cleaned up automatically.
The new files will be put into the patched-fonts dir, but old ones not
removed.
[how]
With commit
afd7ba10 patch-em-all: Purge destination dirs if possible
the script purges old font files from the patched-fonts directory to get
rid of renamed font files. This has been deliberately limited to ttf and
otf files.
But as all license files are automatically copied over we can also
remove them.
This (finally) remove the possibility to manually put any files in those
directories. This can be good or bad.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We have 'license' is the archives, but the 'licence' files are missing.
We allow all-caps and all-lowercase, but not camelcase 'License'.
Sometimes we have OFL.txt which is missing.
[how]
Enable both spellings and also camelcase.
Enable OTF text files.
Also fix misunderstanding of regex vs glob ([] vs {}), where the glob
needs a comma and the regex does not.
Add missing LICENSE files for 2 fonts.
Fixes: #979
Reported-by: Jeremy Thorn <moralground>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Keeping the ligature removal tables up to date with source font updates
is quite a maintenance burden.
Usually if a terminal supports ligatures at all it has an option to
disable them.
Present ligatures do not prevent monospaced fonts and monospaced
detection.
It was only present in v2.0.0, and the code has been broken with v2.1.0.
[note]
Updated example ligature removal table to the one for Iosevka.
Left stubs in relevant code passages to facilitate finding this commit.
Fixes: #976Fixes: #975Fixes: #973
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The description is displayed like this:
* Info: <description>
Sometimes the description text starts with lowercase, sometimes with
caps. This looks weird.
[how]
Always start the description with uppercase.
[note]
Also correct missing(?) description for one font.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Both, Ubuntu and Ubuntu Mono link to the #Ubuntu preview on
ProgrammingFonts.org. But that ends up in Ubuntu Mono. You can not
preview the proportional version.
[note]
This commit must be synched to branch gh-pages manually.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If we ever switch the default branch the links would break. So just say
'default branch' directly, whichever that may be.
[note]
CI workflows not changed, I do not know if there is an alias for the
default branch available.
Fixes: #971 (partially)
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
There is code that shall read the config file and act on
config_has_powerline.
Usually it is set to "1", but Ubuntu has this "0".
Regardless the content, if the variable has content the code assumes the
value is true. That is probably not wanted.
[how]
Use a numeric comparison.
[note]
```
git blame UbuntuMono/config.cfg
4abe6c77b0 Ubuntu/Bold-Italic/config.cfg (Ryan L McIntyre 2017-07-23 17:17:21 -0400 1) config_has_powerline=0
```
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When the source font is proportional we can not really create a
monospaced (patched) font from it. The glyph width is for example very
small for 'i' but wide for 'W'.
The glyphs are all left aligned, leaving very strange separation between
smallish glyphs.
Even if we would center the glyphs, the look would be strange and
completely differenmt from the source font's look.
[how]
For proportional fonts do not allow to patch with `--mono`.
The fact if a source font is monospaced is determined by examining some
(very few) glyphs. But testing all our source fonts in the repo shows
that it is sufficient.
Furthermore the Panose flag is checked and differences between the flag
and what the glyph examination found are reported.
The user can enforce `Nerd Font Mono` generation with double specifying
the command line option `--mono --mono`. Still a warning will be issued.
[note]
Because `gotta-patch-em-all-font-patcher!.sh` does not really count the
variations but calculates them in a separate loop it does not know
anymore how many variations are created per family. The numbers are
wrong.
But probably we should count the result font files in the end anyhow.
Because the information is not needed (in an automated manner) this is
not corrected here.
It seems wrong anyhow:
total_variation_count=$((total_variation_count+combination_count))
total_count=$((total_count+complete_variations_per_family+combination_count))
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
For some fonts with long names the fields are not long enough and for
example a 'Mono' can not be seen.
[how]
Use same field widths as `name_parser_test2`.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When the CI triggers a rebuild of the original-source and the font
contents is unchanged we do not want to commit the new version back to
the repo.
But because fontforge puts the creation date into the font file it will
always differ on every run, and we would needlessly create commits.
[how]
We could use the SOURCE_DATE_EPOCH approach and set the dates to the
relevant change (commit) times like so:
cd src/svgs
export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct -- *.svg)"
and only afterwards call the generator script / fontforge.
But that would need a complete git repo checkout and not just a shallow
one (which is faster and thus is used by github action/checkout).
Instead we can instruct fontforge to not put any timestamp into the
file. The timestamps are anyhow a fontforge proprietary extension.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Often the SVGs are rather detailed and result in a big
original-source.otf, which then again results in bigger than needed
patched fonts.
[how]
Typically people suggest using svgo to make SVGs smaller, but that just
tackles the representation of the icon, i.e. the actual svg file. That
does not help us at all. We do not need small svg files, we need simple
icons with few points and lines. svgo does not have that capability.
Instead Inkscape's 'Simplify' is used. Repeated use can destroy a glyph,
so we need a scale down margin to stop 'over-simplification'.
The values given for the margin at the moment are purely empirical, the
current glyphs survive repeated use of the new simplification script and
still look good.
The resultant original-source.otf file size is approximately similar to
the previously achieved by Ryan's manual work.
[note]
We need a newer Inkscape, thus update to Ubuntu 22.04
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we add a custom glyph (or want to update Seti) the process is
rather laborious and we are needed to change the font and the
accompanying `i_seti.sh` in sync.
[how]
We use a data file to map icon (svg) filenames to codepoints and
readable names.
That file is parsed and the font and info file is created (overwritten
in the repo); and could then be easily committed. This can be a CI
workflow.
Having a dedicated mapping file (`icons.tsv`) enables us to have stable
codepoints for the same symbol over time. Changes in codepoint
allocation can be checked in git.
Having the font autogenerated help guarantee that the icons are all
likely scaled. We rescale them all to the same size and mid-position.
That is not needed for font-patcher, because it rescales and shifts
again based on to-be-patched font metrics. But it certainly is better
for a view into the original-source font.
Sizes and position are still roughly equivalent to the hand positioned
glyphs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
With commits
ef8c12e28 Document and update cheat sheet data
bcef53dad Update cheat sheet
the README has not been updated, and i_cod.sh is still
listed as 'not existing'.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The script is not running with current (i.e. year 2022) release versions
of Inkscape.
The script does not warn if a font is not installed (and creates a
garbage preview instead).
[how]
Rewrite the script that is uses Inkscape actions instead of verbs. Verbs
are already removed in Inkscape HEAD.
Check if needed font is indeed installed.
Do not generate useless Symbols Only font preview (it needs a specific
different one, I suppose).
Disable `svgo`. Maybe we should generate PNGs instead?
Change path for created images, so that it is already correct for the
gh-pages and we could use the github-pages-deploy-action to publish them.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>