Ejemplo n.º 1
0
 def process(self):
     args = dict(self.getAttributeValues(attrMapping=self.attrMapping))
     if 'encoding' in args:
         font = cidfonts.CIDFont(**args)
     else:
         font = cidfonts.UnicodeCIDFont(**args)
     pdfmetrics.registerFont(font)
Ejemplo n.º 2
0
 def __init__(self, row, faceName, encodingName):
     self.row = row
     self.codePoints = 160
     self.boxSize = 18
     self.charsPerRow = 16
     self.rows = 10
     self.hex = 1
     self.faceName = faceName
     self.encodingName = encodingName
     self.rowLabels = ['4', '5', '6', '7', 'A', 'B', 'C', 'D', 'E', 'F']
     try:
         # the dependent files might not be available
         font = cidfonts.CIDFont(self.faceName, self.encodingName)
         pdfmetrics.registerFont(font)
     except:
         # fall back to English and at least shwo we can draw the boxes
         self.faceName = 'Helvetica'
         self.encodingName = 'WinAnsiEncoding'
     self.fontName = self.faceName + '-' + self.encodingName
     self.calcLayout()