[why]
The JetBrains Mono family names are still broken.
The commit
b98c2a19 Fix JetBrains Mono Family names
did not do much, because it was not activated with gotta-patch-em.
The previous commit fixed that.
Put the fonts in the repo are still wrong. Repatching those gives a
chance to test them properly before v3.0.0.
[how]
Run gotta-patch-em with version set to v3.3.3-p6 because thats the git
status right now.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
JetBrains Mono is patched without `--makegroups`, although it is
specified in the `config.cfg`.
[how]
As with the licenses the code expects a specific font directory depth.
That is violated with some fonts, for example JetBrains Mono.
The config is never found.
Compare commit
8a749ab21 patch-em-all: Fix missing licenses
Fixes: #1081
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
I'm not sure why it has been in the code like this, and I removed these
strange globs already before in some places [1].
find -name "*.[o,t]tf"
actually allows
*.otf
*.ttf
*.,tf
[how]
Remove spurious comma in all `find` calls.
Systematically.
[note]
Just some commits mentioned here:
2ace3de8e7722458821ac6817bc729e2
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
With commit
6e361d40c cheat-sheet: Allow click to copy on hex value
(on branch gh-pages) we add the possibility to copy the raw hex code by
clicking on the hex number.
It would be more obvious if there is a tooltip.
[how]
Add tooltip via 'title' in cheat-sheet generator script.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Travis stopped working in 2021, and we would need to set up a new thing
somewhere else.
The shield is always red (because Travis stopped working at all), which
does not look good ;-)
See also #212
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Also correct some metadata in package info.
Reason for this bugfix release is problem we had with 2.3.2 and Symbols
Only font. Tried to fix the release retroactively but Arch was faster.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The commits needed to be in the master branch, but that is protected, so
we can not force push the commits away after debugging.
Revert "DEBUG: Show directory contents"
Revert "DEBUG: archive-fonts.sh"
Revert "DEBUG: Add more of original workflow"
This reverts commit 40f6990282.
This reverts commit 9e3fdefeba.
This reverts commit 5e8b8c6ed5.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If the license file is not in the same folder as the font file or its
parent directory it will not be copied.
Example:
├── AUTHORS.txt
├── config.cfg
├── copyall.sh
├── Ligatures
│ ├── Bold
│ │ └── JetBrainsMono-Bold.ttf
│ ├── BoldItalic
│ │ └── JetBrainsMono-BoldItalic.ttf
├── OFL.txt
└── README.md
When processing one font file (.ttf) the OFL.txt is neither in the same
nor in the parent directory (but rather in the parent's parent.
[how]
Collect all license-ish files for a complete font set and copy them all
over each other into all appropriate destinations in patched-fonts.o
Note that in situations like this:
├── fonts.dir
├── fonts.scale
├── L
│ ├── Bold
│ │ └── Meslo LG L Bold for Powerline.ttf
│ ├── config.cfg
│ └── LICENSE.txt
├── LICENSE.txt
└── README.rst
All LICENSE.txt files will be copied, but only the last one will 'win'.
So make sure all license files are identical.
Fixes: #1068
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
For some reason we work with strange paths like "root/a/b/../../c/d/e"
instead of "root/c/d/e".
[how]
Use dirname to go directories up.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When running with --info on a completely empty patch-destination some
directories are missing and are never created. They would have been
created by the actual patching that is suppressed now.
[how]
Check and create the needed subdirs.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Somehow the license file is missing from the release run.
It is present if I run it on the local machine.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We added a lot of glyphs in Seti + Custom and the new range Material
Design Icons.
[how]
Create new graphics with generator, see README.md.
Use Inkscape to implant into old image.
Note:
In the totals just the new Material Design Icons are included, the old
(obsolete, to be removed) range is not counted at all anymore.
Also did not change the distribution of the diagram. When we would
create a real sankey diagram (with the actual numbers) all the other
sets would be dwarfted by the new Material Design Icons.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
List comprehension helps with readability. Also add comments that
describe expected data structures of altuni and references. Also bump up
the patcher version number.
[how]
Use list comprehension. Add comments. Change the version number.
[why]
Using `continue` feels inelegant when there's a way to write the if
conditions in add_glyphrefs_to_essential() without necessitating the use
of `continue` while ensuring that the function still works as intended.
[how]
Change the `if` conditions and remove any usage of the `continue`
keyword in add_glyphrefs_to_essential().
[why]
Issue #400 recently reoccurred with the latest build of Input font, and
it turns out the dotless-j part of the small `j` now points to U+0237,
which in turn has an alternate unicode encoding to U+F6BE; overwriting
U+F6BE effectively overwrites U+0237, and in turn, alters the small `j`.
This patch aims to fix that.
[how]
In addition to references, the patcher also checks for alternate unicode
encodings which are returned by the glyph.altuni attribute, adds those
to the essential set of glyphs, and in turn recursively searches for
their references/alternate unicode encodings, making sure to handle
circular references (for example: U+2010 and U+2011 in Input Mono)
[why]
When HHEA and (depending on USE-TYPO-METRIC) TYPO or WIN are not
consistent it is unclear which metric we should trust.
In #1056 the complete font bounding box (i.e. yMin and yMax) has been
compared to the baseline to baseline distances, and in all these cases
the WIN values seem to be best (preserve the glyph bounding box).
font-line report fontname.ttf | grep metrics:
ttfdump -t head fontname.ttf | grep "yM(in|ax)"
[note]
Roboto will still be clipped?! There seem to be ridiculously high glyphs
in there. Did not check which.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The initial font-patcher used the WIN font metrics to determine the cell
height. What has been found was forced into HHEA metrics but without
observing the USE_TYPO_METRICS flag.
That has been changed to use the TYPO metric instead of the WIN metric
when the font wants that. For that the gap value becomes important.
This is the current code. It still has problems to detect the correct
cell height. A more rigorous approach seem to be needed.
[how]
The baseline to baseline distance is what we need as 'cell height', to
fill it completely with the powerline glyphs. This is a little bit
complicated and not really specified, each font rendering application or
engine can handle the font metrics differently. But there are some
common approaches.
So we try to come up with the correct and congruent height, comparing
different metrics and issuing a warning on problematic fonts.
Afterwards we make all metrics equal (even if they were not before),
because our goal is clear now and we impose it onto all platforms.
[note]
Useful resources:
* https://glyphsapp.com/learn/vertical-metrics
* https://github.com/source-foundry/font-lineFixes: #1056
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The -l option tries to improve (especially) the powerline glyphs by
making the baseline to baseline height (cell height) an even number.
But it does so only for 2 of the three possible metrics.
[how]
Assuming the hight is identical for all metrics we just need to add '1'
to all ascender values.
[note]
I'm not sure this does anything. After rounding an odd height might
create a 'sharper' triangle tip, not an even height?
Do not understand the real reason for the -l option.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
More often than not (i.e. almost always) I cancel the release workflow.
The problem is that a release workflow will patch all fonts, and all
fonts will differ (at least in the timestamp) and so the repo will grow
A LOT. Usually you want to be really conciously deciding that the growth
is really warranted, and no automatic can do that.
I guess one could trigger rebuilding the zip archives but not commiting
the newly patched fonts back to the repo, but that is also a strange
situation.
[how]
Release has now only a workflow-dispatch trigger, that must be clicked
if a release workflow shall run.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Although Monofur is monospaced it has one glyph (hyphen) that is
slightly wider than all others. This results in a Monospaced font that
is slightly too wide.
[how]
Ignore the hyphen width.
[note]
Additionally improve (commented out) debug code (shows now hex
codepoint).
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If a `Nerd Font Mono` font is to be created we need to make sure the
original font is indeed monospaced. If it is not and we enforce the same
adavnce width on all glyphs they will look very ugly. Fonts need to be
designed to be monospaced.
We spot check only some characteristic glyphs for that.
Hermit Bold has a problem. Although it looks more or less monospaced it
has some glyphs wider than all the others, for example the small letter
`m`.
Creating a `Nerd Font Mono` (a font where all glyphs have the same
width) will either: Add too much space to the right of all the other
(smaller) glyphs, or will have the wider glyphs cut off on the right.
[how]
Add small letter 'm' to the spot check list. Now the patcher will by
default refuse to --mono patch that font.
Also add output of first char that fails the monospace check. This makes
debugging easier.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If a font is problematic to patch as monospaced font, that is detected
but the reporting is maybe not strong enough and gets overlooked.
[how]
Pull font property reporting into dedicated functions.
Use that function additionally in other warning.
[note]
The monospace check uses all glyphs to determine the advance width, but
the actual advance width later ignores some glyphs (that are problematic
in some fonts and are thus ignored, although that glyphs will 'break'
after patching).
This might or might not be useful, I just leave it as it was before.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
With commit
99c260831 font-patcher: Fix more 'Nerd Font Mono' too wide
the glyphs 'ij' and 'IJ' are exempted from the advance width
calculation, because some fonts (i.e. Overpass Mono) defines them as two
cell wide glyphs (Hello? 'Mono'?)
For some obscure reason it was 'IJ' and 'J circumflex' that were
exempt, not 'ij'.
[how]
Exempt correct code.
Fixes: #703
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
With commit
f240e073f font-patcher: Fix windows Mono family names with --makegroups
the script version did not change, which makes it impossible to say if a
user uses a bugfixed patcher or not.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The previous commit
f240e073f (HEAD -> master, origin/master, origin/HEAD) font-patcher: Fix windows Mono family names with --makegroups
fixed a bug in teh font naming; instead of "NFM" the fonts were named
"NF Mono", which is wrong.
Affected are the fonts patched with --makegroups --mono --windows.
That means 1/4 of the fonts of
* Iosevka
* JetBrains Mono
* mononoki
* Cascadia Code
[how]
Run gotta-patch-em-all with FF 20230101 locally.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Without --makegroups the font family is "Name NFM", but with it enabled
we get "Name NF Mono".
[how]
Mimic the old short-naming also for the groups.
This feels a bit strange, why do we need to specify the names three
times for `inject_suffix()`, slightly different. At some point this
should probably be unified.
def inject_suffix(self, fullname, fontname, family):
"""Add a custom additonal string that shows up in the resulting names"""
In principle Family + Subfamily -> Fullname -> Fontname
Somehow we rename not according to the default rules.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>