tests/test_charts_textlabels.py
changeset 4507 e8c76ee7995a
parent 4330 617ffa6bbdc8
--- a/tests/test_charts_textlabels.py	Tue May 21 16:34:07 2019 +0100
+++ b/tests/test_charts_textlabels.py	Thu May 23 11:01:12 2019 +0100
@@ -165,16 +165,23 @@
         story.append(PageBreak())
 
         # Round 1c
-        story.append(Paragraph('Helvetica 18pt, multi-line', h3))
+        try:
+            from reportlab.pdfbase.pdfmetrics import registerFont
+            from reportlab.pdfbase.ttfonts import TTFont
+            fontName = 'Vera'
+            registerFont(TTFont(fontName, "Vera.ttf"))
+        except:
+            fontName = 'Helvetica'
+        story.append(Paragraph('%s 18pt, multi-line' % fontName, h3))
         story.append(Spacer(0, 0.5*cm))
 
         w, h = drawWidth, drawHeight = 400, 100
         protoLabel = self._makeProtoLabel()
         protoLabel.setOrigin(drawWidth*0.5, drawHeight*0.5)
         protoLabel.textAnchor = 'start'
-        protoLabel.fontName = 'Helvetica'
+        protoLabel.fontName = fontName
         protoLabel.fontSize = 18
-        drawings = self._makeDrawings(protoLabel, text='Hello\nWorld!')
+        drawings = self._makeDrawings(protoLabel, text=u'Hello\nW\xf6rld!')
         for d in drawings:
             story.append(d)
             story.append(Spacer(0, 1*cm))