Skip to content
/ bdf2ufo Public

Converts .bdf pixel fonts into .ufo static and variable vector fonts.

License

Notifications You must be signed in to change notification settings

Gissio/bdf2ufo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project logo

bdf2ufo

Converts .bdf pixel fonts to .ufo static and variable vector fonts.

Features

  • Automated Font Generation: Creates both static and variable fonts.

  • Variable Axes Support: Includes five axes for pixel manipulation:

    • Element Size (ESIZ)
    • Roundness (ROND)
    • Bleed (BLED)
    • Horizontal Element Spacing (XESP)
    • Element Jitter (EJIT)

    These allow you to simulate the visual characteristics of LCD screens, CRT monitors and dot matrix printouts.

  • Glyph Composition: Reduces font size by composing pixels from a pixel glyph.

  • Glyph Decomposition: Automatically decomposes composed characters for further size reduction.

  • Anchor Creation: Adds base-to-mark anchors automatically.

Examples

Building a font

  1. Convert Source Font

    • If your font is in .ttf or .otf, first convert to .bdf. Use otf2bdf:
      • macOS: Install via Homebrew: brew install otf2bdf
      • Ubuntu: sudo apt install otf2bdf
      • Windows: Download from here.
  2. Setup Environment:

  3. Install Dependencies:

    • Run pip install -r requirements.txt
  4. Prepare Directory:

    • Create an empty folder to hold your .ufo master files.
  5. Run bdf2ufo:

    • For usage help, execute:

      python tools/bdf2ufo.py --help

  6. Compile .ufo files:

    • Use gftools:

      gftools builder [masters-path]/[family-name]-config.yaml

Tips

  • Verbose Output: Use --verbose for detailed conversion logs.
  • Glyph Alignment: Use --glyph-offset-x for precise glyph centering; supports fractional values.
  • Jitter Effect: Set EJIT around 0.05 for a subtle jitter using a Gaussian distribution.
  • Static Fonts: Omit --variable-axis and --variable-instance; use --static-axes to define axis values.
  • Combining Characters: Undefined characters (U+0300 to U+036F) are auto-copied from similar defined glyphs.
  • Anchor Positioning: Currently, anchors are placed at the glyph's center-bottom.

Additional Resources

About

Converts .bdf pixel fonts into .ufo static and variable vector fonts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published