xref: /aosp_15_r20/external/fonttools/Doc/man/man1/ttx.1 (revision e1fe3e4ad2793916b15cccdc4a7da52a7e1dd0e9)
1*e1fe3e4aSElliott Hughes.Dd May 18, 2004
2*e1fe3e4aSElliott Hughes.\" ttx is not specific to any OS, but contrary to what groff_mdoc(7)
3*e1fe3e4aSElliott Hughes.\" seems to imply, entirely omitting the .Os macro causes 'BSD' to
4*e1fe3e4aSElliott Hughes.\" be used, so I give a zero-width space as its argument.
5*e1fe3e4aSElliott Hughes.Os \&
6*e1fe3e4aSElliott Hughes.\" The "FontTools Manual" argument apparently has no effect in
7*e1fe3e4aSElliott Hughes.\" groff 1.18.1. I think it is a bug in the -mdoc groff package.
8*e1fe3e4aSElliott Hughes.Dt TTX 1 "FontTools Manual"
9*e1fe3e4aSElliott Hughes.Sh NAME
10*e1fe3e4aSElliott Hughes.Nm ttx
11*e1fe3e4aSElliott Hughes.Nd tool for manipulating TrueType and OpenType fonts
12*e1fe3e4aSElliott Hughes.Sh SYNOPSIS
13*e1fe3e4aSElliott Hughes.Nm
14*e1fe3e4aSElliott Hughes.Bk
15*e1fe3e4aSElliott Hughes.Op Ar option ...
16*e1fe3e4aSElliott Hughes.Ek
17*e1fe3e4aSElliott Hughes.Bk
18*e1fe3e4aSElliott Hughes.Ar file ...
19*e1fe3e4aSElliott Hughes.Ek
20*e1fe3e4aSElliott Hughes.Sh DESCRIPTION
21*e1fe3e4aSElliott Hughes.Nm
22*e1fe3e4aSElliott Hughesis a tool for manipulating TrueType and OpenType fonts.  It can convert
23*e1fe3e4aSElliott HughesTrueType and OpenType fonts to and from an
24*e1fe3e4aSElliott Hughes.Tn XML Ns -based format called
25*e1fe3e4aSElliott Hughes.Tn TTX .
26*e1fe3e4aSElliott Hughes.Tn TTX
27*e1fe3e4aSElliott Hughesfiles have a
28*e1fe3e4aSElliott Hughes.Ql .ttx
29*e1fe3e4aSElliott Hughesextension.
30*e1fe3e4aSElliott Hughes.Pp
31*e1fe3e4aSElliott HughesFor each
32*e1fe3e4aSElliott Hughes.Ar file
33*e1fe3e4aSElliott Hughesargument it is given,
34*e1fe3e4aSElliott Hughes.Nm
35*e1fe3e4aSElliott Hughesdetects whether it is a
36*e1fe3e4aSElliott Hughes.Ql .ttf ,
37*e1fe3e4aSElliott Hughes.Ql .otf
38*e1fe3e4aSElliott Hughesor
39*e1fe3e4aSElliott Hughes.Ql .ttx
40*e1fe3e4aSElliott Hughesfile and acts accordingly: if it is a
41*e1fe3e4aSElliott Hughes.Ql .ttf
42*e1fe3e4aSElliott Hughesor
43*e1fe3e4aSElliott Hughes.Ql .otf
44*e1fe3e4aSElliott Hughesfile, it generates a
45*e1fe3e4aSElliott Hughes.Ql .ttx
46*e1fe3e4aSElliott Hughesfile; if it is a
47*e1fe3e4aSElliott Hughes.Ql .ttx
48*e1fe3e4aSElliott Hughesfile, it generates a
49*e1fe3e4aSElliott Hughes.Ql .ttf
50*e1fe3e4aSElliott Hughesor
51*e1fe3e4aSElliott Hughes.Ql .otf
52*e1fe3e4aSElliott Hughesfile.
53*e1fe3e4aSElliott Hughes.Pp
54*e1fe3e4aSElliott HughesBy default, every output file is created in the same directory as the
55*e1fe3e4aSElliott Hughescorresponding input file and with the same name except for the
56*e1fe3e4aSElliott Hughesextension, which is substituted appropriately.
57*e1fe3e4aSElliott Hughes.Nm
58*e1fe3e4aSElliott Hughesnever overwrites existing files; if necessary, it appends a suffix to
59*e1fe3e4aSElliott Hughesthe output file name before the extension, as in
60*e1fe3e4aSElliott Hughes.Pa Arial#1.ttf .
61*e1fe3e4aSElliott Hughes.Ss "General options"
62*e1fe3e4aSElliott Hughes.Bl -tag -width ".Fl t Ar table"
63*e1fe3e4aSElliott Hughes.It Fl h
64*e1fe3e4aSElliott HughesDisplay usage information.
65*e1fe3e4aSElliott Hughes.It Fl d Ar dir
66*e1fe3e4aSElliott HughesWrite the output files to directory
67*e1fe3e4aSElliott Hughes.Ar dir
68*e1fe3e4aSElliott Hughesinstead of writing every output file to the same directory as the
69*e1fe3e4aSElliott Hughescorresponding input file.
70*e1fe3e4aSElliott Hughes.It Fl o Ar file
71*e1fe3e4aSElliott HughesWrite the output to
72*e1fe3e4aSElliott Hughes.Ar file
73*e1fe3e4aSElliott Hughesinstead of writing it to the same directory as the
74*e1fe3e4aSElliott Hughescorresponding input file.
75*e1fe3e4aSElliott Hughes.It Fl v
76*e1fe3e4aSElliott HughesBe verbose.  Write more messages to the standard output describing what
77*e1fe3e4aSElliott Hughesis being done.
78*e1fe3e4aSElliott Hughes.It Fl a
79*e1fe3e4aSElliott HughesAllow virtual glyphs ID's on compile or decompile.
80*e1fe3e4aSElliott Hughes.El
81*e1fe3e4aSElliott Hughes.Ss "Dump options"
82*e1fe3e4aSElliott HughesThe following options control the process of dumping font files
83*e1fe3e4aSElliott Hughes(TrueType or OpenType) to
84*e1fe3e4aSElliott Hughes.Tn TTX
85*e1fe3e4aSElliott Hughesfiles.
86*e1fe3e4aSElliott Hughes.Bl -tag -width ".Fl t Ar table"
87*e1fe3e4aSElliott Hughes.It Fl l
88*e1fe3e4aSElliott HughesList table information.  Instead of dumping the font to a
89*e1fe3e4aSElliott Hughes.Tn TTX
90*e1fe3e4aSElliott Hughesfile, display minimal information about each table.
91*e1fe3e4aSElliott Hughes.It Fl t Ar table
92*e1fe3e4aSElliott HughesDump table
93*e1fe3e4aSElliott Hughes.Ar table .
94*e1fe3e4aSElliott HughesThis option may be given multiple times to dump several tables at
95*e1fe3e4aSElliott Hughesonce.  When not specified, all tables are dumped.
96*e1fe3e4aSElliott Hughes.It Fl x Ar table
97*e1fe3e4aSElliott HughesExclude table
98*e1fe3e4aSElliott Hughes.Ar table
99*e1fe3e4aSElliott Hughesfrom the list of tables to dump.  This option may be given multiple
100*e1fe3e4aSElliott Hughestimes to exclude several tables from the dump.  The
101*e1fe3e4aSElliott Hughes.Fl t
102*e1fe3e4aSElliott Hughesand
103*e1fe3e4aSElliott Hughes.Fl x
104*e1fe3e4aSElliott Hughesoptions are mutually exclusive.
105*e1fe3e4aSElliott Hughes.It Fl s
106*e1fe3e4aSElliott HughesSplit tables.  Dump each table to a separate
107*e1fe3e4aSElliott Hughes.Tn TTX
108*e1fe3e4aSElliott Hughesfile and write (under the name that would have been used for the output
109*e1fe3e4aSElliott Hughesfile if the
110*e1fe3e4aSElliott Hughes.Fl s
111*e1fe3e4aSElliott Hughesoption had not been given) one small
112*e1fe3e4aSElliott Hughes.Tn TTX
113*e1fe3e4aSElliott Hughesfile containing references to the individual table dump files.  This
114*e1fe3e4aSElliott Hughesfile can be used as input to
115*e1fe3e4aSElliott Hughes.Nm
116*e1fe3e4aSElliott Hughesas long as the referenced files can be found in the same directory.
117*e1fe3e4aSElliott Hughes.It Fl i
118*e1fe3e4aSElliott Hughes.\" XXX: I suppose OpenType programs (exist and) are also affected.
119*e1fe3e4aSElliott HughesDon't disassemble TrueType instructions.  When this option is specified,
120*e1fe3e4aSElliott Hughesall TrueType programs (glyph programs, the font program and the
121*e1fe3e4aSElliott Hughespre-program) are written to the
122*e1fe3e4aSElliott Hughes.Tn TTX
123*e1fe3e4aSElliott Hughesfile as hexadecimal data instead of
124*e1fe3e4aSElliott Hughesassembly.  This saves some time and results in smaller
125*e1fe3e4aSElliott Hughes.Tn TTX
126*e1fe3e4aSElliott Hughesfiles.
127*e1fe3e4aSElliott Hughes.It Fl y Ar n
128*e1fe3e4aSElliott HughesWhen decompiling a TrueType Collection (TTC) file,
129*e1fe3e4aSElliott Hughesdecompile font number
130*e1fe3e4aSElliott Hughes.Ar n ,
131*e1fe3e4aSElliott Hughesstarting from 0.
132*e1fe3e4aSElliott Hughes.El
133*e1fe3e4aSElliott Hughes.Ss "Compilation options"
134*e1fe3e4aSElliott HughesThe following options control the process of compiling
135*e1fe3e4aSElliott Hughes.Tn TTX
136*e1fe3e4aSElliott Hughesfiles into font files (TrueType or OpenType):
137*e1fe3e4aSElliott Hughes.Bl -tag -width ".Fl t Ar table"
138*e1fe3e4aSElliott Hughes.It Fl m Ar fontfile
139*e1fe3e4aSElliott HughesMerge the input
140*e1fe3e4aSElliott Hughes.Tn TTX
141*e1fe3e4aSElliott Hughesfile
142*e1fe3e4aSElliott Hughes.Ar file
143*e1fe3e4aSElliott Hugheswith
144*e1fe3e4aSElliott Hughes.Ar fontfile .
145*e1fe3e4aSElliott HughesNo more than one
146*e1fe3e4aSElliott Hughes.Ar file
147*e1fe3e4aSElliott Hughesargument can be specified when this option is used.
148*e1fe3e4aSElliott Hughes.It Fl b
149*e1fe3e4aSElliott HughesDon't recalculate glyph bounding boxes.  Use the values in the
150*e1fe3e4aSElliott Hughes.Tn TTX
151*e1fe3e4aSElliott Hughesfile as is.
152*e1fe3e4aSElliott Hughes.El
153*e1fe3e4aSElliott Hughes.Sh "THE TTX FILE FORMAT"
154*e1fe3e4aSElliott HughesYou can find some information about the
155*e1fe3e4aSElliott Hughes.Tn TTX
156*e1fe3e4aSElliott Hughesfile format in
157*e1fe3e4aSElliott Hughes.Pa documentation.html .
158*e1fe3e4aSElliott HughesIn particular, you will find in that file the list of tables understood by
159*e1fe3e4aSElliott Hughes.Nm
160*e1fe3e4aSElliott Hughesand the relations between TrueType GlyphIDs and the glyph names used in
161*e1fe3e4aSElliott Hughes.Tn TTX
162*e1fe3e4aSElliott Hughesfiles.
163*e1fe3e4aSElliott Hughes.Sh EXAMPLES
164*e1fe3e4aSElliott HughesIn the following examples, all files are read from and written to the
165*e1fe3e4aSElliott Hughescurrent directory.  Additionally, the name given for the output file
166*e1fe3e4aSElliott Hughesassumes in every case that it did not exist before
167*e1fe3e4aSElliott Hughes.Nm
168*e1fe3e4aSElliott Hugheswas invoked.
169*e1fe3e4aSElliott Hughes.Pp
170*e1fe3e4aSElliott HughesDump the TrueType font contained in
171*e1fe3e4aSElliott Hughes.Pa FreeSans.ttf
172*e1fe3e4aSElliott Hughesto
173*e1fe3e4aSElliott Hughes.Pa FreeSans.ttx :
174*e1fe3e4aSElliott Hughes.Pp
175*e1fe3e4aSElliott Hughes.Dl ttx FreeSans.ttf
176*e1fe3e4aSElliott Hughes.Pp
177*e1fe3e4aSElliott HughesCompile
178*e1fe3e4aSElliott Hughes.Pa MyFont.ttx
179*e1fe3e4aSElliott Hughesinto a TrueType or OpenType font file:
180*e1fe3e4aSElliott Hughes.Pp
181*e1fe3e4aSElliott Hughes.Dl ttx MyFont.ttx
182*e1fe3e4aSElliott Hughes.Pp
183*e1fe3e4aSElliott HughesList the tables in
184*e1fe3e4aSElliott Hughes.Pa FreeSans.ttf
185*e1fe3e4aSElliott Hughesalong with some information:
186*e1fe3e4aSElliott Hughes.Pp
187*e1fe3e4aSElliott Hughes.Dl ttx -l FreeSans.ttf
188*e1fe3e4aSElliott Hughes.Pp
189*e1fe3e4aSElliott HughesDump the
190*e1fe3e4aSElliott Hughes.Sq cmap
191*e1fe3e4aSElliott Hughestable from
192*e1fe3e4aSElliott Hughes.Pa FreeSans.ttf
193*e1fe3e4aSElliott Hughesto
194*e1fe3e4aSElliott Hughes.Pa FreeSans.ttx :
195*e1fe3e4aSElliott Hughes.Pp
196*e1fe3e4aSElliott Hughes.Dl ttx -t cmap FreeSans.ttf
197*e1fe3e4aSElliott Hughes.Sh NOTES
198*e1fe3e4aSElliott HughesOn MS\-Windows and MacOS,
199*e1fe3e4aSElliott Hughes.Nm
200*e1fe3e4aSElliott Hughesis available as a graphical application to which files can be dropped.
201*e1fe3e4aSElliott Hughes.Sh SEE ALSO
202*e1fe3e4aSElliott Hughes.Pa documentation.html
203*e1fe3e4aSElliott Hughes.Pp
204*e1fe3e4aSElliott Hughes.Xr fontforge 1 ,
205*e1fe3e4aSElliott Hughes.Xr ftinfo 1 ,
206*e1fe3e4aSElliott Hughes.Xr gfontview 1 ,
207*e1fe3e4aSElliott Hughes.Xr xmbdfed 1 ,
208*e1fe3e4aSElliott Hughes.Xr Font::TTF 3pm
209*e1fe3e4aSElliott Hughes.Sh AUTHORS
210*e1fe3e4aSElliott Hughes.Nm
211*e1fe3e4aSElliott Hugheswas written by
212*e1fe3e4aSElliott Hughes.An -nosplit
213*e1fe3e4aSElliott Hughes.An "Just van Rossum" Aq [email protected] .
214*e1fe3e4aSElliott Hughes.Pp
215*e1fe3e4aSElliott HughesThis manual page was written by
216*e1fe3e4aSElliott Hughes.An "Florent Rougon" Aq [email protected]
217*e1fe3e4aSElliott Hughesfor the Debian GNU/Linux system based on the existing FontTools
218*e1fe3e4aSElliott Hughesdocumentation.  It may be freely used, modified and distributed without
219*e1fe3e4aSElliott Hughesrestrictions.
220*e1fe3e4aSElliott Hughes.\" For Emacs:
221*e1fe3e4aSElliott Hughes.\" Local Variables:
222*e1fe3e4aSElliott Hughes.\" fill-column: 72
223*e1fe3e4aSElliott Hughes.\" sentence-end: "[.?!][]\"')}]*\\($\\| $\\|   \\|  \\)[   \n]*"
224*e1fe3e4aSElliott Hughes.\" sentence-end-double-space: t
225*e1fe3e4aSElliott Hughes.\" End: