Tries to find a PageBot font based on name, else assumes it is a system font. Also optionally sets fontSize unit to value.
(self, fontName, fontSize=None)
| 773 | # Font. |
| 774 | |
| 775 | def font(self, fontName, fontSize=None): |
| 776 | """Tries to find a PageBot font based on name, else assumes it is a |
| 777 | system font. Also optionally sets fontSize unit to value.""" |
| 778 | font = findFont(fontName) |
| 779 | |
| 780 | if font: |
| 781 | self.b.font(font.path) |
| 782 | else: |
| 783 | self.b.font(fontName) |
| 784 | |
| 785 | if fontSize is not None: |
| 786 | self.fontSize(fontSize) |
| 787 | |
| 788 | def fallbackFont(self, fontName): |
| 789 | return self.b.fallbackFont(fontName) |