[why]
This can not work.
Issue 1:
It is unspecified in which order the font matrix jobs run, so the
version number changes somewhen.
The changed (version-bumped) files are never committed and written back,
so this would have to be done manually anyhow.
The version-bump script itself has issues because the regexes for the
change are a bit too loose and other version like strings are changes
also (like the Script Version).
Issue 2:
The script changed versions that should not be changed like the script version
in the scripts (rather than the NF release version).
In bin/scripts/generate-glyph-info-from-set.py pumping has been
forgotten/omitted completely.
[how]
In the version-bump script:
* Use more modern regex
* Instead of copying the code use a loop
Create a commit with the bumped version information in all scripts.
This can only be done with the final job, because we have a problem to
checkout the modified version with actions/checkout.
We need to bump the version on every patch job, because we need the correct
information already in the script when we patch.
[note]
This does not prevent to have multiple commits attempts that change to the same
version. But if the change is empty, no commit will be added and the
step is silently ignored.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The self-written upload-archives script is some issues, for example it
does not replace preexisting release files with new ones when a release
is re-triggered. The error messages are rudimentary at best.
[how]
Use https://github.com/softprops/action-gh-release instead.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The naming has bizarre blanks strewn in sometimes,
or is all caps. For example
`C a s k a y d i a C o v e` or
`CASKAYDIACOVE-Regular`
[how]
When run under Python2 all strings are unicode strings because
`unicode_literals` is imported by `font-patcher`.
Unfortunately the code checks for type str; but that will all become
type unicode with the import.
One check is suboptimal anyhow and can be dropped, while the other is
turned around.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Sometimes scripts can not be run.
[how]
Depending on installed python versions and 'alternatives' setup the
script's shebang needs to point to python3 of course.
Also the files need the executable bit set.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The option `--parser` instructs `font-patcher` to come up with the font
naming by utilizing the FontnameParser object.
This sounds logical from a programmers perspective, but the option name
is not descriptive for end users of `font-patcher`
[how]
As usual naming is hard. A short but maybe more descriptive name for the
option can be `--makegroups`; as it describes what the option means for
the end user: functioning font grouping.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The fontname for Windows can be quite unusable, for example
`CaskaydiaCoveNerdFontCompleteM-`
for several different fonts, as this is the maximum allowed length of 31
characters that is enforced.
The style/weight is completely lost.
[how]
Split the name into base and style (at a dash `-`) and just shrink the
base name. Result for example:
`CaskaydiaCoveN-ExtraLightItalic`
Use equal approach for the PostScriptName (although it is less likely
that length limit is ever met).
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
fontforge has an undocumented call to set the fsSelection bits.
Never rely on documentation :-(
Found this here:
https://github.com/fontforge/fontforge/issues/3174
And the readback values are actually not read from the source font, so
we do not use them.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Under certain circumstances the WWS names (Family and Subfamily) are
used to identify a font. We do not touch these SFNT table entries, so
when the font is renamed these are wrong (have the original name).
Font-grouping will go wrong then.
[how]
The typographic ('Preferred') Family and Styles are set correctly
already and they follow the WWS pattern, so the WWS fields can be (and
should) be empty. They exist to allow font grouping in the case where
the typographic names do not follow that pattern.
Remove preexisting WWS entries (because they are not needed anymore,
otherwise we would need to write the corrected new names there).
We already set the WWS bit in fsSelection that is needed:
def fs_selection(self, fs):
"""Modify a given fsSelection value for current name, bits 0, 5, 6, 8, 9 touched"""
[...]
b |= WWS # We assert this by our naming process
return b
Unfortunately we have no way (jet) to set fsSelection.
This is only the case for Iosevka for all fonts in src/unpatched-fonts.
Reported-by: Rui Ming (Max) Xiong <xsrvmy>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
DO NOT MERGE
[why]
A lot of the fonts have incorrect naming after patching. A completely
different approach can help to come up with a consistent naming scheme.
[how]
See bin/scripts/name-parser/README.md
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The detection if all fonts of a given directory are to be processed is
broken if the font files contain blanks
(like 'Symbols-1000-em Nerd Font Complete Mono Windows Compatible.ttf')
[how]
Need to put name argument in quotes...
Also fix counting for sfd files (but we never generate them anyhow)
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The symbol only fonts Symbols-1000-em Nerd Font Complete.ttf
and 2048-em in `NerdFontsSymbolsOnly/` are generated from
some 'almost' empty source fonts, that are assumable in turn generated
from the sfd font descriptions in `src/glyphs/`?
The process is not documented and we have issues in the generated font
(for example the glyph for capital `E` is defined (and empty) #581#765).
[how]
Use the existing font definitions from `src/glyphs/*.sfd` directly as
source font. That needs a change in font-patcher because the empty
fonts have no glyphs that can be used to orient the scaling upon. In
that case scale on the source font definitions EM.
Then we need patch-em-all to also patch *.sfd fonts.
And finally we need patch-em-all to take a font specific command line
switch for font-patcher (compare 9e2bc9a26 of #723) to instruct it to
create a ttf rather than a sfd font file.
In the sfd file we additionally set the Panose type.
And the UnderlinePosition is adjusted to match the current patched font.
[note]
Also fix wrong glob pattern in patch-em-all `*.[o,t]tf`. The comma is
for sure some leftover from a '{}' shell pattern, that is not used
anymore. (This comment is probably outdated, due to rebasing.)
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We want to patch some fonts with different font-patcher options.
[how]
Use the config.cfg file that each source font can have to specify one
arbitrary option to the font-patcher calls.
[note]
This is partially commit 9e2bc9a26 from #723.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Lilex is missing from the 2.2.0 RC and is not automagically patched.
[how]
Add Lilex to the font metadata database :->
[note]
Lilex's licence has no RFN given.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The new 'pathname' pattern always added a '*' glob to the end.
So when we wanted to (just) recreate "Inconsolata" (by specifying
"/Inconsolata") that means "/Inconsolata*/*.[to]tf".
But that includes also "IncolsolataGo" and "InconsolataLCG" :-(
[how]
Just remove the globbing after the pathname. If a pathname is specified
it must be the correct pathname and no star is added per default.
Users could still specify "/Incon*" to get all Inconsolatas in the
pathname based filter mode.
[why]
It might be easier to use the precompiled application than to build it
ourselves.
[how]
The AppImage has the typical problem with relative paths, so we need to
change some small calls.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The find predicate (e.g. -iname) and predicate parameter (the actual
pattern) are in one variable and will be handed over to find as one
parameter instead of two.
How could this ever work?
[how]
Pass predicate mode and predicate parameter as two shell variables.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When the file names of the source files change which happened for example
with these commits:
ac432eb20 Updated Inconsolata source to latest upstream version of 2.001 (WIP #289)
9c5ad2c78 Updated Inconsolata source to latest upstream version of 2.001 (WIP #289)
or the patched font files naming changes because of any other reason:
The patched-font directory will contain the new files along with the
unchanged old ones (because they where not overwritten).
Typically when manually updating the patched-fonts this is not a
problem, as the maintainer can clean this up by hand (if it is noticed).
But with a github action we might want to have that automatized.
To not deter the usability of the script for end-users or for patching
single fonts of a collection we do NOT want to purge 'all old files'
because we can not know if they are really old or not.
[how]
For each directory that we process from the source fonts we check if all
font files therein match our search criterion (pattern, $2). If we are
going to patch _all_ files that are in that source directory we delete all
font files in the destination directory; expecting that all files will
be recreated.
If we do _not_ patch _all_ files, we can do nothing, because we can not
decide if the existing files originate from one of the
not-to-be-processed source font files or are zombies.
Fixes: #786
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Before Font Logos 1.0.0 there was no stable-codepoint guarantee, and the
later revisions (0.18) reassigned the codepoints. That makes updating
for us very hard, because we would have to resort the icons or follow
the codepoint changes.
With 1.0.0 this changed. That new major release introduced not only a
codepoint guarantee, but it also shifted the codepoints from the F100
region to the F300 region, where we put them anyhow (in most cases).
That is one subset less with 'dynamic base codepoint'.
The reassignment of codepoints in Font Logos kept the codepoints stable
for the icons we already have in release 2.1.0. But at the moment the
2.2.0 Release Candidate (which updated Font Logos with commit 557b8da)
have added glyphs, which are on different points as compared with the
Font Logos 1.0.0 release.
What I want to say, we need to get this straight, before our 2.2.0 RC
turns into a Release 2.2.0.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
We can limit the font files to patch with the gotta-patch-em-all script
to some specific file names; the case insensitive beginning of the
basename of the font file, to be specific.
Sometimes we do not know how the actual font files are named, we just
know the directory name.
[how]
The old filter checked for the beginning of a file name, so we keep this
behavior and allow to check for the beginning of a directory name.
As differentiator the first character of the passed filter is used. As a
slash is not allowed in the file name filters: If the first char is a
slash, we search for font files in a directory that begins with that
name. The file name is not considered in this case.
Examples:
gotta-patch-em-all-font-patcher!.sh Fira
Patches all font files that begin (case insensitive) with 'fira'.
It must be the basename of the font file, the path to the file is not
considered. (Old behavior.)
Translated to a glob this is roughly **/Fira*.[ot]tf
gotta-patch-em-all-font-patcher!.sh /Fira
Patches all font files that are in directories that begin (case
insensitive) with 'fira'. It can not be the beginning of the font
file basename.
Translated to a glob this is roughly **/Fira*/**/*.[ot]tf
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we do CI we probably want to raise an error if no font file could
be found.
[how]
Check how many font files have been generated and return with exit
code 1 if the number is zero.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
The script assumes that it's run from inside bin/scripts, by setting source and target directories according to the output of pwd. It doesn't perform any checks whether it's run from the right directory, so it just doesn't find the fonts if the working directory is different.
Now it sets the directories relative to the script directory.