src/reportlab/pdfbase/ttfonts.py
branchpy33
changeset 3723 99aa837b6703
parent 3721 0c93dd8ff567
child 3728 8559eca73c9c
equal deleted inserted replaced
3722:29c11b905751 3723:99aa837b6703
    51 Canvas and TextObject have special support for dynamic fonts.
    51 Canvas and TextObject have special support for dynamic fonts.
    52 """
    52 """
    53 
    53 
    54 import string
    54 import string
    55 from struct import pack, unpack, error as structError
    55 from struct import pack, unpack, error as structError
    56 from reportlab.lib.utils import getStringIO
    56 from reportlab.lib.utils import getBytesIO
    57 from reportlab.pdfbase import pdfmetrics, pdfdoc
    57 from reportlab.pdfbase import pdfmetrics, pdfdoc
    58 from reportlab import rl_config
    58 from reportlab import rl_config
    59 
    59 
    60 class TTFError(pdfdoc.PDFError):
    60 class TTFError(pdfdoc.PDFError):
    61     "TrueType font exception"
    61     "TrueType font exception"
   356             data = splice(data, 8, '\0\0\0\0')
   356             data = splice(data, 8, '\0\0\0\0')
   357         self.tables[tag] = data
   357         self.tables[tag] = data
   358 
   358 
   359     def makeStream(self):
   359     def makeStream(self):
   360         "Finishes the generation and returns the TTF file as a string"
   360         "Finishes the generation and returns the TTF file as a string"
   361         stm = getStringIO()
   361         stm = getBytesIO()
   362         write = stm.write
   362         write = stm.write
   363 
   363 
   364         numTables = len(self.tables)
   364         numTables = len(self.tables)
   365         searchRange = 1
   365         searchRange = 1
   366         entrySelector = 0
   366         entrySelector = 0