Commit graph

426 commits

Author SHA1 Message Date
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
Fini Jastrow
438843d57a FontnameParser: Fix fsSelection for --has-no-italic
[why]
For fonts that have no Italic but an Oblique - i.e. when Oblique shall
replace the Italic role in RIBBI font grouping (classic group of 4) -
that grouping fails.

This affects DejaVu on Putty.

[how]
For RIBBI grouping only the classic bits are considered. That means that
for fonts that have Oblique instead of Italic (and not additionally) we
need to set the ITALIC bit and the OBLIQUE bit. This has been
overlooked.

Cite from the specs:

> This bit, unlike the ITALIC bit (bit 0), is not related to style-linking
> in applications that assume a four-member font-family model comprised
> of regular, italic, bold and bold italic. It may be set or unset
> independently of the ITALIC bit. In most cases, if OBLIQUE is set, then
> ITALIC will also be set, though this is not required.

[note]
Also increase font-patcher version.

Fixes: #1249

Reported-by: Huifeng Shen <liaoya@gmail.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-22 13:32:11 +02:00
Fini Jastrow
fe9a2d70f3 casks: Add zap stanza comment
[why]
Casks without zap stanza are flagged; all casks should contain them.

The font casks do not really need zap.

[how]
What is the right way to say 'we considered zap, but do not need it'?

It seems that other people add a comment (the same comment).
For example here:
https://github.com/Homebrew/homebrew-cask/pull/119090

And that seems rather widespread.

        git/homebrew-cask/Casks$ git grep '# No zap stanza required' | wc -l
        101

Include the same in our casks.

[note]
https://github.com/Homebrew/homebrew-cask/issues/88469

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-13 12:53:15 +02:00
Fini Jastrow
d812d153ab Start release v3.0.1
Edit ./package.json
Run version-bump.sh 3.0.1

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-13 07:49:58 +02:00
Fini Jastrow
f17700946c Add script to create sample set
[why]
After changing something in the patch process it is unclear if all the
prepatched fonts will look ok later. It would be nice to produce one
font from each input font (and not the complete set of each of the faces
of that font) to have some hopefully representative example how symbols will
blend into the font.

[how]
Add a script with explicit list of representative fonts.
Evaluate the config.cfg and execute one patcher run.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-12 13:21:20 +02:00
Fini Jastrow
41521254f1 gotta-patch-em: Fix wrong config setting
[why]
The config.cfg settings can be wrong if the to-be-patched font does not
set its own. The previous settings are never cleared, so that the flags
leak into the next font(s).

This is only relevant when the run is not parallel (i.e. no -j given) and
all fonts are patched sequentially in the same shell.
On parallel runs (like the release process) this is not a problem
because each patcher runs in its own subshell.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-12 13:21:20 +02:00
Finii
8fd192e77c [ci] Rebuild original-source font 2023-05-11 18:04:07 +02:00
Fini Jastrow
781206aaba generate-original-source: Increase icon size
[why]
The Seti and Custom icons are smaller than in ancient Nerd Font versions
and can seem a bit flimsy. In fact we add about 25% of padding (12% left
and 12% right) to each icon, which seems a bit generous.

This does not show in Nerd Font Mono fonts, because the icons will be
rescaled there, but in the other fonts.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-11 18:04:07 +02:00
Fini
7e2326b86c
Merge pull request #1222 from negset/master [skip ci]
Fix the REGULAR bit of the fsSelection being set incorrectly
2023-05-10 13:00:53 +02:00
Fini Jastrow
9f54f24738 Octicons: Create missing file-symlink-directory (2/2)
Just run ./generate.

Compare commit
  7764e05  Create new octicons.ttf (update to v18.3.0) (2/2)

Fixes: 1213

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-05-10 12:49:17 +02:00