Skip to content
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

Merged
merged 7 commits into from
Apr 22, 2024

Commits on Apr 19, 2024

  1. font-patcher: Allow to specify more options in config file

    [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 <[email protected]>
    Finii committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    b984447 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. gotta-patch-em: Correct file type of config files

    [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 <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    88d63ff View commit details
    Browse the repository at this point in the history
  2. font-patcher: Allow to rehint some Cascadia glyphs

    [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 <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    378d97c View commit details
    Browse the repository at this point in the history
  3. font-patcher: Load config file only once

    Signed-off-by: Fini Jastrow <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    098fa41 View commit details
    Browse the repository at this point in the history
  4. font-patcher: Do not rely on args.configfile

    [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 <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    6c6177d View commit details
    Browse the repository at this point in the history
  5. font-patcher: Improve logging while setup options

    [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 <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    e5f63a3 View commit details
    Browse the repository at this point in the history
  6. gotta-patch-em: Remove post_process

    [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 <[email protected]>
    Finii committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    cd80b9e View commit details
    Browse the repository at this point in the history