5 font_set_name = sys.argv[2]
7 body = open (file).read()
8 body_length = len (body)
10 binary_data = "/%(font_set_name)s %(body_length)d StartData " % vars() \
12 binary_length = len (binary_data)
14 header = r"""%%%%BeginResource: font %(font_set_name)s
15 %%!PS-Adobe-3.0 Resource-FontSet
16 %%%%DocumentNeededResources: ProcSet (FontSetInit)
17 %%%%Title: (FontSet/%(font_set_name)s)
18 %%%%Version: %(version)s
20 %%%%IncludeResource: ProcSet (FontSetInit)
21 %%%%BeginResource: FontSet (%(font_set_name)s)
22 /FontSetInit /ProcSet findresource begin
23 %%%%BeginData: %(binary_length)d Binary Bytes
27 footer = """\n%%%%EndData
30 %%%%EndResource\n""" % vars()
32 fo = open (output,'w')
34 fo.write (binary_data)