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: Process TTC files #783

Merged
merged 6 commits into from
Sep 23, 2022
Merged

Feature: Process TTC files #783

merged 6 commits into from
Sep 23, 2022

Commits on Sep 22, 2022

  1. font-patcher: Pull argument parser out of patcher object

    [why]
    Parsing the command line arguments has nothing to do with the actual
    patching.
    If we want to patch more than one font we need to separate the partching
    from unrelated work.
    
    [how]
    Just do the argument processing in main() and hand the information over
    to the patcher object.
    
    [note]
    No functional change. Lines copied over (almost *) 1:1.
    
    (*) Exceptions:
    self.sym_font_args is now only a local variable, as it is only used in
    this one function.
    The startup message is shown on ... startup (i.e. main()).
    
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    ec4cb0a View commit details
    Browse the repository at this point in the history
  2. font-patcher: Handle argument checks with arguments

    [why]
    The extension handling is a bit out-of-place and could be handled by the
    arguments handling, which simplifies the code.
    Somes goes for other argument validity checks.
    
    [how]
    Put argument checks into setup_arguments().
    
    Dropping self.extensions in favour of self.args.extensions.
    
    No functional change.
    
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    2432a57 View commit details
    Browse the repository at this point in the history
  3. font-patcher: Pull out opening and generating the font

    [why]
    These operations are also not strictly patching.
    When we want to handle more than one font we need to have this outside
    the patch() function.
    
    [how]
    Put opening and exporting (previously in __init__() and patch() into
    main() outside the patcher object.
    
    No functional change (except the sourceFont is now closed :->)
    
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    1b8c9e2 View commit details
    Browse the repository at this point in the history
  4. font-patcher: Allow patching of True Type Collections

    [why]
    Someone might want to patch a whole lot of fonts that come in a ttc.
    
    [how]
    Just open all fonts that the input file contains (1 or more) and create
    a single font or collection font file.
    
    The automatic layer detection does not work in all cases for me, so we
    need to manually search for the foreground layer (usually '1').
    
    Code inspiration taken from
    powerline/fontpatcher#6
    
    [note]
    Changed output in the end to the filename (before it was the font name),
    so that one can easily copy&paste or open that file.
    
    Reported-by: Lily Ballard <lily@ballards.net>
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    e515ccc View commit details
    Browse the repository at this point in the history
  5. font-patcher: Increase script version

    [why]
    With the new TTC feature we might increase the minor number ;-)
    This is not just a bugfix.
    
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    e8a17c7 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. font-patcher: Enable lowestRecPPEM fix in TTCs

    [why]
    The font flags and PPEM fix does not work with font collection files,
    because it does not know how to handle them. It assumes a ttf or otf
    font with the specified table structure.
    
    The fix (for single font files) has been introduced with commit
      40138be  font-patcher: Handle lowestRecPPEM
    
    [how]
    Check if the file is of type 'ttcf', and if so fast forward to the given
    single font index into the collection.
    
    This can be rather slow...
    
    Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
    Finii committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    7c5c838 View commit details
    Browse the repository at this point in the history