File: C059-Roman-font-default.diff

package info (click to toggle)
python-reportlab 4.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,708 kB
  • sloc: python: 99,020; xml: 1,494; makefile: 143; sh: 12
file content (16 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Index: python-reportlab/src/reportlab/graphics/utils.py
===================================================================
--- python-reportlab.orig/src/reportlab/graphics/utils.py
+++ python-reportlab/src/reportlab/graphics/utils.py
@@ -85,6 +85,11 @@ def __makeTextPathsCode__(tp=None, _TP =
                             path_or_stream = getattr(font.face,'pfbFileName',None)
                             if not path_or_stream:
                                 path_or_stream = font.face.findT1File()
+                            if not path_or_stream:
+                                # the T1 file was not yet found!
+                                # fall back to C059-Roman
+                                font = getFont("C059-Roman")
+                                path_or_stream = getattr(font.face,'pfbFileName',None)
                         face = freetype.Face(path_or_stream)
                         self.faces[fontName] = (face,font) 
                     return self.faces[fontName]