Home

Awesome

sfntly-py

Python bindings for Google's sfntly, a font manipulation library written in Java.

The package currently include the following modules:

sfntly.sfnttool

Example:

    >>> from sfntly import sfnttool
    # save WOFF in the same location of input font
    >>> sfnttool.convert('woff', 'font.ttf')
    0
    # save EOT to destination 'outfile', and print more info to stdout
    >>> sfnttool.convert('eot', 'font.ttf', outfile='webfonts/font.eot', verbose=True)
    $ java -jar sfnttool.jar -e -x "font.ttf" "webfonts/font.eot"
    Exception in thread "main" java.lang.IllegalArgumentException: source table must not be null
    [...]
    1

Requirements

Download

Pre-compiled Python wheels are available at: https://github.com/daltonmaag/sfntly-py/releases/latest

Build requirements

Build instructions

git clone --recursive https://github.com/daltonmaag/sfntly-py.git
cd sfntly-py
python setup.py build

Please ensure the 'ant' executable can be found in the user's PATH variable.

Install instructions

If you have built sfntly-py by following the above build instructions do:

python setup.py install

OR

If you have not built sfntly-py as above, simply do:

pip install --find-links https://github.com/daltonmaag/sfntly-py/releases/latest sfntly