15 Commits
Author SHA1 Message Date
DolanandClaude Opus 5.5 4f9348521d fix(layout): make a paragraph's last line as tall as its text, and draw Calibri Light in Carlito in CI's LibreOffice (#3593)
* 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>
2026-09-30 15:01:00 +01:00
Dolan f342f0d7f0 fix: work through the unresolved review comments on recently merged PRs (#3581) 2026-09-29 16:22:02 +01:00
DolanandClaude Opus 5.5 eb206519ae feat: math from LaTeX in docx/math, with accents, bars, braces, boxes, phantoms and large operators (#3570)
* 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>
2026-09-28 17:07:59 +01:00
Dolan edb96fb088 fix: write Normal as the default paragraph style, so Pages draws math at its size, and draw angle brackets in LibreOffice (#3554) 2026-09-27 20:29:16 +01:00
Dolan 7ada74f6d1 feat: docx/math, with matrices, cases, equations lined up with numbers, and brackets of any characters (#3553) 2026-09-27 17:30:38 +01:00
DolanandClaude Opus 5.5 e0ff13ee3d chore: organise the demos into a folder for each topic (#3552)
* 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>
2026-09-27 01:40:45 +01:00
Dolan b04040c7b0 feat: stock, pie of pie and bar of pie charts, categories in groups, trendlines, error bars and more chart options (#3550) 2026-09-26 23:26:04 +01:00
Dolan b7a4bb66b8 feat: new data for a template's charts, with ChartDataPatch (#3549) 2026-09-26 21:57:32 +01:00
Dolan 62f4ecd42d feat: charts in templates, with patchDocument (#3548) 2026-09-26 17:58:53 +01:00
Dolan 43a4e0ce67 feat: combo, radar and bubble charts, and more chart options (#3546) 2026-09-26 13:02:03 +01:00
Dolan 6207d0067f feat: native Word charts in docx/charts (#3545) 2026-09-26 10:15:50 +01:00
DolanandClaude Opus 5.5 e7b568f4e6 feat(shapes): custom shapes with several paths, holes, text areas and connection points (#3539)
- `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>
2026-09-25 16:10:17 +01:00
Dolan 811e5d9b97 feat: write a theme part, with theme fonts for text and theme colours for shapes (#3536) 2026-09-24 20:23:52 +01:00
Dolan 91cd6398e2 feat(shapes): text in document styles, swimlanes, routing, descriptions, percentages and text flows (#3535) 2026-09-24 18:46:00 +01:00
Dolan bf7eb857df feat(shapes): automatic layout, text sizing, connector polish and visual regression tests (#3533) 2026-09-24 13:18:04 +01:00