Commit graph

1666 commits

Author SHA1 Message Date
Fini Jastrow
e5d835080e Drop 'IBM' from 3270's names
[why]
The font was always called 3270.
Having a big company's name in the fontname is scary 😬

See
https://github.com/rbanffy/3270font/issues/60

[how]
Add renaming rule.

Fixes: #1012

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-17 15:44:20 +01:00
Fini Jastrow
b52f0a7cb1 Fix 3270 naming
[why]
Somehow the `IBM 3270 SemiCondensed` font turn out as
`IBM3270Semi Nerd Font Condensed`.

The 3270 font always had the quirk to have a non-standard style with a
dash. We have specific code to circumvent that.

[how]
After updating 3270 the 'Narrow' had been renamed to 'Condensed' and so
our specific patch did not work anymore.

Adapt the regex to find the new style that needs correction.

[note]
https://github.com/ryanoasis/nerd-fonts/issues/1012#issuecomment-1385497230

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-17 15:31:59 +01:00
Fini Jastrow
1d8efb6f68 Fix Mononoki naming [skip ci]
[why]
We get very bad names using the old naming algo:

`mononoki BoldItalic Nerd Font Complete`

Also the typographic subfamily is useless (will not be set bu the old
algo)

[how]
Use `--makegroups` which results in correct fullname
`Mononoki Nerd Font Complete Bold Italic`

Related: #575

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-17 14:42:05 +01:00
Fini Jastrow
fec587385a Update mononoki to 1.5
Mononoki is now a RFN; but under conditions mentioned in [1]
we can use that name for the patched font.

[1] https://github.com/ryanoasis/nerd-fonts/issues/575#issuecomment-1385308049

Fixes: #575

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-17 13:28:27 +01:00
Fini Jastrow
e6c01bc5fb Fix Cheat Sheet for new MDI [skip ci]
[why]
Although commit
  69e8c0e  Add current Material Design Icons

claims that we updated the Cheat Sheet after adding the new Material
Design Icons, that actually did not happen.

[how]
Add new MDI's i_*.sh file to all. That is used by the generate-css that
also generates the cheat sheet web page.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-16 23:48:35 +01:00
Fini Jastrow
c6b3b0841c Update JetBrains Mono to 2.304
Fixes: #1050

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-16 23:27:19 +01:00
Fini Jastrow
e601907caf Update Fira Code README
[why]
We had a copy of the original Fira Code website.
But all the comments and links are only partially relevant for the Nerd
Fonts patched version, e.g. how to install.

[how]
To reduce confusions do not copy the original readme, but link it.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 21:59:30 +01:00
Fini Jastrow
f922619734 gotta-patch-em-all: Drop explicit combinations list
[why]
The list is very long and has very little meaning.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 21:37:37 +01:00
Fini Jastrow
be04d53d85 gotta-patch-em-all: Fix --info
[why]
The info-only option broke with the latest changes.

[how]
Set something to the variable that determines the info only mode.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 21:22:14 +01:00
Fini Jastrow
713f5ef386 Update Iosevka to 17.0.4
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 21:13:14 +01:00
Fini Jastrow
b98c2a1921 Fix JetBrains Mono Family names
[why]
The JetBrains Mono font has a lot of different families. A lot users install
just all "JetBrainsMono Nerd Font" families, and this can break in a lot
different ways.

[how]
Just turn the feature on in font-patcher (via patch-em-all's config).

Fixes: #542

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 17:39:43 +01:00
Fini Jastrow
52d328f55d Fix font-logos
[why]
The 'ferris' glyph in font logos is broken (has overlapping contours).

See

https://github.com/lukas-w/font-logos/issues/86
https://github.com/lukas-w/font-logos/pull/87

[how]
As upstream does not fix, do this here manually.

Fixes: #946

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 17:09:09 +01:00
Fini
a0b6a5bfe5
Merge pull request #773 from earboxer/new-material
Add New Material Design Icons to its own region
2023-01-15 16:17:50 +01:00
Fini Jastrow
c39c97ba61 materialdesignicons: Fix glyph F1522
[why]
The glyph 0xF1522 is broken.

See:
https://github.com/ryanoasis/nerd-fonts/pull/773#issuecomment-1373990838
https://github.com/Templarian/MaterialDesign-Font/issues/9

[how]
Manually edit in fontforge and remove line. Export as simple ttf.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-15 16:10:33 +01: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
Fini Jastrow
7cb227c7e0 Rename "Material Design" to "Material Design Legacy"
[why]
We want to differentiate between the old, problematic Material Design
Icons (problematic because we map them to unicode blocks that we should
not), and a future new and updated set of Material Design Icons.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:59:53 +01:00
Fini Jastrow
5ec943aa13 Update generate-glyph-info-from-set to Python 3
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:59:53 +01:00
Zach DeCook
91ae09a203 material design icons: Update documentation 2023-01-13 12:59:53 +01:00
Zach DeCook
5426881a76 materialdesignicons: Update to newer version (fix #279)
With appropriate codepoint (fix #365)
2023-01-13 12:59:53 +01:00
Fini Jastrow
6f0b1fbf4f doc: Better document how the Cheat Sheet is generated [skip ci]
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 12:07:50 +01:00
Finii
4c76918895 [ci] Rebuild original-source font 2023-01-13 10:47:20 +00:00
Finii
c6ee815472 [ci] Simplify original-source source glyphs 2023-01-13 10:47:16 +00:00
Fini Jastrow
78bf5c3dff CI: Fix release workflow
[why]
When we rerun (on a release candidate) we end up with an error message:

    * Connection #0 to host api.github.com left intact
    Tag exists: "v2.3.0-RC"
    exists=true
    Error: Unable to process file command 'output' successfully.
    Error: Invalid format '"v2.3.0-RC"'
    ##[debug]System.Exception: Invalid format '"v2.3.0-RC"'

[how]
We want to set an output depending on the grep exit code but the grep
output leaks into our value...
Make grep silent.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 10:36:05 +01:00
Fini Jastrow
db39c2549a Fix i_custom_asm codepoint
[why]
The new asm icon replaces the apple icon.
I believe this has been entered as offset by mistake.

[how]
Add new icon to bottom.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 09:49:52 +01:00
igna_martinoli
461b882a5e Improve Assembly icon
[what]
Adds consistance with other low level languages icons like C/C++.

Reverted the change on `asm.svg`, added `asm_nf.svg`, modified `icons.tsv`

[note]
Closes https://github.com/ryanoasis/nerd-fonts/issues/857.
Closes [990#pullrequestreview-1171459043](https://github.com/ryanoasis/nerd-fonts/pull/990#pullrequestreview-1171459043)

Signed-off-by: igna_martinoli <ignamartinoli@protonmail.com>

[Note by Fini: Squashed two commits.]

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 09:49:52 +01:00
Fini Jastrow
04571f54bf Clean up icons.tsv
[why]
The 'new' in the middle can be confusing. What is the meaning?
Also the offsets are easier to graps if they are all equally wide (i.e.
have leading padding zeros).

See https://github.com/ryanoasis/nerd-fonts/pull/990#discussion_r1016193488

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 09:49:52 +01:00
Fini Jastrow
e97e7959d6 font-patcher: Fix unexpected 'Book' SubFamily
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.

[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.

Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.

[note]
This was only a problem with the old naming engine. --makegroups got
this right always.

Fixes: #1046

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-13 08:41:47 +01:00
Fini
1e446bb343
Merge pull request #748 from ryanoasis/feature/allow-downscaling-nonmono
Feature: Allow symbol scaling in nonmono (down to 2 'widths')
2023-01-12 17:32:44 +01:00
Fini Jastrow
6115c0be11 font-patcher: Make trapezoids more slim
[why]
The trapezoids look very clumsy if scaled too wide.
No user request, just aesthetics.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 17:09:43 +01:00
Fini Jastrow
0db79a0b97 font-patcher: Fix vertical overlap
[why]
The vertical overlap is still not 'pixel perfect', it is off by a small
amount that differs by font.

[how]
The reason is the wrong formula. We take the relative widths of the
glyph to calculate the factor needed to add an overlap in height.
Of course we need to take the relative heights *duh*.

Sometimes I think how dumb can a single person be? :-}
I would say this is copy-and-paste laziness.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 16:55:38 +01:00
Fini Jastrow
ed929aa7f4 font-patcher: Wide fonts get only 1 cell Powerline glyphs
[why]
The change introduced with commit
  Default some Powerline glyphs to '2 cells wide'

scales some Powerline glyphs to fit exactly into a 2 cell width. That
looks good on 'normal' fonts, but when the font becomes wider and less
tall at some point that is just too wide.

This is especially the case with the SymbolsOnly font which has a 1:1
aspect ratio. Two cell Powerline glyphs would have an aspect ratio of
2:1 which is unusable.

[how]
Check the destination font cell aspect ratio.
When a two-cell glyph would be wider than 1.6 times its height the
two-cell-mode is forbitten and all Powerline glyphs are scaled into one
cell width.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 16:37:09 +01:00
Fini Jastrow
f311401e32 font-patcher: Add overlap to left-hexagons E0CC
[why]
The hexagons touch the left edge with a full body, so most likely people
do not want to have any visible gap there.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 16:35:08 +01:00
Fini Jastrow
8d78b63764 gotta-patch-em-all: Fix --help option
[why]
Somehow the option is mentioned but not implemented.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 16:33:37 +01:00
Fini Jastrow
95bdc420da font-patcher: Limit vertical overlap
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

Note that the glyphs are usually valign='c' and the overlap is
distributed half top and half bottom. There are no other valign values
implemented (just 'not align' which is ... most likely bad).

[note]
Originally this has been part of commit fecda6a of #780.

[note2]
Originally this has been part of PR #967.
Although that had a bug 😬
It used max() instead of min() (T_T)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>

f
2023-01-12 16:31:23 +01:00
Fini Jastrow
1637ef7ff2 font-patcher: Unwrap complicated looking code
[why]
We have two variables that hold the same data (sym_dim and dim), which
is confusing ('why do we have it?').

There is also the big 'if' on 'do we want to scale', which contains too
much. In the unlikely event that we have a glyph that needs to be scaled
by 1.0 AND have an overlap the code produces the wrong results.

[how]
Shuffle lines but no functional change (except that now we obey
'overlap' always (not that it has been a problem)).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 11:58:44 +01:00
Fini Jastrow
c303a1ee18 font-patcher: Default some Powerline glyphs to '2 cells wide'
[why]
When we scale all Powerline glyphs also horizontally (in X direction) to
'one cell' some might look a bit too small; especially because they were
very big previoulsy (before commit 'font-patcher: Do x-scale powerline
glyphs').

[how]
To get them to a reasonable and always equal width a new scale code is
introduced: '2'. It is evaluated in 'x' or 'y' scaling contexts and
doubles the target cell width (unless a "Nerd Font Mono" is generated
where all glyphs must be one cell wide).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 11:58:42 +01:00
Fini Jastrow
eb396e617d font-patcher: Remove overlap from line-ish glyphs
[why]
Most Powerline glyphs have a little bit over overlap to the previous or
next glyph to prevent a 'break' in a colored prompt.

It does not make sense to have overlap with glyphs that can never
produce any of that issues, i.e. glyphs that are not filled to the
border. Like all the line-ish glyphs.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 11:26:35 +01:00
Fini Jastrow
a6a5a38af5 font-patcher: Do x-scale powerline glyphs
[why]
For the non-Mono variants ('Nerd Font' and 'Nerd Font Propo') the
Powerline symbols are scaled in Y but the width is just kept from the
symbol font, whatever that might be (and if it makes any sense).

If you have for example the triangular thing (`E0B0`) it is bigger than
'one cell' and extrudes into the following cell (on 'Nerd Font'). For
the other side (`E0B2`) it is even worse; it is right aligned in the
current cell and so (because it is wider than one cell) it protrudes
into the previous cell.

[how]
Just allow not only Y scaling but also X scaling for non-Mono fonts.

[note]
This is of relevance just for 'xy' scaling, and only the Powerline
symbols do that.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 11:06:42 +01:00
Fini Jastrow
b3c079d6d3 font-patcher: Correct overlap
[why]
The overlap formula seems to be off sometimes. Although the shift is
correct (and thus the number of 'pixels' that overlap), but the non
overlapping part of the glyph is often not as wide as expected, off by
up to some percent.

[how]
The formula is too simple. It just calculates an additional scale factor
on top of the already existing factor. To get it 'pixel perfect' we need
to calculate first how much the glyph fills the cell - because we want
the overlap to be in 'cell percent' and not 'glyph percent'. That might
be sometimes the same (if the cell is filled completely), but usually it
is not completely full, and that means the overlap will be smaller than
intended.

[note]
To get the current glyph bounding box we pull some lines up in the code
that get the 'dim' variable.

Also use float constants to calculate with float variables.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-12 10:53:40 +01:00
Fini Jastrow
95f29260b0 font-patcher: Prepare for code change
No functional change.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 18:55:14 +01:00
Fini Jastrow
5f85240519 font-patcher: Centralize more scaling code
[why]
Obviously we can drop more code and shuffle scaling logic into the
scaling function.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 18:37:14 +01:00
Fini Jastrow
b571415e6b font-patcher: Fix right-waveform scaling
[why]
While the left-side-waveform gets 'xy' scaled the right-side gets 'pa'
scaled. This has been obviously forgotten.

[how]
Add specific scale rule for right-side-waveform.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 18:03:20 +01:00
Fini Jastrow
22684bc4bc font-patcher: Allow glyph down-scaling for non-mono fonts
[why]
On very small source fonts the patched-in symbol-glyphs can become very
big and create overlay problems. It might be desirable to scale them
down to 'two advance widths'.

[how]
It could be that the glyphs in question are in a ScaleGlyph range. So we
need to activate that code also for non-single fonts.

Further we allow two slots wide symbols in get_scale_factors() for those
fonts.

Now we take the computed scale factors for non-single fonts - only if we
scale down and not up. It will confuse/upset people if the known symbols
in their fonts suddenly become bigger - and it also does not look right.

Fixes: #718
Fixes: #747

Reported-by: Rui Ming (Max) Xiong <xsrvmy>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 16:53:28 +01:00
Fini Jastrow
ebd381c86b font-patcher: Centralize scaling code
[why]
The glyph rescaling is scattered about two functions and several
branches. It becomes hard to follow what is done when and why.

[how]
Use one function that determines any glyph scaling, that includes all
handling except ScaleGlyph related stuff.

This simplifies the code in copy_glyphs() a lot, and keeps all the scaling
in get_scale_factors().

[note]
No behavioral change introduced with this.

[note]
Well, it fixes the possible problem (it will never happen, but lurks)
that a glyph is in the ScaleGlyph range AND has Y scaling set.

The old code first uses the ScaleGlyph scaling and afterwards violates
it by mindlessly doing the Y stretch. This would not happen anymore with
the new code. If a ScaleGlyph is specified for a certain glyph, that
ScaleGlyph is followed and nothing else.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 16:32:27 +01:00
Fini Jastrow
99c2608313 font-patcher: Fix more 'Nerd Font Mono' too wide
[why]
The 'monospace' width is determined by examining all the 'normal' glyphs
and taking the widest one.

'Normal' means 0x00-0x17f: the Latin Extended-A range.

Unfortunately some fonts that claim to be monospaced still have some
glyphs that are wider than the others.

[how]
Exclude a small group of glyphs from the 'find the widest glyph'.
The list is specifically targetted at the fonts we patch, see PR #1045.

Most of these glyphs are either visually small and it is unclear why
they are too wide (like double-quotes), or they are from the real
extended set, notably all the Eth (D with a slash) and other added-slash
or added-caron glyphs.

In ignoring them we might 'break' these specific glyphs for the people
who use them (like: they extend out of the cell into the next), but that
is the only way to keep the 'monospaced promise' without redesigning the
actual font.
But without these exceptions we have Nerd Font Mono fonts that increase
the cell width so that 'normal text' is rendered almost unreadable.
So this is an improvement for most users; and I see no way so solve
these font issues for all users (without redesigning the font itself ;).

Also add a 'warning' if a (still) problematic font is to be patched.
As reminder for self-patcher or when we add fonts here.

[note]
Related commit
  fbe07b8ab  Fix Noto too wide
  2945cecd1  Fix Overpass Mono too wide

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 12:58:27 +01:00
Fini Jastrow
8845e3fb99 font-patcher: Fix Overpass Mono too wide
[why]
The 'monospace' width is determined by examining all the 'normal' glyphs
and taking the widest one.

'Normal' means 0x00-0x17f: the Latin Extended-A range.

Unfortunately Overpass (Mono) has wide-as-two-letters IJ and ij ligatures.

[how]
Exclude a small sub-range from the 'find the widest glyph' that contain
these ligatures. Yes they will kind of break, but what can we do if we
want to create a strictly monospaced font?

[note]
Related commit
  fbe07b8ab  Fix Noto too wide

Related: #1043

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-11 12:58:27 +01:00
Fini Jastrow
9514cbc509 docker: Fix fontforge problem
[why]
The docker image can not start fontforge:
  Error relocating /usr/bin/fontforge: FindProgRoot: symbol not found

[how]
The problem might be that we base on the 'latest' Alpine container, but
install a edge fontforge.

If I see this correct:
https://hub.docker.com/_/alpine/tags

'latest' is the same as latest-stable. Probably we should use a matching
apk repo.

Fixes: #1042 (maybe, need to push to test)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-01-10 12:33:51 +01:00