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

Method fontSize

Lib/pagebot/contexts/basecontext/basecontext.py:791–802  ·  view source on GitHub ↗

Sets the font size in the context. >>> from pagebot.toolbox.units import pt >>> from pagebot import getContext >>> context = getContext() >>> context.newPage(420, 420) >>> context.fontSize(pt(12))

(self, fontSize)

Source from the content-addressed store, hash-verified

789 return self.b.fallbackFont(fontName)
790
791 def fontSize(self, fontSize):
792 """Sets the font size in the context.
793
794 >>> from pagebot.toolbox.units import pt
795 >>> from pagebot import getContext
796 >>> context = getContext()
797 >>> context.newPage(420, 420)
798 >>> context.fontSize(pt(12))
799 """
800 fspt = upt(fontSize)
801 self._fontSize = fspt
802 self.b.fontSize(fspt) # Render fontSize unit to value
803
804 # Babelstring
805

Callers 1

fontMethod · 0.95

Calls 1

uptFunction · 0.90

Tested by

no test coverage detected