Skip to content

How to use Font Bakery

Miguel Sousa edited this page May 2, 2023 · 12 revisions

Font Bakery is a command-line tool for checking the technical quality of font files.

Adobe Fonts font-processing pipeline uses Font Bakery to validate all the fonts submitted by foundry partners.

Font Bakery includes a profile named check-adobefonts which will execute only the checks that are deemed important to the Adobe Fonts team.

How to install Font Bakery

Requirements

  • Python version 3.8 (or greater)
    To determine if your system has Python installed and which version, run this command: python --version
    Please refer to the instructions provided at python.org for downloading and installing Python on your platform.

  • pip version 22.0 (or greater)
    To determine if your Python environment has pip installed and which version, run this command: python -m pip --version
    Please refer to the instructions provided at pip.pypa.io for downloading and installing pip on your Python environment.

⚠️ IMPORTANT: If you have Python 2.x installed in your system, you may have to use python3 (instead of python) in the commands below.

Command to install a stable version of Font Bakery:

python -m pip install --upgrade fontbakery'[freetype]'

Command to install a beta version of Font Bakery:

python -m pip install --upgrade --pre fontbakery'[freetype]'

How to run Font Bakery

Running Font Bakery requires specifying a profile. Adobe Fonts profile is named check-adobefonts.

Run all checks

  • on one font:

     fontbakery check-adobefonts MyFont-Regular.ttf
    
  • on one font in verbose mode:

     fontbakery check-adobefonts --verbose MyFont-Regular.ttf
    
  • on one font and generate a report in HTML format:

     fontbakery check-adobefonts --html report.html MyFont-Regular.ttf
    
  • on one font, but only show the checks that FAIL:

     fontbakery check-adobefonts --loglevel FAIL MyFont-Regular.ttf
    
  • on multiple fonts:

     fontbakery check-adobefonts MyFont-Regular.ttf MyFont-Bold.ttf MyFont-Italic.ttf MyFont-BoldItalic.ttf
    
  • on multiple fonts, using a wildcard:

     fontbakery check-adobefonts MyFont-*.ttf
    

List all checks (that are included in the Adobe Fonts profile)

fontbakery check-adobefonts --list-checks MyFont-Regular.ttf

Exclude specific checks from running

fontbakery check-adobefonts -x com.google.fonts/check/font_version -x com.adobe.fonts/check/sfnt_version MyFont-Regular.otf
  • or simply,

     fontbakery check-adobefonts -x font_version -x sfnt_version MyFont-Regular.otf
    

Only run specific checks

fontbakery check-adobefonts -c com.google.fonts/check/font_version -c com.adobe.fonts/check/sfnt_version MyFont-Regular.otf
  • or simply,

     fontbakery check-adobefonts -c font_version -c sfnt_version MyFont-Regular.otf
    

List all available options

fontbakery check-adobefonts --help

How to interpret the results

  • INFO

    The check's output is merely informational.

  • PASS

    The check succeeded. Congratulations! If your font gets enough of these, you might even get a treat. (Seriously! 😀)

  • SKIP

    The check was skipped because it is not relevant for the font being checked. For example, variable font checks are skipped when the font is static.

  • WARN

    A font issue that you may consider addressing. For more details, read the check's output.

  • FAIL

    A font issue that must be fixed. Adobe Fonts font-processing pipeline will reject the font.

  • ERROR

    The check failed because of a bug in Font Bakery's own code.
    Please report it at https://github.com/googlefonts/fontbakery/issues