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

Feature: Select name source #1319

Merged
merged 3 commits into from
Jul 17, 2023
Merged

Feature: Select name source #1319

merged 3 commits into from
Jul 17, 2023

Commits on Jul 17, 2023

  1. font-patcher: Fix command line argument specs

    [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>
    Finii committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    744eb43 View commit details
    Browse the repository at this point in the history
  2. font-patcher: Correct --makegroups help

    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    883133b View commit details
    Browse the repository at this point in the history
  3. font-patcher: Add option to select postscript name as name source

    [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>
    Finii committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    104e7c1 View commit details
    Browse the repository at this point in the history