MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / ttf_width

Method ttf_width

pager/test_pager_code.py:261–263  ·  view source on GitHub ↗

Get width of TTF text in pixels.

(self, text, font_path, font_size)

Source from the content-addressed store, hash-verified

259 return int(len(text) * font_size * 0.6)
260
261 def ttf_width(self, text, font_path, font_size):
262 """Get width of TTF text in pixels."""
263 return int(len(text) * font_size * 0.6)
264
265 def ttf_height(self, font_path, font_size):
266 """Get height of TTF font in pixels."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected