diff --git a/api/classes/index.AbstractNumbering.html b/api/classes/index.AbstractNumbering.html
index 32e299cc2e..0fa12fb6e1 100644
--- a/api/classes/index.AbstractNumbering.html
+++ b/api/classes/index.AbstractNumbering.html
@@ -35,7 +35,7 @@ Each abstract definition can contain up to 9 levels.
diff --git a/api/classes/index.Body.html b/api/classes/index.Body.html
index 01e575b70c..566a811071 100644
--- a/api/classes/index.Body.html
+++ b/api/classes/index.Body.html
@@ -37,7 +37,7 @@ section. The last section's properties are stored as a direct child of the body
diff --git a/api/classes/index.Bookmark.html b/api/classes/index.Bookmark.html
index a7974fe869..a113200ce9 100644
--- a/api/classes/index.Bookmark.html
+++ b/api/classes/index.Bookmark.html
@@ -31,7 +31,7 @@ of a start marker, content, and an end marker.
diff --git a/api/classes/index.BookmarkEnd.html b/api/classes/index.BookmarkEnd.html
index 1c3dbea1ac..d0180bc2e5 100644
--- a/api/classes/index.BookmarkEnd.html
+++ b/api/classes/index.BookmarkEnd.html
@@ -35,7 +35,7 @@ taken from bookmarkUniqueNumericId (see BookmarkStart)
diff --git a/api/classes/index.BookmarkStart.html b/api/classes/index.BookmarkStart.html
index 3ba52709e0..3d499d8412 100644
--- a/api/classes/index.BookmarkStart.html
+++ b/api/classes/index.BookmarkStart.html
@@ -37,7 +37,7 @@ same as a Bookmark's.
diff --git a/api/classes/index.CellMerge.html b/api/classes/index.CellMerge.html
index 4cee3e7d49..dfdc09340b 100644
--- a/api/classes/index.CellMerge.html
+++ b/api/classes/index.CellMerge.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.CellMergeAttributes.html b/api/classes/index.CellMergeAttributes.html
index 9d76fd29e2..03fe6dd992 100644
--- a/api/classes/index.CellMergeAttributes.html
+++ b/api/classes/index.CellMergeAttributes.html
@@ -30,7 +30,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.CheckBoxSymbolElement.html b/api/classes/index.CheckBoxSymbolElement.html
index 59fcf6e909..d9de2cc7c2 100644
--- a/api/classes/index.CheckBoxSymbolElement.html
+++ b/api/classes/index.CheckBoxSymbolElement.html
@@ -33,7 +33,7 @@ specifying the Unicode character and font to render.
diff --git a/api/classes/index.CheckBoxUtil.html b/api/classes/index.CheckBoxUtil.html
index 08b0c4ea41..fd593a5115 100644
--- a/api/classes/index.CheckBoxUtil.html
+++ b/api/classes/index.CheckBoxUtil.html
@@ -33,7 +33,7 @@ including its checked state and the symbols used for checked and unchecked state
diff --git a/api/classes/index.CommentRangeEnd.html b/api/classes/index.CommentRangeEnd.html
index 6de5f54527..add489b94d 100644
--- a/api/classes/index.CommentRangeEnd.html
+++ b/api/classes/index.CommentRangeEnd.html
@@ -36,7 +36,7 @@ Must be paired with a CommentRangeStart with the same ID.
diff --git a/api/classes/index.CommentRangeStart.html b/api/classes/index.CommentRangeStart.html
index 6236cfb31c..713491e1d7 100644
--- a/api/classes/index.CommentRangeStart.html
+++ b/api/classes/index.CommentRangeStart.html
@@ -36,7 +36,7 @@ Must be paired with a CommentRangeEnd with the same ID.
diff --git a/api/classes/index.CommentReference.html b/api/classes/index.CommentReference.html
index 2264eb42e2..c70ea81227 100644
--- a/api/classes/index.CommentReference.html
+++ b/api/classes/index.CommentReference.html
@@ -36,7 +36,7 @@ It should be placed after the CommentRangeEnd element.
diff --git a/api/classes/index.Comments.html b/api/classes/index.Comments.html
index 459e2a9591..6b5b3f5991 100644
--- a/api/classes/index.Comments.html
+++ b/api/classes/index.Comments.html
@@ -35,7 +35,7 @@ threading is activated and thread data is generated for commentsExtended.xml.
diff --git a/api/classes/index.CommentsIds.html b/api/classes/index.CommentsIds.html
index a31f7a7cba..e0e43ff275 100644
--- a/api/classes/index.CommentsIds.html
+++ b/api/classes/index.CommentsIds.html
@@ -27,7 +27,7 @@ to a stable w16cid:durableId preserved by Word across edits.
diff --git a/api/classes/index.ConcreteHyperlink.html b/api/classes/index.ConcreteHyperlink.html
index 917afadd72..7032cdd300 100644
--- a/api/classes/index.ConcreteHyperlink.html
+++ b/api/classes/index.ConcreteHyperlink.html
@@ -30,7 +30,7 @@ Use InternalHyperlink or ExternalHyperlink for creating hyperlinks in documents.
diff --git a/api/classes/index.DeletedTableCell.html b/api/classes/index.DeletedTableCell.html
index fbecbeb9b4..96ab8d01f0 100644
--- a/api/classes/index.DeletedTableCell.html
+++ b/api/classes/index.DeletedTableCell.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.DeletedTableRow.html b/api/classes/index.DeletedTableRow.html
index 7e70606e03..b5ebc45089 100644
--- a/api/classes/index.DeletedTableRow.html
+++ b/api/classes/index.DeletedTableRow.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.DocumentDefaults.html b/api/classes/index.DocumentDefaults.html
index d88ceb9dbb..de46a0873d 100644
--- a/api/classes/index.DocumentDefaults.html
+++ b/api/classes/index.DocumentDefaults.html
@@ -34,7 +34,7 @@ paragraphs and runs in a document unless overridden by a style or direct formatt
diff --git a/api/classes/index.DrawingPatch.html b/api/classes/index.DrawingPatch.html
index ada23483ab..6f7020372c 100644
--- a/api/classes/index.DrawingPatch.html
+++ b/api/classes/index.DrawingPatch.html
@@ -27,7 +27,7 @@ is one: it replaces the data of a chart made in Word.
diff --git a/api/classes/index.EndnoteIdReference.html b/api/classes/index.EndnoteIdReference.html
index 60ee17f1af..2d3edf6c65 100644
--- a/api/classes/index.EndnoteIdReference.html
+++ b/api/classes/index.EndnoteIdReference.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.EndnoteReferenceRunAttributes.html b/api/classes/index.EndnoteReferenceRunAttributes.html
index ec9d26b904..0bd7d5a78e 100644
--- a/api/classes/index.EndnoteReferenceRunAttributes.html
+++ b/api/classes/index.EndnoteReferenceRunAttributes.html
@@ -30,7 +30,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.Endnotes.html b/api/classes/index.Endnotes.html
index 45016596c5..07decd0cd2 100644
--- a/api/classes/index.Endnotes.html
+++ b/api/classes/index.Endnotes.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.ExternalHyperlink.html b/api/classes/index.ExternalHyperlink.html
index 6d67a13b2d..19aefc82e4 100644
--- a/api/classes/index.ExternalHyperlink.html
+++ b/api/classes/index.ExternalHyperlink.html
@@ -37,7 +37,7 @@ is converted to a ConcreteHyperlink with the relationship ID.
diff --git a/api/classes/index.FileChild.html b/api/classes/index.FileChild.html
index 2f15d1adbd..ac2bb34d83 100644
--- a/api/classes/index.FileChild.html
+++ b/api/classes/index.FileChild.html
@@ -28,7 +28,7 @@ to the document body. Examples include Paragraph and Table.
diff --git a/api/classes/index.FootNotes.html b/api/classes/index.FootNotes.html
index e643259df2..30913fa5ae 100644
--- a/api/classes/index.FootNotes.html
+++ b/api/classes/index.FootNotes.html
@@ -36,7 +36,7 @@ line used when footnotes continue across pages.
diff --git a/api/classes/index.FooterWrapper.html b/api/classes/index.FooterWrapper.html
index 448df5f4e2..d95496454b 100644
--- a/api/classes/index.FooterWrapper.html
+++ b/api/classes/index.FooterWrapper.html
@@ -29,7 +29,7 @@ Each section can have multiple footers for different page types.
diff --git a/api/classes/index.FootnoteReference.html b/api/classes/index.FootnoteReference.html
index c513c0fecd..86fddeef9d 100644
--- a/api/classes/index.FootnoteReference.html
+++ b/api/classes/index.FootnoteReference.html
@@ -27,7 +27,7 @@ and the footnote content by using a unique identifier.
diff --git a/api/classes/index.GridSpan.html b/api/classes/index.GridSpan.html
index 6348dce05c..fb8d612bb8 100644
--- a/api/classes/index.GridSpan.html
+++ b/api/classes/index.GridSpan.html
@@ -34,7 +34,7 @@ in the table grid. This is used to merge cells horizontally (column span).
diff --git a/api/classes/index.HeaderWrapper.html b/api/classes/index.HeaderWrapper.html
index ca39c7f853..34b857c995 100644
--- a/api/classes/index.HeaderWrapper.html
+++ b/api/classes/index.HeaderWrapper.html
@@ -29,7 +29,7 @@ Each section can have multiple headers for different page types.
diff --git a/api/classes/index.HpsMeasureElement.html b/api/classes/index.HpsMeasureElement.html
index 59271aaffa..8f42306082 100644
--- a/api/classes/index.HpsMeasureElement.html
+++ b/api/classes/index.HpsMeasureElement.html
@@ -33,7 +33,7 @@ Values can be specified as numbers (interpreted as half-points) or with explicit
diff --git a/api/classes/index.IgnoreIfEmptyXmlComponent.html b/api/classes/index.IgnoreIfEmptyXmlComponent.html
index 50e4f80278..ee268fcf02 100644
--- a/api/classes/index.IgnoreIfEmptyXmlComponent.html
+++ b/api/classes/index.IgnoreIfEmptyXmlComponent.html
@@ -39,7 +39,7 @@ to be excluded from the output.
diff --git a/api/classes/index.ImageRun.html b/api/classes/index.ImageRun.html
index c20b800956..4631573dd1 100644
--- a/api/classes/index.ImageRun.html
+++ b/api/classes/index.ImageRun.html
@@ -33,7 +33,7 @@ including JPG, PNG, GIF, BMP, and SVG. Optionally wraps the run in
diff --git a/api/classes/index.ImportedXmlComponent.html b/api/classes/index.ImportedXmlComponent.html
index a9ff3ee8cc..14ac5c2b6f 100644
--- a/api/classes/index.ImportedXmlComponent.html
+++ b/api/classes/index.ImportedXmlComponent.html
@@ -30,7 +30,7 @@ templates or when you need to include pre-existing XML fragments.
diff --git a/api/classes/index.InitializableXmlComponent.html b/api/classes/index.InitializableXmlComponent.html
index ef91f53ca6..dae193e16b 100644
--- a/api/classes/index.InitializableXmlComponent.html
+++ b/api/classes/index.InitializableXmlComponent.html
@@ -30,7 +30,7 @@ create a new component that shares or extends the children of an existing compon
diff --git a/api/classes/index.InsertedTableCell.html b/api/classes/index.InsertedTableCell.html
index 44124602cd..c48de478b0 100644
--- a/api/classes/index.InsertedTableCell.html
+++ b/api/classes/index.InsertedTableCell.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.InsertedTableRow.html b/api/classes/index.InsertedTableRow.html
index 02abf4d62e..c1b67ca01e 100644
--- a/api/classes/index.InsertedTableRow.html
+++ b/api/classes/index.InsertedTableRow.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.InsertedTextRun.html b/api/classes/index.InsertedTextRun.html
index c5b2acebf2..65f3e038cd 100644
--- a/api/classes/index.InsertedTextRun.html
+++ b/api/classes/index.InsertedTextRun.html
@@ -37,7 +37,7 @@ made the insertion and when.
diff --git a/api/classes/index.InternalHyperlink.html b/api/classes/index.InternalHyperlink.html
index d37fa67e72..c6930d48f7 100644
--- a/api/classes/index.InternalHyperlink.html
+++ b/api/classes/index.InternalHyperlink.html
@@ -36,7 +36,7 @@ The bookmark must exist in the document for the hyperlink to function.
diff --git a/api/classes/index.LastRenderedPageBreak.html b/api/classes/index.LastRenderedPageBreak.html
index 059d2949de..48a4d048b1 100644
--- a/api/classes/index.LastRenderedPageBreak.html
+++ b/api/classes/index.LastRenderedPageBreak.html
@@ -23,7 +23,7 @@ This is typically generated by Word and not created manually.
diff --git a/api/classes/index.MathDegree.html b/api/classes/index.MathDegree.html
index c397e81596..f516b4ed6d 100644
--- a/api/classes/index.MathDegree.html
+++ b/api/classes/index.MathDegree.html
@@ -28,7 +28,7 @@ For square roots, this element is typically hidden.
diff --git a/api/classes/index.MathFunctionName.html b/api/classes/index.MathFunctionName.html
index 57fced59c9..6fe228a69f 100644
--- a/api/classes/index.MathFunctionName.html
+++ b/api/classes/index.MathFunctionName.html
@@ -28,7 +28,7 @@ that appears before the function argument.
diff --git a/api/classes/index.MathFunctionProperties.html b/api/classes/index.MathFunctionProperties.html
index be7d621a0e..18480a646d 100644
--- a/api/classes/index.MathFunctionProperties.html
+++ b/api/classes/index.MathFunctionProperties.html
@@ -28,7 +28,7 @@ such as function name alignment and spacing.
diff --git a/api/classes/index.MathLimitUpper.html b/api/classes/index.MathLimitUpper.html
index c17b1fa25e..7e489a5046 100644
--- a/api/classes/index.MathLimitUpper.html
+++ b/api/classes/index.MathLimitUpper.html
@@ -36,7 +36,7 @@ commonly used for mathematical notation like lim with conditions above.
diff --git a/api/classes/index.MathPreSubSuperScript.html b/api/classes/index.MathPreSubSuperScript.html
index f3a7ac0eb2..355ef28370 100644
--- a/api/classes/index.MathPreSubSuperScript.html
+++ b/api/classes/index.MathPreSubSuperScript.html
@@ -36,7 +36,7 @@ positioned before (to the left of) the base, commonly used in tensor notation.
diff --git a/api/classes/index.MathRadicalProperties.html b/api/classes/index.MathRadicalProperties.html
index ff9143bba7..c411f6530a 100644
--- a/api/classes/index.MathRadicalProperties.html
+++ b/api/classes/index.MathRadicalProperties.html
@@ -28,7 +28,7 @@ such as whether to hide the degree (for square roots).
diff --git a/api/classes/index.MathRun.html b/api/classes/index.MathRun.html
index e925a2ca9f..212ef7ec18 100644
--- a/api/classes/index.MathRun.html
+++ b/api/classes/index.MathRun.html
@@ -36,7 +36,7 @@ similar to how Run contains text in regular paragraphs.
diff --git a/api/classes/index.MathSubSuperScript.html b/api/classes/index.MathSubSuperScript.html
index 52f0150331..e819534311 100644
--- a/api/classes/index.MathSubSuperScript.html
+++ b/api/classes/index.MathSubSuperScript.html
@@ -36,7 +36,7 @@ commonly used for tensor notation or indexed variables with exponents.
diff --git a/api/classes/index.Media.html b/api/classes/index.Media.html
index 1d6fa5c717..180b1d0b12 100644
--- a/api/classes/index.Media.html
+++ b/api/classes/index.Media.html
@@ -24,7 +24,7 @@ is stored with a unique key for retrieval.
diff --git a/api/classes/index.NextAttributeComponent.html b/api/classes/index.NextAttributeComponent.html
index 937ed45635..43b50a0b32 100644
--- a/api/classes/index.NextAttributeComponent.html
+++ b/api/classes/index.NextAttributeComponent.html
@@ -34,7 +34,7 @@ This gives more control but is more verbose than XmlAttributeComponent.
diff --git a/api/classes/index.OnOffElement.html b/api/classes/index.OnOffElement.html
index 5d94c12139..245d01e626 100644
--- a/api/classes/index.OnOffElement.html
+++ b/api/classes/index.OnOffElement.html
@@ -34,7 +34,7 @@ it is explicitly disabled. When the value is true, the attribute is often omitte
diff --git a/api/classes/index.Packer.html b/api/classes/index.Packer.html
index 9085fb44e3..4065b6996c 100644
--- a/api/classes/index.Packer.html
+++ b/api/classes/index.Packer.html
@@ -26,7 +26,7 @@ of the document structure into OOXML format and compression into a .docx ZIP arc
diff --git a/api/classes/index.PageBorders.html b/api/classes/index.PageBorders.html
index a2ce4ec009..03e4848076 100644
--- a/api/classes/index.PageBorders.html
+++ b/api/classes/index.PageBorders.html
@@ -34,7 +34,7 @@ including which pages display the borders and how they are positioned.
diff --git a/api/classes/index.PageTextDirection.html b/api/classes/index.PageTextDirection.html
index b5d0f57b52..336d83217a 100644
--- a/api/classes/index.PageTextDirection.html
+++ b/api/classes/index.PageTextDirection.html
@@ -30,7 +30,7 @@ for all pages in a section.
diff --git a/api/classes/index.Paragraph.html b/api/classes/index.Paragraph.html
index bf17a0a1c3..4828d9240e 100644
--- a/api/classes/index.Paragraph.html
+++ b/api/classes/index.Paragraph.html
@@ -36,7 +36,7 @@ various inline elements such as text runs, images, hyperlinks, and bookmarks.
diff --git a/api/classes/index.ParagraphPropertiesChange.html b/api/classes/index.ParagraphPropertiesChange.html
index 725b9252d1..302922f22a 100644
--- a/api/classes/index.ParagraphPropertiesChange.html
+++ b/api/classes/index.ParagraphPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.ParagraphPropertiesDefaults.html b/api/classes/index.ParagraphPropertiesDefaults.html
index a4d289cf5a..df2cd45466 100644
--- a/api/classes/index.ParagraphPropertiesDefaults.html
+++ b/api/classes/index.ParagraphPropertiesDefaults.html
@@ -34,7 +34,7 @@ to all paragraphs in the document unless overridden.
diff --git a/api/classes/index.PositionalTab.html b/api/classes/index.PositionalTab.html
index 960ca0eb0c..c6ce764fa8 100644
--- a/api/classes/index.PositionalTab.html
+++ b/api/classes/index.PositionalTab.html
@@ -37,7 +37,7 @@ an exact alignment and position within the paragraph.
diff --git a/api/classes/index.RunPropertiesDefaults.html b/api/classes/index.RunPropertiesDefaults.html
index cddd0c4a0b..d1abbe8824 100644
--- a/api/classes/index.RunPropertiesDefaults.html
+++ b/api/classes/index.RunPropertiesDefaults.html
@@ -34,7 +34,7 @@ to all text runs in the document unless overridden by styles or direct formattin
diff --git a/api/classes/index.SectionProperties.html b/api/classes/index.SectionProperties.html
index 9aa2e9378b..8af7760dec 100644
--- a/api/classes/index.SectionProperties.html
+++ b/api/classes/index.SectionProperties.html
@@ -35,7 +35,7 @@ A document can contain multiple sections with different properties.
diff --git a/api/classes/index.SectionPropertiesChange.html b/api/classes/index.SectionPropertiesChange.html
index d9c2ef069f..adaa368e02 100644
--- a/api/classes/index.SectionPropertiesChange.html
+++ b/api/classes/index.SectionPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.SimpleField.html b/api/classes/index.SimpleField.html
index 0a14c98c20..55a208c1fa 100644
--- a/api/classes/index.SimpleField.html
+++ b/api/classes/index.SimpleField.html
@@ -40,7 +40,7 @@ Simple fields are typically used for fields that don't require complex nesting.<
diff --git a/api/classes/index.SimpleMailMergeField.html b/api/classes/index.SimpleMailMergeField.html
index 29d0a95f4d..96e7871f5c 100644
--- a/api/classes/index.SimpleMailMergeField.html
+++ b/api/classes/index.SimpleMailMergeField.html
@@ -30,7 +30,7 @@ It creates a MERGEFIELD that will be populated with data during mail merge.
diff --git a/api/classes/index.StringContainer.html b/api/classes/index.StringContainer.html
index b3b6d9edb1..d877cf8fcb 100644
--- a/api/classes/index.StringContainer.html
+++ b/api/classes/index.StringContainer.html
@@ -30,7 +30,7 @@ rather than an attribute.
diff --git a/api/classes/index.StringEnumValueElement.html b/api/classes/index.StringEnumValueElement.html
index e5cf42d582..042138f91c 100644
--- a/api/classes/index.StringEnumValueElement.html
+++ b/api/classes/index.StringEnumValueElement.html
@@ -33,7 +33,7 @@ type parameter to enforce type safety for enum values.
diff --git a/api/classes/index.StyleForParagraph.html b/api/classes/index.StyleForParagraph.html
index 79e69dd7b5..f73072d3bc 100644
--- a/api/classes/index.StyleForParagraph.html
+++ b/api/classes/index.StyleForParagraph.html
@@ -35,7 +35,7 @@ run-level properties (font, size, color) for text within the paragraph.
diff --git a/api/classes/index.StyleLevel.html b/api/classes/index.StyleLevel.html
index 20c061b479..b4c0f6ea4a 100644
--- a/api/classes/index.StyleLevel.html
+++ b/api/classes/index.StyleLevel.html
@@ -20,7 +20,7 @@ custom styles to be included in the table of contents at specific levels.
diff --git a/api/classes/index.Styles.html b/api/classes/index.Styles.html
index 5e6250ca6b..a74ac1216a 100644
--- a/api/classes/index.Styles.html
+++ b/api/classes/index.Styles.html
@@ -35,7 +35,7 @@ a way to define consistent formatting across a document.
diff --git a/api/classes/index.TDirection.html b/api/classes/index.TDirection.html
index 6cd2ddd02a..87274e699a 100644
--- a/api/classes/index.TDirection.html
+++ b/api/classes/index.TDirection.html
@@ -34,7 +34,7 @@ useful for creating rotated text or supporting different writing systems.
diff --git a/api/classes/index.Table.html b/api/classes/index.Table.html
index 5d61c0f9d6..645d5cd720 100644
--- a/api/classes/index.Table.html
+++ b/api/classes/index.Table.html
@@ -36,7 +36,7 @@ Tables are used to organize content into a grid structure.
diff --git a/api/classes/index.TableCellBorders.html b/api/classes/index.TableCellBorders.html
index e248eb8bd6..3f483753fd 100644
--- a/api/classes/index.TableCellBorders.html
+++ b/api/classes/index.TableCellBorders.html
@@ -34,7 +34,7 @@ can be configured independently with different styles, colors, and widths.
diff --git a/api/classes/index.TableRow.html b/api/classes/index.TableRow.html
index 90e4aa71fc..228524e3ed 100644
--- a/api/classes/index.TableRow.html
+++ b/api/classes/index.TableRow.html
@@ -36,7 +36,7 @@ one or more table cells that hold the actual content.
diff --git a/api/classes/index.TableRowProperties.html b/api/classes/index.TableRowProperties.html
index de26e4d0e8..d9205f00b7 100644
--- a/api/classes/index.TableRowProperties.html
+++ b/api/classes/index.TableRowProperties.html
@@ -30,7 +30,7 @@ whether it can split across pages, and whether it's a header row.
diff --git a/api/classes/index.TableRowPropertiesChange.html b/api/classes/index.TableRowPropertiesChange.html
index ff82554316..3dfd5cc61f 100644
--- a/api/classes/index.TableRowPropertiesChange.html
+++ b/api/classes/index.TableRowPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.VerticalMerge.html b/api/classes/index.VerticalMerge.html
index c9f55aa7e2..8ef0604263 100644
--- a/api/classes/index.VerticalMerge.html
+++ b/api/classes/index.VerticalMerge.html
@@ -35,7 +35,7 @@ This is used to create row spans in tables.
diff --git a/api/classes/index.WpsShapeRun.html b/api/classes/index.WpsShapeRun.html
index 14a85bf008..055e900625 100644
--- a/api/classes/index.WpsShapeRun.html
+++ b/api/classes/index.WpsShapeRun.html
@@ -28,7 +28,7 @@ options for fills, lines, effects and text layout, and can be any of the preset
diff --git a/api/classes/index.XmlAttributeComponent.html b/api/classes/index.XmlAttributeComponent.html
index da9cb19745..a1f02ba4f4 100644
--- a/api/classes/index.XmlAttributeComponent.html
+++ b/api/classes/index.XmlAttributeComponent.html
@@ -41,7 +41,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.XmlComponent.html b/api/classes/index.XmlComponent.html
index e7d5e478f4..5300a5fdc2 100644
--- a/api/classes/index.XmlComponent.html
+++ b/api/classes/index.XmlComponent.html
@@ -129,7 +129,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/math.MathBrackets.html b/api/classes/math.MathBrackets.html
index 1b33e00f19..bbd84e781d 100644
--- a/api/classes/math.MathBrackets.html
+++ b/api/classes/math.MathBrackets.html
@@ -22,14 +22,14 @@ with what they hold.
diff --git a/api/classes/math.MathLargeOperator.html b/api/classes/math.MathLargeOperator.html
index e68f8baa7f..0aefc43432 100644
--- a/api/classes/math.MathLargeOperator.html
+++ b/api/classes/math.MathLargeOperator.html
@@ -21,14 +21,14 @@ it applies to. MathSum and MathIntegral are two of the
diff --git a/api/classes/math.MathMatrix.html b/api/classes/math.MathMatrix.html
index 43af7d056b..7cc893fce5 100644
--- a/api/classes/math.MathMatrix.html
+++ b/api/classes/math.MathMatrix.html
@@ -23,14 +23,14 @@ and Pages centre every column.
diff --git a/api/classes/math.MathPhantom.html b/api/classes/math.MathPhantom.html
index ebf73c0f26..5260403faf 100644
--- a/api/classes/math.MathPhantom.html
+++ b/api/classes/math.MathPhantom.html
@@ -21,14 +21,14 @@ line things up with it. Or math that is seen but takes up no room, or less, as <
diff --git a/api/classes/shapes.ShapeCanvasRun.html b/api/classes/shapes.ShapeCanvasRun.html
index 4d8351e6de..8629e2b6f9 100644
--- a/api/classes/shapes.ShapeCanvasRun.html
+++ b/api/classes/shapes.ShapeCanvasRun.html
@@ -35,7 +35,7 @@ written in mc:AlternateContent, with the group as its fallback, unl
diff --git a/api/classes/shapes.ShapeGroupRun.html b/api/classes/shapes.ShapeGroupRun.html
index 3ad4897c42..29b90e4748 100644
--- a/api/classes/shapes.ShapeGroupRun.html
+++ b/api/classes/shapes.ShapeGroupRun.html
@@ -35,7 +35,7 @@ when shapes are moved on a
diff --git a/api/classes/shapes.ShapeRun.html b/api/classes/shapes.ShapeRun.html
index 6b99a9442e..6b1434a2f4 100644
--- a/api/classes/shapes.ShapeRun.html
+++ b/api/classes/shapes.ShapeRun.html
@@ -33,7 +33,7 @@ and arrowheads, and text inside it. It sits inline with text unless floati
diff --git a/api/classes/watermarks.ImageWatermark.html b/api/classes/watermarks.ImageWatermark.html
index aaae9258c0..d34858187a 100644
--- a/api/classes/watermarks.ImageWatermark.html
+++ b/api/classes/watermarks.ImageWatermark.html
@@ -46,7 +46,7 @@ way as an ImageRun.
diff --git a/api/classes/watermarks.TextWatermark.html b/api/classes/watermarks.TextWatermark.html
index d1e64b1fb5..8dbc212af0 100644
--- a/api/classes/watermarks.TextWatermark.html
+++ b/api/classes/watermarks.TextWatermark.html
@@ -44,7 +44,7 @@ recognizes it and can remove or replace it through that command.
\n option - causes the field result to be the paragraph number without trailing periods. No information about prior numbered levels is displayed unless it is included as part of the current level.
diff --git a/api/functions/index.convertToXmlComponent.html b/api/functions/index.convertToXmlComponent.html
index 5c35822784..eb4c4ee86e 100644
--- a/api/functions/index.convertToXmlComponent.html
+++ b/api/functions/index.convertToXmlComponent.html
@@ -36,7 +36,7 @@ of the original XML.
diff --git a/api/functions/index.createEmphasisMark.html b/api/functions/index.createEmphasisMark.html
index 962a75ea73..6724e89b26 100644
--- a/api/functions/index.createEmphasisMark.html
+++ b/api/functions/index.createEmphasisMark.html
@@ -37,7 +37,7 @@ text to emphasize it. This is commonly used in East Asian typography.
diff --git a/api/functions/index.createFrameProperties.html b/api/functions/index.createFrameProperties.html
index fdb2ca02f9..99ca2ca861 100644
--- a/api/functions/index.createFrameProperties.html
+++ b/api/functions/index.createFrameProperties.html
@@ -41,7 +41,7 @@ drop cap effects and various text wrapping options.
diff --git a/api/functions/index.createHorizontalPosition.html b/api/functions/index.createHorizontalPosition.html
index e8f612ff0d..5d05c12a7f 100644
--- a/api/functions/index.createHorizontalPosition.html
+++ b/api/functions/index.createHorizontalPosition.html
@@ -40,7 +40,7 @@ object relative to a base element (page, margin, column, etc.).
diff --git a/api/functions/index.createMathAccentCharacter.html b/api/functions/index.createMathAccentCharacter.html
index 3a5d52f0b4..6ef1c4ae7c 100644
--- a/api/functions/index.createMathAccentCharacter.html
+++ b/api/functions/index.createMathAccentCharacter.html
@@ -31,7 +31,7 @@ such as summation (∑), integral (∫), or product (∏) symbols.
diff --git a/api/functions/index.createMathNAryProperties.html b/api/functions/index.createMathNAryProperties.html
index 7ea5fe6593..6b3014f6f1 100644
--- a/api/functions/index.createMathNAryProperties.html
+++ b/api/functions/index.createMathNAryProperties.html
@@ -31,7 +31,7 @@ and integrals, including the operator character and limit positioning.
diff --git a/api/functions/index.createMathSubScriptElement.html b/api/functions/index.createMathSubScriptElement.html
index e1e5058e53..b5f74114a0 100644
--- a/api/functions/index.createMathSubScriptElement.html
+++ b/api/functions/index.createMathSubScriptElement.html
@@ -31,7 +31,7 @@ script objects, and other structures that support subscripts.
diff --git a/api/functions/index.createMathSuperScriptElement.html b/api/functions/index.createMathSuperScriptElement.html
index 547d9d385a..8d0ee0cdde 100644
--- a/api/functions/index.createMathSuperScriptElement.html
+++ b/api/functions/index.createMathSuperScriptElement.html
@@ -31,7 +31,7 @@ script objects, and other structures that support superscripts.
diff --git a/api/functions/index.createPageNumberType.html b/api/functions/index.createPageNumberType.html
index 46c32caa5c..1f6ea10326 100644
--- a/api/functions/index.createPageNumberType.html
+++ b/api/functions/index.createPageNumberType.html
@@ -37,7 +37,7 @@ for all pages in a section.
diff --git a/api/functions/index.createSectionType.html b/api/functions/index.createSectionType.html
index c4cc60d420..04f2b78389 100644
--- a/api/functions/index.createSectionType.html
+++ b/api/functions/index.createSectionType.html
@@ -37,7 +37,7 @@ where the new section begins relative to the previous section.
diff --git a/api/functions/index.createTableFloatProperties.html b/api/functions/index.createTableFloatProperties.html
index c25cf770cc..5ded3905ef 100644
--- a/api/functions/index.createTableFloatProperties.html
+++ b/api/functions/index.createTableFloatProperties.html
@@ -38,7 +38,7 @@ The overlap option isn't part of it: the table properties write it as w:tblOverl
diff --git a/api/functions/index.createTableLook.html b/api/functions/index.createTableLook.html
index fc69f808cb..cffbddddea 100644
--- a/api/functions/index.createTableLook.html
+++ b/api/functions/index.createTableLook.html
@@ -34,7 +34,7 @@ styles to apply special formatting to specific regions of the table.
diff --git a/api/functions/index.createTableRowHeight.html b/api/functions/index.createTableRowHeight.html
index e1b4ddc38a..7ffb570427 100644
--- a/api/functions/index.createTableRowHeight.html
+++ b/api/functions/index.createTableRowHeight.html
@@ -38,7 +38,7 @@ determining how the height should be applied.
diff --git a/api/functions/index.createWrapNone.html b/api/functions/index.createWrapNone.html
index 4669f7e746..055a048c8b 100644
--- a/api/functions/index.createWrapNone.html
+++ b/api/functions/index.createWrapNone.html
@@ -23,7 +23,7 @@ without wrapping around it.
diff --git a/api/functions/index.createWrapSquare.html b/api/functions/index.createWrapSquare.html
index 4c2dd075a1..cc28edb508 100644
--- a/api/functions/index.createWrapSquare.html
+++ b/api/functions/index.createWrapSquare.html
@@ -32,7 +32,7 @@ of the drawing on the specified side(s).
diff --git a/api/functions/index.createWrapThrough.html b/api/functions/index.createWrapThrough.html
index 33388e6d80..bd68efe9ce 100644
--- a/api/functions/index.createWrapThrough.html
+++ b/api/functions/index.createWrapThrough.html
@@ -36,7 +36,7 @@ fills any open space inside the drawing, such as the middle of a ring.
diff --git a/api/functions/index.createWrapTight.html b/api/functions/index.createWrapTight.html
index 390b9b72eb..e0d5c2d6fd 100644
--- a/api/functions/index.createWrapTight.html
+++ b/api/functions/index.createWrapTight.html
@@ -36,7 +36,7 @@ of the drawing rather than its rectangular bounding box.
diff --git a/api/functions/index.dateTimeValue.html b/api/functions/index.dateTimeValue.html
index 44ec94e9a5..36103445c8 100644
--- a/api/functions/index.dateTimeValue.html
+++ b/api/functions/index.dateTimeValue.html
@@ -36,7 +36,7 @@ This matches the xsd:dateTime format required by OOXML.
diff --git a/api/functions/index.fillPartPageNumbers.html b/api/functions/index.fillPartPageNumbers.html
index 339b0c1ed3..ec0c4b59f8 100644
--- a/api/functions/index.fillPartPageNumbers.html
+++ b/api/functions/index.fillPartPageNumbers.html
@@ -35,7 +35,7 @@ are left as they are
diff --git a/api/functions/index.fillSequenceNumbers.html b/api/functions/index.fillSequenceNumbers.html
index e186419796..875eb5b58a 100644
--- a/api/functions/index.fillSequenceNumbers.html
+++ b/api/functions/index.fillSequenceNumbers.html
@@ -27,7 +27,7 @@ tables of contents are filled in from its headings, as Word leaves a heading's S
diff --git a/api/functions/index.hpsMeasureValue.html b/api/functions/index.hpsMeasureValue.html
index af81f749f3..65a9bd75b0 100644
--- a/api/functions/index.hpsMeasureValue.html
+++ b/api/functions/index.hpsMeasureValue.html
@@ -36,7 +36,7 @@ HPS (half-points) are commonly used for font sizes.
diff --git a/api/functions/index.patchDocument.html b/api/functions/index.patchDocument.html
index 0484811b59..e7d1d044a0 100644
--- a/api/functions/index.patchDocument.html
+++ b/api/functions/index.patchDocument.html
@@ -42,7 +42,7 @@ the original document structure and optionally the original formatting.
diff --git a/api/functions/index.universalMeasureToTwips.html b/api/functions/index.universalMeasureToTwips.html
index 852d5403b7..f8b4fe765d 100644
--- a/api/functions/index.universalMeasureToTwips.html
+++ b/api/functions/index.universalMeasureToTwips.html
@@ -35,7 +35,7 @@ Strings are converted according to their unit suffix.
diff --git a/api/functions/layout.estimatePageNumbersWith.html b/api/functions/layout.estimatePageNumbersWith.html
index ae1fd95496..0fcf086497 100644
--- a/api/functions/layout.estimatePageNumbersWith.html
+++ b/api/functions/layout.estimatePageNumbersWith.html
@@ -32,7 +32,7 @@ options say. Give what it returns to a document as its pageNumbers,
diff --git a/api/functions/layout.layoutDocument.html b/api/functions/layout.layoutDocument.html
index b68e9d1de7..36e9dcf786 100644
--- a/api/functions/layout.layoutDocument.html
+++ b/api/functions/layout.layoutDocument.html
@@ -37,7 +37,7 @@ text box, it stops, and gives the pages up to there, with why in stoppedAt
diff --git a/api/functions/layout.measureWithPretext.html b/api/functions/layout.measureWithPretext.html
index 9b70058a50..e97f7025c5 100644
--- a/api/functions/layout.measureWithPretext.html
+++ b/api/functions/layout.measureWithPretext.html
@@ -40,7 +40,7 @@ measures text in another, and Pretext keeps the widths it measured.
diff --git a/api/functions/math.latexToMath.html b/api/functions/math.latexToMath.html
index 9d8d5b0777..ca23a822c0 100644
--- a/api/functions/math.latexToMath.html
+++ b/api/functions/math.latexToMath.html
@@ -44,7 +44,7 @@ cases and aligned equations, with \tag for their numbers. The math
diff --git a/api/interfaces/index.IXmlableObject.html b/api/interfaces/index.IXmlableObject.html
index 71eefa165c..20931d404b 100644
--- a/api/interfaces/index.IXmlableObject.html
+++ b/api/interfaces/index.IXmlableObject.html
@@ -31,7 +31,7 @@ to generate the final XML output. Objects typically have a structure like:
diff --git a/api/types/charts.BarChartBaseOptions.html b/api/types/charts.BarChartBaseOptions.html
index 621461cb5b..436d848d77 100644
--- a/api/types/charts.BarChartBaseOptions.html
+++ b/api/types/charts.BarChartBaseOptions.html
@@ -31,7 +31,7 @@ Default is Office's: -27 for column charts and 0 for bar charts. Stacked bars al
@@ -49,14 +49,14 @@ bar, line or area chart spaces them by date
Sales. 2025: Jan 10, Feb 20.", and none for a decorative chart. An empty description removes it
+
diff --git a/api/types/charts.CategoryChartOptions.html b/api/types/charts.CategoryChartOptions.html
index b2308759e3..5919d2b5c1 100644
--- a/api/types/charts.CategoryChartOptions.html
+++ b/api/types/charts.CategoryChartOptions.html
@@ -59,7 +59,7 @@ in years, are labelled in rows, the groups below their categories
diff --git a/api/types/charts.ChartAxisCrossing.html b/api/types/charts.ChartAxisCrossing.html
index eb6f7e69ef..1c15377edc 100644
--- a/api/types/charts.ChartAxisCrossing.html
+++ b/api/types/charts.ChartAxisCrossing.html
@@ -20,7 +20,7 @@ the value is the category's number, from 1, or when the categories are dates, a
diff --git a/api/types/charts.ChartAxisGroup.html b/api/types/charts.ChartAxisGroup.html
index aea479e1b3..644bc395ef 100644
--- a/api/types/charts.ChartAxisGroup.html
+++ b/api/types/charts.ChartAxisGroup.html
@@ -19,7 +19,7 @@ chart's are along the bottom and the top.
diff --git a/api/types/charts.ChartCategoryGroup.html b/api/types/charts.ChartCategoryGroup.html
index 7a83d1d0ff..54754ab498 100644
--- a/api/types/charts.ChartCategoryGroup.html
+++ b/api/types/charts.ChartCategoryGroup.html
@@ -20,7 +20,7 @@ categories, or groups of its own, such as the months of each quarter of each yea
@@ -67,21 +67,21 @@ a point, and where they fit best on a pie. A chart's position is for the series
another way keep Office's, unless their own labels give one
diff --git a/api/types/charts.ChartDataPatchOptions.html b/api/types/charts.ChartDataPatchOptions.html
index e7e0182146..ecaa33e66b 100644
--- a/api/types/charts.ChartDataPatchOptions.html
+++ b/api/types/charts.ChartDataPatchOptions.html
@@ -19,7 +19,7 @@ series' points, or for a stock chart its prices.
diff --git a/api/types/charts.ChartErrorBarsAmount.html b/api/types/charts.ChartErrorBarsAmount.html
index f7f9525dff..e8b73e5540 100644
--- a/api/types/charts.ChartErrorBarsAmount.html
+++ b/api/types/charts.ChartErrorBarsAmount.html
@@ -64,7 +64,7 @@ deviations, or the standard error.
diff --git a/api/types/charts.ChartLineDash.html b/api/types/charts.ChartLineDash.html
index 40a7da3f6a..c535f51a08 100644
--- a/api/types/charts.ChartLineDash.html
+++ b/api/types/charts.ChartLineDash.html
@@ -19,7 +19,7 @@ and so on.
diff --git a/api/types/charts.ChartPointLabel.html b/api/types/charts.ChartPointLabel.html
index a60b243d48..709d8ffd7b 100644
--- a/api/types/charts.ChartPointLabel.html
+++ b/api/types/charts.ChartPointLabel.html
@@ -19,7 +19,7 @@ format and its font. Anything left out is as the series' labels have it.
diff --git a/api/types/charts.ChartTrendline.html b/api/types/charts.ChartTrendline.html
index b59674fd65..24da761bc8 100644
--- a/api/types/charts.ChartTrendline.html
+++ b/api/types/charts.ChartTrendline.html
@@ -20,7 +20,7 @@ forecast. It is drawn as a dotted line in the series' colour, and has an entry i
@@ -57,7 +57,7 @@ forecast. It is drawn as a dotted line in the series' colour, and has an entry i
along the x axis. Default is 0. Not for moving averages
@@ -73,35 +73,35 @@ the x axis. Default is 0. Not for moving averages
linear, exponential and polynomial trendlines, and above 0 for exponential ones
+
diff --git a/api/types/charts.ChartValueAxis.html b/api/types/charts.ChartValueAxis.html
index bf22784ed8..85a24e092b 100644
--- a/api/types/charts.ChartValueAxis.html
+++ b/api/types/charts.ChartValueAxis.html
@@ -43,7 +43,7 @@ of 0 or less can't be shown. Default is a linear scale
diff --git a/api/types/charts.ComboChartSeriesType.html b/api/types/charts.ComboChartSeriesType.html
index cae921cfc3..0888342b6a 100644
--- a/api/types/charts.ComboChartSeriesType.html
+++ b/api/types/charts.ComboChartSeriesType.html
@@ -19,7 +19,7 @@ or an area. A chart with series of more than one type is Word's "Combo"
@@ -59,14 +59,14 @@ with undefined, takes the next of the theme's accent colours
one for each slice in the order of the categories, where undefined leaves a slice in. Default is 0
+
diff --git a/api/types/charts.SplitPieChartBaseOptions.html b/api/types/charts.SplitPieChartBaseOptions.html
index c166946bd1..75d748e6ad 100644
--- a/api/types/charts.SplitPieChartBaseOptions.html
+++ b/api/types/charts.SplitPieChartBaseOptions.html
@@ -42,7 +42,7 @@ second pie or a stacked bar, joined to the slice of the pie that stands for them
diff --git a/api/types/index.AttributePayload.html b/api/types/index.AttributePayload.html
index 574eed634a..180dfa204f 100644
--- a/api/types/index.AttributePayload.html
+++ b/api/types/index.AttributePayload.html
@@ -21,7 +21,7 @@ control over attribute name mapping.
Specifies the additional length, in EMUs, which shall be added to the bottom edge of the DrawingML object to determine its actual bottom edge including effects.
Specifies the additional length, in EMUs, which shall be added to the left edge of the DrawingML object to determine its actual left edge including effects.
Specifies the additional length, in EMUs, which shall be added to the right edge of the DrawingML object to determine its actual right edge including effects.
Specifies the additional length, in EMUs, which shall be added to the top edge of the DrawingML object to determine its actual top edge including effects.
@@ -78,7 +78,7 @@ those in headers, footers and notes.
in headers and footers only on its pages, show. Those of a section whose number is undefined are left blank.
+
diff --git a/api/types/index.GraphicMediaData.html b/api/types/index.GraphicMediaData.html
index b5157c4e26..03353acfa1 100644
--- a/api/types/index.GraphicMediaData.html
+++ b/api/types/index.GraphicMediaData.html
@@ -25,7 +25,7 @@ graphic it is. This is how docx/shapes writes its shapes.
diff --git a/api/types/index.IContext.html b/api/types/index.IContext.html
index a25bb6dab9..a8118c0743 100644
--- a/api/types/index.IContext.html
+++ b/api/types/index.IContext.html
@@ -18,7 +18,7 @@ during the conversion of components to XML.
diff --git a/api/types/index.ICropOptions.html b/api/types/index.ICropOptions.html
index 65b92d5444..f18644cf5d 100644
--- a/api/types/index.ICropOptions.html
+++ b/api/types/index.ICropOptions.html
@@ -19,7 +19,7 @@ side of the image.
The grid can define a grid which snaps all East Asian characters to grid positions, but leaves Latin text with its default spacing; a grid which adds the specified character pitch to each character on each row; or a grid which affects only the line pitch for the current section.
Specifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.
diff --git a/api/types/index.IRunOptions.html b/api/types/index.IRunOptions.html
index e32ed49819..eed98fcffc 100644
--- a/api/types/index.IRunOptions.html
+++ b/api/types/index.IRunOptions.html
@@ -21,7 +21,7 @@ The children property can contain various inline content elements.
diff --git a/api/types/index.IRunStylePropertiesOptions.html b/api/types/index.IRunStylePropertiesOptions.html
index 68e7bc6d7b..4404cf01e1 100644
--- a/api/types/index.IRunStylePropertiesOptions.html
+++ b/api/types/index.IRunStylePropertiesOptions.html
@@ -19,7 +19,7 @@ including font, size, bold, italic, underline, color, and other character format
@@ -140,117 +140,117 @@ including font, size, bold, italic, underline, color, and other character format
highlights all the run's text. docx used to write it as w:highlightCs, which is in no schema.
diff --git a/api/types/index.ITableCellBorders.html b/api/types/index.ITableCellBorders.html
index 86b87936de..6262232579 100644
--- a/api/types/index.ITableCellBorders.html
+++ b/api/types/index.ITableCellBorders.html
@@ -22,7 +22,7 @@ can be specified for top, bottom, left, right, start, and end edges.
@@ -46,7 +46,7 @@ If relativeHorizontalPosition is also specified, then the absoluteHorizontalPosi
If the attribute is omitted, the value is assumed to be zero.
@@ -57,7 +57,7 @@ If relativeVerticalPosition is also specified, then the absoluteVerticalPosition
If the attribute is omitted, the value is assumed to be zero.
@@ -65,7 +65,7 @@ If the attribute is omitted, the value is assumed to be zero.
below the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -85,7 +85,7 @@ If omitted, the value is assumed to be page.
to the left of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -121,7 +121,7 @@ inline - the table should be vertically aligned in line with the surrounding tex
top - the table should be vertically aligned to the top edge of the anchor
+
@@ -129,7 +129,7 @@ top - the table should be vertically aligned to the top edge of the anchor
to the right of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -137,7 +137,7 @@ to the right of the table. The value is in twentieths of a point. If omitted, th
above the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -88,7 +88,7 @@ When true, horizontal banding (alternating row colors) is disabled.
When false or undefined, horizontal banding is enabled if defined in the table style.
+
@@ -97,7 +97,7 @@ When true, vertical banding (alternating column colors) is disabled.
When false or undefined, vertical banding is enabled if defined in the table style.
+
diff --git a/api/types/index.ITableOfContentsOptions.html b/api/types/index.ITableOfContentsOptions.html
index 9aa85bcd50..0cad874d92 100644
--- a/api/types/index.ITableOfContentsOptions.html
+++ b/api/types/index.ITableOfContentsOptions.html
@@ -23,7 +23,7 @@ Options correspond to field switches in the TOC field code.
@@ -59,7 +59,7 @@ The identifier designated by text in this switch's field-argument corresponds to
Use captionLabelIncludingNumbers (\c) to build a table of captions with labels and numbers.
@@ -85,7 +85,7 @@ the bookmark named by text in this switch's field-argument.
that separate an entry and its page number. The default is a tab with leader dots.
+
@@ -96,21 +96,21 @@ to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1).
If no heading range is specified, all heading levels used in the document are listed.
+
@@ -119,21 +119,21 @@ Page numbers are omitted from all levels unless a range of entry levels is speci
text in this switch's field-argument. A range is specified as for \l.
+
@@ -168,7 +168,7 @@ with each doublet being a comma-separated set of style name and table of content
text in this switch's field-argument (which is typically a letter).
+
@@ -178,14 +178,14 @@ where startLevel and endLevel are integers, and startLevel has a value equal-to
TC fields that assign entries to lower levels are skipped.
+
@@ -76,64 +76,64 @@ parent cell) when the document is packed, so the table renders the same in every
consumer. Supply explicit values to take full control of the grid.
diff --git a/api/types/index.IThemeColorsOptions.html b/api/types/index.IThemeColorsOptions.html
index 5a4cde7da0..a037408dba 100644
--- a/api/types/index.IThemeColorsOptions.html
+++ b/api/types/index.IThemeColorsOptions.html
@@ -21,7 +21,7 @@ when the theme's colors change. The colors not given are Office's.
diff --git a/api/types/index.IXmlAttribute.html b/api/types/index.IXmlAttribute.html
index ea693ba611..173475f01c 100644
--- a/api/types/index.IXmlAttribute.html
+++ b/api/types/index.IXmlAttribute.html
@@ -17,7 +17,7 @@
numbers, or booleans, which will be converted to strings in the final XML.
diff --git a/api/types/index.MathRunStyle.html b/api/types/index.MathRunStyle.html
index d002c4733f..ab9074e20a 100644
--- a/api/types/index.MathRunStyle.html
+++ b/api/types/index.MathRunStyle.html
@@ -23,7 +23,7 @@
alphabet other than roman is plain unless given a style, as LaTeX draws its alphabets upright.
diff --git a/api/types/index.OutputByType.html b/api/types/index.OutputByType.html
index 7239dce5f4..dd2308c88f 100644
--- a/api/types/index.OutputByType.html
+++ b/api/types/index.OutputByType.html
@@ -24,7 +24,7 @@ format determines the return type. Based on JSZip's output types.
diff --git a/api/types/index.PageNumberEstimator.html b/api/types/index.PageNumberEstimator.html
index 2962a27e23..b2d164731c 100644
--- a/api/types/index.PageNumberEstimator.html
+++ b/api/types/index.PageNumberEstimator.html
@@ -38,7 +38,7 @@ page counts can be written with it.
diff --git a/api/types/index.ParagraphChild.html b/api/types/index.ParagraphChild.html
index 87e45c4126..91f698e55c 100644
--- a/api/types/index.ParagraphChild.html
+++ b/api/types/index.ParagraphChild.html
@@ -17,7 +17,7 @@ This union type represents all valid inline content elements that can appear
within a paragraph in WordprocessingML.
Each of its other parts, such as its pictures and the fonts it embeds, by its path in the package, as bytes
+
+
Readonlyparts
parts:ReadonlyMap<string,Element>
Each XML part of the template's package, by its path in the package, such as "word/document.xml". Each is parsed as
@@ -40,7 +48,7 @@
(captureSpacesBetweenElements), as the spaces in a text element are its text
diff --git a/api/types/index.RelationshipType.html b/api/types/index.RelationshipType.html
index 8f4a283e9a..896459ef5f 100644
--- a/api/types/index.RelationshipType.html
+++ b/api/types/index.RelationshipType.html
@@ -17,7 +17,7 @@
Each type corresponds to a specific kind of document component or resource.
diff --git a/api/types/index.TableRowsPatch.html b/api/types/index.TableRowsPatch.html
index 49369a05e6..0bb71a8966 100644
--- a/api/types/index.TableRowsPatch.html
+++ b/api/types/index.TableRowsPatch.html
@@ -32,7 +32,7 @@ none. The other patches are applied after the rows are repeated, so a placeholde
@@ -55,14 +55,14 @@ A field's patch can repeat rows of a table in the copy in turn, whose fields are
repeated for each part, with its item's fields, and an item without parts has no row
diff --git a/api/types/index.TemplatePageNumberEstimator.html b/api/types/index.TemplatePageNumberEstimator.html
index d5cd58bc37..e135a3c3dc 100644
--- a/api/types/index.TemplatePageNumberEstimator.html
+++ b/api/types/index.TemplatePageNumberEstimator.html
@@ -33,7 +33,7 @@ pages, are written with it.
Specifies the height of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the left of the containing block of the shape relative to the element left of it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline.
Specifies the position of the bottom of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the left of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the right of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the top of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the type of positioning used to place an element. Default is static. When the element is contained inside a group, this property must be absolute.
Specifies relative horizontal position data for objects in WordprocessingML documents. This modifies the mso-position-horizontal property. Default is text.
Specifies relative vertical position data for objects in WordprocessingML documents. This modifies the mso-position-vertical property. Default is text.
Specifies the position of the top of the containing block of the shape relative to the element above it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline.
Specifies the width of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the distance from the bottom of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the left side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the right side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the top of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies whether the wrap coordinates were customized by the user. If the wrap coordinates are generated by an editor, this property is true; otherwise they were customized by a user. Default is false.
Font files to measure text in, with their own widths, kerning and line heights, as Word measures it. Give a file
for each of a font's faces the document uses, such as Aptos, Aptos Bold and Aptos Italic: text in fonts without
files is measured as it is without them, and so is bold text, or text that isn't bold, in a font without a file for
-it. Italic text in a font without an italic file is measured with the upright one. The layout stops at a character
-a font's file has no glyph for, as Word draws it in another font
+it, which stops the layout when the font isn't in the width tables. Italic text in a font without an italic file is
+measured with the upright one. The layout stops at a character a font's file has no glyph for, as Word draws it in
+another font. A font the document embeds is measured from the document's own file
Measures how wide text is, such as measureWithPretext, which measures it with the fonts a browser has.
Default is the widths of the fonts Word documents use most, which estimatePageNumbers uses. Lines still
-break, and tabs move to their stops, as Word lays them out, and lines are as tall as Word makes them.
+break, and tabs move to their stops, as Word lays them out, and lines are as tall as Word makes them, from the
+width tables, so the layout stops at text in a font that isn't in them and isn't given as a file or embedded.
diff --git a/api/types/layout.MeasureWidth.html b/api/types/layout.MeasureWidth.html
index cd84d97258..a9ff7035fa 100644
--- a/api/types/layout.MeasureWidth.html
+++ b/api/types/layout.MeasureWidth.html
@@ -33,7 +33,7 @@ between characters and the width of scaled text, which the document's formatting
diff --git a/api/types/shapes.ConnectorEnd.html b/api/types/shapes.ConnectorEnd.html
index c8dca08885..0d8319d03a 100644
--- a/api/types/shapes.ConnectorEnd.html
+++ b/api/types/shapes.ConnectorEnd.html
@@ -38,7 +38,7 @@ bottom-left corner. On a shape without connection points, the connector ends at
diff --git a/api/types/shapes.CustomShapeGeometry.html b/api/types/shapes.CustomShapeGeometry.html
index 31af0dea67..bff95eddab 100644
--- a/api/types/shapes.CustomShapeGeometry.html
+++ b/api/types/shapes.CustomShapeGeometry.html
@@ -50,7 +50,7 @@ fill the shape. Later paths are drawn over earlier ones
diff --git a/api/types/shapes.CustomShapePath.html b/api/types/shapes.CustomShapePath.html
index a237c5d934..0b427f7a76 100644
--- a/api/types/shapes.CustomShapePath.html
+++ b/api/types/shapes.CustomShapePath.html
@@ -20,7 +20,7 @@ own, so paths can overlap without cutting holes in each other.
diff --git a/api/types/shapes.CustomShapePathFill.html b/api/types/shapes.CustomShapePathFill.html
index 7f4b01b4df..7b3417c7ed 100644
--- a/api/types/shapes.CustomShapePathFill.html
+++ b/api/types/shapes.CustomShapePathFill.html
@@ -19,7 +19,7 @@ fill made lighter or darker, as Word's preset shapes shade the top of a cube or
diff --git a/api/types/shapes.IShapeCanvasOptions.html b/api/types/shapes.IShapeCanvasOptions.html
index e85f8fcfca..d52d4d5b29 100644
--- a/api/types/shapes.IShapeCanvasOptions.html
+++ b/api/types/shapes.IShapeCanvasOptions.html
@@ -64,7 +64,7 @@ The shapes are not scaled.
diff --git a/api/types/shapes.IShapeConnectorOptions.html b/api/types/shapes.IShapeConnectorOptions.html
index d926540a4f..78112e6730 100644
--- a/api/types/shapes.IShapeConnectorOptions.html
+++ b/api/types/shapes.IShapeConnectorOptions.html
@@ -23,7 +23,7 @@ or several connectors join the same two shapes, their ends are spread out along
@@ -64,21 +64,21 @@ or several connectors join the same two shapes, their ends are spread out along
shape, so Word doesn't move it when the connector moves
diff --git a/api/types/shapes.IShapeGroupChildOptions.html b/api/types/shapes.IShapeGroupChildOptions.html
index 1b0ba02a2c..994a91ea5c 100644
--- a/api/types/shapes.IShapeGroupChildOptions.html
+++ b/api/types/shapes.IShapeGroupChildOptions.html
@@ -20,7 +20,7 @@ in pixels, unless a layout places it, and id names it
diff --git a/api/types/shapes.IShapeGroupOptions.html b/api/types/shapes.IShapeGroupOptions.html
index d33c23a3de..2f64d15121 100644
--- a/api/types/shapes.IShapeGroupOptions.html
+++ b/api/types/shapes.IShapeGroupOptions.html
@@ -50,7 +50,7 @@ the box around the children. A different size scales every shape in the group.
diff --git a/api/types/shapes.IShapeNestedGroupOptions.html b/api/types/shapes.IShapeNestedGroupOptions.html
index 199539dd2d..9bccaf109b 100644
--- a/api/types/shapes.IShapeNestedGroupOptions.html
+++ b/api/types/shapes.IShapeNestedGroupOptions.html
@@ -47,7 +47,7 @@ box around the children, and a different size scales every child
diff --git a/api/types/shapes.IShapeOptions.html b/api/types/shapes.IShapeOptions.html
index 0aba337f63..86d3e2253e 100644
--- a/api/types/shapes.IShapeOptions.html
+++ b/api/types/shapes.IShapeOptions.html
@@ -23,7 +23,7 @@ or startAngle and endAngle for a "pie"
diff --git a/api/types/shapes.PresetShapeAdjustments.html b/api/types/shapes.PresetShapeAdjustments.html
index 3f51e4b9ff..234d7c7676 100644
--- a/api/types/shapes.PresetShapeAdjustments.html
+++ b/api/types/shapes.PresetShapeAdjustments.html
@@ -21,7 +21,7 @@ allows, so a value that is too large acts like the largest allowed value.
diff --git a/api/types/shapes.ShapeAdjustments.html b/api/types/shapes.ShapeAdjustments.html
index cea9029a4f..f4cd2451b1 100644
--- a/api/types/shapes.ShapeAdjustments.html
+++ b/api/types/shapes.ShapeAdjustments.html
@@ -23,7 +23,7 @@ It is never for shapes without handles, which take no adjustments.<
diff --git a/api/types/shapes.ShapeFlowLayout.html b/api/types/shapes.ShapeFlowLayout.html
index 8247796403..9d11144d9d 100644
--- a/api/types/shapes.ShapeFlowLayout.html
+++ b/api/types/shapes.ShapeFlowLayout.html
@@ -20,7 +20,7 @@ that connect to it, and the shapes on each level are ordered so connectors cross
@@ -52,26 +52,26 @@ with a lane goes in the band of that name, and shapes without one g
across the direction the flow runs in, each with a header at the start of the flow
diff --git a/api/types/shapes.ShapeHorizontalPosition.html b/api/types/shapes.ShapeHorizontalPosition.html
index 2f7bfa4db5..76566f5490 100644
--- a/api/types/shapes.ShapeHorizontalPosition.html
+++ b/api/types/shapes.ShapeHorizontalPosition.html
@@ -26,7 +26,7 @@ a base of the page, the space between its margins, or one of its margins
diff --git a/api/types/shapes.ShapeLayout.html b/api/types/shapes.ShapeLayout.html
index d3cd9c763c..96d00820ec 100644
--- a/api/types/shapes.ShapeLayout.html
+++ b/api/types/shapes.ShapeLayout.html
@@ -20,7 +20,7 @@ layout, which is placed around them. Connectors are routed after the shapes are
diff --git a/api/types/shapes.ShapeSize.html b/api/types/shapes.ShapeSize.html
index 40b295bbd3..1bd4fb6453 100644
--- a/api/types/shapes.ShapeSize.html
+++ b/api/types/shapes.ShapeSize.html
@@ -19,7 +19,7 @@ percentage of the space between the page's margins, or of what floating.si
diff --git a/api/types/shapes.ShapeTextWarp.html b/api/types/shapes.ShapeTextWarp.html
index 283eff0b6a..dfa4978591 100644
--- a/api/types/shapes.ShapeTextWarp.html
+++ b/api/types/shapes.ShapeTextWarp.html
@@ -19,7 +19,7 @@ The ...Filled arches, circle and button spread the text over the wh
diff --git a/api/types/shapes.ShapeThemeColor.html b/api/types/shapes.ShapeThemeColor.html
index 03d3da0c44..ccc450f983 100644
--- a/api/types/shapes.ShapeThemeColor.html
+++ b/api/types/shapes.ShapeThemeColor.html
@@ -20,7 +20,7 @@ same as docx's ThemeColor, which text, borders and sha
diff --git a/api/types/shapes.ShapeTransformation.html b/api/types/shapes.ShapeTransformation.html
index a91dc58b30..ead15dfc54 100644
--- a/api/types/shapes.ShapeTransformation.html
+++ b/api/types/shapes.ShapeTransformation.html
@@ -30,7 +30,7 @@ between the margins for a floating shape, such as "100%"<
diff --git a/api/types/shapes.ShapeTreeLayout.html b/api/types/shapes.ShapeTreeLayout.html
index c41000f234..ee7829dbde 100644
--- a/api/types/shapes.ShapeTreeLayout.html
+++ b/api/types/shapes.ShapeTreeLayout.html
@@ -20,7 +20,7 @@ children are placed side by side below their parent, which is centred over them.
diff --git a/api/types/shapes.ShapeVerticalPosition.html b/api/types/shapes.ShapeVerticalPosition.html
index bc7ba95dc7..f07c0d5fcc 100644
--- a/api/types/shapes.ShapeVerticalPosition.html
+++ b/api/types/shapes.ShapeVerticalPosition.html
@@ -26,7 +26,7 @@ a base of the page, the space between its margins, or one of its margins
diff --git a/api/variables/index.CharacterSet.html b/api/variables/index.CharacterSet.html
index b3fc8d0eec..3f9ef1c273 100644
--- a/api/variables/index.CharacterSet.html
+++ b/api/variables/index.CharacterSet.html
@@ -60,7 +60,7 @@ Maps character set names to their hexadecimal identifiers.
diff --git a/api/variables/index.DocumentAttributeNamespaces.html b/api/variables/index.DocumentAttributeNamespaces.html
index 8016aef259..b6d0e19705 100644
--- a/api/variables/index.DocumentAttributeNamespaces.html
+++ b/api/variables/index.DocumentAttributeNamespaces.html
@@ -94,7 +94,7 @@ in a document, including WordprocessingML, DrawingML, VML, and others.
When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values
diff --git a/api/variables/index.DropCapType.html b/api/variables/index.DropCapType.html
index 17029bbe87..a70cc6ebd0 100644
--- a/api/variables/index.DropCapType.html
+++ b/api/variables/index.DropCapType.html
@@ -32,7 +32,7 @@ beginning of a paragraph. This enum defines how the drop cap should be positione
diff --git a/api/variables/index.EMPTY_OBJECT.html b/api/variables/index.EMPTY_OBJECT.html
index ba5eb856d3..ca593178e3 100644
--- a/api/variables/index.EMPTY_OBJECT.html
+++ b/api/variables/index.EMPTY_OBJECT.html
@@ -20,7 +20,7 @@ has no children or attributes.
diff --git a/api/variables/index.EmphasisMarkType.html b/api/variables/index.EmphasisMarkType.html
index a9425cd58f..7d367e9d96 100644
--- a/api/variables/index.EmphasisMarkType.html
+++ b/api/variables/index.EmphasisMarkType.html
@@ -31,7 +31,7 @@ Emphasis marks are commonly used in East Asian typography.
Specifies that this header or footer shall appear on the first page in this section. The appearance of this header or footer is contingent on the setting of the titlePg element (§2.10.6).
diff --git a/api/variables/index.LevelFormat.html b/api/variables/index.LevelFormat.html
index 636a0bb176..00d9dc8b2f 100644
--- a/api/variables/index.LevelFormat.html
+++ b/api/variables/index.LevelFormat.html
@@ -281,7 +281,7 @@ decimal, roman numerals, letters, and various international formats.
diff --git a/api/variables/index.PageTextDirectionType.html b/api/variables/index.PageTextDirectionType.html
index ad1d0c737c..b665154dfe 100644
--- a/api/variables/index.PageTextDirectionType.html
+++ b/api/variables/index.PageTextDirectionType.html
@@ -28,7 +28,7 @@ vertically (top-to-bottom), commonly used for East Asian languages.
Top-to-bottom, right-to-left (vertical East Asian text flow)
diff --git a/api/variables/index.ShadingType.html b/api/variables/index.ShadingType.html
index 597e4f0087..50032b597f 100644
--- a/api/variables/index.ShadingType.html
+++ b/api/variables/index.ShadingType.html
@@ -103,7 +103,7 @@ color and the pattern color.
diff --git a/api/variables/index.TextEffect.html b/api/variables/index.TextEffect.html
index 27a5f13a00..5516f8fb71 100644
--- a/api/variables/index.TextEffect.html
+++ b/api/variables/index.TextEffect.html
@@ -56,7 +56,7 @@ these effects are deprecated and may not be supported by all applications.
diff --git a/api/variables/index.VerticalAlign.html b/api/variables/index.VerticalAlign.html
index 1cd0367dfe..7f1e3b0259 100644
--- a/api/variables/index.VerticalAlign.html
+++ b/api/variables/index.VerticalAlign.html
@@ -32,7 +32,7 @@ backward-compatibility and will be removed in the next major release.
diff --git a/api/variables/index.VerticalAlignTable.html b/api/variables/index.VerticalAlignTable.html
index a6c5ef29b7..2dc103034d 100644
--- a/api/variables/index.VerticalAlignTable.html
+++ b/api/variables/index.VerticalAlignTable.html
@@ -28,7 +28,7 @@ are valid according to ECMA-376 (§17.18.87 ST_VerticalJc within <w:tcP
diff --git a/api/variables/index.VerticalMergeType.html b/api/variables/index.VerticalMergeType.html
index 106c1589d6..e8e7a98daf 100644
--- a/api/variables/index.VerticalMergeType.html
+++ b/api/variables/index.VerticalMergeType.html
@@ -29,7 +29,7 @@ This cell continues a vertical merge started by a cell above it.
This cell begins a new vertical merge region.
diff --git a/api/variables/index.bookmarkUniqueNumericId.html b/api/variables/index.bookmarkUniqueNumericId.html
index f94b60fcd2..b69823200d 100644
--- a/api/variables/index.bookmarkUniqueNumericId.html
+++ b/api/variables/index.bookmarkUniqueNumericId.html
@@ -27,7 +27,7 @@ than a generator per instance.
diff --git a/api/variables/index.docPropertiesUniqueNumericId.html b/api/variables/index.docPropertiesUniqueNumericId.html
index e3b480788b..2c88df3070 100644
--- a/api/variables/index.docPropertiesUniqueNumericId.html
+++ b/api/variables/index.docPropertiesUniqueNumericId.html
@@ -28,7 +28,7 @@ one counter rather than a generator per instance.
diff --git a/api/variables/layout.estimatePageNumbers.html b/api/variables/layout.estimatePageNumbers.html
index c66e4c80c8..898a7ffe90 100644
--- a/api/variables/layout.estimatePageNumbers.html
+++ b/api/variables/layout.estimatePageNumbers.html
@@ -20,18 +20,20 @@ numbers of pages, are written with it. Give it to a document as its pageNu
The pages are laid out with the widths and heights of the fonts Word documents use most, such as Calibri, Cambria,
-Arial and Times New Roman. To measure text in other fonts, such as Aptos, from their files, use
+Arial and Times New Roman, and of those made as wide, such as Carlito, and text in the fonts the document embeds is
+measured from their files. To measure text in other fonts, such as Aptos, from their files, use
estimatePageNumbersWith. It follows paragraphs' spacing, indents, line spacing, tab stops and keep settings, widow
and orphan control, lists, pictures in the line, tables, whose rows break across pages, footnotes and endnotes, page,
column and section breaks, and each section's page size, margins, columns, headers, footers and page numbering.
It stops at the first thing it can't lay out yet: a drawing or table that text flows around, a text box or frame, an
equation, a footnote that continues on the next page, columns evened out before a continuous section break, a table
-row kept whole that is taller than a page, a character whose width in its font isn't known, such as a mathematical
-symbol in Calibri, which Word draws in Cambria Math, or a date in the text, which Word writes when it opens the document.
-The page references to bookmarks after it are left blank, for Word to fill in when it updates the fields. A document in
-compatibility mode, which Word lays out as an older version of Word did, isn't laid out at all. When laying the pages
-out again with the page numbers it worked out still changes them after three passes, as when a table of contents wraps
-one way with a number and the other way without it, all of them are left blank.
+row kept whole that is taller than a page, text in a font that isn't in the width tables and isn't embedded, such as
+Aptos, a character whose width in its font isn't known, such as a mathematical symbol in Calibri, which Word draws in
+Cambria Math, or a date in the text, which Word writes when it opens the document. The page references to bookmarks
+after it are left blank, for Word to fill in when it updates the fields. A document in compatibility mode, which Word
+lays out as an older version of Word did, isn't laid out at all. When laying the pages out again with the page numbers
+it worked out still changes them after three passes, as when a table of contents wraps one way with a number and the
+other way without it, all of them are left blank.
Page references are written as Word writes them, with \p ("above", "below" or "on page 4") and in formats of their
own, such as \* roman, and so are numbers of pages. Page references, tables of contents and SEQ fields (caption
numbers, which are counted without laying out the pages) are written clean, so Word shows the numbers as they are
@@ -42,7 +44,7 @@ written, and the numbers left blank stay blank, without asking to update the fie
diff --git a/live-examples/lib/index.d.ts b/live-examples/lib/index.d.ts
index 44e62fda15..b91abbe84b 100644
--- a/live-examples/lib/index.d.ts
+++ b/live-examples/lib/index.d.ts
@@ -10673,6 +10673,8 @@ export declare type PatchedTemplate = {
* (`captureSpacesBetweenElements`), as the spaces in a text element are its text
*/
readonly parts: ReadonlyMap;
+ /** Each of its other parts, such as its pictures and the fonts it embeds, by its path in the package, as bytes */
+ readonly binaryParts?: ReadonlyMap;
};
/**
diff --git a/live-examples/lib/index.iife.js b/live-examples/lib/index.iife.js
index 5190b9598b..969f9beee7 100644
--- a/live-examples/lib/index.iife.js
+++ b/live-examples/lib/index.iife.js
@@ -36564,12 +36564,16 @@ while (n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[+
* as they are and doesn't ask to update the fields.
*
* @param parts - The template's XML parts, parsed, by their paths, which are changed in place
+ * @param binaryParts - Its other parts, by their paths, for the estimator to read the fonts it embeds
*/
- var fillTemplatePageNumbers = (parts, estimator) => {
+ var fillTemplatePageNumbers = (parts, estimator, binaryParts = /* @__PURE__ */ new Map()) => {
var _rootOf$elements, _rootOf;
const document = rootOf(parts.get(DOCUMENT));
if (!document) return;
- const estimate = estimator({ parts });
+ const estimate = estimator({
+ parts,
+ binaryParts
+ });
const partPageCounts = fillBodyFields(PARSED, document, estimate, { blank: true });
const relationships = (_rootOf$elements = (_rootOf = rootOf(parts.get(relationshipsPathOf(DOCUMENT)))) === null || _rootOf === void 0 ? void 0 : _rootOf.elements) !== null && _rootOf$elements !== void 0 ? _rootOf$elements : [];
for (const { attributes = {} } of relationships) {
@@ -37498,7 +37502,7 @@ while (n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[+
map.set(relationshipKey, relationshipsJson);
appendRelationship(relationshipsJson, id, type, target, targetMode);
}
- if (pageNumbers) fillTemplatePageNumbers(map, pageNumbers);
+ if (pageNumbers) fillTemplatePageNumbers(map, pageNumbers, binaryContentMap);
const packageParts = xmlifyPackageParts(file, void 0);
if (hasMedia || contentTypeOverrides.length > 0) {
const contentTypesJson = map.get("[Content_Types].xml");
diff --git a/live-examples/lib/layout.d.ts b/live-examples/lib/layout.d.ts
index d9a5685158..f30a2a171a 100644
--- a/live-examples/lib/layout.d.ts
+++ b/live-examples/lib/layout.d.ts
@@ -39,19 +39,21 @@ export declare type DocumentLayout = {
* ```
*
* The pages are laid out with the widths and heights of the fonts Word documents use most, such as Calibri, Cambria,
- * Arial and Times New Roman. To measure text in other fonts, such as Aptos, from their files, use
+ * Arial and Times New Roman, and of those made as wide, such as Carlito, and text in the fonts the document embeds is
+ * measured from their files. To measure text in other fonts, such as Aptos, from their files, use
* {@link estimatePageNumbersWith}. It follows paragraphs' spacing, indents, line spacing, tab stops and keep settings, widow
* and orphan control, lists, pictures in the line, tables, whose rows break across pages, footnotes and endnotes, page,
* column and section breaks, and each section's page size, margins, columns, headers, footers and page numbering.
*
* It stops at the first thing it can't lay out yet: a drawing or table that text flows around, a text box or frame, an
* equation, a footnote that continues on the next page, columns evened out before a continuous section break, a table
- * row kept whole that is taller than a page, a character whose width in its font isn't known, such as a mathematical
- * symbol in Calibri, which Word draws in Cambria Math, or a date in the text, which Word writes when it opens the document.
- * The page references to bookmarks after it are left blank, for Word to fill in when it updates the fields. A document in
- * compatibility mode, which Word lays out as an older version of Word did, isn't laid out at all. When laying the pages
- * out again with the page numbers it worked out still changes them after three passes, as when a table of contents wraps
- * one way with a number and the other way without it, all of them are left blank.
+ * row kept whole that is taller than a page, text in a font that isn't in the width tables and isn't embedded, such as
+ * Aptos, a character whose width in its font isn't known, such as a mathematical symbol in Calibri, which Word draws in
+ * Cambria Math, or a date in the text, which Word writes when it opens the document. The page references to bookmarks
+ * after it are left blank, for Word to fill in when it updates the fields. A document in compatibility mode, which Word
+ * lays out as an older version of Word did, isn't laid out at all. When laying the pages out again with the page numbers
+ * it worked out still changes them after three passes, as when a table of contents wraps one way with a number and the
+ * other way without it, all of them are left blank.
*
* Page references are written as Word writes them, with `\p` ("above", "below" or "on page 4") and in formats of their
* own, such as `\* roman`, and so are numbers of pages. Page references, tables of contents and SEQ fields (caption
@@ -73,14 +75,16 @@ export declare type EstimatePageNumbersOptions = {
* Font files to measure text in, with their own widths, kerning and line heights, as Word measures it. Give a file
* for each of a font's faces the document uses, such as Aptos, Aptos Bold and Aptos Italic: text in fonts without
* files is measured as it is without them, and so is bold text, or text that isn't bold, in a font without a file for
- * it. Italic text in a font without an italic file is measured with the upright one. The layout stops at a character
- * a font's file has no glyph for, as Word draws it in another font
+ * it, which stops the layout when the font isn't in the width tables. Italic text in a font without an italic file is
+ * measured with the upright one. The layout stops at a character a font's file has no glyph for, as Word draws it in
+ * another font. A font the document embeds is measured from the document's own file
*/
readonly fonts?: readonly FontFile[];
/**
* Measures how wide text is, such as {@link measureWithPretext}, which measures it with the fonts a browser has.
* Default is the widths of the fonts Word documents use most, which {@link estimatePageNumbers} uses. Lines still
- * break, and tabs move to their stops, as Word lays them out, and lines are as tall as Word makes them.
+ * break, and tabs move to their stops, as Word lays them out, and lines are as tall as Word makes them, from the
+ * width tables, so the layout stops at text in a font that isn't in them and isn't given as a file or embedded.
*/
readonly measureWidth?: MeasureWidth;
};
diff --git a/live-examples/lib/layout.iife.js b/live-examples/lib/layout.iife.js
index ded300ea89..07b888d74b 100644
--- a/live-examples/lib/layout.iife.js
+++ b/live-examples/lib/layout.iife.js
@@ -126,18 +126,25 @@ var docxLayout = (function(exports) {
/**
* Estimates how much space text takes up, from the widths of the characters in common fonts.
*
- * The estimate is close for the fonts in {@link FONT_WIDTHS}. Other fonts are measured with the one most like them,
- * so their estimates are rougher. Kerning and ligatures are left out, which makes text a little wider than Word draws it.
+ * The estimate is close for the fonts in {@link FONT_WIDTHS}, and those made with the same widths, such as Carlito.
+ * Other fonts are measured with the one most like them, so their estimates are rougher, and {@link unknownFont} says
+ * which they are. Kerning and ligatures are left out, which makes text a little wider than Word draws it.
*
* @module
*/
var DEFAULT_FONT = "Times New Roman";
var TAB_STOP$2 = 36;
- var SIMILAR_FONTS = [
- [/^(carlito|calibri light|segoe ui|candara|corbel)$/i, "Calibri"],
+ var SAME_WIDTHS = [
+ [/^carlito$/i, "Calibri"],
[/^caladea$/i, "Cambria"],
+ [/^(liberation sans|arimo|helvetica)$/i, "Arial"],
+ [/^(liberation serif|tinos)$/i, "Times New Roman"],
+ [/^(liberation mono|cousine)$/i, "Courier New"]
+ ];
+ var SIMILAR_FONTS = [
+ [/^(calibri light|segoe ui|candara|corbel)$/i, "Calibri"],
[/mono|courier|consolas|code|typewriter/i, "Courier New"],
- [new RegExp("times|tinos|liberation serif|georgia|garamond|palatino|book antiqua|(? Array.from({ length: last - first + 1 }, (_, offset) => first + offset));
var CHARACTER_INDEX = new Map(CHARACTERS.map((code, index) => [code, index]));
@@ -339,26 +346,35 @@ var docxLayout = (function(exports) {
];
var EAST_ASIAN_NAME = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]|hiragino|cjk|source han|pingfang|songti|heiti|kaiti|fangsong|mincho|mingliu|simhei|gungsuh|nanum/i;
var EAST_ASIAN_SANS = /gothic|ゴシック|hei|黑|黒|sans|고딕|pingfang/i;
+ /** The East Asian font in the table a font is, by any of its names. Undefined for other fonts */
+ var knownEastAsianFontOf = (font) => {
+ const name = font.toLowerCase();
+ return EAST_ASIAN_FONTS.find((candidate) => [candidate.name, ...candidate.aliases].some((alias) => alias.toLowerCase() === name));
+ };
/**
* The East Asian font a font is, or is measured as, by its name. Undefined for other fonts.
*/
var eastAsianFontOf = (font) => {
- const name = font.toLowerCase();
- const known = EAST_ASIAN_FONTS.find((candidate) => [candidate.name, ...candidate.aliases].some((alias) => alias.toLowerCase() === name));
+ var _knownEastAsianFontOf;
const similar = EAST_ASIAN_SANS.test(font) ? "MS Gothic" : "MS Mincho";
- return known !== null && known !== void 0 ? known : EAST_ASIAN_NAME.test(font) ? EAST_ASIAN_FONTS.find((candidate) => candidate.name === similar) : void 0;
+ return (_knownEastAsianFontOf = knownEastAsianFontOf(font)) !== null && _knownEastAsianFontOf !== void 0 ? _knownEastAsianFontOf : EAST_ASIAN_NAME.test(font) ? EAST_ASIAN_FONTS.find((candidate) => candidate.name === similar) : void 0;
};
/** Whether a font is one for Chinese, Japanese or Korean text */
var isEastAsianFont = (font) => font !== void 0 && eastAsianFontOf(font) !== void 0;
+ var named = (name) => FONT_WIDTHS.find((known) => known.name.toLowerCase() === name.toLowerCase());
+ /** The widths of a font in the table, or of a font with the same widths as one. Undefined for other fonts */
+ var exactWidthsOf = (font) => {
+ const same = SAME_WIDTHS.find(([pattern]) => pattern.test(font));
+ return named(same ? same[1] : font);
+ };
/**
* The widths to measure a font with: its own, or those of the most similar font in the table.
- * Sans-serif fonts that aren't in the table, such as Aptos and Helvetica, are measured as Arial.
+ * Sans-serif fonts that aren't in the table, such as Aptos, are measured as Arial.
*/
var widthsOf = (font = DEFAULT_FONT) => {
- var _named;
- const named = (name) => FONT_WIDTHS.find((known) => known.name.toLowerCase() === name.toLowerCase());
+ var _exactWidthsOf;
const similar = SIMILAR_FONTS.find(([pattern]) => pattern.test(font));
- return (_named = named(font)) !== null && _named !== void 0 ? _named : named(similar ? similar[1] : "Arial");
+ return (_exactWidthsOf = exactWidthsOf(font)) !== null && _exactWidthsOf !== void 0 ? _exactWidthsOf : named(similar ? similar[1] : "Arial");
};
/** The widths of the face text is in: its font's, bold, italic, both or neither */
var faceOf = ({ font, bold, italic }) => {
@@ -428,6 +444,25 @@ var docxLayout = (function(exports) {
});
};
/**
+ * Whether the tables measure text in a font as another font, as they don't have the font's own widths: a font that isn't
+ * in them and isn't made with the same widths as one that is, such as Aptos, which they measure as the most similar
+ * font that is. Word draws it with its own widths when it has it, and in another font when it doesn't, such as Cambria
+ * on the Mac (`word-watertight-text.docx` TX18), so a layout stops there rather than guessing. The East Asian fonts of
+ * the tables are measured as themselves, but for the other characters of those that aren't monospaced, such as Latin
+ * letters in Yu Gothic, which are measured as Times New Roman or Arial. Without text, whether the height of a line in
+ * the font is another font's.
+ */
+ var unknownFont = (font = {}, text) => {
+ var _font$font2;
+ const name = (_font$font2 = font.font) !== null && _font$font2 !== void 0 ? _font$font2 : DEFAULT_FONT;
+ const eastAsian = knownEastAsianFontOf(name);
+ if (eastAsian === void 0) return exactWidthsOf(name) === void 0;
+ return !eastAsian.monospaced && text !== void 0 && [...text].some((character) => {
+ const code = character.codePointAt(0);
+ return !isWide(code) && !isHalfWidth(code) && !takesNoRoom(character);
+ });
+ };
+ /**
* How wide a line of text is, in points. Tabs move to the next half inch, counted from the start of the line.
*
* @param start - Where the text starts on its line, in points
@@ -443,8 +478,8 @@ var docxLayout = (function(exports) {
* How tall a line of single-spaced text is, in points.
*/
var measureLineHeight = (font = {}) => {
- var _eastAsianFontOf, _font$font2;
- return ((_eastAsianFontOf = eastAsianFontOf((_font$font2 = font.font) !== null && _font$font2 !== void 0 ? _font$font2 : "Times New Roman")) !== null && _eastAsianFontOf !== void 0 ? _eastAsianFontOf : widthsOf(font.font)).lineHeight * lineSizeOf(font) / 1e3;
+ var _eastAsianFontOf, _font$font3;
+ return ((_eastAsianFontOf = eastAsianFontOf((_font$font3 = font.font) !== null && _font$font3 !== void 0 ? _font$font3 : "Times New Roman")) !== null && _eastAsianFontOf !== void 0 ? _eastAsianFontOf : widthsOf(font.font)).lineHeight * lineSizeOf(font) / 1e3;
};
/**
* How far a line of single-spaced text goes below its baseline, in points. The rest of the line is above it, with the
@@ -452,8 +487,8 @@ var docxLayout = (function(exports) {
* Courier New's descent (scripts/layout-probes/word-mixed-heights.ts MH2a).
*/
var measureDescent = (font = {}) => {
- var _eastAsianFontOf2, _font$font3;
- return ((_eastAsianFontOf2 = eastAsianFontOf((_font$font3 = font.font) !== null && _font$font3 !== void 0 ? _font$font3 : "Times New Roman")) !== null && _eastAsianFontOf2 !== void 0 ? _eastAsianFontOf2 : widthsOf(font.font)).descent * lineSizeOf(font) / 1e3;
+ var _eastAsianFontOf2, _font$font4;
+ return ((_eastAsianFontOf2 = eastAsianFontOf((_font$font4 = font.font) !== null && _font$font4 !== void 0 ? _font$font4 : "Times New Roman")) !== null && _eastAsianFontOf2 !== void 0 ? _eastAsianFontOf2 : widthsOf(font.font)).descent * lineSizeOf(font) / 1e3;
};
//#endregion
//#region src/text-layout/line-break-rules.ts
@@ -1148,12 +1183,16 @@ var docxLayout = (function(exports) {
* @module
*/
var _excluded$1 = ["unsupported"];
- var DEFAULT_MEASURER = {
+ /**
+ * Measures text with the widths of the fonts in {@link FONT_WIDTHS}, and says which fonts it doesn't have, which it
+ * measures as {@link SIMILAR_FONT_MEASURER} does, so a layout stops at them.
+ */
+ var DEFAULT_MEASURER = _objectSpread2(_objectSpread2({}, {
measureWidth: (text, font) => measureTextWidth(text, font),
measureLineHeight,
measureDescent,
unknownCharacter
- };
+ }), {}, { unknownFont });
var DEFAULT_TAB_STOP = 36;
var TOLERANCE$1 = .01;
var STRETCH_TO_SQUEEZE = 2.04;
@@ -1488,14 +1527,18 @@ var docxLayout = (function(exports) {
*/
var layoutLines = (items, { width, format = {}, tabStops = [], defaultTabStop = DEFAULT_TAB_STOP, markFont = {}, measurer = DEFAULT_MEASURER, breakRules }) => {
const { indentLeft = 0, indentRight = 0, firstLineIndent = 0, lineSpacing, alignment } = format;
- const markHeight = measurer.measureLineHeight(markFont);
+ let markHeight;
+ const markLineHeight = () => {
+ var _markHeight;
+ return (_markHeight = markHeight) !== null && _markHeight !== void 0 ? _markHeight : markHeight = measurer.measureLineHeight(markFont);
+ };
/**
* Whether a line of only pictures is in a paragraph whose mark has a taller line than the pictures' runs, so that how
* tall the line is depends on whether the mark counts. Word hasn't shown that: in its probes the pictures' runs were as
* large as the mark or larger (scripts/layout-probes/word-mixed-heights.ts MH3d, MH7), and beside text the mark doesn't
* count
*/
- const markMatters = ({ ascent, tallest, picture }) => picture > 0 && ascent === 0 && markHeight > tallest + TOLERANCE$1 && (picture < markHeight - TOLERANCE$1 || (lineSpacing === null || lineSpacing === void 0 ? void 0 : lineSpacing.rule) === "multiple" && lineSpacing.multiple !== 1);
+ const markMatters = ({ ascent, tallest, picture }) => picture > 0 && ascent === 0 && markLineHeight() > tallest + TOLERANCE$1 && (picture < markLineHeight() - TOLERANCE$1 || (lineSpacing === null || lineSpacing === void 0 ? void 0 : lineSpacing.rule) === "multiple" && lineSpacing.multiple !== 1);
/** The heights of a line with the text of the token on it too */
const withToken = (heights, token) => {
if (token.type === "box") {
@@ -1725,6 +1768,13 @@ var docxLayout = (function(exports) {
/** Whether a bit is set in a number of flags, such as 0x20 in an OS/2 table's fsSelection */
var hasFlag = (flags, flag) => Math.floor(flags / flag) % 2 === 1;
var tagOf = (view, offset) => String.fromCharCode(view.getUint8(offset), view.getUint8(offset + 1), view.getUint8(offset + 2), view.getUint8(offset + 3));
+ /**
+ * Throws as a read past the end of the file does, for what is read only when text is laid out in the font, so that a
+ * damaged font throws when it is read, rather than when it is laid out
+ */
+ var checkInFile = (view, end) => {
+ if (end > view.byteLength) throw new RangeError(`The font file points past its end, to ${end}`);
+ };
/** Where each table of the font at an offset starts */
var readTables = (view, offset) => new Map(Array.from({ length: view.getUint16(offset + 4) }, (_, index) => {
const record = offset + 12 + index * 16;
@@ -1779,7 +1829,9 @@ var docxLayout = (function(exports) {
if (subtable === void 0) throw new Error("The font has no Unicode character map");
const { offset, format } = subtable;
if (format === 12) {
- const groups = Array.from({ length: view.getUint32(offset + 12) }, (_, index) => {
+ const count = view.getUint32(offset + 12);
+ if (offset + 16 + count * 12 > view.byteLength) throw new Error("The font file is damaged: its character map says it has more ranges of characters than it has room for");
+ const groups = Array.from({ length: count }, (_, index) => {
const group = offset + 16 + index * 12;
return {
start: view.getUint32(group),
@@ -1797,6 +1849,12 @@ var docxLayout = (function(exports) {
const starts = ends + segments * 2 + 2;
const deltas = starts + segments * 2;
const rangeOffsets = deltas + segments * 2;
+ checkInFile(view, rangeOffsets + segments * 2);
+ for (let segment = 0; segment < segments; segment++) {
+ const rangeOffset = view.getUint16(rangeOffsets + segment * 2);
+ const characters = view.getUint16(ends + segment * 2) - view.getUint16(starts + segment * 2) + 1;
+ if (rangeOffset !== 0) checkInFile(view, rangeOffsets + segment * 2 + rangeOffset + characters * 2);
+ }
return (code) => {
const segment = Array.from({ length: segments }, (_, index) => index).find((index) => view.getUint16(ends + index * 2) >= code);
if (segment === void 0 || view.getUint16(starts + segment * 2) > code) return 0;
@@ -1961,6 +2019,7 @@ var docxLayout = (function(exports) {
const lineGap = view.getInt16(hhea + 8);
const metricCount = view.getUint16(hhea + 34);
const hmtx = tables.get("hmtx");
+ checkInFile(view, hmtx + metricCount * 4);
const os2 = tables.get("OS/2");
const fsSelection = os2 === void 0 ? 0 : view.getUint16(os2 + 62);
const windowsHeight = os2 === void 0 ? ascender - descender : view.getUint16(os2 + 74) + view.getUint16(os2 + 76);
@@ -2018,7 +2077,11 @@ var docxLayout = (function(exports) {
throw error;
}
};
- if (tag === COLLECTION_TAG) return read(() => Array.from({ length: view.getUint32(8) }, (_, index) => readFace(view, view.getUint32(12 + index * 4))));
+ if (tag === COLLECTION_TAG) {
+ const count = view.getUint32(8);
+ if (12 + count * 4 > bytes.byteLength) throw new Error("The font file is damaged: it says it has more fonts than it has room for");
+ return read(() => Array.from({ length: count }, (_, index) => readFace(view, view.getUint32(12 + index * 4))));
+ }
if (FONT_TAGS.has(tag)) return read(() => [readFace(view, 0)]);
throw new Error(WEB_FONT_TAGS.has(tag) ? "The font is a web font (WOFF), which is compressed. Give it as a TrueType or OpenType font (.ttf or .otf)" : "The data isn't a TrueType or OpenType font");
};
@@ -2027,7 +2090,8 @@ var docxLayout = (function(exports) {
* Measures text in the fonts of these faces with their own widths, kerning and line height, and text in other fonts with
* `fallback`. Text that is bold, or not, is measured with a face that is too, and with one that is italic, or not, as the
* text is, when there is one. A character a face has no glyph for is one whose width isn't known, as Word draws it in
- * another font, unless it takes no room, such as a soft hyphen.
+ * another font, unless it takes no room, such as a soft hyphen. Text in a font without a face as bold as it is in
+ * a font whose widths aren't known, unless `fallback` knows them, as Word makes that face itself from another.
*/
var createFontFileMeasurer = (faces, fallback = DEFAULT_MEASURER) => {
const chosen = /* @__PURE__ */ new Map();
@@ -2074,6 +2138,10 @@ var docxLayout = (function(exports) {
var _fallback$unknownChar;
const face = faceOf(font);
return face ? [...text].find((character) => character !== " " && !takesNoRoom(character) && face.advanceOf(character.codePointAt(0)) === void 0) : (_fallback$unknownChar = fallback.unknownCharacter) === null || _fallback$unknownChar === void 0 ? void 0 : _fallback$unknownChar.call(fallback, text, font);
+ },
+ unknownFont: (font, text) => {
+ var _fallback$unknownFont;
+ return faceOf(font) === void 0 && ((_fallback$unknownFont = fallback.unknownFont) === null || _fallback$unknownFont === void 0 ? void 0 : _fallback$unknownFont.call(fallback, font, text)) === true;
}
};
};
@@ -4435,6 +4503,24 @@ var docxLayout = (function(exports) {
}, Object.keys(lists).length > 0 ? { breakRules: { lists } } : {}), unsupported ? { unsupported } : {});
};
/**
+ * The faces of the fonts a document embeds, which Word draws text in those fonts in. Each is the face of the font the
+ * document names, of the boldness and italics the document says it is (`w:embedRegular`, `w:embedBold` and the others),
+ * whatever its file says. A file that isn't a font, is damaged, or is a collection of no fonts, is left out, so text in
+ * its font is in a font the layout doesn't know, as it may not be in Word.
+ */
+ var facesOf = (fonts) => fonts.flatMap(({ name, data, bold, italic }) => {
+ try {
+ const [face] = readFontFile(data);
+ return face === void 0 ? [] : [_objectSpread2(_objectSpread2({}, face), {}, {
+ name,
+ bold,
+ italic
+ })];
+ } catch (_unused) {
+ return [];
+ }
+ });
+ /**
* The parts of the document being written, formatted to be read.
*/
var partsOfFile = (context) => {
@@ -4456,7 +4542,13 @@ var docxLayout = (function(exports) {
settings: file.Settings.prepForXml(READING_CONTEXT),
headersAndFooters: new Map([...file.Headers, ...file.Footers].map((wrapper) => [`rId${wrapper.View.ReferenceId}`, Object.values(format(wrapper))[0]])),
footnotes: format(file.FootNotes),
- endnotes: format(file.Endnotes)
+ endnotes: format(file.Endnotes),
+ fonts: facesOf(file.FontTable.options.map(({ name, data }) => ({
+ name,
+ data,
+ bold: false,
+ italic: false
+ })))
};
};
/**
@@ -4659,7 +4751,7 @@ var docxLayout = (function(exports) {
const all = sections.map((_, section) => notePropertiesOf(kind, section));
return all.some(({ restart }) => restart === "eachPage") ? "notes numbered afresh on each page" : all.some(({ restart, start }) => restart !== "eachSect" && start !== all[0].start) ? "notes numbered on from a number of their own in a later section" : kind === "footnote" && all.some(({ position }) => position !== "pageBottom") ? "footnotes put elsewhere than at the bottom of the page" : kind === "endnote" && all.length > 1 && all.some(({ position }) => position !== "docEnd") ? "endnotes at the end of each section" : void 0;
};
- const documentContent = _objectSpread2({
+ const documentContent = _objectSpread2(_objectSpread2({
blocks,
sections,
footnotes,
@@ -4671,7 +4763,7 @@ var docxLayout = (function(exports) {
endnoteNumbers,
relativeReferences: markers.relative,
endnoteReferences
- }, readSettings(parts.settings));
+ }, parts.fonts !== void 0 && parts.fonts.length > 0 ? { fonts: parts.fonts } : {}), readSettings(parts.settings));
return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref21 = (_ref22 = (_ref23 = (_ref24 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : styles.unsupported) !== null && _ref24 !== void 0 ? _ref24 : inNumbering) !== null && _ref23 !== void 0 ? _ref23 : footnotes.size > 0 ? notesUnsupported("footnote") : void 0) !== null && _ref22 !== void 0 ? _ref22 : endnotes.length > 0 ? notesUnsupported("endnote") : void 0) !== null && _ref21 !== void 0 ? _ref21 : unwrittenNumber ? "notes numbered in a format not yet written" : void 0 }));
};
//#endregion
@@ -4750,6 +4842,30 @@ var docxLayout = (function(exports) {
var Unsupported = class extends Error {};
/** Thrown to stop laying out columns being balanced in a height they don't fit in */
var Overflow = class extends Error {};
+ /** The measurers the layout measures with, by those it is given, so the lines laid out with each are kept */
+ var stoppingMeasurers = /* @__PURE__ */ new WeakMap();
+ /**
+ * A measurer that stops the layout where it would measure text in a font it doesn't know, or the height of a line in
+ * one, as it measures them as another font, where Word draws them in their own, or in another again when it doesn't have
+ * them (`word-watertight-text.docx` TX18)
+ */
+ var stoppingAtUnknownFonts = (measurer) => {
+ var _stoppingMeasurers$ge;
+ const { unknownFont } = measurer;
+ if (unknownFont === void 0) return measurer;
+ /** The font, unless the measurer doesn't know it, or this text in it */
+ const known = (font, text) => {
+ if (unknownFont(font, text)) throw new Unsupported("a font not in the width tables");
+ return font;
+ };
+ const stopping = (_stoppingMeasurers$ge = stoppingMeasurers.get(measurer)) !== null && _stoppingMeasurers$ge !== void 0 ? _stoppingMeasurers$ge : _objectSpread2(_objectSpread2({}, measurer), {}, {
+ measureWidth: (text, font) => measurer.measureWidth(text, known(font, text)),
+ measureLineHeight: (font) => measurer.measureLineHeight(known(font)),
+ measureDescent: (font) => measurer.measureDescent(known(font))
+ });
+ stoppingMeasurers.set(measurer, stopping);
+ return stopping;
+ };
/**
* Thrown to lay out the columns of a page again when its footnotes take more room than the columns before the one being
* filled were laid out above (`area`)
@@ -4904,6 +5020,7 @@ var docxLayout = (function(exports) {
})) throw new Unsupported("a character whose width in its font isn't known");
return inline;
};
+ const measuring = stoppingAtUnknownFonts(measurer);
const byParagraph = (_laidOutLines$get = laidOutLines.get(measurer)) !== null && _laidOutLines$get !== void 0 ? _laidOutLines$get : /* @__PURE__ */ new WeakMap();
laidOutLines.set(measurer, byParagraph);
/** A paragraph's lines, broken at a width, or at the width of each line from those given on */
@@ -4921,7 +5038,7 @@ var docxLayout = (function(exports) {
tabStops: paragraph.tabStops,
defaultTabStop,
markFont: paragraph.markFont,
- measurer,
+ measurer: measuring,
breakRules
});
const unknown = laidOut.find((line) => line.unsupported !== void 0);
@@ -4999,7 +5116,7 @@ var docxLayout = (function(exports) {
format: block.format,
tabStops: block.tabStops,
defaultTabStop,
- measurer,
+ measurer: measuring,
breakRules
});
return {
@@ -6668,6 +6785,12 @@ var docxLayout = (function(exports) {
};
//#endregion
//#region src/layout/layout-passes.ts
+ /**
+ * Lays out a document's pages as many times as the page numbers it works out change how its lines wrap, such as those of
+ * a table of contents.
+ *
+ * @module
+ */
var PASSES = 3;
/** The number of pages, which is known only when all of the document was laid out */
var knownPageCount = ({ pageCount, stoppedAt }) => stoppedAt === void 0 ? pageCount : void 0;
@@ -6683,12 +6806,13 @@ var docxLayout = (function(exports) {
* last. Each pass is laid out with the numbers of the pass before, so the last pass's numbers are those it was laid out
* with only when they stop changing. When they still change after three passes, as when a table of contents wraps one
* way with a number and the other way without it, none can be written, so it gives the first pass, laid out without them,
- * as not settled.
+ * as not settled. Text in the fonts the document embeds is measured from their files, and the rest with `measurer`.
*/
- var layOutPasses = (content, measurer) => {
+ var layOutPasses = (content, measurer = DEFAULT_MEASURER) => {
+ const measuring = content.fonts === void 0 ? measurer : createFontFileMeasurer(content.fonts, measurer);
const layOut = (before, pass, first, earlierPlaces) => {
const pagination = paginate(content, {
- measurer,
+ measurer: measuring,
pageNumbers: before === null || before === void 0 ? void 0 : before.bookmarks,
places: before === null || before === void 0 ? void 0 : before.places,
earlierPlaces,
@@ -6746,9 +6870,11 @@ var docxLayout = (function(exports) {
};
/**
* A measurer that measures widths with a function, and lines' heights and descents with the width tables, as Word works
- * them out from the font's height and the paragraph's spacing.
+ * them out from the font's height and the paragraph's spacing. The height of a line in a font that isn't in the tables
+ * isn't known, so a layout stops at text in one.
*/
var measurerOf = (measureWidth) => ({
+ unknownFont: (font) => unknownFont(font),
measureWidth: (text, { font = DEFAULT_FONT, size = 10, bold = false, italic = false, characterSpacing = 0, scale = 100 }) => {
const widthOf = (part) => part.length === 0 ? 0 : measureWidth(part, {
name: font,
@@ -6803,13 +6929,71 @@ var docxLayout = (function(exports) {
}];
});
};
+ var EMBEDDED_FACES = [
+ [
+ "w:embedRegular",
+ false,
+ false
+ ],
+ [
+ "w:embedBold",
+ true,
+ false
+ ],
+ [
+ "w:embedItalic",
+ false,
+ true
+ ],
+ [
+ "w:embedBoldItalic",
+ true,
+ true
+ ]
+ ];
+ /**
+ * A font file as a document embeds it: its first 32 bytes mixed with the bytes of its key (`w:fontKey`), a GUID, from
+ * the last to the first, as Word obfuscates the fonts it embeds, and docx does. Undefined for a key that isn't a GUID.
+ */
+ var deobfuscated = (bytes, fontKey) => {
+ if (fontKey === void 0) return bytes;
+ const digits = String(fontKey).replace(/[{}-]/g, "");
+ if (!/^[0-9a-f]{32}$/i.test(digits)) return;
+ const key = Array.from({ length: 16 }, (_, index) => parseInt(digits.slice(30 - index * 2, 32 - index * 2), 16));
+ return bytes.map((byte, index) => index < 32 ? byte ^ key[index % 16] : byte);
+ };
+ /**
+ * The font files a document embeds, from its font table (`w:fonts`) and the files the table's relationships refer to.
+ */
+ var embeddedFontsOf = (parts, binaryParts, fontTablePath) => {
+ const fontTable = rootOf(parts.get(fontTablePath));
+ const relationships = relationshipsOf(parts, fontTablePath);
+ return childrenOf(fontTable && contentOf$1(fontTable)).filter((child) => "w:font" in child).flatMap((child) => {
+ const name = attributesOf(child["w:font"])["w:name"];
+ const faces = childrenOf(child["w:font"]);
+ return EMBEDDED_FACES.flatMap(([element, bold, italic]) => {
+ var _relationships$find;
+ const { "r:id": id, "w:fontKey": fontKey } = attributesOf(find(faces, element));
+ const path = (_relationships$find = relationships.find((relationship) => relationship.id === id)) === null || _relationships$find === void 0 ? void 0 : _relationships$find.path;
+ const bytes = path === void 0 ? void 0 : binaryParts.get(path);
+ const data = bytes && deobfuscated(bytes, fontKey);
+ return name === void 0 || data === void 0 ? [] : [{
+ name: String(name),
+ data,
+ bold,
+ italic
+ }];
+ });
+ });
+ };
/**
* Reads a .docx's main document, with the parts it refers to.
*
* @param parts - The XML parts of its package, parsed by xml-js's `xml2js`, not compact and keeping the spaces between
* elements, by their paths, such as "word/document.xml"
+ * @param binaryParts - Its other parts, such as the fonts it embeds, by their paths
*/
- var readDocx = (parts) => {
+ var readDocx = (parts, binaryParts = /* @__PURE__ */ new Map()) => {
var _relationshipsOf$find, _relationshipsOf$find2, _partOf, _find;
const documentPath = (_relationshipsOf$find = (_relationshipsOf$find2 = relationshipsOf(parts, "").find(({ type }) => type === "officeDocument")) === null || _relationshipsOf$find2 === void 0 ? void 0 : _relationshipsOf$find2.path) !== null && _relationshipsOf$find !== void 0 ? _relationshipsOf$find : DEFAULT_DOCUMENT;
const relationships = relationshipsOf(parts, documentPath);
@@ -6818,6 +7002,7 @@ var docxLayout = (function(exports) {
return relationship && rootOf(parts.get(relationship.path));
};
const theme = partOf("theme");
+ const fontTable = relationships.find((relationship) => relationship.type === "fontTable");
const documentParts = {
styles: readTextStyles((_partOf = partOf("styles")) !== null && _partOf !== void 0 ? _partOf : { "w:styles": [] }, theme && readThemeFonts(theme)),
numbering: partOf("numbering"),
@@ -6827,7 +7012,8 @@ var docxLayout = (function(exports) {
return part ? [[id, contentOf$1(part)]] : [];
})),
footnotes: partOf("footnotes"),
- endnotes: partOf("endnotes")
+ endnotes: partOf("endnotes"),
+ fonts: fontTable === void 0 ? [] : facesOf(embeddedFontsOf(parts, binaryParts, fontTable.path))
};
const document = rootOf(parts.get(documentPath));
return readContent({ "w:body": (_find = find(childrenOf(document && contentOf$1(document)), "w:body")) !== null && _find !== void 0 ? _find : [] }, documentParts);
@@ -6835,7 +7021,7 @@ var docxLayout = (function(exports) {
//#endregion
//#region src/layout/estimate-page-numbers.ts
/** What a document is read into: a template patchDocument patched, or the body of a document being written */
- var contentOf = (document, context) => "parts" in document ? readDocx(document.parts) : (context === null || context === void 0 ? void 0 : context.file) && readDocument(document, context);
+ var contentOf = (document, context) => "parts" in document ? readDocx(document.parts, document.binaryParts) : (context === null || context === void 0 ? void 0 : context.file) && readDocument(document, context);
/** Lays out the pages until their page numbers stop changing, with a measurer. Gives none when they don't */
var estimateWith = (content, measurer) => {
const pagination = content && layOutPasses(content, measurer);
@@ -6860,19 +7046,21 @@ var docxLayout = (function(exports) {
* ```
*
* The pages are laid out with the widths and heights of the fonts Word documents use most, such as Calibri, Cambria,
- * Arial and Times New Roman. To measure text in other fonts, such as Aptos, from their files, use
+ * Arial and Times New Roman, and of those made as wide, such as Carlito, and text in the fonts the document embeds is
+ * measured from their files. To measure text in other fonts, such as Aptos, from their files, use
* {@link estimatePageNumbersWith}. It follows paragraphs' spacing, indents, line spacing, tab stops and keep settings, widow
* and orphan control, lists, pictures in the line, tables, whose rows break across pages, footnotes and endnotes, page,
* column and section breaks, and each section's page size, margins, columns, headers, footers and page numbering.
*
* It stops at the first thing it can't lay out yet: a drawing or table that text flows around, a text box or frame, an
* equation, a footnote that continues on the next page, columns evened out before a continuous section break, a table
- * row kept whole that is taller than a page, a character whose width in its font isn't known, such as a mathematical
- * symbol in Calibri, which Word draws in Cambria Math, or a date in the text, which Word writes when it opens the document.
- * The page references to bookmarks after it are left blank, for Word to fill in when it updates the fields. A document in
- * compatibility mode, which Word lays out as an older version of Word did, isn't laid out at all. When laying the pages
- * out again with the page numbers it worked out still changes them after three passes, as when a table of contents wraps
- * one way with a number and the other way without it, all of them are left blank.
+ * row kept whole that is taller than a page, text in a font that isn't in the width tables and isn't embedded, such as
+ * Aptos, a character whose width in its font isn't known, such as a mathematical symbol in Calibri, which Word draws in
+ * Cambria Math, or a date in the text, which Word writes when it opens the document. The page references to bookmarks
+ * after it are left blank, for Word to fill in when it updates the fields. A document in compatibility mode, which Word
+ * lays out as an older version of Word did, isn't laid out at all. When laying the pages out again with the page numbers
+ * it worked out still changes them after three passes, as when a table of contents wraps one way with a number and the
+ * other way without it, all of them are left blank.
*
* Page references are written as Word writes them, with `\p` ("above", "below" or "on page 4") and in formats of their
* own, such as `\* roman`, and so are numbers of pages. Page references, tables of contents and SEQ fields (caption
diff --git a/live-examples/lib/shapes.iife.js b/live-examples/lib/shapes.iife.js
index fa279b99eb..7ae4cead57 100644
--- a/live-examples/lib/shapes.iife.js
+++ b/live-examples/lib/shapes.iife.js
@@ -3374,18 +3374,25 @@ var docxShapes = (function(exports, docx) {
/**
* Estimates how much space text takes up, from the widths of the characters in common fonts.
*
- * The estimate is close for the fonts in {@link FONT_WIDTHS}. Other fonts are measured with the one most like them,
- * so their estimates are rougher. Kerning and ligatures are left out, which makes text a little wider than Word draws it.
+ * The estimate is close for the fonts in {@link FONT_WIDTHS}, and those made with the same widths, such as Carlito.
+ * Other fonts are measured with the one most like them, so their estimates are rougher, and {@link unknownFont} says
+ * which they are. Kerning and ligatures are left out, which makes text a little wider than Word draws it.
*
* @module
*/
var DEFAULT_FONT = "Times New Roman";
var TAB_STOP = 36;
- var SIMILAR_FONTS = [
- [/^(carlito|calibri light|segoe ui|candara|corbel)$/i, "Calibri"],
+ var SAME_WIDTHS = [
+ [/^carlito$/i, "Calibri"],
[/^caladea$/i, "Cambria"],
+ [/^(liberation sans|arimo|helvetica)$/i, "Arial"],
+ [/^(liberation serif|tinos)$/i, "Times New Roman"],
+ [/^(liberation mono|cousine)$/i, "Courier New"]
+ ];
+ var SIMILAR_FONTS = [
+ [/^(calibri light|segoe ui|candara|corbel)$/i, "Calibri"],
[/mono|courier|consolas|code|typewriter/i, "Courier New"],
- [new RegExp("times|tinos|liberation serif|georgia|garamond|palatino|book antiqua|(? Array.from({ length: last - first + 1 }, (_, offset) => first + offset));
var CHARACTER_INDEX = new Map(CHARACTERS.map((code, index) => [code, index]));
@@ -3587,26 +3594,35 @@ var docxShapes = (function(exports, docx) {
];
var EAST_ASIAN_NAME = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]|hiragino|cjk|source han|pingfang|songti|heiti|kaiti|fangsong|mincho|mingliu|simhei|gungsuh|nanum/i;
var EAST_ASIAN_SANS = /gothic|ゴシック|hei|黑|黒|sans|고딕|pingfang/i;
+ /** The East Asian font in the table a font is, by any of its names. Undefined for other fonts */
+ var knownEastAsianFontOf = (font) => {
+ const name = font.toLowerCase();
+ return EAST_ASIAN_FONTS.find((candidate) => [candidate.name, ...candidate.aliases].some((alias) => alias.toLowerCase() === name));
+ };
/**
* The East Asian font a font is, or is measured as, by its name. Undefined for other fonts.
*/
var eastAsianFontOf = (font) => {
- const name = font.toLowerCase();
- const known = EAST_ASIAN_FONTS.find((candidate) => [candidate.name, ...candidate.aliases].some((alias) => alias.toLowerCase() === name));
+ var _knownEastAsianFontOf;
const similar = EAST_ASIAN_SANS.test(font) ? "MS Gothic" : "MS Mincho";
- return known !== null && known !== void 0 ? known : EAST_ASIAN_NAME.test(font) ? EAST_ASIAN_FONTS.find((candidate) => candidate.name === similar) : void 0;
+ return (_knownEastAsianFontOf = knownEastAsianFontOf(font)) !== null && _knownEastAsianFontOf !== void 0 ? _knownEastAsianFontOf : EAST_ASIAN_NAME.test(font) ? EAST_ASIAN_FONTS.find((candidate) => candidate.name === similar) : void 0;
};
/** Whether a font is one for Chinese, Japanese or Korean text */
var isEastAsianFont = (font) => font !== void 0 && eastAsianFontOf(font) !== void 0;
+ var named = (name) => FONT_WIDTHS.find((known) => known.name.toLowerCase() === name.toLowerCase());
+ /** The widths of a font in the table, or of a font with the same widths as one. Undefined for other fonts */
+ var exactWidthsOf = (font) => {
+ const same = SAME_WIDTHS.find(([pattern]) => pattern.test(font));
+ return named(same ? same[1] : font);
+ };
/**
* The widths to measure a font with: its own, or those of the most similar font in the table.
- * Sans-serif fonts that aren't in the table, such as Aptos and Helvetica, are measured as Arial.
+ * Sans-serif fonts that aren't in the table, such as Aptos, are measured as Arial.
*/
var widthsOf = (font = DEFAULT_FONT) => {
- var _named;
- const named = (name) => FONT_WIDTHS.find((known) => known.name.toLowerCase() === name.toLowerCase());
+ var _exactWidthsOf;
const similar = SIMILAR_FONTS.find(([pattern]) => pattern.test(font));
- return (_named = named(font)) !== null && _named !== void 0 ? _named : named(similar ? similar[1] : "Arial");
+ return (_exactWidthsOf = exactWidthsOf(font)) !== null && _exactWidthsOf !== void 0 ? _exactWidthsOf : named(similar ? similar[1] : "Arial");
};
/** The widths of the face text is in: its font's, bold, italic, both or neither */
var faceOf = ({ font, bold, italic }) => {
@@ -3630,6 +3646,7 @@ var docxShapes = (function(exports, docx) {
if (isHalfWidth(code)) return 500;
return takesNoRoom(character) ? 0 : AVERAGE_LETTERS.reduce((total, letter) => total + widths[letter], 0) / AVERAGE_LETTERS.length;
};
+ var isPrivate = (code) => code >= 57344 && code <= 63743;
var FULL_WIDTH_SYMBOLS = /* @__PURE__ */ new Set([..."§¨°±´¶×÷‐―‖‘’“”†‡‥…‰′″※℃Å"]);
/**
* The width of a character of a monospaced East Asian font, in thousandths of an em: an em for ideographs and the symbols
@@ -3659,6 +3676,39 @@ var docxShapes = (function(exports, docx) {
};
};
/**
+ * The first character of text whose width in its font isn't known, so isn't what Word lays out: one of the tables'
+ * characters that Word draws in another font when the font doesn't have it, or whose width Word's PDF doesn't show, or a
+ * symbol font's own character. Undefined when the widths of all of them are known, or are measured as before: those of
+ * characters the tables don't have, as an average letter.
+ */
+ var unknownCharacter = (text, font = {}) => {
+ const { widths, monospaced } = measuresOf(font);
+ return [...text].find((character) => {
+ const code = character.codePointAt(0);
+ const index = CHARACTER_INDEX.get(code);
+ return index === void 0 || monospaced ? isPrivate(code) : widths[index] === void 0;
+ });
+ };
+ /**
+ * Whether the tables measure text in a font as another font, as they don't have the font's own widths: a font that isn't
+ * in them and isn't made with the same widths as one that is, such as Aptos, which they measure as the most similar
+ * font that is. Word draws it with its own widths when it has it, and in another font when it doesn't, such as Cambria
+ * on the Mac (`word-watertight-text.docx` TX18), so a layout stops there rather than guessing. The East Asian fonts of
+ * the tables are measured as themselves, but for the other characters of those that aren't monospaced, such as Latin
+ * letters in Yu Gothic, which are measured as Times New Roman or Arial. Without text, whether the height of a line in
+ * the font is another font's.
+ */
+ var unknownFont = (font = {}, text) => {
+ var _font$font2;
+ const name = (_font$font2 = font.font) !== null && _font$font2 !== void 0 ? _font$font2 : DEFAULT_FONT;
+ const eastAsian = knownEastAsianFontOf(name);
+ if (eastAsian === void 0) return exactWidthsOf(name) === void 0;
+ return !eastAsian.monospaced && text !== void 0 && [...text].some((character) => {
+ const code = character.codePointAt(0);
+ return !isWide(code) && !isHalfWidth(code) && !takesNoRoom(character);
+ });
+ };
+ /**
* How wide a line of text is, in points. Tabs move to the next half inch, counted from the start of the line.
*
* @param start - Where the text starts on its line, in points
@@ -3674,8 +3724,17 @@ var docxShapes = (function(exports, docx) {
* How tall a line of single-spaced text is, in points.
*/
var measureLineHeight = (font = {}) => {
- var _eastAsianFontOf, _font$font2;
- return ((_eastAsianFontOf = eastAsianFontOf((_font$font2 = font.font) !== null && _font$font2 !== void 0 ? _font$font2 : "Times New Roman")) !== null && _eastAsianFontOf !== void 0 ? _eastAsianFontOf : widthsOf(font.font)).lineHeight * lineSizeOf(font) / 1e3;
+ var _eastAsianFontOf, _font$font3;
+ return ((_eastAsianFontOf = eastAsianFontOf((_font$font3 = font.font) !== null && _font$font3 !== void 0 ? _font$font3 : "Times New Roman")) !== null && _eastAsianFontOf !== void 0 ? _eastAsianFontOf : widthsOf(font.font)).lineHeight * lineSizeOf(font) / 1e3;
+ };
+ /**
+ * How far a line of single-spaced text goes below its baseline, in points. The rest of the line is above it, with the
+ * font's line gap at the top, where Word puts it: Arial 11 with Courier New 11 is 272.42 twips, Arial's ascent and gap and
+ * Courier New's descent (scripts/layout-probes/word-mixed-heights.ts MH2a).
+ */
+ var measureDescent = (font = {}) => {
+ var _eastAsianFontOf2, _font$font4;
+ return ((_eastAsianFontOf2 = eastAsianFontOf((_font$font4 = font.font) !== null && _font$font4 !== void 0 ? _font$font4 : "Times New Roman")) !== null && _eastAsianFontOf2 !== void 0 ? _eastAsianFontOf2 : widthsOf(font.font)).descent * lineSizeOf(font) / 1e3;
};
/**
* Splits spans into words and the spaces between them. A word can be made of pieces of several spans, such as a bold
@@ -4364,6 +4423,12 @@ var docxShapes = (function(exports, docx) {
}
return i;
}
+ _objectSpread2(_objectSpread2({}, {
+ measureWidth: (text, font) => measureTextWidth(text, font),
+ measureLineHeight,
+ measureDescent,
+ unknownCharacter
+ }), {}, { unknownFont });
//#endregion
//#region src/shapes/shape-floating.ts
/**
diff --git a/usage/layout.md b/usage/layout.md
index a428dacaa6..6361fbe42a 100644
--- a/usage/layout.md
+++ b/usage/layout.md
@@ -228,6 +228,7 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- a table row kept with the next before a row that then moves to the next page whole, such as one of a height that doesn't fit
- a table whose rows give a column different widths, a table given no widths of more than 63 columns, more than Word allows, and, in a table whose cells all have widths, a word longer than the table can make room for, a long word in a table wider than its cells, or one in a table with cells merged across its columns
- a long word in a cell merged across the columns of a table given no widths, which Word makes room for in a way not yet followed: a word longer than those columns' longest words together, when the table is narrowed to fit, or than their longest lines together, when more than one of them has anything in it
+- text in a font that isn't in the width tables, isn't given as a file (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) and isn't embedded in the document, such as Aptos, Georgia or Calibri Light, so its lines may not be where Word puts them: Word draws it with the font's own widths, or in another font when it doesn't have it, such as Cambria on the Mac. Bold text in a font given or embedded without a bold face stops too, as Word makes the bold face itself
- a character whose width in its font isn't known, so its line may not be where Word puts it: a letter or symbol its font doesn't have, or its font's file has no glyph for, which Word draws in another font, such as most mathematical symbols in Calibri, Arial and Courier New, which Word draws in Cambria Math; a few that Word drew in a way their widths can't be read from, such as Ž and Ё in Courier New; and a symbol font's own symbol, such as Wingdings' tick (`SymbolRun`), or a symbol whose character isn't four hexadecimal digits
- a document that hyphenates its words, compresses its punctuation, or uses Word's strict rules for the characters that can't start a line
- borders Word hasn't been seen to draw, or to lay out in a box: a style such as thin and thick lines with a medium gap or an art border, thin and thick lines narrower than half a point or wider than 2¼, a shadow on a style other than single, or a frame; two paragraphs with the same borders but for a border between them; a box of borders that goes on across a section break, or past a page break before a paragraph in it; and a border in a footnote, or on the empty paragraph that ends a section
@@ -252,7 +253,7 @@ A wrong page number is worse than a blank one, so it doesn't guess.
## How close it is
-Text in fonts other than those five is measured as the most similar of them, so its page numbers are rougher. Aptos, Office's default font since 2023, is measured as Arial. Given the fonts' files, text is measured in them as Word measures it (see [Measuring fonts from their files](#measuring-fonts-from-their-files)), and in a browser, it can be measured in the fonts the page has instead (see [Measuring with a page's fonts](#measuring-with-a-pages-fonts)). Characters the width tables don't have, such as Hebrew, Arabic and Thai letters, box drawing, shapes such as the bullets ● and ■, and emoji, are measured as an average letter of the font, or an em for emoji, and East Asian fonts Office doesn't have as MS Mincho or MS Gothic.
+Text in fonts made with the same widths as those five is measured exactly as them: Carlito as Calibri, Caladea as Cambria, Liberation Sans, Arimo and Helvetica as Arial, Liberation Serif and Tinos as Times New Roman, and Liberation Mono and Cousine as Courier New. Text in the fonts the document embeds (`fonts`) is measured from their files, as Word draws it in them. Text in other fonts, such as Aptos, Office's default font since 2023, stops the layout (see [What it leaves blank](#what-it-leaves-blank)), unless their files are given (see [Measuring fonts from their files](#measuring-fonts-from-their-files)). Characters the width tables don't have, such as Hebrew, Arabic and Thai letters, box drawing, shapes such as the bullets ● and ■, and emoji, are measured as an average letter of the font, or an em for emoji. The Latin letters of the East Asian fonts that aren't monospaced, such as Yu Gothic, and East Asian fonts Office doesn't have stop the layout too.
Each change to `docx/layout` is checked against LibreOffice's layout of a set of documents, and against the pages Word marked in documents it saved. Word lays out some things differently from LibreOffice, so turn `updateFields` on if the page numbers must be Word's own once the document is opened in Word: Word then asks to update the fields, and works them out again. LibreOffice rounds the height of each line to whole twips, 269 for Calibri 11, so where a line only just fits on a page, it can be on the next page in LibreOffice and on this one in Word, and in `docx/layout`, which follows Word.
@@ -260,7 +261,7 @@ Laying out a document takes about 0.3 seconds per 100 pages in Node.
## Measuring with a page's fonts
-By default, text is measured with tables of the widths of the characters of those five fonts, which `docx/layout` has with it, so it lays out the same pages in Node and in every browser. In a browser, it can measure text in the fonts the page has instead, with [Pretext](https://github.com/chenglou/pretext), which measures text with a canvas. That helps when the document is in a font that isn't in the tables, such as Aptos, and the page has it.
+By default, text is measured with tables of the widths of the characters of those five fonts, which `docx/layout` has with it, so it lays out the same pages in Node and in every browser. In a browser, it can measure text in the fonts the page has instead, with [Pretext](https://github.com/chenglou/pretext), which measures text with a canvas.
`docx` doesn't come with Pretext. Install it (`npm install @chenglou/pretext`), give its module to `measureWithPretext`, and give what that returns to `estimatePageNumbersWith`, as `measureWidth`:
@@ -295,10 +296,10 @@ const doc = new Document({
});
```
-Pretext only measures how wide words and spaces are. The rest is laid out as Word lays it out: lines break where Word breaks them, rather than where a browser would, tabs move to the paragraph's tab stops, and lines are as tall as Word makes them. Their heights still come from the tables, so the lines of a font that isn't in them are as tall as those of the most similar font that is.
+Pretext only measures how wide words and spaces are. The rest is laid out as Word lays it out: lines break where Word breaks them, rather than where a browser would, tabs move to the paragraph's tab stops, and lines are as tall as Word makes them. Their heights still come from the tables, so the layout stops at text in a font that isn't in them, such as Aptos, as how tall Word makes its lines isn't known, unless its file is given too (see [Measuring fonts from their files](#measuring-fonts-from-their-files)) or the document embeds it.
- Pretext needs a canvas to measure with: an `OffscreenCanvas`, or a page's. Node has neither, so use `estimatePageNumbers` there.
-- Load the fonts before the document is written, such as with `document.fonts.load('11pt "Aptos"')`. A font that hasn't loaded is measured as the browser's default font, and Pretext keeps the widths it measured.
+- Load the fonts before the document is written, such as with `document.fonts.load('11pt "Calibri"')`. A font that hasn't loaded is measured as the browser's default font, and Pretext keeps the widths it measured.
- A font the page has under another name, such as a web font, is measured in the CSS font family `fontFamilies` gives it. Fonts not in it are measured in the font of their own name, or the browser's default font when the page doesn't have one.
- The page numbers are only as close to Word's as the page's fonts are to the fonts Word has. Laid out in Chrome with Word's own fonts, the headings of the documents `docx/layout` is checked against were all on Word's page.
@@ -344,9 +345,26 @@ const doc = new Document({
In a browser, give it the bytes of a file the page fetched, such as `await (await fetch("Aptos.ttf")).arrayBuffer()`. `docx` doesn't come with any font files.
- **The files** are TrueType or OpenType fonts (`.ttf` or `.otf`), or collections of them (`.ttc`), as bytes: a `Uint8Array`, such as a Node `Buffer`, or an `ArrayBuffer`. Web fonts (`.woff` and `.woff2`) are compressed, and can't be read.
-- **Each file is one face of a font,** such as Aptos Bold, and its name and whether it is bold or italic are read from it. Give a file for each face the document uses. Bold text in a font without a bold file is measured as it would be without the files, and italic text without an italic file is measured with the upright one. To measure a font with a file of another name, give the name the document uses, such as `{ data: carlito, name: "Calibri" }`.
+- **Each file is one face of a font,** such as Aptos Bold, **or a collection of faces,** such as Cambria and Cambria Math in `cambria.ttc`, each of which is measured. The name of each face and whether it is bold or italic are read from it. Give a file for each face the document uses. Bold text in a font without a bold file is measured as it would be without the files, so it stops the layout when the font isn't in the width tables, as Word makes the bold face itself, and italic text without an italic file is measured with the upright one. To measure a font with a file of another name, give the name the document uses, such as `{ data: carlito, name: "Calibri" }`, which every face in the file is given.
- **Widths** are the font's own. The layout stops at a character the file has no glyph for, as Word draws it in another font (see [What it leaves blank](#what-it-leaves-blank)).
- **Kerning** is applied as Word applies it: only to text that asks for it, with `kern` on a run or a style (`w:kern`), and only to text of that size or larger. `kern: 2` kerns text from 1 point, as Word's own Normal template does. The pairs are the font's, from its `GPOS` table, or its `kern` table when it has no `GPOS` table, and pairs across runs in the same font are kerned too.
- **The height of a line** is the font's, as Word works it out: its ascent and descent for Windows and the gap between lines it adds to them, or its typographic ascent, descent and line gap when the font says to use them, as Aptos does. The line goes that descent below its baseline, with the gap above the text, which is what a line of it and another font, or a picture, is made from.
Text in fonts without files is measured as it is without them: with the width tables, or as `measureWidth` measures it when it is given too.
+
+### Fonts the document embeds
+
+Text in the fonts a document embeds is measured from the files it embeds, with nothing more given to the estimator: the fonts `docx` embeds with the `fonts` option, each as the regular face of the font of the name it is given, and those a template Word saved embeds ("Embed fonts in the file"), each as the face Word embedded it as. Bold text in a font embedded without a bold face stops the layout, as it does with a file given without one. A file the document embeds that isn't a font, or is damaged, is left out, so text in its font stops the layout. When a font the document embeds is given as a file too, the document's own file is measured.
+
+```ts
+import { readFile } from "node:fs/promises";
+import { Document } from "docx";
+import { estimatePageNumbers } from "docx/layout";
+
+const doc = new Document({
+ pageNumbers: estimatePageNumbers,
+ fonts: [{ name: "Pacifico", data: await readFile("Pacifico.ttf") }],
+ styles: { default: { document: { run: { font: "Pacifico", size: 22 } } } },
+ sections: [...],
+});
+```
The unique identifier for this abstract numbering definition.