MCPcopy Create free account
hub / github.com/PageBot/PageBot / font

Method font

Lib/pagebot/contexts/basecontext/basecontext.py:775–786  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

fontSizeMethod · 0.95
findFontFunction · 0.90

Tested by

no test coverage detected