Commit graph

371 commits

Author SHA1 Message Date
Fini Jastrow
0c43738914 font-patcher: Remove debug output
[why]
Comes from a23e33ca87, should not have been included in commit.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:32:05 +01:00
Fini Jastrow
7f1b120fca font-patcher: Keep box drawing glyphs if we have all
[why]
If the to-be-patched font already has all box drawing glyphs we could
use them instead of our extra set from Hack.

But we need to scale them in case the 'cell' size has changed.

[how]
All the mechanics have been already added, we just need to enable it now
in the right cases.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:32:05 +01:00
Fini Jastrow
ff57585e51 font-patcher: Add box drawing glyphs
Fixes: #1108

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:32:05 +01:00
Fini Jastrow
d07f7253b9 font-patcher: Add possibility to just rescale existing glyphs
[why]
When the destination font has box drawing glyphs and we change the
'cell' size, we need to rescale the existing glyphs (so that they fill
the new 'cell'.

[how]
Add a new parameter attribute that skips the copying und just works on
the scaling of glyphs that have this.

For a correct message only the default attribute is checked.

[note]
This just add the possibility, it is not yet used.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:32:03 +01:00
Fini Jastrow
702e31716c font-patcher: Access the symbol fonts via unicode
[why]
The whole patching process addresses the glyphs via their unicode
number / codepoint. We ensure the adressability for the to be patched
font, but the symbol fonts can differ.

[how]
Just set the way we want to address the symbol font glyphs.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:31:30 +01:00
Fini Jastrow
80e818bf55 font-patcher: Allow xy scaling for ScaleGroups
[why]
All the box drawing glyphs should be scaled and shifted as one (i.e.
equally). For such glyph sets we have the ScaleGroups that handle it
nicely, determining a combined bounding box and calculation scale and
shift from that bounding box instead of the actual glyph's bounding box.

But unfortunately it is hard-wired to do just 'pa' scaling. For the box
drawing glyphs we need 'xy' scaling.

[how]
The preparatory stage calculates the 'pa' factor for ScaleGroups for us.
That is mainly so because the old system worked that way and has no
notion of combinded-bounding-box. The data needed to be stored in one
number, the scale. Later came the correct shifting, which needed the
bounding box. But the scaling still relied on the one scale factor that
is used for x and y.

Instead, if we have a combinded bounding box, we ignore the
precalculated scale factor and calculate a new set of x- and y-scales
based on the requested scaling algorithm. In this way we can get 'xy' or
'pa' or even 'xy2' scaling, or whatever we like, based on the combined
bounding box.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:31:30 +01:00
Fini Jastrow
1d7c4f7791 font-patcher: Issue warning on width irregularities
[why]
For some reason we determine the bounding box xmax value of the 'normal'
extended glyphs. For the cell size we use the advance width of those
glyphs - the xmax values is not utilized at all.

But if we would ever use it, it might be good to see that something
unexpected(?) happened.

This commit is not really necessary. Maybe it is good, maybe it just
adds noise. We can always remove it later.

No functional change.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-10 12:31:30 +01:00
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
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
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
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
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
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
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
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
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
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
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 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
a046d98349 font-patcher: Forgot to increase script version
This is important for the docker image so that we can easier see which
version the people use.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-28 15:46:10 +01:00
Fini Jastrow
202bca8be1 font-patcher: Fix empty lines output
[why]
When --quiet and --no-progressbar is given we get a lot of empty lines
in the output.

[how]
Just output the carriage return when we have output som eunterminated
stuff before.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-28 15:26:34 +01:00
Fini Jastrow
299fc76096 font-patcher: Do not destroy ligs or SS
[why]
When a certain 'higher codepoint' glyph is needed for a substitution or
ligature rule of a basic glyph and we replace the 'higher codepoint'
glyph with a symbol that stylistic set or ligature will be broken.

[how]
We can not determine if a certain glyph is the _target_ of a pos-sub
rule (at least I could not find a way). What we do is remove all pos-sub
entries that _start_ at a symbol-patched glyph [1], but that is not the
same.

Instead of walking through all substitution tables we just examine the
'basic glyphs' and also protect all glyphs that they reference through
most of the possub tables.

In fact I encountered only "Substitution" entries and never "Ligature"
entries, but we handle both alike. "Pair", "AltSub", and "MultSub" are
not handled, but could be added if need be.

[1] #711

Fixes: #901

Reported-by: Xiangyu Zhu <frefreak.zxy@gmail.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-28 12:41:28 +01:00
Finii
ab3f4f0585 [ci] Bump release version 2023-01-24 15:56:06 +00:00
Finii
62842ec851 [ci] Bump release version 2023-01-23 14:41:11 +00:00
Nathaniel Evan
e514906a9f font-patcher: Use list comprehension in refcheck
[why]
List comprehension helps with readability. Also add comments that
describe expected data structures of altuni and references. Also bump up
the patcher version number.

[how]
Use list comprehension. Add comments. Change the version number.
2023-01-23 08:12:15 +01:00
Nathaniel Evan
46e2fcf00d font-patcher: Optimize add_glyphrefs_to_essential
[why]
Using `continue` feels inelegant when there's a way to write the if
conditions in add_glyphrefs_to_essential() without necessitating the use
of `continue` while ensuring that the function still works as intended.

[how]
Change the `if` conditions and remove any usage of the `continue`
keyword in add_glyphrefs_to_essential().
2023-01-23 08:11:58 +01:00
Nathaniel Evan
cd6ae0ca92 font-patcher: Cover alternate unicode encodings
[why]
Issue #400 recently reoccurred with the latest build of Input font, and
it turns out the dotless-j part of the small `j` now points to U+0237,
which in turn has an alternate unicode encoding to U+F6BE; overwriting
U+F6BE effectively overwrites U+0237, and in turn, alters the small `j`.
This patch aims to fix that.

[how]
In addition to references, the patcher also checks for alternate unicode
encodings which are returned by the glyph.altuni attribute, adds those
to the essential set of glyphs, and in turn recursively searches for
their references/alternate unicode encodings, making sure to handle
circular references (for example: U+2010 and U+2011 in Input Mono)
2023-01-23 08:11:52 +01:00
Fini Jastrow
621008773c font-patcher: Use WIN metrics in all conflicting cases
[why]
When HHEA and (depending on USE-TYPO-METRIC) TYPO or WIN are not
consistent it is unclear which metric we should trust.

In #1056 the complete font bounding box (i.e. yMin and yMax) has been
compared to the baseline to baseline distances, and in all these cases
the WIN values seem to be best (preserve the glyph bounding box).

    font-line report fontname.ttf | grep metrics:
    ttfdump -t head fontname.ttf | grep "yM(in|ax)"

[note]
Roboto will still be clipped?! There seem to be ridiculously high glyphs
in there. Did not check which.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 17:21:16 +01:00
Fini Jastrow
04c682fd9c font-patcher: Rewrite font height calculation
[why]
The initial font-patcher used the WIN font metrics to determine the cell
height. What has been found was forced into HHEA metrics but without
observing the USE_TYPO_METRICS flag.
That has been changed to use the TYPO metric instead of the WIN metric
when the font wants that. For that the gap value becomes important.

This is the current code. It still has problems to detect the correct
cell height. A more rigorous approach seem to be needed.

[how]
The baseline to baseline distance is what we need as 'cell height', to
fill it completely with the powerline glyphs. This is a little bit
complicated and not really specified, each font rendering application or
engine can handle the font metrics differently. But there are some
common approaches.

So we try to come up with the correct and congruent height, comparing
different metrics and issuing a warning on problematic fonts.
Afterwards we make all metrics equal (even if they were not before),
because our goal is clear now and we impose it onto all platforms.

[note]
Useful resources:
* https://glyphsapp.com/learn/vertical-metrics
* https://github.com/source-foundry/font-line

Fixes: #1056

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 15:23:08 +01:00
Fini Jastrow
ce6c161281 font-patcher: Handle -l option in all metrics
[why]
The -l option tries to improve (especially) the powerline glyphs by
making the baseline to baseline height (cell height) an even number.
But it does so only for 2 of the three possible metrics.

[how]
Assuming the hight is identical for all metrics we just need to add '1'
to all ascender values.

[note]
I'm not sure this does anything. After rounding an odd height might
create a 'sharper' triangle tip, not an even height?
Do not understand the real reason for the -l option.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 15:21:09 +01:00
Fini Jastrow
5cc911e559 font-patcher: Use format for output
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 15:21:08 +01:00
Fini Jastrow
dd3ed4dc74 font-patcher: Fix Monofur 'Nerd Font Mono' too wide
[why]
Although Monofur is monospaced it has one glyph (hyphen) that is
slightly wider than all others. This results in a Monospaced font that
is slightly too wide.

[how]
Ignore the hyphen width.

[note]
Additionally improve (commented out) debug code (shows now hex
codepoint).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 14:53:21 +01:00
Fini Jastrow
326ccdf601 font-patcher: Improve monospace check
[why]
If a `Nerd Font Mono` font is to be created we need to make sure the
original font is indeed monospaced. If it is not and we enforce the same
adavnce width on all glyphs they will look very ugly. Fonts need to be
designed to be monospaced.

We spot check only some characteristic glyphs for that.

Hermit Bold has a problem. Although it looks more or less monospaced it
has some glyphs wider than all the others, for example the small letter
`m`.
Creating a `Nerd Font Mono` (a font where all glyphs have the same
width) will either: Add too much space to the right of all the other
(smaller) glyphs, or will have the wider glyphs cut off on the right.

[how]
Add small letter 'm' to the spot check list. Now the patcher will by
default refuse to --mono patch that font.

Also add output of first char that fails the monospace check. This makes
debugging easier.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-22 14:24:38 +01:00
Fini Jastrow
b942b12bf4 font-patcher: Improve warning on problematic mono patching
[why]
If a font is problematic to patch as monospaced font, that is detected
but the reporting is maybe not strong enough and gets overlooked.

[how]
Pull font property reporting into dedicated functions.
Use that function additionally in other warning.

[note]
The monospace check uses all glyphs to determine the advance width, but
the actual advance width later ignores some glyphs (that are problematic
in some fonts and are thus ignored, although that glyphs will 'break'
after patching).
This might or might not be useful, I just leave it as it was before.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-21 17:42:29 +01:00
Fini Jastrow
0c51571462 font-patcher: Remove obsolete comment
[why]
That feature mainlined since ... 2.2.0 or so?

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-21 17:42:29 +01:00
Fini Jastrow
7ef696a8b4 font-patcher: Fix: Fix more 'Nerd Font Mono' too wide
[why]
With commit
  99c260831  font-patcher: Fix more 'Nerd Font Mono' too wide

the glyphs 'ij' and 'IJ' are exempted from the advance width
calculation, because some fonts (i.e. Overpass Mono) defines them as two
cell wide glyphs (Hello? 'Mono'?)

For some obscure reason it was 'IJ' and 'J circumflex' that were
exempt, not 'ij'.

[how]
Exempt correct code.

Fixes: #703

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-21 17:42:16 +01:00
Fini Jastrow
8deda7fb49 font-patcher: Increase script version after last bugfix
[why]
With commit
  f240e073f font-patcher: Fix windows Mono family names with --makegroups

the script version did not change, which makes it impossible to say if a
user uses a bugfixed patcher or not.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-18 21:16:35 +01:00
Fini Jastrow
f240e073f0 font-patcher: Fix windows Mono family names with --makegroups
[why]
Without --makegroups the font family is "Name NFM", but with it enabled
we get "Name NF Mono".

[how]
Mimic the old short-naming also for the groups.

This feels a bit strange, why do we need to specify the names three
times for `inject_suffix()`, slightly different. At some point this
should probably be unified.

    def inject_suffix(self, fullname, fontname, family):
        """Add a custom additonal string that shows up in the resulting names"""

In principle Family + Subfamily -> Fullname -> Fontname
Somehow we rename not according to the default rules.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-18 15:15:24 +01:00
Finii
1cc7631da3 [ci] Bump release version 2023-01-17 19:02:09 +00:00
Fini Jastrow
54acb57739 font-patcher: Add ScaleGlyph for Material Design Icons
[why]
Scaling the glyphs individually breaks a lot of glyph pairs or groups,
for example F0718-F071E.

[how]
Use one ScaleGlyph for the complete set. The set itself is already very
well scaled, i.e. all glyphs are maximized in a given design space and
that they look good next to pairing glyphs.
There is no need to use ScaleRules which is quite costly for such a big
range of glyphs (they all are copied twice in the process).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 13:02:05 +01:00
Fini Jastrow
cd39545628 font-patcher: Add mixture of ScaleGlyph and ScaleGroups
[why]
ScaleGlyph always did scaling only (no translation) based on one
reference glyph.

ScaleGroups does scaling and translation but can not work with one
reference glyph but constructs always a combined bounding box.

Missing is a way to scale AND translate, but with only one reference
glyph.

[how]
Invent GlyphsToScale+ keyword, that supports just that.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 13:01:17 +01:00
Fini Jastrow
5d0c65006d font-patcher: Prevent autohinting on added symbols
[why]
The files sizes of otf files are (especially with the addition of the
current Material Design Icons) big enough already. The autohints are not
really useful for symbols, so we can drop them and save some space.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:59:53 +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