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

Method draw_ttf

tests/test_pager_code.py:254–259  ·  view source on GitHub ↗

Draw text using TTF font. Returns width.

(self, x, y, text, color, font_path, font_size)

Source from the content-addressed store, hash-verified

252
253 # ========== TTF TEXT ==========
254 def draw_ttf(self, x, y, text, color, font_path, font_size):
255 """Draw text using TTF font. Returns width."""
256 if VERBOSE:
257 text_preview = text[:30] + ('...' if len(text) > 30 else '')
258 print(f"[MockPager] draw_ttf({x}, {y}, '{text_preview}', size={font_size})")
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."""

Callers 1

run_testsFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected