annotate_table_layout — ANNOTATE paper op

• Data kinds: text → table

• Call: import fullseye as fs; fs.ledger.annotate_table_layout(text, xy, anchor='lt', font_size=13, font_path=None, pad=6, col_gap=None, row_gap=0, align='auto', header=False, bold=False, italic=False, line_spacing=1.15) (to call the implementation directly, import annotate; annotate.annotate_table_layout(text, xy, anchor='lt', font_size=13, font_path=None, pad=6, col_gap=None, row_gap=0, align='auto', header=False, bold=False, italic=False, line_spacing=1.15); from the registry, opsannotate.get("annotate_table_layout"))

Usage

Returns a table (dict): the column and row positions at which a tab-separated string is placed as a table.

Rows are split at \n, columns at \t. Column width is the maximum width measured 1 cell at a time with the real font at the given size -- counting characters always goes wrong between Japanese and alphanumerics, so measuring is the only correct way.

Parameters

text : str

Tab-separated. Every row must have the same number of columns (otherwise ValueError).

xy : (x, y)

The position pointed to by anchor (x=col, y=row).

anchor : str

One of the 9 options 'lt','ct','rt','lm','cm','rm','lb','cb','rb'.

pad : int

Inner padding of the table [px].

col_gap : int or None

Gap between columns [px]. None (default) rounds row height ×0.6, so

changing the font size moves the spacing along with it.

row_gap : int

Added between rows [px] (0 keeps the plain line pitch).

align : str or sequence

One of TABLE_ALIGNS, or a per-column sequence. "auto"

(default) right-aligns a column only when all its values look like numbers.

With header=True the header row is excluded from that test.

header : bool

If true, the 1st row is made bold as a header and 1 rule is drawn below it.

bold, italic : bool or int

Synthetic type styles (_bold_px / _italic_tile). The header

bold is separate from this and applies only to the header row.

Returns

dict

{"rect": (x,y,w,h), "ncols", "nrows", "col_w": [...], "col_x": [...], "row_y": [...], "row_h", "col_gap", "align": [...], "header", "rule_y": y of the header rule (None if header is false), "cells": [{"text","row","col","xy","width","bold"}]}.

col_x / row_y / cells[i]["xy"] are all in image coordinates.

Raises

ValueError

Column count differs between rows / empty / unknown align anchor /

length of align differs from the column count.

Examples

>>> import annotate

>>> lay = annotate.annotate_table_layout("Name\tValue\nA\t1.5\nB\t22.25", (10, 10))

>>> lay["ncols"], lay["nrows"], lay["align"]

(2, 3, ['left', 'left'])

>>> lay2 = annotate.annotate_table_layout("Name\tValue\nA\t1.5\nB\t22.25", (10, 10),

... header=True)

>>> lay2["align"] # without the header, column 2 is numbers only

['left', 'right']

Detailed usage guide

• figure_annotation family guide

Background guides (the physics and conventions behind this op)

• dataset_conventions — Training-dataset conventions — COCO / YOLO / VOC and pitfalls in visual inspection

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• annotate_paper_tour — py -3.11 examples/annotate_paper_tour.py

Ops the type connects to (they accept table as input)

—

Same category (paper)

annotate_leader_layout · annotate_leader · annotate_markers · annotate_legend · annotate_dimension_layout · annotate_dimension · annotate_angle_layout · annotate_angle


*Provenance: annotate.py — ANNOTATE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.