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