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

Method ttf_height

pager/test_pager_code.py:265–267  ·  view source on GitHub ↗

Get height of TTF font in pixels.

(self, font_path, font_size)

Source from the content-addressed store, hash-verified

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."""
267 return int(font_size * 1.2)
268
269 def draw_ttf_centered(self, y, text, color, font_path, font_size):
270 """Draw horizontally centered TTF text."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected