• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

COPYINGH A D21-Dec-200617.6 KiB343281

ChangeLogH A D21-Oct-200616.5 KiB610354

GNUmakefile.inH A D06-Dec-20112.7 KiB11892

README.texiH A D06-Dec-201111 KiB337251

afm.pyH A D21-Dec-20061.5 KiB5324

config.h.inH A D21-Oct-200686 53

configureH A D06-Dec-2011132 KiB4,7143,933

configure.inH A D06-Dec-2011745 3323

gf2pbm.cH A D21-Oct-200616.3 KiB713559

mftrace.1H A D23-Jan-20075.7 KiB268256

mftrace.pyH A D12-Mar-201141 KiB1,4271,094

mftrace.specH A D06-Dec-20111.1 KiB5439

mftrace.spec.inH A D21-Oct-20061.1 KiB5440

tfm.pyH A D21-Dec-20065.1 KiB186118

README.texi

1\input texinfo @c -*-texinfo-*-
2
3@setfilename README.info
4@settitle  mftrace - Scalable Fonts for MetaFont
5
6
7@ignore
8
9Copyright (c) 1999--2006 by the authors
10
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU General Public License.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19@end ignore
20
21@include version.texi
22
23@node Top, , ,
24@top
25
26@chapter mftrace - Scalable PostScript Fonts for MetaFont
27
28@section Introduction
29
30@code{mftrace} is a small Python program that lets you trace a @TeX{}
31bitmap font into a PFA or PFB font (A PostScript Type1 Scalable Font)
32or TTF (TrueType) font.  It is licensed under the GNU GPL.
33
34Scalable fonts offer many advantages over bitmaps, as they allow
35documents to render correctly at many printer resolutions. Moreover,
36Ghostscript can generate much better PDF, if given scalable PostScript
37fonts.
38
39Versions prior to 1.0.5 were called `pktrace'.
40
41@section Download
42
43@itemize
44@item @uref{http://lilypond.org/download/sources/mftrace/mftrace-@mftversion{}.tar.gz}
45@item GIT at @uref{https://github.com/hanwen/mftrace}
46@end itemize
47
48
49@section Required
50
51@file{mftrace} is a thin Python wrapper around some other programs that
52do the real work: a tracing program and t1asm.  To run mftrace you need:
53@itemize @bullet
54@item A tracing program:
55      autotrace >= 0.30 (see @uref{http://autotrace.sourceforge.net}
56      or potrace (see @uref{http://potrace.sourceforge.net}).
57
58      Potrace is recommended as it runs quicker than autotrace.
59
60@item Python--2.2 or later. See @uref{http://www.python.org/}
61@item t1utils. See @uref{http://www.lcdf.org/~eddietwo/type/}
62@item  TeX--your tex installation should include
63@itemize @bullet
64  @item  kpsewhich,
65  @item  MetaFont
66@end itemize
67@end itemize
68
69@section Recommended
70
71@itemize @bullet
72@item A recent version (040215 or newer) of
73@uref{http://fontforge.sourceforge.net,FontForge}. Some of @code{mftrace}
74functionality requires FontForge to be present on user's system. This
75includes rounding to integer, simplifying and autohinting font outlines,
76as well as generating any output formats except PFA, PFB and AFM. You
77should not request any of these features using @code{mftrace} options if
78you don't like your font to be run through FontForge (note that in this
79case you also have to explicitly specify @code{--noround} to disable
80rounding to integer).
81
82@item Alternatively, you need GhostScript with its @file{printafm}
83utility, available somethere in your PATH. @code{mftrace} uses
84@file{printafm} to generate AFM files in case there is no need to
85process the font with FontForge.
86
87@end itemize
88
89@section Red Hat
90
91A RPM may be built by issuing
92@example
93
94        rpmbuild -tb mftrace-@var{version}.tar.gz
95
96@end example
97
98
99
100@section Debian GNU/Linux
101
102Users of Debian unstable (and Debian 3.0 when it is released) can
103install all requirements by running (as root):
104@example
105
106    apt-get install mftrace
107
108@end example
109If you wish to also install the FontForge package to simplify and
110autohint the font, then run the command
111@example
112
113    apt-get install fontforge
114
115@end example
116
117
118@section Install
119
120Install the prerequite packages. Then run
121@example
122
123    ./configure
124    make install
125
126@end example
127in the mftrace directory. Run as follows:
128@example
129
130mftrace cmr10
131
132@end example
133
134@section Invoking mftrace.
135
136Command line options:
137@table @code
138@item --formats=LIST
139 A comma-separated list of formats to generate. Choices include:  AFM,
140 PFA, PFB, TTF and SVG. Default is to generate a PFA file. Note that
141 @file{fontforge} (formerly called @file{pfaedit}) needs to be installed
142 in order to generate any format except PFA or PFB. For generating AFM
143 you need either @file{fontforge} or @file{ghostscript}.
144@item -e,--encoding=@var{enc}
145 Use encoding file @var{enc}. Encoding files used by @code{mftrace} are
146 basically in the  GhostScript/dvips format, but you may use a special
147 @code{.notavail} glyph name in order to tell mftrace not to process
148 a specific glyph. If this option is not specified,  mftrace will try to
149 determine the encoding file automatically, from the encoding specified
150 in the TFM file.
151@item --glyphs=@var{list}
152  Only process glyphs in @var{list}, which is a  comma-delimited  list of
153  decimal numbers or ranges.
154@example
155  --glyphs 1-10,50,55,90-100
156@end example
157@item --gffile=@var{name}
158=  Take glyphs from file @var{name}.
159@item --grid @var{gridsize}
160Set reciprocal grid size in em units multiplied by ratio magnification/1000.
161For example @code{--grid 10 --magnification 1000} will round
162coordinates of control points to 1/10 of em unit. Useful simultaneously
163with @code{--noround}  option. Default @var{gridsize} value is 1, i. e. round to integer.
164@item -h,--help
165 help on options.
166@item -k,--keep
167 Retain all temporary files in the directory @file{mftrace.dir/}. This
168 is useful for debugging problems.
169@item --keep-trying
170 Try to continue if external programs called by mftrace fail. If METAFONT
171 crashes with overflow errors, but nevertheless outputs a GF file, try to
172 process its output as is (useful for some buggy fonts, see below). If
173 potrace/autotrace fails to trace a specific character, first try it with
174 a less smoothed curve, and if that fails, skip the character.
175
176 By default mftrace outputs @file{trace-bug-FONTNAME-NUMBER.pbm} and
177stops the process with a request to file a bugreport.
178@item --magnification
179The magnification to use for the PFA file. The default is 1000. The
180larger the more precise the PFA file will be. However, when
181magnification is too large METAFONT can crash with overflow errors.
182
183Sadly, many MF fonts contain resolution checks
184@example
185  if dots_per_inch * design_size > 1500:
186    ...
187@end example
188This check is susceptible to overflow errors.  Such code should be
189reported as a bug, and changed to
190@example
191  if dots_per_inch > (1500 / design_size):
192    ...
193@end example
194
195@item --noround
196Don't round coordinates of control points to integer
197values. Useful simultaneously  with
198@code{--grid} option. Disabled by default.
199
200@item -o,--output-base=FILE
201 Output to FILE.pfa or FILE.pfb.
202@item --simplify
203 Pass the font through FontForge for automatic  simplification and hinting.
204@item --tfmfile=FILE
205 Use @var{file} for the TFM file.  This file is needed to determine at
206 what resolution to run MetaFont.
207@item  -V,--verbose
208 Be verbose: print all commands as they are invoked. This is useful
209 for debugging.
210@item -v,--version
211 Print version number
212@item --dos-kpath
213 Try to kludge up the paths coming from MikTeX for a cygwin
214environment. If this doesn't work, specify @code{--tfmfile} and
215@code{--encoding} manually.
216@item -w,--warranty
217show warranty and copyright
218@item --potrace
219use Potrace (default).
220@item --autotrace
221use AutoTrace.
222
223@item -D,--define=@var{symbol}=@var{value}
224Set the font info @var{symbol} to the given @var{value}. For example
225@code{-DFamilyName=Foo} sets the font family name to @code{Foo}.
226
227Mftrace tries to fill in sensible values for the FontName, FamilyName,
228FullName and Weight fields. It does so by guessing values for the CM font
229series. For other fonts, it tries to read an AFM file (which is not likely
230to exist). Suggestions for a more generic way to handle this are welcome.
231
232@end table
233
234Mftrace uses kpathsea for finding fonts, so any kpathsea variable can
235be used to fine-tune which files should be loaded.  For example, you
236can set @code{MFINPUTS} to specify which paths to search for
237@file{.mf} files.
238
239Additional options may be passed to the backend program (potrace or autotrace)
240with the @code{MFTRACE_BACKEND_OPTIONS} environment variable.
241
242
243@section Discussion
244
245Why use @code{mftrace} over
246@uref{http://textrace.sourceforge.net,textrace}?  Textrace and mftrace
247are functionally similar. However, mftrace is quicker, more cleanly
248written and can be installed using standard methods. Additionally,
249textrace requires perl, ghostscript and dvips.
250
251How about @uref{http://www.truetex.com,MetaFog}? MetaFog operates
252directly on the curves that generate the bitmap font, its outlines will
253probably be smaller and better. However, MetaFog is a proprietary
254product: its source code is not available, and it will only run on a
255limited number of platforms.
256
257How about @uref{ftp://bop.eps.gda.pl/pub/metatype1/,MetaType1}?
258MetaType1 is an approach that puts severe constraints on what may be
259done in a font program. It does not work for fonts containing overlaps
260and shaped pens.
261
262How about @uref{http://fontforge.sourceforge.net/,FontForge} itself?
263FontForge is an interactive editor, but it can be scripted. Since it
264supports bitmap tracing and @TeX{} bitmap fonts, it is possible to
265duplicate the functionality of mftrace.  However, out of the box,
266FontForge does not recognize TeX encodings.
267
268
269@section Bugs and todo
270
271@itemize
272@item Environment variables containing relative directories,
273  such as MFINPUTS or TFMINPUTS, are not handled correctly.
274
275@item Discuss fonts & copyright.
276@item Submit @file{tfm.py} to www.python.org. @file{tfm.py}  is a python
277  module to parse Tex Font Metric file.
278@end itemize
279
280Should you encounter any bug or problem, then please send a bugreport
281to @email{hanwen@@xs4all.nl,Han-Wen Nienhuys}.
282
283@section Author
284
285@email{hanwen@@xs4all.nl,Han-Wen Nienhuys}
286
287
288@section Credits
289
290Gf2pbm, the utility to convert a MetaFont GF file to a PBM file was
291based on Paul Vojta's Xdvi. The license notice is reproduced below.
292
293Thanks to all bughunters and contributors: Andrey V. Panov, Geoffrey
294Alan Washburn, @uref{http://www.maths.qmul.ac.uk/~jdg/,Julian Gilbey}
295G@"{u}nther Spahlinger, Richard Mahoney, Stanislav Brabec, and Thomas
296Bushnell BSG.
297
298
299@quotation
300Copyright (c) 1990-1999  Paul Vojta
301
302Permission is hereby granted, free of charge, to any person obtaining a copy
303of this software and associated documentation files (the "Software"), to
304deal in the Software without restriction, including without limitation the
305rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
306sell copies of the Software, and to permit persons to whom the Software is
307furnished to do so, subject to the following conditions:
308
309The above copyright notice and this permission notice shall be included in
310all copies or substantial portions of the Software.
311
312THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
313IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
314FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
315PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
316IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
317CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
318@end quotation
319
320The rest of the package mftrace  script itself is licensed under the
321@uref{http://www.gnu.org/licenses/gpl.txt,GNU General Public License}.
322
323
324
325@section See also
326
327@itemize @bullet
328@item @uref{http://partners.adobe.com/asn/developer/pdfs/tn/T1Format.pdf,Type1
329font specification}
330@item @uref{http://partners.adobe.com/asn/developer/pdfs/tn/5015.Type1_Supp.pdf,Supplement
331to the Type1 specification}.
332@end itemize
333
334@bye
335
336
337