Commit graph

1494 commits

Author SHA1 Message Date
Fini Jastrow
0101e3c24f doc: Remove EM size from readme source-font table [skip ci]
[why]
With addition of the version the lines are too long to be rendered
without wrap in the default gitlab width.

The EM size is not really relevant for most, while the version is.
And we want a concise table, so something has to leave.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-17 11:58:28 +02:00
Fini Jastrow
b82bd819aa Remove mentions of master branch [skip ci]
[why]
If we ever switch the default branch the links would break. So just say
'default branch' directly, whichever that may be.

[note]
CI workflows not changed, I do not know if there is an alias for the
default branch available.

Fixes: #971 (partially)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-17 11:50:53 +02:00
Fini Jastrow
5b2edf9ecf doc: Add sourcefont versions to readme
[why]
This makes it easier to check if we are up to date.

[note]
Just checked the versions where a source links has been given.

Updated a few links and sorted stuff.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-17 11:25:26 +02:00
Finii
f1094f1fad [ci] Rebuild original-source font 2022-10-13 14:43:09 +00:00
Fini Jastrow
49878a2f61 CI: Remove set-output commands [skip ci]
[why]
The set-output command will be removed, see [1].

[how]
Use output environment file instead.

[1] https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-13 16:37:20 +02:00
Fini Jastrow
5fe831289f ci: Change commit message of rebuild [skip ci]
[why]
Messages should be in the imperative form.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 14:02:08 +02:00
Fini Jastrow
26a435e020 Rebuilds patched fonts
[how]
./gotta-patch-em-all-font-patcher\!.sh /NerdFontsSymbolsOnly

Just add `Mono` variants to commit.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 13:47:45 +02:00
Fini Jastrow
f84b4a26e4 Symbols Only font: Remove gaps
[why]
We do not want fonts with gap. Gaps are explicitely removed on patching
anyhow. Why should the templates have gaps?

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 13:46:54 +02:00
Fini Jastrow
3e478f7cf8 font-patcher: Fix empty input font detection
[why]
If we have an empty input font (i.e. for Symbols Only font) and that
font has a gap.. That gap will be redistributed to a gapless font where
the ascenders and descenders are expanded to fill/keep the gap.

If the font has no height (i.e. == ) and a gap, the height will
afterwards be > 0 and the empty font detection breaks.

[how]
Detect empty fonts before gaps.

Fixes: #965

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 13:46:54 +02:00
Fini Jastrow
6f4af9482d font-patcher: Clarify height code
[why]
Use of abs() looks like we do not know if the descenders are expected
to be positive or negative. But it is well defined.

Furthermore on abnormal fonts (where the descenders are nonexisting)
we can use the wrong value. Well, that is academic I guess.

[how]
In our own `ymin` value we store a value like os2_descender, which means
that it is on the same axis as the ascender (ymax). Typical values where
the baseline is on y-coordinate 0 ymax will be positive and ymin (being
below the baseline) will be negative.

The total height has to be calculated from adding ascender + -descender
(when the descenders are lower than the ascenders, which is guaranteed).

The older descender values have positive values; are on an opposite y
axis... The height with them would be ascender + descender.

Well, WE have in the font_dim os2-like values...

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 13:46:54 +02:00
Fini Jastrow
4bca7849fe gotta-patch-em-all: Fix config_has_powerline
[why]
There is code that shall read the config file and act on
config_has_powerline.

Usually it is set to "1", but Ubuntu has this "0".

Regardless the content, if the variable has content the code assumes the
value is true. That is probably not wanted.

[how]
Use a numeric comparison.

[note]
```
git blame UbuntuMono/config.cfg
4abe6c77b0 Ubuntu/Bold-Italic/config.cfg (Ryan L McIntyre 2017-07-23 17:17:21 -0400 1) config_has_powerline=0
```

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 10:01:06 +02:00
Fini Jastrow
fc22acc3e3 doc: Fix link to pull request course
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 09:05:23 +02:00
Fini Jastrow
de06ddfcbc Rebuilds patched fonts
[why]
We do not want to rebuild all fonts, just the affected ones.
Without a proper release timestamp this is impossible (i.e. harder) to
do via CI, so do it manually 😬

[how]
./gotta-patch-em-all-font-patcher\!.sh /JetBrainsMono/Ligatures/ExtraLight
./gotta-patch-em-all-font-patcher\!.sh /JetBrainsMono/Ligatures/Light

Hmm, the patched fonts got slightly smaller. These font file sizes are a
mystery for me.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 08:49:44 +02:00
Fini Jastrow
a72f9961dd Fix JetBransMono != ligature
[why]
In JetBrainsMono v2.242 the exclam-equal ligature is broken.
It has been fixed in v3.000.

[how]
The JetBrains Mono v3 has not been released yet. So we just transplant
the one broken glyph from v3.000 into our v2.242.

[note]
https://github.com/JetBrains/JetBrainsMono/issues/494

Fixes: #963

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 08:49:44 +02:00
Finii
da88bdb616 [ci] Rebuilds patched fonts 2022-10-10 16:49:55 +00:00
Fini Jastrow
ee17073b62 font-patcher: Fix checksum algo
[why]
For some fonts the calculated checksum(s) was wrong.

[how]
Misplaced the multiplier ... the LSB shall not be shifted of course, but
the current code shifts as last action: Also the LSB is shifted.

First shift (old) accumulated content, then add new data.
In that way the last added data (LSB) is not shifted.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-10 16:29:20 +02:00
allcontributors[bot]
876faa922a docs: update .all-contributorsrc [skip ci] 2022-10-09 10:29:08 +02:00
allcontributors[bot]
296eef9074 docs: update CONTRIBUTORS.md [skip ci] 2022-10-09 10:29:08 +02:00
Fini Jastrow
0f8b75f3c3 Update changelog [skip ci]
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-08 19:55:59 +02:00
allcontributors[bot]
a1730fa10e docs: update .all-contributorsrc [skip ci] 2022-10-08 18:36:23 +02:00
allcontributors[bot]
b3199a7286 docs: update CONTRIBUTORS.md [skip ci] 2022-10-08 18:36:23 +02:00
Kurt
322d08f824 doc: update zh-tw translation documentation 2022-10-08 18:36:06 +02:00
Finii
77346b3bc0 [ci] Regenerate CSS files 2022-10-07 12:05:00 +00:00
Finii
3a97add78b [ci] Regenerate fontconfig 2022-10-07 12:04:54 +00:00
Finii
4f2f8ff820 [ci] Rebuilds patched fonts 2022-10-07 11:58:20 +00:00
Finii
cdcf7a5a30 [ci] Bump release version 2022-10-07 11:55:35 +00:00
Fini Jastrow
732d0fa203 Trigger Release 2.3.0-RC
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-07 11:58:30 +02:00
Fini Jastrow
6d30fee4bf font-patcher: Respect gap values in source font
[why]
We just ignore specified gaps in the source fonts (i.e. set them to
zero). This reduces the line spacing in the patched font (because the
gap is missing).

[how]
Distribute the gap INTO the cell, so that we can work with zero gap (we
need that for the powerline glyphs), and still keeping the powerline
glyphs centered about the regular glyphs AND keeping the total line
spacing.

Idea-by: Tushar Singh <tusharvickey1999@gmail.com>

Fixes: #850

Reported-by: Joe Bolts
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-07 11:56:12 +02:00
Fini Jastrow
ed33d1b943 Update 3270font to v3.0.1
[why]
We have only a rather old 3270font: v1.2.23

This new font can be processed with current FontForge without problems.
And we have the benefit of an update.

[how]
Because the paths change (Medium->Regular etc) we need to purge the
patched-fonts/ directories manually. The automatic purging does work
only if at least the paths are kept.

[note]
https://github.com/rbanffy/3270font

Fixes: #947

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-07 11:55:34 +02:00
Finii
6742fb221d [ci] Regenerate fontconfig 2022-10-07 09:06:27 +00:00
Finii
7b0d73f609 [ci] Rebuilds patched fonts 2022-10-07 08:59:26 +00:00
Fini Jastrow
25d8c0d0bd Update Inconsolata to v3.000
https://github.com/googlefonts/Inconsolata

Only small changes visually, but of course completely different from the
paths (because now the source is a 2D variable font).

Small letter t changed a bit.
Under the letter dot and block-building glyphs changed.
Subscript numerals.

Closes: #774

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-07 08:28:08 +02:00
allcontributors[bot]
f9676d96cb update .all-contributorsrc [skip ci] 2022-10-07 07:36:37 +02:00
allcontributors[bot]
f907e4f171 update CONTRIBUTORS.md [skip ci] 2022-10-07 07:36:37 +02:00
Fini Jastrow
e459f55bff doc: Fix more missing/changed image links
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-07 06:57:27 +02:00
Kurt
1e24cb6745 docs: fix logo image source path 2022-10-07 06:57:27 +02:00
Fini
969c53d964
Merge pull request #912 from ryanoasis/feature/avoid-patching-proportional
Avoid patching proportional sources
2022-09-24 16:59:11 +02:00
Fini Jastrow
feafa89bb3 font-patcher: Prevent --mono on proportional fonts
[why]
When the source font is proportional we can not really create a
monospaced (patched) font from it. The glyph width is for example very
small for 'i' but wide for 'W'.
The glyphs are all left aligned, leaving very strange separation between
smallish glyphs.
Even if we would center the glyphs, the look would be strange and
completely differenmt from the source font's look.

[how]
For proportional fonts do not allow to patch with `--mono`.

The fact if a source font is monospaced is determined by examining some
(very few) glyphs. But testing all our source fonts in the repo shows
that it is sufficient.
Furthermore the Panose flag is checked and differences between the flag
and what the glyph examination found are reported.

The user can enforce `Nerd Font Mono` generation with double specifying
the command line option `--mono --mono`. Still a warning will be issued.

[note]
Because `gotta-patch-em-all-font-patcher!.sh` does not really count the
variations but calculates them in a separate loop it does not know
anymore how many variations are created per family. The numbers are
wrong.
But probably we should count the result font files in the end anyhow.

Because the information is not needed (in an automated manner) this is
not corrected here.

It seems wrong anyhow:
  total_variation_count=$((total_variation_count+combination_count))
  total_count=$((total_count+complete_variations_per_family+combination_count))

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-24 16:56:30 +02:00
Fini Jastrow
cb5f8ccbb8 query_names: Unify field widths
[why]
For some fonts with long names the fields are not long enough and for
example a 'Mono' can not be seen.

[how]
Use same field widths as `name_parser_test2`.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-24 13:53:48 +02:00
Fini Jastrow
122b4798dc doc: Update readme(s) for new install.ps1 flags
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-24 12:01:51 +02:00
Evan Reed
539eb92138 Feature: Add -WindowsCompatibleOnly switch parameter to install.ps1
Fixes: #840
2022-09-24 11:56:39 +02:00
Fini Jastrow
1d21ef9e79 font-patcher: Preserve existing bitmaps
[why]
Bitmaps existing in a font are discarded. The font-patcher script just
cares about outline fonts.

[how]
If the sourcefont has bitmaps, do save them into the patched font. Note
that this does not generate bitmaps for the patched-in glyphs (icons).

[note]
Fonts probably affected in src/unpatched-fonts:
    bitmap (11,) (gohufont-11)
    bitmap (14,) (gohufont-14)
    bitmap (11,) (gohufont-uni-11)
    bitmap (14,) (gohufont-uni-14)
    bitmap (7, 9, 10, 12, 14, 18, 24) (ProFontIIx)
    bitmap (12, 14, 16, 18, 20, 22, 24, 28, 32) (TerminusTTF-Bold Italic-4.40.1)
    bitmap (12, 14, 16, 18, 20, 22, 24, 28, 32) (TerminusTTF-Bold-4.40.1)
    bitmap (12, 14, 16, 18, 20, 22, 24, 28, 32) (TerminusTTF-Italic-4.40.1)
    bitmap (12, 14, 16, 18, 20, 22, 24, 28, 32) (TerminusTTF-4.40.1)

Fixes: #86

Reported-by: DoctorKnowsBetter
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-24 11:40:29 +02:00
Fini
3b57d3b78a
Merge pull request #778 from ryanoasis/feature/stable-codepoints
Feature: stable codepoints
2022-09-23 11:55:36 +02:00
Fini Jastrow
501dd29a31 font-patcher: Clean up patch sets
[why]
The patch set table has 'contradicting' or 'complicated' entries.

[how]
When we use exact patching a SrcStart will be ignored and shall be None
to make that clear.

The other two cases patch in only one glyph, make the entries more easy
we could either make them 'exact' (reuse source codepoint) or specify a
SrcStart. At the moment they rely on the (hidden?) rule that non-exact
entries without SrcStart still reuse the SymStart...

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-23 11:42:35 +02:00
Fini Jastrow
92d8a6007e font-patcher: Make symbol codepoints (more) stable
[why]
The Font Logos and Octicons codepoints depend on the parallel existence
of FontAwesome. I.e. Font Logos is shifted of Octicons or FontAwesome is
also present in the patched font; Octicons is shifted if FontAwesome is
present.

This means that people, although using a Nerd Font, can expect the
symbols in different locations. The reason is clear; people that just
want one or some symbols and use a specifically patched font will be
able to use the original symbol font codepoints.

But I guess that these uses are nonexisting. Almost all will use
'complete' patched fonts and that is what we deliver and document.

To make the documentation less complicated we should fix the code point
ranges that a specific symbol set will be patched in at.

[how]
Just drop the associated functions and use a False constant instead.

[note]
The two possible places where Octicons / Font Logos ends up are there
since they have been added back in 2015/6 (commits 9620d47ae, f933b5a2).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-23 11:42:35 +02:00
Fini Jastrow
7ca44d063f font-patcher: Remove "SrcEnd" option
[why]
In patch set definitions we have for the source ranges SymStart and SymEnd
and for the destination we can specify SrcStart and SrcEnd

The SrcEnd can be automatically generated. For SrcEnd values that differ
from the autogenerated value (are lower) the script would crash, or (are
higher) ignore them anyhow.

There are two modes: 'exact = True' and 'exact = False'.

The SrcStart and SrcEnd values are ignored if exact is True, because the
glyphs are patched into the same codepoint where they originate. This
also means that gaps in the symbols are preserved - all patched in
glyphs have the same codepoint as they have in the source (symbol) font.

When exact is False on the other hand, all (non empty) glyphs are filled
into the codepoints that start at SrcStart. Gaps (empty glyphs) are
ignored and thus are not present as gap in the patched font anymore (*).
The to-be-filled-next codepoint in the patched font just increases by 1
on every filled symbol.

See note for the reason.

This also makes maintining the patch set easier as noone needs to
'calculate' a SrcEnd value anymore.

[how]
Use directly the start value and the counter instead of filling an array
with a range, that is then indexed by the counter.

Before this commit:

  list_of_patched_font_codepoints = list(range(SrcStart, SrcEnd + 1))
  current_codepoint = list_of_patched_font_codepoints[loop_counter]

After this commit:

  current_codepoint = SrcStart + loop_counter

[note]
Maybe related to code removed with c728079b6.

I guess the code uses the list, because it has been believed that glyphs
can only be indexed by strings containing a hex number. The array
supposedly contained that strings.

But in fact the fontforge python module docu is like this:

font.__getitem__(key)

    If key is an integer, then returns the glyph at that encoding.
    If a string then returns the glyph with that name.
    May not be assigned to.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-23 11:42:35 +02:00
Fini
23ae931a6f
Merge pull request #783 from ryanoasis/feature/process-ttc
Feature: Process TTC files
2022-09-23 11:18:32 +02:00
Fini Jastrow
7c5c838122 font-patcher: Enable lowestRecPPEM fix in TTCs
[why]
The font flags and PPEM fix does not work with font collection files,
because it does not know how to handle them. It assumes a ttf or otf
font with the specified table structure.

The fix (for single font files) has been introduced with commit
  40138bee9  font-patcher: Handle lowestRecPPEM

[how]
Check if the file is of type 'ttcf', and if so fast forward to the given
single font index into the collection.

This can be rather slow...

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-23 10:52:55 +02:00
Fini Jastrow
e8a17c71bf font-patcher: Increase script version
[why]
With the new TTC feature we might increase the minor number ;-)
This is not just a bugfix.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-22 19:02:47 +02:00
Fini Jastrow
e515cccab9 font-patcher: Allow patching of True Type Collections
[why]
Someone might want to patch a whole lot of fonts that come in a ttc.

[how]
Just open all fonts that the input file contains (1 or more) and create
a single font or collection font file.

The automatic layer detection does not work in all cases for me, so we
need to manually search for the foreground layer (usually '1').

Code inspiration taken from
https://github.com/powerline/fontpatcher/pull/6

[note]
Changed output in the end to the filename (before it was the font name),
so that one can easily copy&paste or open that file.

Reported-by: Lily Ballard <lily@ballards.net>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-22 19:02:47 +02:00