Commit graph

1376 commits

Author SHA1 Message Date
Fini Jastrow
b83d1cfacb Create NerdFontsSymbolsOnly with proportional widths
[why]
The commit
  59c45ba4e  Remove negative bearings on 2048-em glyphs
has been introduced to fix some problems with the symbols only font, at
least from the commit message.

That font is intended to be used in font-fallback situations, and so we
do not know the advance width of the current font anyhow. It does not
make sense to enforce an advance width with these.

[how]
Create the NerdFontsSymbolsOnly as if 59c45ba4e would be still in
effect, i.e. with variable advance width.

[note]
There have been a lot discussions about the reverted commit, some can be
found here:
* #900
* #764
* #731

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:36:51 +02:00
Fini Jastrow
63db683b1a font-patcher: Add possibility to generate proportional font
[why]
Theoretically we can produce 3 types on fonts:
* A: Strictly monospaced font
* B: Allow bigger symbols, but advance width still monospaced
* C: Allow bigger symbols, advance width will vary

All have their uses.

Historically Nerd Fonts produced A and B.
Then we had kind of a breaking change with 2.2.0 that it produces
now A and C.

The commit
  b9b7a5080  Revert "Remove negative bearings on 2048-em glyphs"
restores the old (pre 2.2.0) behavior. But the type C fonts can be
useful, so maybe we can have them as option?

[how]
Add commandline option to be able to create all fonts types:
* A: specify -s or --mono or --use-single-width-glyphs
* B: specify nothing
* C: specify --variable-width-glyphs

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:36:32 +02:00
Fini Jastrow
1bb174e6bd Revert "Remove negative bearings on 2048-em glyphs"
This reverts commit 59c45ba4ef.

[why]
The commit breaks the non-mono Nerd Fonts for a lot of people.
The issue was not very good documented and investigation can not be
seen.

For the TITLE it should have affected only the 2048-em Symbols only
font, but in fact all patched fonts were changed. Maybe that was
intended, maybe not.

[how]
This will make the advance width again equal for all glyphs.
This enables the use of the non-mono variant in more terminals.
For wider symbols a space is now (again) needed after the symbol.
That is expected by a lot applications.

[note]
See Pull Request 764 for more details.

See next commits for alternative solution for original problem.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:32:09 +02:00
Fini Jastrow
110d19853c CI: Reduce running time
[why]
The CI runs takes hours... 4 to 5?

[how]
With the recent changes we can half the number of patcher runs, because
we can create a normal and a Windows Compatible font version from one
patching process.

The export is done twice still (just the actual patching is avoided),
so the reduction will be less. But still!

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:15:00 +02:00
Fini Jastrow
df5702427a Update all readme files
[why]
The options in the translations are rather old for some.

[how]
Reorder stuff, and add new items with english description, because,
well, I can not translate. But better to have it in english there then
to miss it.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:15:00 +02:00
Fini Jastrow
98b28c8f3d font-patcher: Add possibility to generate normal and Windows font in one go
[why]
The normal and the Windows Compatible fonts differ just in the naming.
The patching is all the same.

For the CI we patch the original font for each output font. That is not
needed if we just want to create two differently named exports.

Skipping the patching where it is possible would save some time. Not
half the time, but the patching process itself is not too quick either.

[how]
Backup the original font names (as we need them again to deduce the new
Windows Compatible names).

Then do the patching once and the export twice, if parameter is given.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:15:00 +02:00
Fini Jastrow
3c3e2a49a7 font-patcher: Split code into more functions
[why]
The patch() function also does the font generation. This makes it
impossible to generate two fonts from one patch run.
(Will be needed in next commit).

The name setup could be done later.

[note]
This is no functional change, just reordering.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:15:00 +02:00
Fini Jastrow
35d3cfeff5 font-patcher: Fix generated font name output
[why]
After generating the patched font only a shortened name is displayed.

[how]
Obviously the two output lines were swapped...

If the fullname is None, and then output the fullname? :-}

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-01 12:15:00 +02:00
Fini Jastrow
51b99e0a7a CI: Disable cask creation (for now) [skip ci]
[why]
After discussion with
https://github.com/Homebrew/homebrew-cask-fonts/pull/6167#issuecomment-1229152446
I assume we would never use this in CI.

It can be helpful for new fonts, but even then they suggest using the
tools provided (i.e.`font-casker`):
https://github.com/Homebrew/homebrew-cask-fonts/blob/master/CONTRIBUTING.md#automatic-generation

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-30 10:57:44 +02:00
Fini Jastrow
6c2d3ec752 CI: Fix cask artifact upload
[why]
The casks-artifact is empty.

[how]
Supply the correct path for the upload.
For this the generator script prints the output pathname(s),
which in turn are used in the CI.

Also drop unneeded '/' from path end.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-30 10:46:51 +02:00
Finii
de9bb5b9bf [ci] Rebuilds patched fonts 2022-08-26 22:19:18 +00:00
Finii
aff362ab36 [ci] Bump release version 2022-08-26 22:15:32 +00:00
Fini Jastrow
b772df2c7f Trigger Release 2.2.1
This is a hotfix for #895, which broke all `Mono` fonts.

Sorry :-(

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Fini Jastrow
b71a9e474b Fix: Monospaced fonts wrong width
[why]
With commit
  821ac6817  Create symbols only font directly from sfd template

we have a default width for source fonts without a width (i.e. empty
fonts).

Unfortunately the detection for 'empty font' is wrong.

[how]
Reorder the commands such that we have a meaningful calculation.

Maybe this has been broken by too many (manual) rebases.

Fixes: #895

Reported-by: redactedscribe
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Mickaël Bourgier
a334db4180 Add nerd-fonts-hack AUR package to readme 2022-08-26 19:31:48 +02:00
Fini Jastrow
8d5db15856 doc: Update AUR links in translations of readme
[why]
The AUR list has recently been updated with
  889a74148  doc: Reorder AUR packages
  f81b39fab  List AUR packages for Jetbrains & Victor Mono

but the translation have not been updated.

[how]
Unfortunately ... translating is a bit over my head, so I just add the
English text everywhere and someone native might report it :-/

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Fini Jastrow
75ce899201 CI: Mark release "draft" while creation
[why]
We create the release packages one by one in a lot of jobs. Whenever a
job is ready it adds its package to the release.

This means that the release starts with one archive and grows over the
next 5 (!) hours. (Noto takes about 5h to patch.)

But people will be notified and find the new *unfinished* release, which
can raise questions or problems.

[how]
Mark the release 'draft'.

Unfortunately I can not find (quickly, now) a way to un-draft the
release so this has to be done manually. Maybe it is better anyhow, so
that one can edit the release message etc.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Fini Jastrow
f4f19ea0e1 CI: Fix hopeless-docker prevention
[why]
I am sure I tested it and it worked. Well, it does not, it throws an
error message
  Unrecognized named-value: 'secrets'

[how]
Secrets can not be used in the `if`, see
https://github.com/actions/runner/issues/520

But they can be used in `env`, ... so do it there.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Finii
fa78ea2ab0 [ci] Regenerate fontconfig 2022-08-26 16:56:33 +00:00
Finii
c934b492ec [ci] Rebuilds patched fonts 2022-08-26 16:48:45 +00:00
Finii
572221ec32 [ci] Bump release version 2022-08-26 16:44:55 +00:00
Fini Jastrow
c5b8b55f68 Trigger Release 2.2.0
A release is desperately needed.
This includes work from the last year or so.
See also #881

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 13:04:55 +02:00
Fini
f90b12ba8e
Merge pull request #892 from Finii/improve-ci
Improve CI process for releases
With merge request to have the complete overhaul in a closed context.
2022-08-26 12:53:28 +02:00
Fini Jastrow
1d6aa1748d CI: Prevent docker release when hopeless
[why]
On forks for example they might have a docker repo associated or not.
The release process is run in any case and will fail in that cases.

[how]
Check that at least the secret is known.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 11:34:07 +02:00
Fini Jastrow
43b5af6271 CI: Fix docker release trigger
[why]
The docker image should be rebuilt whenever a file that will end up in
the container has been changed. So this needs to be in line with the
.dockerignore file.

[how]
Add missing (new) `font-patcher` sub-scripts.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 11:30:27 +02:00
Fini Jastrow
a777d53008 CI: Use jq to process package.json
[why]
`grep` and `awk` do not know json. This might break if some format
changes or whatever.

[note]
The font matrix setup is also with `jq`.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:45:11 +02:00
Fini Jastrow
e972eb0785 CI: Prepend release tags with a "v"
[why]
Usually release tags and versions start with a "v", and we also had that
up to 2.1.0:

$ git tag -l
2.2.0-RC
FontPatcher
v0.1.0
v0.1.1
v0.1.2
v0.2.0
v0.2.1
v0.3.0
v0.3.1
v0.4.0
v0.4.1
v0.5.0
v0.5.1
v0.6.0
v0.6.1
v0.7.0
v0.8.0
v1.0.0
v1.1.0
v1.2.0
v2.0.0
v2.1.0

[how]
In the files we keep the non-"v" version numbers, but the tags on github
shall be prepended with a "v" like "v2.2.0-RC".

The variable RELEASE_TAG_VERSION is renamed to RELEASE_VERSION to make
clear that this is not the name of the tag.

Where we reference a tag, "v$RELEASE_VERSION" is used.

[note]
One of the environment variable is not needed, we can use the output directly.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:44:28 +02:00
Fini Jastrow
039f5baffe CI: Allow releases on package.json change
[why]
The release workflow is triggered on a lot occasions, but not on changes
of the package.json file. But that file contains our version number and
when we change it we should create a new release. At least is that how I
would imagine it working.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
3c78eb7f09 CI: Make commits from the action stand out more
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
967036e731 CI: Fix fontconfig and casks
[why]
The fontconfig and cask generation seems unfinished or broken.

[how]
Fix the point in time when the fontconfig is generated and commit any
changes back to the repo.

Generate the casks and store them as CI artifacts at least.
Probably they should be uploaded to the cask repo (on 'real' releases)?

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
c292e7e8c6 generate-fontconfig: Create sorted config
[why]
Even when the logical content does not change we will get a new commit
on recreation because the order can/will be different.

[how]
Put the fonts in alphabetical order in the config file.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
4c69402911 generate-casks: Fix separation of non-mono and mono fonts
[why]
The filter expects 'Mono' to be the last part of the font filename. With
font-patcher's --makegroups that is not the case anymore, because in
fact 'Mono' is part of the font name and the font filename ends in the
style (i.e. 'Italic').

[how]
Because we do only create 'Complete' fonts, and 'Mono' is always after
'Complete' (i.e. 'Complete Mono') for both veriants created by the
font-patcher, we can use that to select mono fonts.

[note]
Also bump script version after several changes.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
e188061e04 generate-casks: Fix display of currently processed font
[why]
The script shows
  # [Nerd Fonts]  Generating cask for: .
for any font it processes.

[how]
Well, the variable naming is a bit strange, maybe that is the reason for
the bug? We already have the font name in another variable, use that.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
e7af933fdf generate-casks: Allow to specify pattern
[why]
The CI uses the script with the font-matrix name, to regenerate the cask
of just one font. But the script is ignoring the parmeter and generates
all casks.

[how]
Allow to specify a regex pattern as first parameter and limit the
processing to that font(s), as done in archive-fonts.sh

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
e7722458fc archive-fonts: Fix missing readme in archive
[why]
When run on more than one font the mini-readme is only added to the
first created archive.

[how]
Remove the readme file only after all archives have been generated.

[note]
Also rewrite `find` command, to actually do some work. The formulation
was rather odd, using a shell glob to find the directories and `find` to
select one.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
bc87b361a2 CI: Prevent rolling release on normal releases
[why]
The release CI is run every time something is pushed to master. This is
useful if we are on a release candidate. The release will be updated.

But if we do a normal release and afterwards push some new commit to
master - before we update the version in the package.json to a RC - the
actual (fixed) release will also be updated.

[how]
Determine if we have a

* new normal release
* new prerelease
* updated prerelease

and run the release process itself only in that cases.

[note]
The release is checked for via API instead of an action, because the
typical action needs a complete checkout (works on the local git repo).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:31:57 +02:00
Fini Jastrow
fcdb7b04f5 CI: Advance tag after adding commits to release
[why]
When people check the repo out at a release tag they expect to get all
the files that are IN the release.
But we add the patched fonts and the version-bumped scripts only
afterwards.

[how]
Just overwrite (shift) the tag after everything is finished.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 19:47:11 +02:00
Fini Jastrow
9a33516649 CI: Add names for some steps
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
f5a9a007da CI: Simplify checkout for matrix setup
[why]
We check the whole repo out, just to set up the font matrix.
All data is thrown away afterwards. That takes needless time.

[how]
Just check out the two files we really need for the setup (the script
and the database).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
abdae7bb01 CI: Strip blanks from release tag version string
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
a57403f833 CI: Centralize release version determination
[why]
We need the release tag version in all jobs.

[how]
Instead of determining it in every job again and again (with the same
code) we set an output in the first job and reuse it everywhere.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
aa48eea360 font-patcher: Show script version on run
[why]
We show only the Release version of the patcher script. Often it is
unclear which particular script people are using.

[how]
Also show the script version. This is a bit frickle, as it needs
developers to change the number manually (as with all other scripts in
the project that have a script version), but so be it.

This could be replaced by the 'current' git hash. But that has the
drawback that one needs to search for the commit to see how old the
script is.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
7b81d7c84a CI: Fix version bump
[why]
This can not work.

Issue 1:
It is unspecified in which order the font matrix jobs run, so the
version number changes somewhen.

The changed (version-bumped) files are never committed and written back,
so this would have to be done manually anyhow.

The version-bump script itself has issues because the regexes for the
change are a bit too loose and other version like strings are changes
also (like the Script Version).

Issue 2:
The script changed versions that should not be changed like the script version
in the scripts (rather than the NF release version).

In bin/scripts/generate-glyph-info-from-set.py pumping has been
forgotten/omitted completely.

[how]
In the version-bump script:
* Use more modern regex
* Instead of copying the code use a loop

Create a commit with the bumped version information in all scripts.
This can only be done with the final job, because we have a problem to
checkout the modified version with actions/checkout.

We need to bump the version on every patch job, because we need the correct
information already in the script when we patch.

[note]
This does not prevent to have multiple commits attempts that change to the same
version. But if the change is empty, no commit will be added and the
step is silently ignored.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
d2b94f557b CI: Use GH action to upload release files
[why]
The self-written upload-archives script is some issues, for example it
does not replace preexisting release files with new ones when a release
is re-triggered. The error messages are rudimentary at best.

[how]
Use https://github.com/softprops/action-gh-release instead.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
f2ed019e63 CI: Remove outdated steps
[why]
Fonttools, FreeType, and HarfBuzz are not used in the CI job.
Propably a leftover from thomething done in the past?

[how]
Because I can not find out the reason WHY they are there the lines are
kept and just disabled. This leaves a nice 'stub' for git blame in the
file.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:22:27 +02:00
Fini
d08f9932c6
Merge pull request #806 from ryanoasis/feature/ci-use-2022-fontforge
CI: Include newest fontforge release in tests
2022-08-23 09:43:36 +02:00
Tor Arne Vestbø
6acec45622 font-patcher: Ensure PostScript font name does not contain spaces
When pulling the subfamily out of the sfnt_names SubFamily property,
we will get a subfamily with possible spaces, e.g. 'Bold Italic'.

When constructing the final unique font name (PostScript name), we
need to remove those spaces, to make the font name valid, otherwise
the font will fail validation with a warning when installing.

Fixes #413
2022-08-23 09:27:19 +02:00
Fini
ccc6f4e546
Merge pull request #887 from avalonv/master
List AUR packages for Jetbrains & Victor Mono
2022-08-23 08:46:50 +02:00
Fini Jastrow
889a74148d doc: Reorder AUR packages
And include a link to the AUR package search, because we do not list all
packages but only some.

Make nerd-fonts-git more prominant and list together with the other
'all' packages.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-23 08:36:29 +02:00
Fini Jastrow
2e15c65192 Rebuilds patched fonts [skip ci]
This is a simulated CI run, because only Caskaydia Cove is affected all
the latest changes - and a complete run takes a ridiculous amount of
time.

Done via:

./gotta-patch-em-all-font-patcher\!.sh /CascadiaCode

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-22 15:43:47 +02:00