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