Commit graph

1792 commits

Author SHA1 Message Date
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
Fini
32f1a0ad6b
Merge pull request #1086 from ryanoasis/feature/intermediate-versions
font-patcher: Use git version tag for font version
2023-02-02 16:46:36 +01:00
Fini Jastrow
07a42fcb98 font-patcher: Use git version tag for font version
[why]
When changes are made to the font-patcher and fonts are patched with
that version we can not see which patcher has been used in the fonts
afterwards.

Would be good to have the usual version-patchversion number in the fonts
in these cases (i.e. `v2.3.3-7` for 7 commits after `2.3.3`).

I did this manually before, but it is always a hassle.

[how]
If the font-patcher is run directly from a git repo and git is installed
we try to get the latest tag version including patch number.

If and only if that is successful and that version is 'newer' than the
version encoded in the font-patcher script the git version is trusted
more.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-02 16:37:45 +01:00
Fini Jastrow
ed6488c33b font-patcher: Fixup: Set Panose on "Nerd Font" variants
[why]
Forgot to push these changes to the PR #1099.
They are just 'more output'.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-02 11:43:11 +01:00
Fini
3eed4574bd
Merge pull request #1099 from ryanoasis/bugfix/panose-on-standard-variant
Bugfix Panose on "Nerd Font" variants
2023-02-02 11:00:39 +01:00
Fini Jastrow
7007410afb Publish contributors after allcontributors
[why]
After adding a contributor with allcontributors the website is not
updated.

[how]
Obviously there is a setting if a dependant workflow should be started.
Set that value to 'true'.

Also fix commented-out section of workflow triggers for 'release', that
should not be triggered by allcontributors, when that is commented-in
again (if ever).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-02 07:52:14 +01:00
allcontributors[bot]
151aa370f0 docs: update .all-contributorsrc [skip ci] 2023-02-02 06:21:23 +01:00
allcontributors[bot]
87bac5f599 docs: update CONTRIBUTORS.md [skip ci] 2023-02-02 06:21:23 +01:00
Micael Jarniac
716589f5e6 Fix minor typo
The period on `Option 7.` was outside the code block.
2023-02-02 06:19:43 +01:00
Fini Jastrow
122bbae54b font-patcher: Set Panose on "Nerd Font" variants
[why]
Some fonts have invalid (or unset) Panose flags. When we create a "Nerd
Font Mono" font the Panose proportion is set to 'monospace'. This
make the font selectable in certain applications that need monospaced
fonts.

After #764 the "Nerd Font" variant shall (again) be detected as
monospaced font, but the glyphs have a big right side bearing (hang into
the next 'cell'). So we need to set the Panose bits there also.

[how]
We already have a check if the font is propably monospaced, independent
from Panose. This is used to prevent --mono patching on originally
proportional fonts.

If we find out with that check that the font is (most probably)
monospaced we also set the appropriate bits in Panose; unless Panose has
valid values that contradict that change.

Fixes: #1098

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-01 18:19:19 +01:00
Fini Jastrow
cdd64ae8a1 Remove old script duplicate
[why]
query_monospace is newer.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-02-01 17:53:12 +01:00