MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / text_size

Function text_size

experiments/human_eval/draw_interest_drift_heatmap.py:71–73  ·  view source on GitHub ↗
(draw: ImageDraw.ImageDraw, text: str, font: ImageFont.FreeTypeFont)

Source from the content-addressed store, hash-verified

69
70
71def text_size(draw: ImageDraw.ImageDraw, text: str, font: ImageFont.FreeTypeFont) -> tuple[int, int]:
72 box = draw.textbbox((0, 0), text, font=font)
73 return box[2] - box[0], box[3] - box[1]
74
75
76def centered_text(

Callers 3

centered_textFunction · 0.70
draw_rotated_textFunction · 0.70
draw_pngFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected