1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-19 20:12:52 +02:00
Commit Graph

1852 Commits

Author SHA1 Message Date
Fini Jastrow
bb8a59df50 font-patcher: Whitespace cleanup
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:31:30 +01:00
Fini Jastrow
da5dffb8f9 Fix Pomicons license
[why]
Pomicons changed their licence from CC BY-NC-ND 3.0 to SIL 1.1 here:

fedf571f29

[how]
Change text.
I'm not shure which one we would call our most restrictive source now,
so remove that paragraph.

[note]
Fix whitespace error en passant.

Fixes: #1143

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 11:52:58 +01:00
Fini Jastrow
3dde174ca5 CI: Fix: Add font with references
[why]
The font is not available on the Github Workflow VM.

[how]
But we have it in the repo anyhow...

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 11:37:18 +01:00
Finii
bbb81d285a [ci] Update FontPatcher.zip 2023-03-10 10:07:25 +00:00
Fini Jastrow
376e39e513 CI: Add font with references
[why]
We had a bug that font-patcher crashes with fonts with references.

[how]
Just try such a font with all fontforge versions. Just tests if it
patches, the patch result is not checked.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 11:03:18 +01:00
Fini Jastrow
4a3ca9069d font-patcher: Fix crash with older fontforge
[why]
If a font has references in glyphs that we want to add to the essential
set of glyphs, and fontforge is old (i.e. 2020*) the patcher crashes.

[how]
The fontforge function glyph.references returns a three element tuple in
current fontforge (i.e. 20230101). But older versions skip the selection
bit and return only tuples of two.

As we use only the first tuple element we do not care about the 2nd and
possible 3rd element(s) and just thrash them.

Fixes: #1142

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 10:43:55 +01:00
Fini Jastrow
8d315f467c Fix access rights
[why]
For some unknown reason some files have the execute right bit set in
git. That is neither needed nor recommended.

The *.cfg files are pulled in with `source`, so they do not need to be
executable.

[note]
Example command to check
    find . -perm /111 -type f

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-08 08:39:15 +01:00
Finii
3026885788 [ci] Update FontPatcher.zip 2023-03-02 14:07:33 +00:00
Fini Jastrow
f84a4a46d2 font-patcher: Add Codicons scale list
[why]
All glyphs of the codicons set are individually maximised in size.
That leads to the curious condition that 'circle small' looks bigger
than 'cicrle' (because the line width is scaled up more -> looks bold).

Also some other 'subsets' look ugly and can not be used together.

[how]
Add appropriate ScaleGroups.

For the circles we also include one full-size circle as reference. To
get less than maximal scale for the small circles.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-02 15:04:48 +01:00
Fini Jastrow
368ba3444b generate-css: Create a json database with css names
[why]
Somebody might want to have a file where all symbols we add are listed.
At the moment there are only the i_*.sh scripts and the CSS files. Both
are rather unwieldy.

[how]
Just create a json file with all symbol names, like the CSS file.

Fixes: #448

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-02 12:44:21 +01:00
Finii
5d57dbe9a0 [ci] Update FontPatcher.zip 2023-02-23 17:16:55 +00:00
Fini Jastrow
90be3f4264 font-patcher: Scale all Material Design Icons individually
[why]
The Material Design Icons have for sure pairs of glyphs that people
would like to have scaled identically. Because the sheer number of
glyphs and because they are already very nicely and uniformly scaled
within their design space the MDI at the new codepoints where all scaled
the same with taking the theoretical design space as ScaleGlyph.

But that means all icons get scaled a bit smaller than before, where we
individually scaled each Material Design Icon to fill the cell.
This lead to numerous complaints.

[how]
We take a different approach now, more conventional maybe. Especially in
the light that the older bigger icons will get dropped; and people love
them.
So the uniform scaling is ditched and the individual scaling is used.

Fixes: #1061
Note: https://github.com/greshake/i3status-rust/pull/1728

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-23 18:14:09 +01:00
Finii
50e0f8247b [ci] Update FontPatcher.zip 2023-02-21 14:25:33 +00:00
Fini Jastrow
a23e33ca87 font-patcher: Allow anonymous fonts
[why]
When the font has no name the patching fails.

When there is no name we fall back to filename parsing, so it should not
fail.

[how]
Check if we have a name. If not do not try to set it.

[note]
Also change type checks to isinstance() calls.

Fixes: #514

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-21 15:22:44 +01:00
Fini Jastrow
cbec0064b5 test-powerlines: Add more glyphs and colorize
[why]
The last missing powerline-extra glyphs should also be in this set.

The intermediate line's color is not visible in some terminals.

[note]
Also fix that E0CF is shown twice.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-18 17:09:35 +01:00
Fini Jastrow
c899778ad4 test-powerline: Allow for 2 cell wide glyphs
[why]
When testing 'Nerd Font' fonts (i.e. symbols may be 2 cells wide),
the output does not take that into account and does not insert
the needed blanks.

[how]
Because the actual width can not be easily determined add a
parameter (just add anything as parameter) to switch some glyphs
to two cell mode. These glyphs are in a list, i.e. hardcoded.

If the widths in non-Mono fonts is ever changed this script needs
to be adapted.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-18 10:20:38 +01:00
Fini Jastrow
23502d630e test-powerline: Enable use with old bash
[why]
On MacOS Ventura the unicode codepoints are shown instead of the actual
glyphs.

[how]
On that OS the bash is rather old and does not have the unicode escape
sequence \u. As it is rather hard to convert it to octal UTF8 we instead
embed simply the concrete characters, as done in the i_*.sh scripts.

Note: zsh on that OS does have it, though.

[note]
I'm no Mac expert, just trying to get this working.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-18 09:58:34 +01:00
Fini Jastrow
4d74a51f12 test-powerline: Fix wrong wave glyph
[why]
The left side wave is also used on the right side.
The right side wave is never shown.

[how]
Well,...

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-18 09:57:08 +01:00
Fini Jastrow
a4e4e8e85b Remove obsolete license file
[why]
We have the same file in the repo, once with the ending 'TXT' and once
with the ending 'txt'.

This raises an issue on case-insensitive file systems.

[how]
The original in src/unpatched-fonts has the lower case ending.
So drop the capital letters one.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-18 08:09:54 +01:00
Finii
ff87dd69a9 [ci] Update FontPatcher.zip 2023-02-17 10:50:26 +00:00
Fini Jastrow
afa6abe0d9 archive-font-patcher: Write commit hash instead of tags in readme
[why]
In the CI we have only a shallow clone of the repo, so access to tags is
not possible. Instead of resulting in a nice message like '2.3.3-35' we
get an empty string.

[how]
As we have no tags we can only write the commit hash and other
information given in the only existing (i.e. last) commit:
date, author, title

It's a bit more cumbersome but one can still see from which point in the
repo the archive has been created.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-17 11:44:13 +01:00
allcontributors[bot]
55b6e087c9 docs: update .all-contributorsrc 2023-02-17 10:06:37 +01:00
allcontributors[bot]
2428efe292 docs: update CONTRIBUTORS.md 2023-02-17 10:06:37 +01:00
Finii
3daed4a72f [ci] Update FontPatcher.zip 2023-02-17 09:02:40 +00:00
Fini
2d20402792
Merge pull request #1044 from b-/release-master-fontpatcher
Create FontPatcher.zip in repo up-to-date with master
2023-02-17 09:59:33 +01:00
Fini Jastrow
31cae9d07d archive-font-patcher: Include version in readme
[why]
If we create the zip file not only on releases we need some better
version information inside.

We can not use the same approach with real releases, because we add the
tag at a later stage in the workflow.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-17 09:56:31 +01:00
Fini Jastrow
d563f56ab0 Cleanup zip-release
[why]
Some changes to bring it in line with the other workflows.

[how]
Sorted from short to long:

* Name all steps
* Correct trigger
* Remove unused output
* Simplify zipcmp decision
* Use apt instead of apt-get
* Update upload-artifact action
* Remove some trailing whitespace
* Remove name from artifact to prevent strange double zip name
* Use ordinary checkout instead of sparse - we need it anyhow to commit

[note]
Ok, 'simplify zipcmd decision' that might be matter of taste.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-17 09:56:31 +01:00
Fini Jastrow
bc59f01e78 Rename archiver script
[why]
It is not really a release, it is just a convenience for people that
want to download the current master patcher with all accessories.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-17 09:56:31 +01:00
bri
9411186bbd add zipcmp conditional 2023-02-17 09:56:31 +01:00
bri
b4fb18369d On push to (specific paths within) master 2023-02-17 09:56:31 +01:00
bri
be8c8d55f5 let's change things, a lot 2023-02-17 09:56:31 +01:00
bri
27bfc9ad5a release master fontpatcher.zip 2023-02-17 09:56:31 +01:00
Fini Jastrow
0b04391b77 font-patcher: Fix center alignment of ScaleGroup
[why]
When a ScaleGroup's combinded bounding box is wider than the target font
cell the actual X position of a glyph in the group depends on it's own
bonding box and not of the combinded bounding box. When doing center
or right alignment.

[how]
'Overwide' ScaleGroup glyphs are correctly placed and shifted in
position, but that would mean a negative left side bearing (i.e. glyph
extends to the left into previous 'cell').
We do not want that and it is later corrected for all glyphs. But that
is done on an individual glyph level and it is just left aligned for its
concrete bounding box (i.e. left side bearing is set to zero).

The dilemma here is that you can not really center a (combinded) glyph
within a cell, when
* the cell is smaller than the glyph
* a left bearing is not allowd

So we change the algorithm here that 'center' and 'right' alignment
mean:
* Center the glyph in the target font cell
* But if that would create a left side 'overhang' (bearing) just left
  align (move it as far left as possible without creating a negative
  bearing)

The only glyphs affected by this change are the very wide weather icons,
and here escpecially the moon phases F096 and following (target
codepoints E38E ..).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-15 21:39:16 +01:00
Fini Jastrow
68b381eac5 Fix weather icons cloud scaling
[why]
The scaling of the clouds is not identical but depends on the actual
glyph bounding box. But the clouds should all have the same scaling to
be 'interchangeable'

[how]
Put all clouds in a ScaleGroup.

Also add missing Celsius degrees glyph to other degree glyphs group.

Fixes: #1107

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-15 21:39:16 +01:00
Fini Jastrow
dfffc615ad font-patcher: Reform PowerlineExtra sizing
[why]
The Powerline extra glyph sizing is not really clear.

[how]
Make the triangulars 1 cell wide, as for example Iosevka also does.
Make the Legos 2 cell wide with pa scaling to make them look nicer.
Make the Hexagons 2 cells wide and keep their aspect ratio if possible.
Make small and big Squares also 2 cell wide and keep their aspect ratio
of possible.

For the small and big Squares add a tiny bit of border (negative
overlap), because they have no smooth border line over their open and
closed squares, and that might look strange if some touch and some dont.

Fixes: #1106

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-15 21:18:11 +01:00
Fini Jastrow
3e38c60f52 font-patcher: Fix BTB warning for SymbolsOnly font
[why]
When patching the Symbols Only font we derive the baseline to baseline
distance through abnormal means, so the check fails.

[how]
Set expected baseline to baseline value explicitely for the Symbols Only
font.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-15 21:18:11 +01:00
Fini Jastrow
40d82b0a0a generate-extraglyphs: Correct output
[why]
We print two times the name of the output font, and never the name of
the input font...

[how]
*cough*

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-14 10:11:24 +01:00
Fini Jastrow
869d6f9351 Allow for growing original icon set
[why]
We have an automation for adding glyphs to the original set.
If someone throws in the svg file and adds the glyph to the icons.tsv a
new original-source font is generated.

But the added glyphs are not patched in, because that would need a
change at font-patcher (adjust the end codepoint).

This can be forgotten easily.

[how]
The maximum codepoint of our own (original + seti) set is 0xE6FF. At
0xE700 the Devicons start.

The original-source generation script now checks the offset, they may
not be negative and on the positive end we may not leave our set-range.
If that happens the script fails thus the workflow fails.

Also increate the patch range in font-patcher. If there are no icons to
patch in the symbol font the codepoints are just ignored.

[note]
See also PR #1119

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-13 12:19:52 +01:00
Fini Jastrow
de659388e9 font-patcher: Remove leftover code
[why]
There is a bit of code that is not needed anymore (or was never needed).
This makes things look more complicated than they are.

[how]
1. It is plain wrong to write that we add one (1) glyph if we do not add
   any glyph.
2. One (1) is added to index later anyhow, so we do not need to distort
   the counting in the beginning (the code will run with index=1 for
   both the first and the second patched in glyph).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-13 12:19:52 +01:00
Fini Jastrow
882e04271e Drop support for Python 2
[why]
Python 2 is long since EOL.

With the last commit we want to use Enums, which are not available in
Python 2.

I believe Python 2 broke some time before already, I stopped caring for
Python 2 some time ago.

This does not change any existing code. It just documents that there are
no efforts anymore to support Python 2.

This is PR #1121

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-12 17:30:31 +01:00
Fini Jastrow
62b972b431 font-patcher: Fix: Use WIN metrics in all conflicting cases
[why]
With commit
  621008773  font-patcher: Use WIN metrics in all conflicting cases
we intended to use the WIN metrics for the baseline to baseline
calculations for fonts that have contradicting (i.e. broken) metrices.

But we use the TYPO metrics instead.

[how]
This is obviously a typo in the code. To prevent such errors and improve
the readability we use Enums now. I believe we silently dropped support
for Python 2 some time back. And if not we drop it today :-}

[note]
Many thanks to Nathaniel Evan for again finding this bug!

Mentioned in: #1116

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-12 17:06:18 +01:00
Fini Jastrow
b112fe12de font-patcher: Fix: Fix line gap redistribution
[why]
With commit
  e69a025a8  font-patcher: Fix line gap redistribution
we fixed the wrong adding instead of subtraction of the bottom gap part
from the descenders.

At least this was done for HHEA and TYPO values.

With WIN values the descenders have positive (!) numbers, so the sign
was not changed for the WIN case.

But that is wrong, as we are already in the ymin xmax coordinate system
(and took the negative of the WIN descenders). So of course here also we
need to subtract and not add.

Mentioned in: #1116

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-12 17:06:02 +01:00
allcontributors[bot]
468b2b974f docs: update .all-contributorsrc 2023-02-12 16:00:15 +01:00
allcontributors[bot]
b31f617a40 docs: update CONTRIBUTORS.md 2023-02-12 16:00:15 +01:00
teatimeguest
773cafb7cc font-patcher: Make sure nf-custom-asm and nf-custom-v_lang icons are included 2023-02-12 15:59:59 +01:00
allcontributors[bot]
bde5c7def1 docs: update .all-contributorsrc 2023-02-12 00:25:01 +01:00
allcontributors[bot]
9eb6dba6d9 docs: update CONTRIBUTORS.md 2023-02-12 00:25:01 +01:00
Fini Jastrow
e69a025a8d font-patcher: Fix line gap redistribution
[why]
Instead of redistributing the line gap we remove it.
At least when HHEA or TYPO metrics are used.
It's ok with WIN metrics.

[how]
If we have negative numbers for a gap and want to add more to it, where
'add' means 'make it more', we must of course _subtract_ the value.

But baseline-to-baseline code into function so we can check it after all
our gymnastics for correctness. It means the metrics.

[note]
Also correct out-of-sync comment.

Fixes: #1116

Reported-by: Nathaniel Evan <nathanielevan>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-12 00:24:36 +01:00
Fini Jastrow
59c5cb5a1f font-patcher: Patch in heavy angle brackets
[why]
The heavy angle brackets (276E and 276F) are used for a lot of prompts,
but we do not yet patch them in and a lot of fonts do not bring them
themselves.

[how]
One time rip the glyphs out from Hack and patch them in always, but
careful (do not replace existing glyph).
We take the whole set 276C - 2771.

[note]
Usually we should never again need to run the generate-extraglyphs
script, we rip them out now and they look good. Whatever Hack does with
new versions we can follow but that is optional.

Related: #1110

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-10 16:41:00 +01:00
Fini Jastrow
d083aa6540 docs: Improve self-patching instructions
[why]
A lot of issues arise here. Running through fontforge instead of direct
seems to be more compatibe across setups.

Fixes: #284

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-04 11:54:14 +01:00