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

Method ttf_width

pager/pagerctl_mock.py:341–344  ·  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

339 return surf.get_width()
340
341 def ttf_width(self, text, font_path, font_size):
342 """Get width of TTF text in pixels."""
343 font = self._get_ttf_font(font_path, font_size)
344 return font.size(text)[0]
345
346 def ttf_height(self, font_path, font_size):
347 """Get height of TTF font in pixels."""

Callers

nothing calls this directly

Calls 1

_get_ttf_fontMethod · 0.95

Tested by

no test coverage detected