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

Function text

experiments/human_eval/draw_error_analysis_single_case.py:46–59  ·  view source on GitHub ↗
(
    page: fitz.Page,
    box: tuple[float, float, float, float],
    value: str,
    size: float,
    color=TEXT,
    font: str = "Times-Bold",
    align: int = fitz.TEXT_ALIGN_CENTER,
)

Source from the content-addressed store, hash-verified

44
45
46def text(
47 page: fitz.Page,
48 box: tuple[float, float, float, float],
49 value: str,
50 size: float,
51 color=TEXT,
52 font: str = "Times-Bold",
53 align: int = fitz.TEXT_ALIGN_CENTER,
54) -> None:
55 x0, y0, x1, y1 = box
56 lines = value.count("\n") + 1
57 min_height = size * 1.35 * lines + 4
58 y1 = max(y1, y0 + min_height)
59 page.insert_textbox(fitz.Rect(x0, y0, x1, y1), value, fontsize=size, fontname=font, color=color, align=align)
60
61
62def chip(page: fitz.Page, x: float, y: float, w: float, h: float, label: str, fill, stroke, color=TEXT) -> None:

Callers 6

chipFunction · 0.85
draw_statusFunction · 0.85
draw_panel_1Function · 0.85
draw_panel_2Function · 0.85
draw_panel_3Function · 0.85
draw_figureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected