annotate_text_path_layout — ANNOTATE paper op

Data kinds: texttable

Call: import fullseye as fs; fs.ledger.annotate_text_path_layout(text, path, font_size=13, font_path=None, spacing=1.0, start=0.0, anchor='start', offset=0.0, upright=False, line_spacing=1.15) (to call the implementation directly, import annotate; annotate.annotate_text_path_layout(text, path, font_size=13, font_path=None, spacing=1.0, start=0.0, anchor='start', offset=0.0, upright=False, line_spacing=1.15); from the registry, opsannotate.get("annotate_text_path_layout"))

Usage

Returns a table (dict): the position and slope of each glyph along a polyline (set by arc length).

> The detailed description below is the original text — the summary and the headings are translated.

文字 i の中心は弧長 `s_i = s0 + Σ_{j<i} a_j*spacing + a_i/2`、傾きは

その位置の線分の接線角(画面座標、度)。経路より長い文字列は ValueError。

位置の決め方(2026-09-08 に追加。既定はそれまでの動作と同じ):

• `anchor —— 経路に沿ったそろえ方。"start"`(既定・従来どおり)/

`"center"(経路の中央にそろえる)/ "end"`(終端にそろえる)。

`start` はアンカーで決めた位置からさらにずらす量として効く。

• `offset` —— 経路に垂直なずらし [px]。正が進行方向の右

(画面座標。y が下向きなので、左→右に進む文字なら「下」)。

線に触れさせずに脇へ置く用途。

• `\n で**改行**。2 行目以降は line_spacing` を掛けた行高だけ

`offset` と同じ向き(進行方向の右)へずれる。★この 1 つの規則で、

横書きは「下へ」、縦書きは「左へ」とどちらも組版どおりになる

(縦書きは進行方向が下なので、その右は画面の左)。

• `upright` —— 字を接線角に回さず正立させる。経路が主に縦向き

(始点→終点の |dy| > |dx|)なら送りを字幅でなく字高にするので、

これが縦書きになる。`VERTICAL_ROTATED_CHARS` の字だけは 90 度回す。

句読点(`、。,.`)は縦組みの作法どおり右上へ寄せる

(:data:VERTICAL_SHIFTED_CHARS、寄せ量は送りの :data:_VPUNCT_SHIFT 倍)。

Windows の `@` 付きフォントが font 側でやっていたことを、ここでは合成で行う

—— Pillow はフォントをファイルパスで開くので `@` の顔に到達できず、

HarfBuzz の `direction="ttb"` も Raqm の有無で結果が変わるため、

プラットフォームで揃うほうを採った。

縦書きで実装していないこと(黙って近似しない): 小書き仮名の位置補正、

縦中横、行末の禁則。短い注記のための機能で、本文組版ではない。

Returns

-------

dict

``{"chars": [{"char","s","xy","angle_deg","width","advance","line"}],

"length": 経路長, "used": 最も長い行の送りの合計(従来どおり

`Σ advance*spacing`), "span": 最も長い行が実際に占める弧長

(最後の字の後ろの送りを含まない —— アンカーはこちらで揃える),

"lines": 行数, "line_height": 行送り [px], "vertical": 縦書きか}``。

Raises

------

ValueError

文字が空、経路が 2 点未満か長さゼロ、非有限、行が経路より長い、

アンカーと `start` の組み合わせで行が経路から外れる場合。

Detailed usage guide

figure_annotation family guide

Background guides (the physics and conventions behind this op)

dataset_conventions — 学習データセット規約の知識 — COCO / YOLO / VOC と外観検査での落とし穴

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_tourpy -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.