1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-25 03:32:02 +02:00

517 Commits

Author SHA1 Message Date
Finii
41f27ae08b [ci] Bump release version 2024-11-18 02:51:18 +00:00
Fini Jastrow
f28b343071 Trigger Release 3.3.0 (also: circumvent CI bug)
The CI first builds the fonts and THEN calls `generate-css`.
Which was ok, previously.

But now we store the glyphnames in the font files, and they are taken
from `glyphnames.json`, and THAT is only updated with the CSS file.

So the font files will get OLD names, if the symbol fonts got updated.

For now I just manually run the `glyphnames.json` update
(`generate-css.sh`) manually now, with this commit.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-18 00:53:43 +01:00
Fini Jastrow
e6426bbc60 font-patcher: Fix alignment of some glyphs
[why]
The EE00 and EE03 glyphs are aligned too far to the left.

[how]
Affected are only right aligned glyphs with (negative) overlap, that
have an advance width (i.e. are member of a scale group).

Extract a new condition as variable as we need it in several places.
Use that condition also for the right alignment applicability check.

Related: #1733

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 21:49:57 +01:00
Fini Jastrow
33d4af78a4 font-patcher: Fix 2 cell glyphs with overlap
[why]
Glyphs that shall end up in two cells with xy scaling and overlap (for
example E0C0, E0C2) end up being a bit too wide.
In fact the width is the 2 cell width and 2 overlap width.

[how]
Apply the overlap (which is 'percent' factor) not on the concrete glyph
width, which is 2*cellwidth in these cases, but base it on the
one-cell-width instead.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 19:05:40 +01:00
Fini Jastrow
41f91bcb4c Combine extraglyphs fonts
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 19:05:40 +01:00
Fini Jastrow
2b587fe474 Boxdrawing: Overhaul symbol font
[why]
All the glyphs have overlap (negative bearings). That in itself is ok,
altough it (the glyph width for example) is not consistent for all
subsets.

The overlaps can interact strangely with the overlap given by the
font-patcher script.

[how]
It seems better to remove the negative bearings.
Also some glyph width are corrected (unified).

The font is then stored uncompressed now.

[note]
The script used to modify the font:

import fontforge, psMat

font = fontforge.open('src/glyphs/extraglyphs_orig.sfd')
font.encoding = 'UnicodeFull'

def adjust(f, rang, left, width):
    for c in rang:
        g = f[c]
        if c in range(0x2599, 0x259f + 1):
            plus = 0
            g.transform(psMat.scale(1233/1234, 1))
        if c == 0x259D or c == 0x2595:
            g.width = width
            g.right_side_bearing = 0
        else:
            g.left_side_bearing = int(g.left_side_bearing + left)
            g.width = width
        print('{:X} {} {} {} {}'.format(c, g.boundingBox(), g.left_side_bearing, g.width, g.right_side_bearing))

adjust(font,
    [*range(0x2500, 0x2570 + 1), *range(0x2574, 0x257f + 1)],
    20, 1233 + 40)
adjust(font,
    range(0x2571, 0x2573 + 1),
    87, 1280+127)
adjust(font,
    range(0x2580, 0x259f + 1),
    0, 1233)

font.generate('TEST.sfd')
font.generate('TEST.ttf')

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 19:05:40 +01:00
Fini Jastrow
27b5aa903d font-patcher: Improve doc on ScaleGroup shifting
[why]
It can be confusing what is or is not synced when scaling-shifting.

[how]
Add text from commit:
  90bde735f  font-patcher: Use ScaleGlyph BB to align glyph

Also add a new (documentary) property for the tables that can be checked
so that nothing unexpected will happen.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 19:05:40 +01:00
Fini Jastrow
56f4c15341 font-patcher: Fix overlap scaling and shifting
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-17 19:05:40 +01:00
Fini Jastrow
bd59368568 font-patcher: Add progress indicators
[note]
Glyphs taken from FiraCode; remove negative bearings and add a helper
glyphs for vertical alignment that is used for the combined boundingbox
calculation but not patched in.

Fixes: #1345

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-14 12:37:59 +01:00
Fini Jastrow
f1dc79948d Devicons: Fix scaling of some few glyphs
[why]
Some glyphs in the (patched) E7B0-E7CF region seem to be too big.

[how]
The codepoints in the symbol font are 0x0100 less.
These are the "small things" that had a specific scale rule, which is
not needed anymore after we dropped these small icons and filled those
codepoints with new and bigger icons.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-14 00:18:44 +01:00
Fini Jastrow
ab08bd9da4 Devicons: Activate Devicons update
$ ./generate
    Program root: /usr

    Reading mapping file
    Found 496 entries

    Unpacking Devicons archive

    Mixing Vorillaz Devicons and possible fixes in
    Found 1688 svgs
    Bad RGB color spec: rgb(0%,0%,0%)
    Bad RGB color spec: rgb(0%,0%,0%)
    Bad RGB color spec: rgb(0%,0%,0%)
    Bad RGB color spec: rgb(0%,0%,0%)
    Using fixed svg for angularjs-plain.svg
    Using fixed svg for awk-plain.svg
    Bad RGB color spec: rgb(0%,0%,0%)
    Using fixed svg for bash-plain.svg
    Bad RGB color spec: rgb(25.882353%,12.156863%,37.254902%)
    Using fixed svg for llvm-plain.svg
    Bad RGB color spec: rgb(9.411765%,71.372549%,96.470588%)
    Generating devicons.ttf with 496 glyphs
    Generating GlyphInfo i_dev.sh
    Finished

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-14 00:18:44 +01:00
Fini Jastrow
662a61440f font-patcher: Rename glyphs to our ID / Class name
[why]
The glyphnames in the font files are sometimes off. We take them from
the symbol source/font and ofter they are empty or even plain wrong (esp
if we move to other codepoints).

[how]
We have the list of all glyphnames that is generated by collecting all
data from the i_*.sh files. When patching we take this information now
and use it if appropriate.

Make sure the glyphname.json file is included in our zip patcher release
and also in the Docker image. It will run as before if the file can not
be found or is invalid etc.

Suggested-by: Ulices <hasecilu@tuta.io>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-13 16:51:19 +01:00
Fini Jastrow
f530e22e23 font-patcher: Correct handling of right aligned proportional icons
[why]
The right align check does produce wrong results if a proportional font
is generated.

[how]
Just skip the aspect ratio alignment re-check and leave the work to the
proportional font shifting that is done afterwards anyhow.

Fixes: #1695

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-11-13 16:22:53 +01:00
Fini Jastrow
25ee48c0c3 font-patcher: Fix weather icons scale for 'other' icons
[why]
A lot of icons that do not represent a 'weather state' but rather a
'weather event' are in the 'weather state' scaling group which scales
the icons waaaay down. This makes those icons almost unusable in stand
alone use cases.

[how]
Put all the extra icons into a new scaling group that is defined before
the weather state scaling group and thus takes precedence.

Split the final scaling group to have some icons on individual scale.

Fixes: #1708

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-10-30 14:50:15 +01:00
Fini Jastrow
525b634c09 Increase Powerline overlap (big triangles and more)
[why]
There are still the annoying vertical colored lines sometimes that turn
up due to subpixel rendering.

[how]
Add "landing platforms" to the big triangular glyphs (E0B8, E0BA, E0BC,
E0BE) and flames (E0C0, E0C2).
The landing platform is approx 7% wide (based on one-cell width, assuming
the glyphs are all rendered 2 cells wide for the "xy2" ones).

Increase the overlap width for patching to 5%.

See also:
Merge request #1551
Merge request #1419
Commit 5e285867
Commit a8b9e1da

Fixes: #1629 (well, not the top problem which is unfixable)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-10-28 23:07:50 +01:00
Fini Jastrow
622de682cc font-patcher: Fix patching woff files
[why]
After we added the possibility to process font archives (.ttc) we lost
the ability to process woff and woff2 fonts.

It seems woff(2) files show no font names in fontforge, see
https://github.com/fontforge/fontforge/issues/1964

[how]
Open woff(2) files differently.

Fixes: #1647 (further down)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-10-28 17:27:06 +01:00
Fini Jastrow
2123aea420 Update Font Logos to 1.3.0
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-10-28 16:28:01 +01:00
Fini Jastrow
b95c671ccb font-patcher: Fix behavior when trying to patch non-font files
[why]
When the file specified to be patched is not a font file the patcher run
errors out with an out of index runtime error:

Traceback (most recent call last):
  File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2155, in <module>
    main()
  File "/home/fini/extra/git/nerd-fonts/font-patcher", line 2147, in main
    patcher.generate(sourceFonts)
  File "/home/fini/extra/git/nerd-fonts/font-patcher", line 415, in generate
    sourceFont = sourceFonts[0]
                 ~~~~~~~~~~~^^^
IndexError: list index out of range

[how]
Do not assume that the specified file will be a font file but rather
check if fontforge detects a font in the file and error out if there is
no font found.

Fixes: #1647

Reported-by: Kristopher James Kent <kris@kjkent.dev>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-06-02 08:48:31 +02:00
Fini Jastrow
cb0c9ed1e7 font-patcher: Fix escaping warnings
[why]
Some strings have broken format, because the string should contain a
verbatim backslash.

It seems this is a new warning for Python 3.12

[how]
Use raw strings or escape the escape character via '\\'

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-05-06 22:13:25 +02:00
Fini Jastrow
f3949ee393 font-patcher: Increase version after icon shape change
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-26 12:59:04 +02:00
Fini Jastrow
9e0ca39200 font-patcher: Increase version after change
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-23 09:43:48 +02:00
Gibson Fahnestock
961fa8f8c1 font-patcher: don't double-shrink heavy angle brackets
Fixes: https://github.com/ryanoasis/nerd-fonts/issues/1611

Co-Authored-By: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-23 09:43:48 +02:00
Fini Jastrow
e5f63a3d7a font-patcher: Improve logging while setup options
[why]
The logging to files does not work correctly for the messages given
while the options themselves are parsed.

[how]
As soon as we have enough information (after the first argument parsing)
we set the logger up. When processing the config file arguments we have
a full functioning logger now.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-22 14:08:28 +02:00
Fini Jastrow
6c6177d6a5 font-patcher: Do not rely on args.configfile
[why]
We now have two places where we can detect if a config file is given.
This should be unified.

Also handling of missing (?) sections in the config file is not always
handled gracefully.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-22 14:08:28 +02:00
Fini Jastrow
098fa410a6 font-patcher: Load config file only once
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-22 14:08:28 +02:00
Fini Jastrow
378d97cf1b font-patcher: Allow to rehint some Cascadia glyphs
[why]
Some Caskaydia Cove glyphs that are used in ligatures (to create endless
arrows for example) show uneven line thickness on some platforms.

The reason is the not-matching hinting of glyphs that are places next
to each other and so minuscule differences are quite visible.

Note that the 'original' hinting is generated by VTT on the static
Cascadia Code instances, which upstream just have ttfautohint hints that
are different from the hints in the variable fonts and people complained
that the look is different.

[how]
Add a new field to the config.cfg file that holds regexes of glyph
names for glyphs that should be re-hinted by fontforge on patching time.

In principle we could also implement that as an additional pre-step that
needs to be manually done after running VTT on the static font files.

I'm not sure which is better.

Note that fontforge generates a lot of debug output because the hinting
is not ideal - the global tables are kept and probably less compatible
to fontforge's own hinting... But the results are good.

Fixes: #1291
Fixes: #1609

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-22 14:08:28 +02:00
Fini Jastrow
88d63ff827 gotta-patch-em: Correct file type of config files
[why]
The config files are called `config.json` while the contents is
INI-like. The usual extension would be `.cfg`.

[how]
We use `.cfg` already for the shell variable configuration.

Combine both config file variants into one (real) cfg file, that is
directly read by the font-patcher and no shell variables files are used
anymore.

This needs some rewrite in gotta-patch-em to get the quoting right.
To make this simpler we remove the `--debug 1` option from the variable
and insert it directly (as it is applied always anyhow).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-22 14:08:28 +02:00
Fini Jastrow
b984447921 font-patcher: Allow to specify more options in config file
[why]
At the moment we have two different config files:

config.cfg:
Is read by gotta-patch-em and allows to specify some needed
commandline options for a font-patcher run

config.json:
Is read by font-patcher and can contain ligature table removal
instructions

It would be nice to combine/unify them.

[how]
Add the possibility to add commandline options in the config.cfg
file. Of course we need commandline options to specify the config
file first, so the options are parsed in two steps.

The config.file takes precedence (if possible) over directly specified
options.

This is how the new section in the config file can look like:

[Config]
commandline: --powerlineextra --mono

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-19 14:41:48 +02:00
Finii
6fa413d6bc [ci] Bump release version 2024-04-12 14:31:51 +00:00
Fini Jastrow
ce9910a3fb Attach license to old MaterialDesignIcons font file
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-12 08:47:03 +02:00
Fini Jastrow
c90f4ef058 Add Pomicons license
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-12 08:47:03 +02:00
Fini Jastrow
066d36514c font-patcher: Correct essential glyph detection
[why]
We have two ranges of glyphs to examine:
 1. `0x0000`-`0x017f` is the Latin Extended-A range
 2. `0xfb00`-`0xfb06` are 'fi' and other ligatures

Both ranges are added to the essential glyphs (with their
sub-references, and with other glyphs that are referenced through
possub rules).

That is correct for range 1, but range 2 - the ligature glyphs - should
only become essential if they are indeed used for ligatures by some
rule.

For example with the UbuntuMono font, that does not have any fi ligature
natively, but it DOES have a filled `0xFB01` glyph, we would protect
that glyph and its subreferences (i.e. `0xF001`) - needlessly breaking
the Font Awesome icons in that font.

[how]
Add all glyphs of range 1 to the essential glyphs, but add glyphs of
range 2 only if they have a possub rule attached.

Reported-by: Eli Array Minkoff <eli@planetminkoff.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-10 08:07:03 +02:00
Fini Jastrow
84140625a3 font-patcher: Correct essential ligatures
[why]
The essential glyphs are partially based on which substitution rules
the font has.

And the config.json configuration is able to remove some substitution
rules.

So we must first possibly remove rules and then examine them, not the
other way around, because now we detect 'essential glyphs' for rules
that we later remove.

[how]
Correct order of operation.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-10 08:07:03 +02:00
Finii
1895050935 [ci] Bump release version 2024-04-04 07:53:24 +00:00
Fini Jastrow
92c5b0f3e0 Update Font Logos to 1.2.0
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-02 20:38:36 +02:00
Fini Jastrow
f089ee8a6e Font Awesome: Update to 6.5.1
This does not pull in all icons of 6.5.1, but only of
'Region A' and 'Region B', see script `remix` and
PR #1563.

It keeps the codepoints constant for existing icons.

Fixes: #1550

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-02 18:24:46 +02:00
Fini Jastrow
09c6c8988c Add Ubuntu Sans
Prevent the "SansMono" becomes "SansM" rule for UbuntuSansMono.

Fixes: #1435

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-04-02 18:21:29 +02:00
Fini
f81f17af0d
Merge pull request #1558 from landfillbaby/master
update Intel One Mono to 1.3.0
2024-03-30 13:28:01 +01:00
Fini Jastrow
7543e4a3a8 Add inverse powerline arrow heads
Fixes: #1451

See also (merged but not released):
eb6b9721a8

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-29 14:10:31 +01:00
Fini Jastrow
5a958b3e96 font-patcher: Prevent excessively tall icons in mono fonts
[why]
Very slender and tall icons will be scaled huge compared to their fatter
neighbors. This happens for example to the chess pieces (E25F ff) or
text style icons like italic (EB0D).

[how]
When a monospaced font is created use a slightly less tall cell height
for all icons (except icons that have to match the actual line height).

This can be prevented by the new scale control character `^` that
symbolizes maximized vertical size (height) within the real cell.

The smaller cell (now called icon cell) is less tall than the line
height, but higher than the cap height of the font; to prevent people
complaining that the icons shrunk too much.
It is about 1/3 higher than the cap height compared to the line height.

This is NOT applied to the other Nerd Fonts fonts variants (i.e. Regular
and Propo) because all icons are generally a bit bigger than the cap
height (no scaling down to fit into one advance width) and as the
scaling is far less pronounced the slender-and-tall icons scale
comparably and do not look out off place there.

Suggested-by: Aaron Bell @aaronbell
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-29 13:28:05 +01:00
Lucy Phipps
0c2a028715
update Intel One Mono to 1.3.0 2024-03-25 15:35:08 +00:00
Fini Jastrow
5e2858670e Increase Powerline overlap (only rounded)
[why]
We still fight with the faint lines on the big side of the powerline
glyphs. They come from the LCD antialiasing mode that has problems with
the borders.

Other fonts use far more overlap. We use only a modest amount of overlap
(1% of the width).

[how]
As the other fonts do, increase the overlap (to 6% now).

Add full-hight 'landing platforms' on the outsides of the glyphs,
which are 7% wide.

Related: a8b9e1da06e5729923dabbfaea93ffff69abd067
Related: #1245

Fixes: #1547

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-20 16:39:03 +01:00
Fini Jastrow
cd9f49041f Move PowerlineExtra into subdirectory
And add meta information.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-20 16:38:44 +01:00
Fini Jastrow
50eae52aea Devicons: Add proper attribution
[why]
The font file is not changed, it is still the 9 year old file.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-19 00:45:01 +01:00
Fini Jastrow
a0b080abaf name_parser: Fill short and long name as TypoFamily
[why]
This sets out to circumvent a problem with VisualStudio 2022. That
application seems to have problems with fonts when the ID16 is not a
prefix in ID1.

We have this when --makegroups >= 4, because

ID1  has the short name suffix 'NF'
ID16 has the long suffix 'Nerd Font'

These fonts can be selected in VisualStudio 2022, and the preview works
ok, but once active some replacement default font is used instead.

The problem vanishes if ID16 and ID1 have the same stem, or rather ID1
has someting added on top of ID16; but ID16 is a substring of ID1.

See more discussions in #1442

[how]
Write both forms in ID16 fields, 'NF' and 'Nerd Font' suffixes. This
works as long as the application considers all languages equal.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-17 20:36:52 +01:00
Fini Jastrow
d907552970 font-patcher: Include new codicons and scale group icons
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-16 10:26:40 +01:00
Fini Jastrow
d45ff3da75 font-patcher: Increase version
[why]
Forgot to increase with commit 136a84bc0387406aa.

Now we also have different original icons, lets have a new number.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-16 02:04:45 +01:00
Fini Jastrow
136a84bc03 font-patcher: Fix Octicon scaling groups
[why]
The Octicon scaling group has two errors, one is a typo (the first digit
of a number is missing), and the second is off by one for some reason.

Reported-by: @aaronbell
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-03-14 08:01:20 +01:00
Fini Jastrow
393c66684b font-patcher: Fix debug format string
[why]
The format string is invalid and results in a runtime error if that
particular warning is issued (which is only the case for Terminus).

[how]
A verbatim percent sign must be encoded as '%%'.

[note]
This has already been fixed before with commit
  f81564fad  font-patcher: Fix typo in logger output

but the change has been lost by rebasing :-(

See also #1350

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-01-15 18:31:06 +01:00
Fini Jastrow
da4fb70b7e font-patcher: Break alternative unicode links before patching
[why]
The D2Coding font has a lot of glyphs shared between multiple unicode
codepoints.
Usually we just want to change the glyph on one particular codepoint
and not on all linked ones; which will affect codepoints not in our
patching ranges.

For example the glyph FULL BLOCK is used by codepoint 2588 and E286. In
the Exxx range they have a lot of icons, and also a full block.

[how]
Remove all links on glyphs that we are about to patch over, so that we
really just patch the codepoint we want to patch (and have no hidden
'links').

[note]
This could in principle break alts or ligs if they rely on another
codepoint that we removed. But breaking ligs is always a possibility
when patching over existing glyphs.

[note]
I checked several (not all) fonts in our repertoire, and only D2coding
is massively affected.

The only other fonts are these with 2 codepoints each:
heavy_data.ttf Removing alternate unicode on F001 (FB01)
heavy_data.ttf Removing alternate unicode on F002 (FB02)
Tinos-Regular.ttf Removing alternate unicode on F001 (FB01)
Tinos-Regular.ttf Removing alternate unicode on F002 (FB02)

Fixes: 1454

Reported-by: @hdd1013
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-01-15 18:31:06 +01:00