1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
|
<HTML>
<HEAD>
<!-- Created with AOLpress/2.0 -->
<!-- AP: Created on: 3-Sep-2001 -->
<!-- AP: Last modified: 28-Oct-2001 -->
<TITLE>TtfMod -- A TrueType® Font Modifier</TITLE>
</HEAD>
<BODY>
<H1 Align=Center>
<A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=25752&type=1"
width="88" height="31" border="0" alt="SourceForge Logo" ALIGN=right> </A>
TtfMod<BR>
<SMALL>A TrueType® Font Modifier</SMALL>
</H1>
<H2>
<IMG SRC="ttfsplash2.png" WIDTH="360" HEIGHT="330" ALIGN="Right">Table of
Contents
</H2>
<UL>
<LI>
<A HREF="#Overview">Overview</A>
<UL>
<LI>
<A HREF="#TTFontView">TrueType Font View</A>
<LI>
<A HREF="#Standards">Standards</A>
</UL>
<LI>
<A HREF="changelog.html">Change Log</A>
<LI>
<A HREF="#Configuring">Configuring TtfMod</A>
<LI>
<A HREF="#Download">Download</A>
<LI>
<A HREF="#CharView">The TTF Character View</A>
<LI>
<A HREF="#bugs">Buggies!</A>
<LI>
<A HREF="index.html#Acknowledgements">Acknowledgements</A>
</UL>
<H3>
<A NAME="Overview">Overview</A>
</H3>
<P>
TtfMod is not a font creation program, look at
<A HREF="../overview.html">PfaEdit</A> for that. It is designed as a companion
program to PfaEdit, to take an existing TrueType (OpenType, TrueType Collection)
file and allow you to edit some of the tables. This is primarily to provide
access to certain features of TrueType that would be awkward to fold into
PfaEdit's UI, specifically TrueType instructing (hinting). (It has helped
me figure out why PfaEdit's TrueType instructing is so bad).
<P>
This program isn't finished yet. <FONT COLOR="Red"><STRONG><BIG>Don't use
the Save or Save As commands. </BIG></STRONG></FONT>Let's pretend it's called
ttfview for now...
<P>
TrueType is not standardized. It is an evolving specification with at least
three groups working on it and changing it in different ways. The major players
are:
<UL>
<LI>
<A HREF="http://fonts.apple.com/TTRefMan/">Apple</A>
<LI>
<A HREF="http://www.microsoft.com/typography/otspec/default.htm">MicroSoft</A>
<LI>
<A HREF="http://partners.adobe.com/asn/developer/opentype/">Adobe</A>
</UL>
<P>
None of these is entirely consistant with the others.
<UL>
<LI>
Many of the differences are small, for instance:
<UL>
<LI>
Apple and Adobe call a field in the cmap table "language", while Microsoft
(who doesn't use it) calls it "version",
</UL>
<LI>
but some are quite large, for instance
<UL>
<LI>
Apple calls the bitmap data table "bdat" while MicroSoft and Adobe call it
"EBDT". This means that a font's bitmaps need to be specified twice to work
on both systems
<LI>
Apple and MS interpret the offsets of compound glyphs quite differently when
scaling factors/rotations are present. Apple doesn't even describe its
interpretation well enough to implement it. OpenType provides a mechanism
for distinguishing between the two (without describing what Apple does),
but Apple doesn't mention this, and anyway old fonts won't have it.
</UL>
</UL>
<P>
This is unfortunate.
<P>
Good luck.
<H3>
<A NAME="TTFontView">TrueType Font View</A>
</H3>
<P>
This window shows you all the tables in the truetype file. It also shows
you where those tables start and how big they are (that's probably useless
information in almost all cases). Double clicking on a table will bring up
a table editor to allow you to modify that particular table. Double clicking
with the control key down will bring up a bare hex editor. Not all tables
are editable (yet), and some tables are tightly connected so you can't edit
one without editing the other (for example the loca and glyp tables are bound
together).
<P>
If you move the cursor onto one of the tables and leave it there, a popup
will appear giving a better explanation of the table than the often cryptic
four character name.
<P>
<FONT COLOR="Red"><STRONG><SMALL>NOTE: </SMALL></STRONG></FONT> TTF tables
are often intricately interconnected. Be careful about changing things that
affect other tables. ttfmod will not fix up the others. For example: don't
change the Glyph Count field in the 'maxp' table or you will confuse almost
every other table.
<P>
No access will be provided to the CFF table of an opentype font. This is
essentially postscript data and is better viewed from PfaEdit.
<P>
In a ttc file (A TrueType collection file) there may be more than one font.
<H3>
<A NAME="Standards">Standards</A>
</H3>
<P>
I shall not attempt to explain what all the tables do, I refer you to the
True/Open Type docs for that:
<UL>
<LI>
<A HREF="http://fonts.apple.com/TTRefMan/RM06/Chap6.html">Table descriptions
for True Type and Apple's AAT</A>
<LI>
<A HREF="http://partners.adobe.com/asn/developer/opentype/tablist.html">Table
descriptions for Open Type</A>
<LI>
<A HREF="http://fonts.apple.com/TTRefMan/RM05/Chap5.html">Instruction
definitions</A>
<LI>
<A HREF="http://fonts.apple.com/TTRefMan/">TrueType top-level at Apple</A>
<LI>
<A HREF="http://partners.adobe.com/asn/developer/opentype/">OpenType top-level
at Adobe</A>
<LI>
<A HREF="http://www.microsoft.com/typography/otspec/default.htm">Open/True
Type top-level at MicroSoft</A>
</UL>
<H3>
<A NAME="Configuring">Configuring TtfMod</A>
</H3>
<P>
If you want to use TtfMod's grid-fitting debugging capabilities you must
install <A HREF="http://freetype.sourceforge.net/">FreeType's library</A>.
You must also either live in a country where Apple's TrueType grid fitting
patents are not applicable or have obtained a license from Apple allowing
you to use their patent and then compile the FreeType library with grid-fitting
enabled (in ftoption.h), then set similar #defines in ttfmod/config.h. For
more information contact <A HREF="mailto:patents@apple.com">Apple's legal
department</A> or see
<A HREF="http://freetype.sourceforge.net/patents2.html">FreeType's patent
page</A>.
<P>
(<SMALL>NOTE</SMALL>: I found that I needed to change options in
<CODE><SMALL>include/freetype/config/ftoption.h</SMALL></CODE>)
<P>
If you have freetype configured properly then configure.ttfmod should be
able to choose a configuration that is appropriate.
<H3>
<A NAME="Download">Download</A>
</H3>
<P>
Before you do anything else you should download and build
<A HREF="../index.html#source">PfaEdit</A>. TtfMod also uses libgdraw and
libgunicode.<BR>
Then you should download
<A HREF="http://freetype.sourceforge.net/download.html#stable">libfreetype</A>,
configure it, build it and install it.
<P>
I have a kind of funky configure script which will improve once I've got
ttfmod fully integrated into the distribution (it isn't integrated yet because
it doesn't work yet). Anyway the configure script lives in the top pfaedit
directory and is called <CODE>configure.ttfmod </CODE>NOT
<CODE>configure</CODE> (<CODE>configure</CODE> will configure pfaedit). Once
you've configured it cd into the ttfmod directory and type make:
<PRE>$ gunzip ttfmod_src*.tgz
$ tar xf ttfmod_src*.tar
$ cd pfaedit
$ configure.ttfmod
$ cd ttfmod
$ make
</PRE>
<UL>
<LI>
<A HREF="../ttfmod_src-011028.tgz">Source</A> 28-Oct-2001
<LI>
<A HREF="../ttfmod-011025.tgz">linux (redhat 7.1) executable</A>:
25-Oct-2001<BR>
(The executable is compiled without the grid-fitting debugger)
</UL>
<H3>
<A NAME="CharView">The TTF Character View</A>
</H3>
<P>
This will look different depending on what capabilities you have enabled.
<P>
<B>If you are not burdened by Apple's patents then the view will look like
this:</B><BR>
<IMG SRC="ttfcv-all.png" WIDTH="609" HEIGHT="487"><BR>
On the left is a list of instructions that define the hints for the current
character, centered is a gloss on these instructions, and to the far right
is the image of the character.
<P>
If you move the mouse over an instruction you will get an list of what the
instruction pops off the stack (and perhaps other bits of state), and a
description of what the instruction does.
<P>
If you click on a gloss, the instruction which generates that gloss will
also be highlit, as will the point which is affected.
<P>
The original set of splines that define the character will be displayed with
red dots for the points and blue crosses for the control points. Numbered
points will have their numbers displayed somewhere near-by. The grid fit
version of the spline will be displayed with green dots. The rasterized image
of the glyph is displayed in grey. (You can change the grid size (the pixels
per em)) with the view menu.
<P>
<B>If you are subject to Apple's patents:</B><BR>
<IMG SRC="ttfcv-nobytecode.png" WIDTH="697" HEIGHT="487"><BR>
Note that the grid-fit splines and the rasterized image are missing.
<P>
<B>If you are more paranoid than I am:</B><BR>
<IMG SRC="ttfcv-nodebug.png" WIDTH="374" HEIGHT="487"><BR>
And have turned off the debugger entirely, then the gloss is also missing.
<H3>
Reporting <A NAME="bugs">bugs</A>...
</H3>
<P>
TtfMod isn't very far along. I may not pay much attention to bug reports
for a bit, but I'm sure you'll find some. If you can isolate one and come
up with a reproduceable minimal case, that would be great. The executable
has symbols in it so if you run it in gdb you should be able to get a stack
trace... Do what you can.
<P>
<A HREF="mailto:gww@silcom.com">gww@silcom.com</A>
<H3>
Known bugs...
</H3>
<UL>
<LI>
ttfmod doesn't deal well with composit glyphs. A composit glyph runs the
instructions for each of the components, then moves them, then runs the
instructions for the composit. FreeType does the right thing, of course.
But when TtfMod generates its gloss it only runs the instructions of the
composit, and not those of the components.
</UL>
<H3>
<A NAME="Acknowledgements">Acknowledgements</A>
</H3>
<P>
This program would have been far harder to write if the
<A HREF="http://freetype.sourceforge.net/">freetype library</A> hadn't done
almost exactly what I wanted.
<P>
Valek Filippov gave me the russian translation.
</BODY></HTML>
|