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

refactor(font): rewrite makeFF in Python #3714

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Sep 17, 2022

  1. refactor: better .pfa/.pfb generation code

    The old version was a big list of commands to `mftrace` in a single
    target. Now the code uses a pattern to create the different files in a
    more idiomatic way.
    
    It is not necessary to explicitly state the encoding for some files.
    The `mftrace` script can always find the correct encoding
    automatically.
    IvoWingelaar committed Sep 17, 2022
    Configuration menu
    Copy the full SHA
    84f6ec3 View commit details
    Browse the repository at this point in the history
  2. chore(font): remove redundant list in build script

    This list isn't necessary because we generate a bunch of fonts in the
    docker container, and copy everything over. This list is implicitly
    defined by the output of `.ff` scripts.
    IvoWingelaar committed Sep 17, 2022
    Configuration menu
    Copy the full SHA
    aa34014 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    817ff86 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8c9c903 View commit details
    Browse the repository at this point in the history
  5. refactor: rewrite makeFF in Python

    Rewriting `makeFF` in Python improves the code in several ways:
    - Increases maintainability as Python code is more readable than
      dense Perl code using mostly string substitutions (sometimes with
      regular expressions) to write scripts, and rewrite other files.
    - Pair kerning is a feature that requires us to read the `.tfm` files
      that contain those metric tables. The current codebase contains a
      `.tfm` parser written in Python, not in Perl. This commit makes it
      possible to use that to build pair kerning tables in the FontForge
      scripts.
    
    This new code also splits the mapping between the old TeX font
    codepoints and the modern Unicode scalar values into a separate module
    that can in the future be reused for metrics generation. This decreases
    code duplication, and makes changes more robust. It's also easier to
    write sanity checks in the new mappings to catch easy-to-miss mistakes
    like codepoints being mapped twice.
    IvoWingelaar committed Sep 17, 2022
    Configuration menu
    Copy the full SHA
    0e1a8c8 View commit details
    Browse the repository at this point in the history