wordcraft/crates/doc/src
Valentin Klein a5b17eb3a4
Enclose Characters: put a character in a circle, square, triangle or diamond (#301)
* Home › Font › Enclose Characters: circle, square, triangle or diamond around a character (#297)

New command format.enclose {"shape": "circle|square|triangle|diamond" | null,
"style"?: "shrink|enlarge", "text"?: string} puts one full-width or up to two
half-width characters in an enclosure, changes its shape, or (null) takes the
text back out. It is stored the way ECMA-376 describes it: an EQ field with the
overstrike switch, eq \o\ac(○,字), with the text as its plain-text result.

Layout now draws EQ \o fields: the arguments overstruck as one cluster
(centred, \al or \ar). An enclosure symbol among them is drawn as a vector
shape around the text in the text's colour, so it never depends on the font
having ○ □ △ ◇; "shrink text" scales the text into a one-em shape, "enlarge
symbol" grows the shape around text at its own size. Screen and PDF both get
it through the display list. Imported Word documents with enclosed characters
used to show nothing (the field has no result); they now render.

.docx: written as Word stores enclosed characters (begin, the code split so the
symbol and the text have their own run sizes, end, no result); the reader
recovers the style from those sizes. The style lives in the model as a trailing
\* enlarge on the code, never written to a file.

Home › Font gets an Enclose Characters button that opens a dialog (Style:
None / Shrink text / Enlarge symbol, Text, Enclosure list, a drawn preview);
scripts with a shape never see it. Strings in every interface catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Merge fix: keep both sides (enclosures and ruby; tests); regenerate parity checklist

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 13:20:45 -04:00
..
bidi.rs Right-to-left and Persian text support (bidi, shaping, RTL paragraphs, DOCX) (#207) 2026-10-10 09:26:41 -04:00
edit.rs Hyperlinks cover only their own text (#413) (#449) 2026-10-11 01:50:48 -04:00
effects.rs Free rotation and flips for pictures, shapes and text boxes (#332) (#340) 2026-10-10 17:10:09 -04:00
encoding.rs Import Word 97-2003 .doc files (#28) (#145) 2026-10-10 08:36:38 -04:00
eq.rs Enclose Characters: put a character in a circle, square, triangle or diamond (#301) 2026-10-11 13:20:45 -04:00
fields.rs Zotero integration: cite while you write, with a Zotero tab (#189) 2026-10-10 08:35:59 -04:00
freeform.rs Draw tab: draw with pen, pencil and highlighter, erase ink, and hide ink (#315) 2026-10-10 18:50:37 -04:00
graphic.rs Charts, SmartArt and OLE objects are no longer lost when you save a .docx (#333) 2026-10-10 17:48:51 -04:00
lib.rs Enclose Characters: put a character in a circle, square, triangle or diamond (#301) 2026-10-11 13:20:45 -04:00
math.rs Wrap long display equations across lines like Word (#326) (#329) 2026-10-10 16:37:25 -04:00
math_edit.rs Equations: Word (OMML) import, layout and save, plus an equation editor like Word's (#191) 2026-10-10 09:04:52 -04:00
math_latex.rs Equation fixes: numbering removal, control colour, undo for navigation edits, LaTeX text spaces (#444, #446, #447, #448) (#487) 2026-10-11 11:14:51 -04:00
math_linear.rs Equations: Word (OMML) import, layout and save, plus an equation editor like Word's (#191) 2026-10-10 09:04:52 -04:00
math_symbols.rs Equations: Word (OMML) import, layout and save, plus an equation editor like Word's (#191) 2026-10-10 09:04:52 -04:00
numbering.rs Define New Multilevel List and Track Changes Options dialogs (#342) 2026-10-10 17:40:39 -04:00
para.rs Phonetic Guide: ruby text (furigana, pinyin) over base text (#296) 2026-10-11 13:12:45 -04:00
props.rs Phonetic Guide: ruby text (furigana, pinyin) over base text (#296) 2026-10-11 13:12:45 -04:00
resolve.rs Track Changes: formatting revisions (w:rPrChange/w:pPrChange) (#41) (#399) 2026-10-10 19:32:59 -04:00
section.rs Track Changes: formatting revisions (w:rPrChange/w:pPrChange) (#41) (#399) 2026-10-10 19:32:59 -04:00
styles.rs Re-land #264, #263, #270, #271, #267, #280: clipboard pane, table styles, Manage Styles, Asian Typography, Group, Shape Effects (#323) 2026-10-10 16:09:04 -04:00
table.rs M0.1–M0.6: workspace, geom, document model, fonts, layout, render 2026-10-05 22:30:16 -04:00
tests.rs Draw tab: draw with pen, pencil and highlighter, erase ink, and hide ink (#315) 2026-10-10 18:50:37 -04:00
wrap.rs Tight and Through wrapping follow the object's outline (#354) (#360) 2026-10-11 12:10:48 -04:00