Beispiel #1
0
 def write(self, file, writer, registry):
     if self.font is None:
         self.mkfontfile()
     if self.strip:
         # XXX: access to the encoding file
         if self.encodingfilename:
             encodingfile = type1font.encodingfile(self.encodingfilename, self.encodingfilename)
             usedglyphs = dict([(encodingfile.decode(char)[1:], 1) for char in self.usedchars.keys()])
         else:
             self.font._encoding()
             usedglyphs = dict([(self.font.encoding.decode(char), 1) for char in self.usedchars.keys()])
         strippedfont = self.font.getstrippedfont(usedglyphs)
     else:
         strippedfont = self.font
     strippedfont.outputPDF(file, writer)
Beispiel #2
0
 def write(self, file, writer, registry):
     if self.font is None:
         self.mkfontfile()
     if self.strip:
         # XXX: access to the encoding file
         if self.encodingfilename:
             encodingfile = type1font.encodingfile(self.encodingfilename,
                                                   self.encodingfilename)
             usedglyphs = dict([(encodingfile.decode(char)[1:], 1)
                                for char in self.usedchars.keys()])
         else:
             self.font._encoding()
             usedglyphs = dict([(self.font.encoding.decode(char), 1)
                                for char in self.usedchars.keys()])
         strippedfont = self.font.getstrippedfont(usedglyphs)
     else:
         strippedfont = self.font
     strippedfont.outputPDF(file, writer)
Beispiel #3
0
    def output(self, file, writer, registry):
        import font.t1font
        font = font.t1font.T1pfbfont(self.filename)

        file.write("%%%%BeginFont: %s\n" % self.name)
        # file.write("%%Included glyphs: %s\n" % " ".join(usedglyphs))
        if self.strip:
            # XXX: access to the encoding file
            if self.encodingfilename:
                encodingfile = type1font.encodingfile(self.encodingfilename, self.encodingfilename)
                usedglyphs = dict([(encodingfile.decode(char)[1:], 1) for char in self.usedchars.keys()])
            else:
                font._encoding()
                usedglyphs = dict([(font.encoding.decode(char), 1) for char in self.usedchars.keys()])
            strippedfont = font.getstrippedfont(usedglyphs)
        else:
            strippedfont = font
        strippedfont.outputPS(file, writer)
        file.write("\n%%EndFont\n")
Beispiel #4
0
    def output(self, file, writer, registry):
        import font.t1font
        font = font.t1font.T1pfbfont(self.filename)

        file.write("%%%%BeginFont: %s\n" % self.name)
        # file.write("%%Included glyphs: %s\n" % " ".join(usedglyphs))
        if self.strip:
            # XXX: access to the encoding file
            if self.encodingfilename:
                encodingfile = type1font.encodingfile(self.encodingfilename,
                                                      self.encodingfilename)
                usedglyphs = dict([(encodingfile.decode(char)[1:], 1)
                                   for char in self.usedchars.keys()])
            else:
                font._encoding()
                usedglyphs = dict([(font.encoding.decode(char), 1)
                                   for char in self.usedchars.keys()])
            strippedfont = font.getstrippedfont(usedglyphs)
        else:
            strippedfont = font
        strippedfont.outputPS(file, writer)
        file.write("\n%%EndFont\n")
Beispiel #5
0
 def write(self, file, writer, registry):
     encodingfile = type1font.encodingfile(self.encoding.name, self.encoding.filename)
     encodingfile.outputPDF(file, writer)
Beispiel #6
0
 def write(self, file, writer, registry):
     encodingfile = type1font.encodingfile(self.encoding.name,
                                           self.encoding.filename)
     encodingfile.outputPDF(file, writer)