| Conditions | 2 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import os |
||
| 8 | def register_font(font='Vera.ttf'): |
||
| 9 | """Register fonts for report labs canvas.""" |
||
| 10 | directory = os.path.join(bundle_dir()) |
||
| 11 | ttfFile = resource_path(os.path.join(directory, font)) |
||
| 12 | if os.path.exists(ttfFile): |
||
| 13 | pdfmetrics.registerFont(TTFont("Vera", ttfFile)) |
||
| 14 | return ttfFile |
||
| 15 | else: |
||
| 16 | print(ttfFile, 'can not be found') |
||
| 17 | |||
| 20 |