-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
font-patcher: Allow to rehint some Cascadia glyphs #1613
Conversation
WHY are the config files called Just curious 😒 Renaming them needs a Edit: Answer: They are INI files with JSON values |
d521209
to
0c6e419
Compare
[why] At the moment we have two different config files: config.cfg: Is read by gotta-patch-em and allows to specify some needed commandline options for a font-patcher run config.json: Is read by font-patcher and can contain ligature table removal instructions It would be nice to combine/unify them. [how] Add the possibility to add commandline options in the config.cfg file. Of course we need commandline options to specify the config file first, so the options are parsed in two steps. The config.file takes precedence (if possible) over directly specified options. This is how the new section in the config file can look like: [Config] commandline: --powerlineextra --mono Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
0c6e419
to
e48d920
Compare
[why] The config files are called `config.json` while the contents is INI-like. The usual extension would be `.cfg`. [how] We use `.cfg` already for the shell variable configuration. Combine both config file variants into one (real) cfg file, that is directly read by the font-patcher and no shell variables files are used anymore. This needs some rewrite in gotta-patch-em to get the quoting right. To make this simpler we remove the `--debug 1` option from the variable and insert it directly (as it is applied always anyhow). Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] Some Caskaydia Cove glyphs that are used in ligatures (to create endless arrows for example) show uneven line thickness on some platforms. The reason is the not-matching hinting of glyphs that are places next to each other and so minuscule differences are quite visible. Note that the 'original' hinting is generated by VTT on the static Cascadia Code instances, which upstream just have ttfautohint hints that are different from the hints in the variable fonts and people complained that the look is different. [how] Add a new field to the config.cfg file that holds regexes of glyph names for glyphs that should be re-hinted by fontforge on patching time. In principle we could also implement that as an additional pre-step that needs to be manually done after running VTT on the static font files. I'm not sure which is better. Note that fontforge generates a lot of debug output because the hinting is not ideal - the global tables are kept and probably less compatible to fontforge's own hinting... But the results are good. Fixes: #1291 Fixes: #1609 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] We now have two places where we can detect if a config file is given. This should be unified. Also handling of missing (?) sections in the config file is not always handled gracefully. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The logging to files does not work correctly for the messages given while the options themselves are parsed. [how] As soon as we have enough information (after the first argument parsing) we set the logger up. When processing the config file arguments we have a full functioning logger now. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The previous change(s) removed executing the config.cfg **shell script** which would pull in some environment variables like `post_process`. With that change the appropriate option has to be given with the commandline value of the new config.cfg **INI** file. [how] Remove defunct leftover code. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
96a1e06
to
cd80b9e
Compare
Compared previous and current passed options via this change index c2535a1dc..4c71ad6e7 100755
--- a/font-patcher
+++ b/font-patcher
@@ -2082,6 +2082,11 @@ def main():
logger.info("Can not write logfile, disabling")
logger.debug("Naming mode %d", args.makegroups)
+ qqq = list(vars(args))
+ qqq.sort()
+ print("|||", [[k,vars(args)[k]] for k in qqq])
+ sys.exit(0)
+
patcher = font_patcher(args)
sourceFonts = [] Run via After some |
[why]
Some Caskaydia Cove glyphs that are used in ligatures (to create endless arrows for example) show uneven line thickness on some platforms.
The reason is the not-matching hinting of glyphs that are places next to each other and so minuscule differences are quite visible.
Note that the 'original' hinting is generated by VTT on the static Cascadia Code instances, which upstream just have ttfautohint hints that are different from the hints in the variable fonts and people complained that the look is different.
[how]
Add a new field to the config.json file that holds regexes of glyph names for glyphs that should be re-hinted by fontforge on patching time.
In principle we could also implement that as an additional pre-step that needs to be manually done after running VTT on the static font files.
I'm not sure which is better.
Note that fontforge generates a lot of debug output because the hinting is not ideal - the global tables are kept and probably less compatible to fontforge's own hinting... But the results are good.
Fixes: #1291
Fixes: #1609
Requirements / Checklist
Issue number where discussion took place: #xxx
What does this Pull Request (PR) do?
How should this be manually tested?
Any background context you can provide?
What are the relevant tickets (if any)?
Screenshots (if appropriate or helpful)