[why]
If a user specified a name we should probably not camel-casify it.
Fixes (idea mentioned in): #1319
Suggested-by: HUMORCE
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
In the post we used these information sources to determine the name and
weights/styles of the to-be-patched font:
* The filename
* The fullname (ID 4)
* The postscriptname (ID 6)
Usually it is best to use the Fullname of a font to determine its real
name and styles/weights:
The Postscript name has the advantage to have a hyphen between name and
styles/weight; but as it can not contain blanks the correct name can not
be determined by this. To get the styles/weights back we use a list of
all possible (?!) weights and styles and sort all the string parts.
This works reasonably well and the fullname is usually best.
Not so with Input Mono Condensed. Here are its names:
ID4: "InputMonoCondensed LightIta"
IF6: "InputMonoConsensed-LightItalic"
[how]
Add option to select between fullname and postscriptname as font naming
source.
For special purposes, also allow a custom (arbitrary) name input.
If that is given the specified name will be used to name the patched
font without adding any suffix - the user has full control on the name.
Fixes: #1314
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
A lot arguments need one user supplied value, but that is not enforced.
For example
font-patcher src/unpatched-fonts/Agave/Agave-Regular.ttf --out
results in a crash, because the needed output directory has not been
passed, but the default is also not used.
The problem is that the option is defined to take any amount of values,
includeing zero values (and more than one value).
That all does not make sense. The switch does need exactly one value.
[how]
Remove the wrong nargs specification. Instead use the default, which is
'expect one value' for the default action 'store'.
Instead of a crash the user is now presented with this output:
font-patcher: error: argument -out/--outputdir: expected one argument
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[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>
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>
[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>
[why]
The debug messages appear two times.
[how]
Do not use the root logger as we can not get rid of it afterwards.
Instead set up a normal logger just for the startup and forget it after
we have a proper logger.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Usually the variable `logger` holds the logger object and all logging
calls got through that.
But because we use the font filename as loggername that logger object
can only be set up after the arguments have been parsed. If some
messages are to be logged before the call needs to go to the root logger
called as `logging` class.
This means one needs to take `logger` or `logging` based on the time
when someting is to be logged. That can be confusing and is easily
wrong, especially if code is shifted.
[how]
Always use the `logger` variable and just let that point to the root
logger until we set up a concrete logger.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The dowload turns up empty. This is because we specify a glob while we
need to specify a regex.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
I broke it by manually editing with this commit:
86b35c9d5 Add N-R-K as contributor manually
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Drop the detailed translations because I can not keep this up to date
anyhow. Having the current options in the readme is more important I
guess. This whole translation business is a problem on its own and not
solved.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This is again a workflow release, after v3.0.0 and v3.0.1 which were
fully manual. Hopefully the workflow still works.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Sometimes a user might want to keep the original name.
This is escpecially true as Visual Studio seems to look at the font
names directly and enables special handling for 'Cascadia Code'.
Users might want to self-patch without renaming.
[how]
Add additional value to makegroups option.
That option should probably be renamed into 'naming scheme' or
something, as it is not really a fitting description of what it does.
Fixes: #1242 (some aspect of it)
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When we did not collect xavgwidth data for some font and want to tweak
it the font-patcher crashes.
[how]
Check if we have a number before accessing it in the array.
[note]
This happens when font_patcher.patch() has not been called.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
For tweaking we use the self.sourceFont, but in the loop the real
correct value is the local sourceFont. Usually it's the same, but from a
logical standpoint this is wrong.
The name is a bit unfortunate and C++ would have generated a warning.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The font_patcher object should be self contained, and code outside of it
should not depend on stuff done within it that does not have to do
anything with patching.
In fact the code should run even if font_patcher.patch() has not been
called.
[how]
Pull name backup out of the patching process.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[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>