Commit graph

435 commits

Author SHA1 Message Date
Fini Jastrow
db9a71a270 generate-font-image-previews: Update Inkscape calls
[why]
Verbs have been dropped from Inkscape with version 1.2

[how]
Use actions instead. I'm not sure how well that works with older
Inkscapes now, but ... sigh

[note]
Also add missing helper for font filenames for Intel One Mono.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-26 15:02:27 +02:00
Fini Jastrow
d3181df01f name-parser: Add IntelOne replacement to SIL table
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-26 15:02:27 +02:00
Fini Jastrow
bac7332702 name-parser: Sort SIL table
No functional change

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-26 15:02:27 +02:00
Dennis Prazak
5d85a45a93 Add Intel One Mono 2023-07-26 15:02:27 +02:00
Fini Jastrow
0eef3a89f9 complete-readmes: Do not detect blanks as "name change"
[why]
When we rename "Envy Code R" to "EnvyCodeR" this is detected as RFN
relevant name change, which it is not.

[how]
Compare the blank removed lower cased names.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-15 19:33:55 +02:00
Fini Jastrow
57f17e23bc Add font: Envy Code R (fix)
[why]
Forgotten change

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-15 19:33:55 +02:00
Fini Jastrow
9512cddd4f Add font: Envy Code R
The font has RFN, but we are allowed to use the patched name
"Envy Code R Nerd Font", see PR #1318.

Thanks go to Damien Guard!

Fixes: #1205

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-15 15:17:39 +02:00
Fini Jastrow
28f5657782 archive-fonts: Unify README handling
[why]
The readmes in the zip and tar.xz archives differ. The zips have only a
very small and generic `readme.md`. The tar.xz have that readme as well as
the `README.md` from the patched-fonts/ directory. This should be the same
for both.

To have two files with names that just differ in case (`readme.md` and
`README.md`) can be problematic on some platforms.

[how]
Combine both readmes into one file - put the generic info in the top of
the readme.

Also include the RELEASE_VERSION if known into the readme. That makes it
more easy to identify which Nerd Font release that archive came from.

RELEASE_VERSION is set in the release workflow.

Fixes: #1284

Reported-by: Jan Klass <kissaki@posteo.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-15 12:00:52 +02:00
Fini Jastrow
c173f661a0 docker: Transport return code to outside
Fixes: #1316

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-11 22:34:10 +02:00
Fini Jastrow
c0d9a22d5f Add InconsolataGo programmingfonts link
Fixes: #1313

Reported-by: Koen Lageveen <braver>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-06 10:53:16 +02:00
Fini Jastrow
be013e5987 Add GohuFont programmingfonts link
Thanks to Koen Lageveen <braver>

Fixes: #1312

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-07-05 12:14:25 +02:00
Finii
ef6fe05754 [ci] Bump release version 2023-06-04 20:32:30 +00:00
Fini Jastrow
5eebd95456 fetch-archives: Allow to specify a regex
[why]
Now where we have zip and tar.xz archives one might want to just fetch
one specific one. So we need to have a pattern not only for the
beginning of the file name.

[how]
Enable full regexes for the filtering.
For this we need to escape blanks in the pattern/regex, that a user
might specify (./fetch-archive.sh v2.2.2 'Some Font').

[note]
This is already then used for the casks workflow, as that only needs the
zips.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 20:44:08 +02:00
Fini Jastrow
a11fa2db53 archive-fonts: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 19:06:04 +02:00
Fini Jastrow
a519cfe3a1 i_all: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:04 +02:00
Fini Jastrow
ed4028aaaa optimize-original-source: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
248508e1d6 version-bump: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
3454239496 tests.sh: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
a621ded9e3 test-powerlines: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
9be8e86a2d standardize-readmes: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
a10a77bc40 gotta-patch-em: Fix various ShellCheck issues
[note]
$powerline has been removed already with commit
  96cd985b5  Drop counting variations stuff and unify readme creation

$last_current_dir has never been functional

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
fc1f816dc5 generate-sample-set: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
ad56629f40 generate-font-image-previews: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
06ba2a8a28 generate-css: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
7290f0208f casks: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
8f60f64617 fetch-archives: Fix various ShellCheck issues
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 16:58:03 +02:00
Fini Jastrow
f6f80995a1 archive-fonts: Create tar.xz packs
See #1233

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 13:09:59 +02:00
Fini Jastrow
c4a3e0249e archive-fonts: Make PWD independent
[why]
Scripts should run regardless of current working directory.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 13:09:59 +02:00
Fini Jastrow
6b49625585 archive-fonts: Whitespace
No functional change except working in sorted order.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-02 13:09:59 +02:00
Fini Jastrow
f81c702165 test-fonts: Correct MDI range
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-01 08:06:29 +02:00
Fini Jastrow
d3d302fb69 test-fonts: Drop "all" range
[why]
The "all" range just prints again all the ranges that we previously
already printed (?!!).

As we can not select individual sets this does not make much sense.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-01 08:06:29 +02:00
Fini Jastrow
6bb3b23d88 test-fonts: Fix missing codepoints and allow MacOS
[why]
If a set has multiple ranges defined only the last of that ranges is
actually printed.

[how]
With commit
  7a4b5f872  Fixes build errors (ShellCheck)

a false positive of spellcheck lead to a 'correction' in the code that
actually broke it. The mapfile does not accumulate the sequences but
fills it in and so just the last sequence 'survives'.

Dropping mapfile also enables this script on MacOS, as that ancient
bash does not have mapfile.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-01 07:54:21 +02:00
Fini Jastrow
6f1cdb82d9 test-fonts: Allow for 5 digit codes
[why]
The code is hardcoded for 4 (hex-)digit codepoints. If we want to
examine 3 or 5 digit codes it breaks the formatting.

[how]
Switch from \u to \U to allow printing codepoints with more than 4
digits. This works on all machines I tested (Linux/Mac).

Manually pad the codepoint to get a consistent length independent of
actual number of digits. We can not use "%5x" because we want to
underline only the actual digits.
This also makes the output of empty slots nicer because the underline is
skipped if there is no code.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-06-01 07:37:35 +02:00
hasecilu
dcbcef0fe6
Update test-fonts.sh version.
- 1.1.0 version.
- Add example command to change column size.
2023-05-31 13:41:19 -06:00
hasecilu
bf4fc58b8b
Update style of for loop, from using seq to C style. 2023-05-31 11:37:06 -06:00
hasecilu
e72d7ba5e7
Update range of font logos 2023-05-31 10:57:37 -06:00
hasecilu
a260711d46
Use single square bracket on if statement. 2023-05-30 23:48:38 -06:00
hasecilu
75960ab56d
Use first arguments as wrapping value.
- Resistant to bad inputs.
- First checks if argument is a number and then checks if its greater than 2, if it's, the `wrapAt` variable is updated.
2023-05-30 23:45:53 -06:00
hasecilu
89dc2f8de7
Rename unused dummy variable 'i' to '_'.
- According to https://www.shellcheck.net/wiki/SC2034 : "For throwaway variables, consider using _ as a dummy".
2023-05-30 20:49:19 -06:00
hasecilu
7ccf229c37
Attend SC2071 error code.
- See: https://www.shellcheck.net/wiki/SC2071
2023-05-30 20:41:20 -06:00
hasecilu
6f7f9e92be
Update wrapAt value to 16.
- Since the format of the values used are normally hexadecimal seems a reasonably election.
2023-05-30 20:36:31 -06:00
hasecilu
283cedb2d4
Update line decoration variables.
- Each variable was splitted in 3 variables containing the start block, middle block and end block respectively.
- Now the wrapAt variable controls programatically the length of the decorations lines, (for loop).
- Minimal wrapAt allowed value is 3.
2023-05-30 20:34:09 -06:00
Fini Jastrow
1b7711564a generate-css: Adapt text
[why]
PR #1252 and this ran slightly out of sync.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-30 19:41:34 +02:00
rszyma
df64f73f2a modify generate-css.sh for changes in #1252 2023-05-30 19:41:34 +02:00
Fini Jastrow
930eef239c name-parser: Fix some Blex fonts
[why]
IBM Plex uses some abbreviations also in the fullname and we do not try
abbreviations when resolving weights.

[how]
As this is the only font that has such specials we handle it beforehand
and do not try all combinations of abbreviated and long keywords.

And then their abbreviations are also not standard - at least not used
by us or Adobe, etc.

For such a small amount of affected font files it seems in order to
specifically just fix them instead of a general solution.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00
Fini Jastrow
f5e648b873 IBM Plex: Fix "Text" weight
[why]
The 'Text' weight of Plex is handled as 'other', means that this is
added to the font's name and is a distrinct own family.

But in the original font it is used as weight.

[how]
Remove special handling of 'text' in the font name.
Add 'Text' to known_weights list.

"Text" is not a standard naming, but I see no problems when we handle it
as one. This keeps the family relationships in Blex like Plex.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00
Fini Jastrow
2e9caea9cd name-parser: Simplify for CodeClimate
[why]
Function get_name_token has a Cognitive Complexity of 12 (exceeds 9 allowed).
Consider refactoring.

[how]
Remove not really needed special case.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00
Fini Jastrow
07a23bda90 name-parser: Allow dashes between modifier and weight
[why]
Some fonts might have a non-standard (i.e. broken) weight naming scheme:
They put a blank or a dash between the modifier and the weight, for
example "Extra Bold" or "Demi-Condensed", when they mean "ExtraBold"
resp "DemiCondensed".

The former happens with CartographCF, the later with IBM3270.

[how]
Automatically allow a dash between modifier and weight, which comes up
as CamelCase boundary. Insert an optional dash (r'-?') into such
boundaries.
For the further lookup we need to remove the dash in the found keyword,
if there is any, to get back to standard naming.

This might break if the font name ends in a modifier. So we can not
really distinguish

       Font Name Extra Bold Italic
    => Font Name - ExtraBold Italic
    => Font Name Extra - Bold Italic

The known modifiers are 'Demi', 'Ultra', 'Semi', 'Extra'.

It is possible but unlikely that a font name ends in one of these.
For example "Modern Ultra - Bold".

[note]
The question arises if we should not parse the PSname instead of the
Fullname; and stick to the dash there as boundary.
The problem might be prepatched fonts with broken naming, that would be
parsed completely wrong then. So maybe the current approach is still the
best, with the caveat given above (fontnames ending in a modifier).

[note 2]
Funny enough the variable allow_regex_token was not used at all :->
Some leftover? Anyhow we use it now.

[note 3]
We can still not remove the special handling for IBM3270, because the
font initially looks like a PSname and this is parsed as such, which
breaks the name in the incorrect place:

        PSname template  = "Name-StylesWeights"
        Fullname of 3270 = "IBM 3270 Semi-Condensed"

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00
Fini Jastrow
f1c2eea937 name-parser: Fix unify_style_names()
[why]
The code is obviously wrong. No effect has been seen, though.

First we check if a certain string is a key in the dict.
If it is, we retrieve the value with the string lower-cased as key.

This does not make sense.

[how]
All the keys are lower case anyhow, so the code seems unneeded. Maybe it
is a leftover. The styles that go into it _and are in the dict_ all come
from a regex-enabled search and thus are lower-cased.

Whatever, to have the correct code we use the lower-cased string for
both, checking for existance and retrieving the value - this is the only
sane approach.
Also change to dict.get() method instead of a self made if code.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00
Fini Jastrow
b0e5a35477 name-parser: Remove filename parsing code
[why]
Patching CartographCF-Bold.ttf creates this naming:

    Family (ID 1)      : CartographF Nerd Font Condensed
    SubFamily (ID 2)   : Bold
    Fullname (ID 4)    : CartographF Nerd Font Condensed Bold
    PSN (ID 6)         : CartographFNF-CondensedBold
    PrefFamily (ID 16) : CartographF Nerd Font
    PrefStyles (ID 17) : Condensed Bold

    CartographF Nerd Font Condensed Bold
    \===> 'CartographFNerdFont-CondensedBold.ttf'

[how]
The font-patcher historically used the file name of the to-be-patched
font to come up with the new name. When the FontnameParser has been
developed that mechanics has been copied at least for fallback. The
earliest tests compared old and new naming with all the filenames.

Later, when the FontnameParser has been used to really apply name
changes it has always based the parsing on the Fullname or the PSname,
because they really hold the information (or at least should hold);
while the filename might be completely random.

Still code the dealt with specific problems in FILEnames prevailed. The
Ubuntu font for example has a file name like 'Ubuntu-C.ttf', and we
needed to convert the C to Condensed.

As that requirement vanished we can drop all the code that has been
added specifically only for parsing the Ubuntu font filenames.

Side note: USUALLY font filenames should be roughly equal to the PSname.

Fixes: #1258

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-26 13:01:58 +02:00