2 # mftrace - Generate Type1 or TrueType font from Metafont source.
4 # Copyright (c) 2001--2006 by
5 # Han-Wen Nienhuys, Jan Nieuwenhuizen
7 # Distributed under terms of the GNU General Public License. It comes with
15 # Read some global vars
17 def __init__ (self
, lines
):
21 afm
= Afm_font_metric ()
22 for i
in self
.lines
[:20]:
23 m
= re
.match ('([^ \t\n]*)[ \t]*(.*[^ \t\n])', i
)
28 afm
.__dict
__[key
] = value
31 class Afm_font_metric
:
35 def read_afm_file (filename
):
36 reader
= Afm_reader (open (filename
).readlines ())
37 return reader
.get_afm ()
39 if __name__
== '__main__':
40 i
= read_afm_file (sys
.argv
[1])
41 print i
, i
.FullName
, i
.FontName