Skip to content

Commit 33be3a4

Browse files
committed
Update README
1 parent 82a5a45 commit 33be3a4

File tree

1 file changed

+58
-13
lines changed

1 file changed

+58
-13
lines changed

README.rst

+58-13
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,59 @@ UFO Extractor
66

77
Tools for extracting data from font binaries into UFO objects.
88

9-
Features
10-
--------
9+
Supported input formats
10+
-----------------------
1111

12-
Import data into a `Defcon <https://github.com/typesupply/defcon>`__ ``Font``
13-
instance:
12+
The following font formats are supported:
13+
14+
- CFF or TrueType-flavored OpenType fonts (``*.otf``, ``*.ttf``)
15+
- `FontTools <https://github.com/fonttools/fonttools>`__ TTX files
16+
(``*.ttx``)
17+
- WOFF 1.0/2.0 (``*.woff``, ``*.woff2``)
18+
- PostScript Type1 fonts (``*.pfa``, ``*.pfb``, etc.)
19+
- FontLab files (``*.vfb``, when installed with optional dependency "vfb")
20+
21+
Note however, that what data will (or even could) be exported will depend on
22+
input file format and the file itself.
23+
24+
Python module
25+
-------------
26+
27+
Import data into an `ufoLib2 <https://github.com/fonttools/ufoLib2/>`__
28+
or `Defcon <https://github.com/typesupply/defcon>`__ ``Font`` instance:
1429

1530
.. code:: python
1631
1732
>>> import extractor
18-
>>> import defcon
19-
>>> ufo = defcon.Font()
33+
>>> from ufoLib2 import Font # alternatively: from defcon import Font
34+
>>> ufo = Font()
2035
>>> extractor.extractUFO("/path/to/MyFont.ttf", ufo)
2136
>>> ufo.save("/path/to/MyFont.ufo")
2237
23-
Supported input formats:
38+
Console script
39+
--------------
2440

25-
- CFF or TrueType-flavored OpenType fonts (``*.otf``, ``*.ttf``)
26-
- `FontTools <https://github.com/fonttools/fonttools>`__ TTX files
27-
(``*.ttx``)
28-
- WOFF 1.0/2.0 (``*.woff``, ``*.woff2``)
29-
- PostScript Type1 fonts (``*.pfa``, ``*.pfb``, etc.)
30-
- FontLab files (``*.vfb``, when installed with optional dependency "vfb")
41+
A console script for one-off conversion is also provided
42+
(note: see Installation below):
43+
44+
.. code::
45+
46+
$ extractufo -h
47+
usage: extractufo [-h] [-m {ufoLib2,defcon}] [-z] FONT_FILE [FONT_FILE ...]
48+
49+
Extract data from font binaries and build UFO objects from them.
50+
51+
positional arguments:
52+
FONT_FILE Input font path
53+
54+
options:
55+
-h, --help show this help message and exit
56+
-m {ufoLib2,defcon}, --ufo-module {ufoLib2,defcon}
57+
Select the default library for writing UFOs (default: autodetect, prefer ufoLib2)
58+
-z, --zip Output UFO ZIP
59+
60+
Each resulting UFO will be saved as FONT_FILE.ufo(z) in the same directory as the original FONT_FILE.
61+
If destination file or directory already exists, conversion for that source file will be skipped and the application exit code will indicate an error.
3162
3263
Installation
3364
------------
@@ -44,6 +75,20 @@ To install with support for extracting from vfb files:
4475
4576
$ pip install ufo-extractor[vfb]
4677
78+
If you want to use the console script and have neither `ufoLib2` nor `defcon`
79+
installed (or aren't sure), running the following will install `ufoLib2` as well
80+
to ensure that the script works:
81+
82+
.. code::
83+
84+
$ pip install ufo-extractor[script]
85+
86+
The options may also be combined:
87+
88+
.. code::
89+
90+
$ pip install ufo-extractor[vfb][script]
91+
4792
Note that, for historical reasons, the package is listed on the
4893
`Python Package Index <https://travis-ci.org/typesupply/extractor>`__ under the name
4994
``ufo-extractor``, to disambiguate it from another package also called "extractor".

0 commit comments

Comments
 (0)