blob: 464df248af7706dbfcfc293a8d4635ffcfda2ea9 [file] [log] [blame]
Just4977da41999-12-18 18:18:09 +00001<HTML>
2<HEAD>
3
4<TITLE>FontTools</TITLE>
5
6
7</HEAD>
8<BODY bgcolor="#FFFFFF">
9
10<H1>FontTools</H1>
11
jvrf5ccb352001-08-10 08:54:14 +000012<A HREF="http://fonttools.sourceforge.net/">FontTools</A> is a suite of tools and
13libraries for manipulating fonts. It is written
14in Python and has a BSD-style, open-source licence -- see LICENSE.txt. It's hosted at
15<A HREF="http://sourceforge.net/">sourceforge.net</A>.
Just4977da41999-12-18 18:18:09 +000016
17<P>
Juste5ad9c92000-03-15 20:56:20 +000018It currently reads and writes TrueType font files, reads PostScript Type 1 fonts
19and more. It contains two command line programs to convert TrueType fonts to an
20XML based format (called TTX) and back.
21
22<H3>Scope</H3>
23
24FontTools' functionality is aimed towards font developers and font tool developers.
25It can of course be used to just access fonts (outlines, metrics, etc.) but it is
26not optimized for that. It will be further developed so it can be the core of any
27font editor. And that's exactly what it will be for our upcoming major rewrite of
28<A HREF="http://www.robofog.com/">RoboFog</A>, our (commercial) PythonPowered font
29editor for MacOS.
30
31<H3>Installation</H3>
32
33You need the following software to use FontTools:
34
35<UL>
36<LI>
jvrf5ccb352001-08-10 08:54:14 +000037 <B>Python</B>. The fresh versions as well as older versions (You need 1.5.1 or higher) can be obtained here:
38 <A HREF="http://www.python.org/download/">http://www.python.org/download/</A>
39 or here:
40 <A HREF="http://sourceforge.net/projects/python/">http://sourceforge.net/projects/python/</A>
Juste5ad9c92000-03-15 20:56:20 +000041
jvrf5ccb352001-08-10 08:54:14 +000042 <P>Windows: grab the Windows installer, run the full install.
43 <BR>Un*x: follow the build instructions.
Juste5ad9c92000-03-15 20:56:20 +000044 <BR>Linux: maybe you already *have* Python: check whether you have
45 version 1.5.1 or newer.
46 <BR>MacOS: grab the installer, run "Easy Install"
47
jvrcd8f9df2001-08-10 20:27:23 +000048 <P><B>Important:</B> If you have (or decided to install) a Python version
49 earlier than 2.0, you must also install
50 <A HREF="http://www.python.org/sigs/distutils-sig/download.html">distutils</A>,
51 a set of tools to help build and install Python packages. (It is included with
52 Python 2.0 and higher.)
Juste5ad9c92000-03-15 20:56:20 +000053<P>
54<LI>
jvrf5ccb352001-08-10 08:54:14 +000055 The <B>Numeric Python</B> extension (you don't need this under MacOS, since it's
56 included in the MacPython installer). Get a fresh version from the download page,
57 linked from here:
58 <A HREF="http://sourceforge.net/projects/numpy/">http://sourceforge.net/projects/numpy/</A>
59 <P>Windows: grab the "Numeric-*.exe" archive, it's an installer. Make sure the
60 Python version in the archive name (eg. "2.1") matches the Python version you have.
61 <BR>Linux/Un*x: get a source archive and run this command from the unpacked directory:
62 <BR><TT>python ./setup.py install</TT>
Juste5ad9c92000-03-15 20:56:20 +000063<P>
64<LI>
jvrf5ccb352001-08-10 08:54:14 +000065 <B>PyXML</B>, a set of XML tools:
66 <A HREF="http://sourceforge.net/projects/pyxml/">http://sourceforge.net/projects/pyxml/</A>
Juste5ad9c92000-03-15 20:56:20 +000067
jvrf5ccb352001-08-10 08:54:14 +000068 <BR>Installation should be very similar to installing Numeric Python, see above.
Juste5ad9c92000-03-15 20:56:20 +000069
70</UL>
71
72
jvrf5ccb352001-08-10 08:54:14 +000073Now run the "setup.py" script from the FontTools archive. This will install
74all the modules in the right places, as well as tries to compile the one (optional)
75C extension contained in FontTools. (XXX: need precompiled Mac and Windows binaries,
76*or* a way to skip compilation when there's no compiler available.)
Juste5ad9c92000-03-15 20:56:20 +000077
78<P>Additional Mac instructions:
79De-binhex "TTX.rsrc.hqx" by dropping it onto StuffIt expander. (Or use your
80own preferred method)
81The "TTX.py" script included in this archive is the Mac-only main program:
82Drop it onto the "BuildApplet" app inside the Python folder; this will
83produce the TTX applet.
84
85
86<H3>User documentation</H3>
87
88<P>For MacOS there's a small application called TTX. If you drop a TrueType file
89onto it, it will convert it to XML. If you drop an XML file onto it, it will
90convert it back to TrueType. Please read the additional README file in the Mac
91subdirectory, since it behaves quite differently than the command line programs
92described below.
93
94<P>For Unix and DOS I've provided two command line programs:
95<UL>
96 <LI>ttDump.py
97 <LI>ttCompile.py
98</UL>
99They do pretty much what you'd expect. They take several arguments:
100an input file name and optionally an output file name. There are some extra
101options which are explained by the 'usage' text; use the -h option to display
102it.
103
Juste5ad9c92000-03-15 20:56:20 +0000104<P>Adam Twardoch contributed a Windows registry script (ttx_shellext_win32.py) which
105makes the two above tools available under the Right Mouse Button. I haven't tested
106these myself, but I'm very interested in hearing about the results!
107
Juste5ad9c92000-03-15 20:56:20 +0000108<H3>Note about glyph names and TrueType GlyphID's</H3>
109
110TrueType fonts use glyph indices (GlyphID's) to refer to glyphs in most places.
111While this is fine in binary form, it is really hard to work with for
112humans. Therefore we use names instead.
113
114<P>The names are derived from what is found in the 'post' table. It is
115possible that different glyphs use the same PS name. If this happens, we
116force the names to be unique by appending "#n" to the name (n being an
117integer number). The original PS names will still be maintained by the
118'post' table, so even though we use a different name internally, we are
119still able to write the 'post' table back in original form. If there is
120no proper 'post' table available, names will be derived from a Unicode
121cmap (if available) in conjuction with the Adobe Glyph List (see fontTools/agl.py).
122
123<P>Because the order in which glyphs are stored inside the TT font is
124important, ttLib maintains an ordered list of glyph names in the font.
125
126<H3>Feedback</H3>
127
jvrf5ccb352001-08-10 08:54:14 +0000128Please join the fonttools-discussion mailing list at SourceForge. Subscription
129info can be found if you follow the "Mailing Lists" link at the
130<A HREF="http://sourceforge.net/projects/fonttools/">SourceForge project page</A>.
131You can also email me directly at <A HREF="mailto:just@letterror.com">just@letterror.com</A>.
132
133<P>
134If you want to follow the development of FontTools closely, or would like to
135contribute, you can also subscribe to the fonttools-checkins mailing list.
Juste5ad9c92000-03-15 20:56:20 +0000136
137<H3>Anonymous CVS-access</H3>
138
jvrf5ccb352001-08-10 08:54:14 +0000139The FontTools sources are also accessible through CVS, see the
140the <A HREF="http://sourceforge.net/projects/fonttools/">SourceForge project
141page</A>. Let me know if you'd like to become a co-developer.
Juste5ad9c92000-03-15 20:56:20 +0000142
143<H3>Developer documentation</H3>
144
145Sorry, documentation beyond doc strings in the source code is still on my to-do list...
146Below follows a brief overview of what's there.
147
148
Just4977da41999-12-18 18:18:09 +0000149<H3>GUI Tools</H3>
Juste5ad9c92000-03-15 20:56:20 +0000150TTX -- A simple Mac app that converts TrueType (or OpenType) fonts to TTX format and back.
Just4977da41999-12-18 18:18:09 +0000151<P>
152<H3>Command line tools</H3>
153
Juste5ad9c92000-03-15 20:56:20 +0000154<UL>
jvrf5ccb352001-08-10 08:54:14 +0000155 <LI>ttDump.py -- dumps a TrueType (or OpenType) font file to TTX format.
156 <LI>ttCompile.py -- compiles a TTX file back into a TTF (or OTF) file.
Just4977da41999-12-18 18:18:09 +0000157</UL>
158
159<P>
160<H3>The library</H3>
161
162Cross-platform
Juste5ad9c92000-03-15 20:56:20 +0000163<UL>
164 <LI>fontTools.t1Lib -- Provides a Type 1 font reader. Writing is a planned feature.
165 <LI>fontTools.ttLib -- Extensive TrueType tools. Reads and writes. This is the flagship
166 of FontTools, it's by far the most mature component. Contains a completely modular
167 TTF table converter architecture. See ttLib/tables/table_API_readme.txt.
168 <LI>fontTools.afmLib -- And AFM file reader/writer.
169 <LI>fontTools.cffLib -- Reads CFF fonts. Writing is a planned feature.
170 <LI>fontTools.unicode -- A simple (but large) module that translates
171 Unicode values to their descriptive names. Still Unicode 2.0.
172 <LI>fontTools.agl -- Interface to the Adobe Glyph List: maps unicode values
173 to glyph names and back.
Just4977da41999-12-18 18:18:09 +0000174</UL>
175
176Mac-specific
Juste5ad9c92000-03-15 20:56:20 +0000177<UL>
178 <LI>fontTools.fondLib -- A reader/writer class for Mac FOND resources.
179 <LI>fontTools.nfntLib -- Reads Mac NFNT bitmap font resources.
Just4977da41999-12-18 18:18:09 +0000180</UL>
181
Juste5ad9c92000-03-15 20:56:20 +0000182<H3>Thank-you's</H3>
183
184(in alphabetical order)
185Erik van Blokland, Petr van Blokland, Jelle Bosma, Vincent Connare,
186Simon Daniels, Hannes Famira, Greg Hitchcock, Jack Jansen, Antoine Leca,
187Werner Lemberg, Peter Lofting, Dave Opstad, Laurence Penney,
188Guido van Rossum, Adam Twardoch.
189
190<H3>Copyrights</H3>
191
jvrf5ccb352001-08-10 08:54:14 +0000192FontTools/TTX -- 1999-2001 Just van Rossum; Letterror (just@letterror.com)
Just4977da41999-12-18 18:18:09 +0000193
194</BODY>
195</HTML>