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

Function centered_text

experiments/human_eval/draw_interest_drift_heatmap.py:76–85  ·  view source on GitHub ↗
(
    draw: ImageDraw.ImageDraw,
    x: float,
    y: float,
    text: str,
    font: ImageFont.FreeTypeFont,
    fill: tuple[int, int, int],
)

Source from the content-addressed store, hash-verified

74
75
76def centered_text(
77 draw: ImageDraw.ImageDraw,
78 x: float,
79 y: float,
80 text: str,
81 font: ImageFont.FreeTypeFont,
82 fill: tuple[int, int, int],
83) -> None:
84 tw, th = text_size(draw, text, font)
85 draw.text((x - tw / 2, y - th / 2), text, font=font, fill=fill)
86
87
88def draw_rotated_text(

Callers 1

draw_pngFunction · 0.70

Calls 1

text_sizeFunction · 0.70

Tested by

no test coverage detected