PDF Output: Dont abort when non-sfnt fonts are used, instead draw the text as outlines

This commit is contained in:
Kovid Goyal 2013-01-08 11:51:02 +05:30
parent ee1a933a92
commit 6bce49960c

View File

@ -240,14 +240,17 @@ class PdfEngine(QPaintEngine):
@store_error
def drawTextItem(self, point, text_item):
# super(PdfEngine, self).drawTextItem(point, text_item)
self.apply_graphics_state()
gi = self.qt_hack.get_glyphs(point, text_item)
if not gi.indices:
sip.delete(gi)
return
name = hash(bytes(gi.name))
if name not in self.fonts:
try:
self.fonts[name] = self.create_sfnt(text_item)
except UnsupportedFont:
return super(PdfEngine, self).drawTextItem(point, text_item)
self.apply_graphics_state()
metrics = self.fonts[name]
for glyph_id in gi.indices:
try: