Files
docx/docs/usage
Dolan 2f06726259 feat(layout): measure text with Pretext in a page's fonts, and lay it out as Word does (#3610)
* feat(layout): measure text with Pretext in a page's fonts, and lay it out as Word does

docx/layout can now measure how wide text is with a function the caller
gives it, through estimatePageNumbersWith({ measureWidth }). measureWithPretext
builds one on Pretext, taken from the caller, so docx doesn't depend on it.
Lines still break, tabs still move to their stops, and lines are still as
tall as Word makes them.

* fix: answer only the DevTools messages the Pretext comparison is waiting for

CodeQL flagged calling a callback looked up by an id from Chrome's
messages. Only a number id with a callback waiting for it is answered now.

* fix(docs): open the live examples' editor without a package's types when they can't be fetched

A package's types only help with editing, so a failed fetch or an error
page leaves them out rather than stopping the editor.
2026-10-01 14:50:57 +01:00
..