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

1877 Commits

Author SHA1 Message Date
Fini Jastrow
f99e108273 name-parser: Fix enable_short_families() with empty prefix
[why]
Specifying an empty string as prefix unexpectedly does not enable short
family names for all fonts - but for no font at all.
Usually an empty prefix matches all strings (font names).

This makes it hard to enable short families for all fonts no matter
what.

[how]
Fix detection if the prefix is False or a string.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-15 20:57:07 +02:00
Fini Jastrow
037ab03f16 name-parser: Drop special handling for 'Windows Compatible'
[why]
This just drops the 'windows compatibility' options in association with
the name parser (i.e. --makegroups') as we want to always create fonts
that work on any platform.

Note that the fonts prodused right now are NOT windows compat anymore
and you can not specify the flag. Violating 'git rules' this commit is
not working correctly. But it is easier to do this in smaller steps.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-15 20:57:07 +02:00
Fini Jastrow
619214c9ee name-parser: Make PS length limit more lenient
[why]
The postscript font name length limit of 31 is only present in very old
post script printers. And even then it depends on the printing method.

Some of our well knows source fonts have longer PS names (Noto etc).

And the limit exists regardless of windows or not.

[how]
Let limit depend on PS name part (font name or family name).
Remove reference to windows compat mode.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-15 20:57:07 +02:00
Fini Jastrow
ae656bad83 name-parser: Further formalize style handling
[why]
Some styles can not take modifiers. We handle the shortening as if they
can. That is not a problem but mighht be unexpected.

Do detect weights we have a fixed list, but that is missing a lot
weights that we would be able to shorten.

The shortening does not work for 'Retina', which is imho a more recent
'invention' (after the paper of the previous commit has been written).

[how]
Separate known weights and make them accessible from other functions.
Use these data tables also for weight detection.
Introduce 'Retina' in the weights table.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-15 20:57:07 +02:00
Fini Jastrow
81e2e1f988 name-parser: Generalize and shorten style-shortening
[why]
We really struggle to keep the font names below the length limits. To
achieve this some styles are abbreviated. The abbreviations have been
taken from Noto and were initially used to mimic Noto's naming scheme.

But a bit shorter names would help in some instances to produce short
enough name entries. Also some styles that are used by fonts other than
Noto are not abbreviated at all.

[how]
In document [1] Adobe gives examples of very short style abbreviations.
We just implement all these.

Example: 'ExtraCondensed' now becomes 'XCn' instead of the more readable
but longer 'ExtCond' that Noto uses.

[1] https://adobe-type-tools.github.io/font-tech-notes/pdfs/5088.FontNames.pdf

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-15 20:57:07 +02:00
Fini Jastrow
179dae01e0 font-patcher: Use standard filenames
[why]
The filenames of the patched fonts are rather ... unique:
- they contain blanks to separate name parts
- they do not separate name and style/weight

This is in part due to history reasons, because the names were not
parsed at all and just some suffix added.

Example (contrived):
  Victor Mono Nerd Font Propo Bold.ttf

Normally font file names would be:
  VictorMonoNerdFontPropo-Bold.ttf

We ourselves relied in part on that naming scheme, but do not follow it.
There are a lot powerline fonts out there that all add blanks to the
filename.

Some filename recommendation can be found in [1].

[how]
The filename is now always constructed directly from name ID 16
and name ID 17. If one of them is empty ID 1 and ID 2 are used as
fallback, as customary.
ID 16 (ID 1) and ID 17 (ID 2) are separated by a hyphen.

The result is that in can differ from the fontname (ID 6) and uses
always the longest most readable name parts.

[1] https://forum.fontlab.com/fontlab-studio-tips-and-tricks/font-family-naming-in-fontlab-studio-5/

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
68405398bc name-parser: Remove more names
[why]
There are some more name entries that we should rename or remove.
None of the fonts in the src/unpatched-fonts/ has these set; but in
principle a font could have it set and then we would need to handle
that.

[how]
Just remove the entries if they are existing.
Note that we do not handle NameID 25.

Also add some more comments.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
45f9551d73 font-patcher: Unify naming variants
[why]
The short form of 'Nerd Font Mono' is 'NFM'.

The PS names have a mixture 'NerdFontM'.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
784bd422d6 name-parser: Set UniqueID
[why]
When we rename a font we should always also change the unique ID.

[how]
Take the fullname and the Nerd Font version number. In general we do not
have the version number in the NameParser object; but we have the
'Version' name and we loot the last word (which we have set to the Nerd
Font version already in the patcher) as version descriptor.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
44ffebcaa3 name-parser: Add Extended to known styles
[why]
This is missing, for example for
  iosevka-extendedextralightoblique

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
95cae8fd81 Drop "Complete" from font names
[why]
Nowadays the Complete font is the normal font. We already dropped the
partially patched fonts long ago. If someone is self patching they will
know if it is a basic font or a complete font.

And already now one can not see if the patched font is bare minimum
(i.e. Seti, Custom, and Devi) or includes Powerline and/or
PowerlineExtra.

[how]
Just drop "Complete" from the naming.

[note]
As the name changes and thus the file name a lot of the other scripts
will break. But they might break anyhow because other naming changes, so
fix that as last commit.

See also commit
  557fc004c  Attempt to fix duplicate fonts in fontbook on osx

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
a7ecf075d2 font-patcher: Special rule for SymbolsOnly font
[why]
When patching the SymbolsOnly font via gotta-patch-em-all we create a
'Nerd Font Propo'. With the previous change that will be reflected by a
changed name.

The name change can come unexpected for users.

And in fact a 'Nerd Font' version would be ridiculous as there are no
preexsiting glyphs in the font.

So we should keep the previous naming:
* `Symbols Only Nerd Font` (which is in fact a Nerd Font Propo)
* `Symbols Only Nerd Font Mono` (for the monospaced version)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
0b6f63e4df font-patcher: Invent name base "Nerd Font Propo"
[why]
We have three ways to create a patched font
- 'normal' (i.e. monospaced oversized symbols): Nerd Font
- 'mono' (i.e. strictly monospaced small symbols): Nerd Font Mono
- 'proportional' (i.e. proportional symbols): Nerd Font Propo

The first two variants have a name, the third one has no name, it is
also called 'Nerd Font' (and it was THE font, for v2.1.0 (only)).

[how]
Invent and set new name, so that all variants have different names.
Makes refering to them explicit.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Fini Jastrow
80f602e805 font-patcher: Pull 'Mono' to front in names
[why]
When we crate a font we take the OriginalName, add "Nerd Font" and which
patches we applied, and add "Mono" if --mono has been specified:

OriginalName Nerd Font Complete Mono
OriginalName Nerd Font plus Weather Mono

But the 'Mono' part is quite important, but this scheme will put it in a
place where it is easily out of view or has been removed (to keep the
name short).

This truncation is especially bad on Windows Compatiple and when the
user installs both the 'Nerd Font' and the 'Nerd Font Mono':

    SomeVeryLongFontName Nerd Font Complete
    SomeVeryLongFontName Nerd Font Complete Mono

become after truncation
    SomeVeryLongFontName Nerd Font Comp.ttf
    SomeVeryLongFontName Nerd Font Comp.ttf

[how]
Always put the "Mono" directly after "Nerd Font" and all the other name
components come later.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 08:01:12 +02:00
Finii
51c1aa5904 [ci] Update FontPatcher.zip 2023-04-14 05:11:44 +00:00
Fini Jastrow
5823665f1f font-patcher: Fix patching non-monospaced fonts
[why]
Any non-monospaced font will not be be patched, the patcher crashes.

[how]
This must have happened when the box drawing characters rescaling
feature has been disabled. The default value (False) is not always set.

The box drawing patch has the ability to rescale existing box glyphs.
That used to be done when all box glyphs are already existing in the
source font. We do not patch in a new glyph set then, but we rescale the
existing glyphs to match the possibly new cell size.
But that feature is disabled and the attribute 'dont-copy' is never
utilized. It is disabled because some existing box sets are rather ...
sspecial in their overlap and can not be scaled as we would scale them.

Fixes: #1170

Reported-by: Henrique Monteiro <hrqmonteiro@protonmail.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-14 07:08:39 +02:00
allcontributors[bot]
049ca735ca docs: update .all-contributorsrc 2023-04-13 09:16:04 +02:00
allcontributors[bot]
cfb43ccc33 docs: update CONTRIBUTORS.md 2023-04-13 09:16:04 +02:00
Finii
7647c69634 [ci] Update FontPatcher.zip 2023-04-12 16:29:12 +00:00
Sebastian Ullrich
046bdc3ef2 Add run comment 2023-04-12 18:20:57 +02:00
Fini Jastrow
9defc59b9d font-patcher: Fix --xavgcharwidth with --quiet
[why]
--xavgcharwidth does not work when --quiet is given.

[how]
Correct indent level ....

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-12 18:19:36 +02:00
Finii
c8fdda98bf [ci] Update FontPatcher.zip 2023-04-12 14:32:14 +00:00
Fini Jastrow
156f9bf694 font-patcher: Add option to manipulate xAvgCharWidth
[why]
Some old applications seem to depend on obsolete xAvgCharWidth values to
show two-cell glyphs correctly. Fontforge can only generate OS/2 tables
version 4, but these applications need 2 or less. In fact they seem to
not look up the version number, but rely on the value being like it
always has been ;-)

One example is Windows notepad, that takes the xAvgCharWidth as base for
the cell size and draws the two-cell chars in a cell twice that size -
without any regard to glyph width.

[how]
These issue seems to be encountered rather seldom and only with some
obscure (grin) applications. There is also no good way to handle this
automatically. So we add a command line option that allows the user to
tweak the value after patched-font generation.

The option is called `--xavgcharwidth`:
* If not specified the behavior of the patcher does not change
* If just given the xAvgCharWidth is copied over from the source
* If a number is added that number is used as xAvgCharWidth
* If the number added is zero we will calculate the old style xAvgCharWidth

Fixes: #522

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-12 16:29:05 +02:00
Fini Jastrow
cf59464e52 font-patcher: Optimize font tweaking for ttc
[why]
When we have a ttc and tweak the contained fonts we recalculate the
total checksum after each tweak while we only need to tweak it after all
changes (included fonts) have been tweaked.

[how]
Pull the total checksum recalculation out of the subfonts loop.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-12 16:29:05 +02:00
allcontributors[bot]
ae7d6a5744 docs: update .all-contributorsrc 2023-04-08 18:53:41 +02:00
allcontributors[bot]
9ebca248a9 docs: update CONTRIBUTORS.md 2023-04-08 18:53:41 +02:00
Fini Jastrow
e600957704 doc: Fix more anchors
The readme is obsolete anyhow, but while we touch it we can just fix some more anchors.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-08 18:53:25 +02:00
Weltolk
fa79edbc33 doc: Fix anchor in readme 2023-04-08 18:53:25 +02:00
Fini Jastrow
6c5e64d4f6 IosevkaTerm: Prepare gh-pages for change
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-05 16:04:36 +02:00
Fini Jastrow
a8e7751d47 Disentangle Iosevka and Iosevka Term
[why]
Both are full fledged families, one specifically for terminal, the other
not. Although it might be that people want both there is a likelyhood
that some just need one set.

Splitting these makes the individual release packages smaller and more
handable, and improves release workflow run time.

[note]
Also fix RFN of mononoki en passant :-}
See comment on mononoki's RFN with the mononoki 1.6 update commit.

See also #803

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-04-05 16:04:36 +02:00
Fini Jastrow
dfd186c2a4 Update Lilex to 2.000
Fixes: #1157

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-30 19:38:49 +02:00
allcontributors[bot]
95de53343d docs: update .all-contributorsrc 2023-03-25 12:41:27 +01:00
allcontributors[bot]
c68cddf16f docs: update CONTRIBUTORS.md 2023-03-25 12:41:27 +01:00
Fini
db1df04b58
Merge pull request #1151 from ryanoasis/feature/source-update
Update all source fonts
2023-03-21 19:31:45 +01:00
Fini Jastrow
8a63cf62e2 Update Victor Mono to 1.5.4
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 19:29:34 +01:00
Fini Jastrow
d1b193de54 Update Terminus to 4.49.2
Also drop all the bitmap fonts that we have in src/unpatched-fonts/ but
we do not do anything with them.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 19:14:53 +01:00
Fini Jastrow
dda72eb4c4 Update Source Code Pro to 2.038
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 18:53:55 +01:00
Fini Jastrow
8b92cbaf56 Update Roboto Mono to 3.0
Not adding the 'ExtraLight' weight.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 18:53:25 +01:00
Fini Jastrow
1a242e9540 Update Overpass to 3.0.5
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 18:26:05 +01:00
Fini Jastrow
1868c68c8b Update MPlus to ... current
They started with new version numbering and have different version on
each subset.

The complete naming set changed. See their website to find the font you
used before.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 17:05:54 +01:00
Fini Jastrow
a9270a8437 Update mononoki to 1.6
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 16:19:12 +01:00
Fini Jastrow
21aafd5620 Update Lilex to 1.100
Light has been dropped upstream.
We drop the otf variants, original design is a ttf.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 15:26:37 +01:00
Fini Jastrow
160f045d02 Update Literation to 2.1.5
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:58:06 +01:00
Fini Jastrow
b5f41db164 Update Iosevka to 21.1.1
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:47:01 +01:00
Fini Jastrow
136b855971 Update Hermit to 2.0
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:47:00 +01:00
Fini Jastrow
1142815f23 Update Go Mono to 2.010
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:47:00 +01:00
Fini Jastrow
4f6fcfe69a Update Fira Mono to 3.206
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:46:59 +01:00
Fini Jastrow
49dd8c70c1 Update readme
Forgot to include this in the previous commits and accidentially pushed
them directly to master.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 14:46:59 +01:00
Fini Jastrow
adb3a8587a Update DaddyTimeMono to 1.2.3
Add config.cfg to keep ttf instead of following the upstream switch to otf.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 12:33:36 +01:00
Fini Jastrow
0d272cd39b Update IBM Plex to 2.3
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-03-21 12:14:59 +01:00