Draw text using TTF font. Returns width.
(self, x, y, text, color, font_path, font_size)
| 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.""" |