* fix(layout): make a paragraph's last line as tall as its text, not its mark
The layout made the last line of every paragraph at least as tall as the
paragraph's mark. Word and LibreOffice don't: a line of 8-point text in a
paragraph whose mark is 11 points is 8 points tall, as a document of
probes saved as a PDF from Word 16 for Mac and laid out by LibreOffice
26.8 showed. Text given a smaller size than its style's, as a TextRun's
size does, was laid out too tall, which put a heading of the
text-and-spacing demo on the page after Word's.
The mark now only sets the height of a line with no text on it, such as
an empty paragraph's, or a page break's at the end of a paragraph.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NijyutGmb3bNR3dNRWJken
* ci: draw Calibri Light in Carlito in the shape demos' LibreOffice
LibreOffice has no font for Calibri Light, the heading font of Office's
theme and of docx's default heading styles, and drew it in Noto Serif,
whose lines are 12% taller. So the layout comparison checked docx/layout,
which measures Calibri Light as Calibri, against headings taller than
Word's: Calibri Light is as tall as Calibri. A fontconfig alias makes
LibreOffice draw it in Carlito, as wide and tall as Calibri.
The title of charts-in-templates, in the template's heading font, is now
drawn in Carlito, so its reference image is drawn again. The other 30
pages don't change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NijyutGmb3bNR3dNRWJken
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat: math from LaTeX in docx/math, with accents, bars, braces, boxes, phantoms and large operators
latexToMath turns LaTeX math into docx's math components, to go in a Math.
It reads what LaTeX, MathJax and KaTeX write: fractions, roots, scripts,
large operators, functions, \left and \right, accents, braces, boxes,
fonts, \text, and the environments for matrices, cases and aligned
equations, with \tag. It throws for what it can't read, saying where.
The parts LaTeX needs are public components too: MathLargeOperator,
MathAccent, MathBar, MathBrace, MathBox and MathPhantom in docx/math, and
in docx, MathRun's style, script and literal, MathFraction's type, and
limits on MathSum and MathIntegral.
Closes#2994
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: draw MathRun alphabets upright unless given a style, and escape the \middle| table cell
A run with a script but no style wrote no m:sty, which Word draws as italic, so sansSerif came out italic
sans-serif rather than the upright 𝖠 its docs show. A script other than roman now defaults to a plain style,
as LaTeX draws its alphabets; a given style is kept. latexToMath already gave each alphabet its style.
The | after \middle in the LaTeX docs' table ended the cell, splitting the row into three.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore: organise the demos into a folder for each topic
The demos were one flat list of 124 numbered files, which made it hard to
find the one you wanted. Each is now in a folder for its topic, such as
demo/tables/basic-table.ts, with a name that says what it shows instead of
a number.
npm run demo lists every demo and narrows the list as you type. It also
takes a demo's path or name, a topic, or search words.
The demos' images moved to demo/assets/images, as images is now a topic.
The docs' links, the Demos workflow, the shape render script and its
reference images use the new paths and names.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmyffPd5QMJYjXiMBQ3EnZ
* fix: list only a topic's own demos, and drop stale output file names
npm run demo text also offered the text-boxes demos and others with
"text" in their name, so a topic now searches for "text/". Three demos
logged their old numbered file name after writing My Document.docx.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- `paths` draws a custom shape from several paths, each filled with the
shape's fill, not at all, or lighter or darker, and with or without its line
- A closed part of a path inside another is a hole, whichever way round it
is drawn: parts are turned round so both fill rules cut the same holes
- `textArea` sets where a custom shape's text goes, and "fitText" fits it
- `connectionPoints` gives a custom shape its own connection points
- Connection sites and text areas are guides that keep their share of the
shape when it is resized, as PowerPoint writes freeforms
- Demo 120, with a reference render, and docs in shapes.md
Claude-Session: https://claude.ai/code/session_01TmyffPd5QMJYjXiMBQ3EnZ
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>