Files
docx/scripts
Dolan 72ebbb1be7 feat(layout): stop at text in an embedded font that Office also offers, as Word draws it in Office's own copy (#3710)
* feat(layout): stop at text in a font from a file that Office also offers, as Word draws it in Office's copy

Word for Mac drew Pacifico, which a document embedded, in Office's own cloud
copy of it rather than the embedded file. docx/layout now stops at text in a
font embedded or given as a file when Office offers a font of that name, but
for Office's fonts of the width tables, and measures the file when guessing,
noting the guess.

The names come from Office's catalog of its cloud fonts (version 4.42),
cross-checked against Microsoft's published list, generated by
scripts/generate-office-cloud-fonts.ts. The layout demos of embedded fonts
and fonts from files move from Pacifico to Kaushan Script, which Office
doesn't offer.

* fix(layout): stop at Latin text in an East Asian font Office offers, given as a file

The width tables have the East Asian characters of fonts such as Microsoft
YaHei but not their Latin letters, so offeredByOffice now takes the text
being measured, and Latin text in such a font from a file stops as Office's
copy may draw it differently.

* fix(scripts): strip every angle bracket and unescape & last in the cloud fonts generator

CodeQL flagged the published list's cell text: one pass of tag stripping could
leave part of a tag, and unescaping & before   could unescape twice.
The generated list is unchanged.

* fix(scripts): read the text between a cell's tags in the cloud fonts generator

CodeQL still read removing tags with a replace as incomplete sanitization,
so the cell's text is now collected from between its tags rather than by
removing them. The generated list is unchanged.
2026-10-05 23:06:45 +01:00
..