diff --git a/api/classes/charts.ChartDataPatch.html b/api/classes/charts.ChartDataPatch.html
index db01c7dc35..4dbd065492 100644
--- a/api/classes/charts.ChartDataPatch.html
+++ b/api/classes/charts.ChartDataPatch.html
@@ -45,7 +45,7 @@ placeholder in the document's text is left as it is.
diff --git a/api/classes/index.AbstractNumbering.html b/api/classes/index.AbstractNumbering.html
index b29dbbcbe1..d18798f2de 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 8201604f43..ee2350248c 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 6094c6b68f..62ef6d6108 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 58577d3333..8cc8efdd7f 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 58500228d4..47524fd466 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 abb9ef1a7e..87fff46252 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 894e36a39c..15e86702a9 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 bca824adca..b33f1475cb 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 59a9f1a7c3..12722f72d2 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 243ae1b7c0..deb82ea6b7 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 e9a6a38370..6cfd8cfe07 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 00fab53511..13936fecac 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 2f0beb434b..72ee5e2229 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 69432c3f72..78aa6531e8 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 2d912ca910..844a1f4401 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 bbf9fb1c62..4798695ea9 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 31c25d9ed4..2da20cc6c3 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 1de86cedd9..08b997f6e3 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 f53857169a..c76d97b5a0 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 99eddf367d..eae32f4256 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 7d89786f32..d7b1f05136 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 6bb974f2dd..c26e7a9094 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 a05b85bc2e..b8b33c6fee 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 db914db9e0..35e44dae30 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 e3da95699c..3951480e6d 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 d85fe98e36..66fc496397 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 8a6af7aca7..44ecddf6db 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 ff746e9e6b..77decc4764 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 55dd8732d0..17c4165ade 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 5e34cc43d4..727e3bcf99 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 45c5b2cc82..82a3d8e43b 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 e91727eaf8..6badd0bca7 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 b8ccdbd299..68323ff528 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 8e7c1bf946..4de865f334 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 9080b17471..77c5d70d69 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 c54bb47bb9..9191398a73 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 06c037d552..d87d83a7a5 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 d8de686d70..9d13c523bb 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 49d51a08d6..1072d65d44 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 3b811a3dd2..3572d63804 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 361cb74ae7..aabb1a0359 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 18f34e2804..0c37b1fb02 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 b33ed81b54..ff62f58a35 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 9d688f6623..2feae28323 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 8e95eed580..80cc221a04 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 8d9275db9f..8b92eeb1d7 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 041664061f..b58366a8f8 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 7f19779e3b..44272a6df0 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 c84c24dce9..0647f670a9 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 b33c4b5e05..ef9b287729 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 0f7792ba28..e0473f8043 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 fd224a922d..220bd1bd4a 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 f8d3239a25..89b7e2fc89 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 3557bfd29d..585c02ba60 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 b8e14bcf68..3023fc42e8 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 d55f1679b0..b94830d696 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 a631878492..b234b66450 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 e16413544c..eb61a16e4d 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 073e604566..200ecfe4a4 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 18cee1aafb..2472639655 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 29b1e2338c..2927492b8a 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 d4ef3de6fb..f124640acc 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 b4d6061667..9403c9d26b 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 82fd4c3baf..1224a9c568 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 69be21247e..fdc301d039 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 ae074926ea..8605e87059 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 a42fcca9a4..5499f36b65 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 5fb25e1e69..7d96bc9eff 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 bfdb7618b1..86bcfac8de 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 1841156182..b695abdc96 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 9ba2462f27..3f45646bdd 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 8fe100165b..479573eab8 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 e5629c16a2..ed8281b1aa 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 15ba9b3eb1..e4a8dfb3dc 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 9585444c2e..df240e925c 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 4088f0a3ce..fd3748890a 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 beedfea633..5355f59873 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 b8e0b776cb..6b615b2280 100644
--- a/api/classes/math.MathBrackets.html
+++ b/api/classes/math.MathBrackets.html
@@ -29,7 +29,7 @@ with what they hold.
diff --git a/api/classes/math.MathLargeOperator.html b/api/classes/math.MathLargeOperator.html
index 4c70f97c8b..c7b2c40217 100644
--- a/api/classes/math.MathLargeOperator.html
+++ b/api/classes/math.MathLargeOperator.html
@@ -28,7 +28,7 @@ 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 32c9f0b6b7..29c1a4ad40 100644
--- a/api/classes/math.MathMatrix.html
+++ b/api/classes/math.MathMatrix.html
@@ -30,7 +30,7 @@ and Pages centre every column.
diff --git a/api/classes/math.MathPhantom.html b/api/classes/math.MathPhantom.html
index b99245cbe0..6969d02c54 100644
--- a/api/classes/math.MathPhantom.html
+++ b/api/classes/math.MathPhantom.html
@@ -28,7 +28,7 @@ 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 1a9a9cca47..3700861b61 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 9878e7749b..7a021e54a4 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 e1ab6663bd..bc7b74b0f9 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 85e69432e0..7a65d79c3c 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 0b94d08077..a3aee87461 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 09eeae2bc7..d5fd7181d4 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 19d95a01f7..66afabe0dc 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 93b6892515..3990249475 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 12c33cadbb..58bdb828cf 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 0c3fbb5931..52091c9a1a 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 30b5175dfa..4cda28f552 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 b667d751a3..2c656590f3 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 2e45309eec..3318abed79 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 9d18011e9a..f12c3b2669 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 29dc9f2930..3fe4a451f7 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 a390d087c1..d36894ddbb 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 7dd48e079d..2cf2f4b943 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 2e49530672..b76dbe54c0 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 c50adec6a6..45686fb54f 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 44fa5b2cfd..006b479fa3 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 ea1dab035a..b082f19d84 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 e6d105c2e6..8f0e902819 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 c98bb75df3..160349fa2e 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 f14636dd0e..77ad6288d9 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 12c21f9360..a5e5fd3eb0 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 356f2e28a8..a9ae61c0ba 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 92e0275ebd..8af5597cd8 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 bba685eff3..5819c0086e 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 1579c44985..57b667692f 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 6dc99ba002..1592aa7dc4 100644
--- a/api/functions/layout.layoutDocument.html
+++ b/api/functions/layout.layoutDocument.html
@@ -40,7 +40,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 d88e964ca2..d0651cf0c0 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 467b52ea25..1c9b6bbbec 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 71f8dd09e0..616bd471c8 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 ca57be8a89..a6baa226dc 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 5392f7ab1a..bca712721d 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 7b7254cd8f..fdbd2ebe39 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 8b3991bbff..f0bd95e6a0 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 b76275a67c..35278f1a67 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 b99b1c9e2c..dbb3156b89 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 4a4b93b0d4..dd81683a33 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 9c7c64e17f..1a27a7518d 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 fa122250dd..8b7b19873d 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 bd78ada83e..22c52935be 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 a193be4163..dd4d27250e 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 a92926fc6b..0debd0bfba 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 f71b8d156e..76872b850e 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 62892d2ca8..ed437ee5a6 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.
@@ -63,14 +63,14 @@ name. The page references to a bookmark that isn't in it are left blank.
the first of them on may not be Word's. Nothing of them is written into the document.
+
@@ -88,7 +88,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 60a4467049..c5eee953e7 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 0384118ba4..a444c5782a 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 6ed517b577..8d60f0e1cf 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 54ae2f1138..a550e171d6 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 2108fd8bb2..04980de10e 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 ca378b57f0..ae8e62a715 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 ddf19e6874..9b1e4bbea4 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 d668ed5dbd..52822bb2b4 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 79329d00f9..968b7319aa 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 5ce603d174..d4b4224caa 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 f6f1308338..ed41be0010 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 047b2180f0..cc13d7df67 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 9da96c3047..8ca92e6ebb 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.
@@ -57,7 +57,7 @@ when it opens it, unzipped and read as the template is, by its path in the templ
(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 ac67e4b015..f844fc09a9 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 00471b8d96..41859d11db 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 071eca9e24..86822a1995 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.
@@ -63,7 +63,7 @@ nearest to Word's lays it out. It still stops where it has no guess, such as at
is off, so the numbers written are Word's, as near as the layout knows, or blank.
+
@@ -73,7 +73,7 @@ break, and tabs move to their stops, as Word lays them out, and lines are as tal
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 90ea3f94e8..72cda4aa50 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 22b3698529..8ab66a5273 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 c9d0b49706..78ba5bc68b 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 b6d75d09ca..eb8c521ef6 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 cad66ce107..9fc3401d92 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 e48596e6b6..b6112bf964 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 5fb09352c3..bdc1c716db 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 d0dae67206..edb889ecc6 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 6bf9f507ba..1c3acae201 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 91f0696da2..358ce8ca22 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 6aa9e13b55..57e7c51903 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 e3fdc2286f..39666fa45a 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 dacd277ff0..cfc910bd1f 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 19aa0c95f9..90183efb8a 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 d7d5395f67..2f9477eee4 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 35257779e6..06a3ae5619 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 7273982d82..9f6c395045 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 134038dcfe..2cbf22f4d0 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 8565b68eea..82112b8b47 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 7577a4a371..81f121ca41 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 2f7c1a825d..317c9246ea 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 a538483c06..05f6fbd703 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 77aee48441..e3967dab9c 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 3eef9c0e30..6041185200 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 9a73df6fb1..15b86ad953 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 96eab22f2c..46a8b279a4 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 a08219cf87..7afcb8326a 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 715f968cdc..8bf6721eea 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 ec2f490c04..e580124fe6 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 3c380409e9..beb3ab4176 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 882e4891ca..b6230aab12 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 5d9567b2b3..fc24d5e820 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 57c0c22651..07fa832555 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 d8d2e07730..cc3c9242a9 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 836ff612c9..621ff8c16d 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 be17723cd4..74e0a67345 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 5048dbad02..09f91fd3c3 100644
--- a/api/variables/layout.estimatePageNumbers.html
+++ b/api/variables/layout.estimatePageNumbers.html
@@ -51,7 +51,7 @@ written, and the numbers left blank stay blank, without asking to update the fie
diff --git a/live-examples/lib/layout.iife.js b/live-examples/lib/layout.iife.js
index cfa1b6474a..342bce6bd2 100644
--- a/live-examples/lib/layout.iife.js
+++ b/live-examples/lib/layout.iife.js
@@ -7124,34 +7124,15 @@ var docxLayout = (function(exports) {
return (METRIC.has(unit) ? Math.round(inUnits) : Math.floor(inUnits + ROUNDING)) / perPoint;
};
/**
- * A run's size (`w:sz`, or `w:szCs` for complex scripts) in points, from half-points, or from points, which Word rounds down to a half-point:
- * "11.75pt" is 11.5. Word ignores a size in inches, centimeters or millimeters, as if it had none (word-units2).
+ * A run's size (`w:sz`, or `w:szCs` for complex scripts) in points, from half-points, or from a length in any unit, which
+ * Word rounds down to a half-point, with or without a style that gives a size: "11.75pt" is 11.5, "0.4in" 28.5, "1cm" and
+ * "10mm" 28, and "0.3cm" 8.5, as it reads centimeters and millimeters to the nearest twip first (word-units2.ts V3,
+ * scripts/layout-probes/stops2/word-stops-text.ts RF27a to RF27c, word-stops-text2.ts RF27d to RF27g)
*/
var sizeOf$2 = (value) => {
var _MEASURE$exec;
const unit = typeof value === "string" ? (_MEASURE$exec = MEASURE.exec(value)) === null || _MEASURE$exec === void 0 ? void 0 : _MEASURE$exec[4] : void 0;
- return unit === void 0 || unit === "pt" ? pointsOf(value, 2) : void 0;
- };
- /**
- * Why how Word reads a length in formatted XML isn't known, when it isn't: a size in a unit other than points, which Word's
- * PDFs showed it ignores in sizes that aren't whole half-points with no style giving a size (word-units2.ts V3), and
- * draws at its length in whole half-points in a run whose style gives one (scripts/layout-probes/stops2/word-stops-text.ts
- * RF27a to RF27c), which leaves which of the two decides unknown. Its minus sign is the whole number's only, as for every
- * length: "-2.5pt" lowers text by 1.5 points, "-0.5pt" and "-0.3cm" raise it, and "-0.5mm" spaces letters further apart
- * (RF26a, RF26b, RF28a, RF28b). Undefined when every length's reading is known.
- */
- var unknownLengthIn = (element, name = "") => {
- if (Array.isArray(element)) return element.reduce((found, child) => found !== null && found !== void 0 ? found : unknownLengthIn(child, name), void 0);
- if (!isObject(element)) return;
- return Object.entries(element).reduce((found, [key, child]) => {
- if (found !== void 0 || key !== "_attr") return found !== null && found !== void 0 ? found : unknownLengthIn(child, key);
- return Object.values(child).reduce((reason, value) => {
- const measure = typeof value === "string" ? MEASURE.exec(value) : null;
- if (reason !== void 0 || !measure) return reason;
- const [, , , , unit] = measure;
- return (name === "w:sz" || name === "w:szCs") && unit !== "pt" ? "a size given in a unit other than points" : void 0;
- }, void 0);
- }, void 0);
+ return unit === void 0 || !METRIC.has(unit) ? pointsOf(value, 2) : Math.floor(pointsOf(value, 20) * 2 + ROUNDING) / 2;
};
var isOff = (value) => value === false || value === 0 || value === "false" || value === "0" || value === "off";
/**
@@ -7406,7 +7387,7 @@ var docxLayout = (function(exports) {
return (_styles$find = styles.find((style) => style.isDefault && style.definition.type === type)) === null || _styles$find === void 0 ? void 0 : _styles$find.id;
};
const byId = new Map(styles.map((style) => [style.id, style.definition]));
- return _objectSpread2({
+ return {
run: combine(defaults.map((children) => readRunFormat(find(childrenOf(find(children, "w:rPrDefault")), "w:rPr"), themeFonts))),
paragraph: combine(defaults.map((children) => readParagraphFormat(find(childrenOf(find(children, "w:pPrDefault")), "w:pPr")))),
styles: byId,
@@ -7414,7 +7395,7 @@ var docxLayout = (function(exports) {
defaultCharacterStyle: defaultStyle("character"),
defaultTableStyle: defaultStyle("table"),
themeFonts
- }, withoutUndefined({ unsupported: unknownLengthIn(xml) }));
+ };
};
/**
* Reads the margins of a table's cells (`w:tblCellMar`), or of one cell (`w:tcMar`), in points.
@@ -7538,12 +7519,15 @@ var docxLayout = (function(exports) {
* How wide a run's border is as Word draws it, in eighths of a point: as a paragraph's of its style. A border of no style
* ("none") takes its space still, but no width (scripts/layout-probes/word-run-formatting.ts RF7h). An art border's size
* is in points, so apples of 12 take 12 points (scripts/layout-probes/stops2/word-stops-text.ts RF25c), and Word draws a
- * single border of an eighth of a point, and a double one of none, as given (RF25f, RF25e). Undefined when Word hasn't been
- * seen to draw it.
+ * single border of an eighth of a point, and a double one of none, as given (RF25f, RF25e). A shadow doubles a single
+ * line, as a paragraph's (`word-paragraph-formats.docx` B6), and one drawn as a frame is as wide: one of 1.5 points 2
+ * points from the text takes 100 twips beside and above and below it with a shadow, and 70 as a frame
+ * (scripts/layout-probes/stops2/word-stops-text2.ts RF24c, RF24d). Undefined when Word hasn't been seen to draw it.
*/
var runBorderWidth = ({ style, size, shadow, frame }) => {
var _BORDER_WIDTHS$style, _BORDER_WIDTHS$style2, _SEEN_RUN_BORDERS$sty;
- if (shadow || frame || size === void 0) return style === "none" && !shadow && !frame ? 0 : void 0;
+ if (size === void 0) return style === "none" && !shadow && !frame ? 0 : void 0;
+ if (shadow || frame) return style === "single" && size >= 2 && size <= 96 ? (shadow ? 2 : 1) * size : void 0;
if (!LINE_BORDERS.has(style)) return size >= 1 && size <= WIDEST_ART_BORDER ? size * EIGHTHS_PER_POINT$2 : void 0;
if (style === "single" && size === 1 || style === "double" && size === 0) return BORDER_WIDTHS[style](size);
return style === "none" ? 0 : size < 2 || size > 96 ? void 0 : (_BORDER_WIDTHS$style = (_BORDER_WIDTHS$style2 = BORDER_WIDTHS[style]) === null || _BORDER_WIDTHS$style2 === void 0 ? void 0 : _BORDER_WIDTHS$style2.call(BORDER_WIDTHS, size)) !== null && _BORDER_WIDTHS$style !== void 0 ? _BORDER_WIDTHS$style : (_SEEN_RUN_BORDERS$sty = SEEN_RUN_BORDERS[style]) === null || _SEEN_RUN_BORDERS$sty === void 0 ? void 0 : _SEEN_RUN_BORDERS$sty[size];
@@ -7589,15 +7573,15 @@ var docxLayout = (function(exports) {
};
/**
* Why a run's formatting can't be laid out as Word lays it out, when it can't: OpenType features other than ligatures,
- * whose widths the width tables don't have, a border of a style, width or space Word hasn't been seen to draw, or with a
- * shadow or drawn as a frame, and emphasis marks of a kind the schema doesn't have.
+ * whose widths the width tables don't have, a border of a style, width or space Word hasn't been seen to draw, or of a style
+ * other than single with a shadow or drawn as a frame, and emphasis marks of a kind the schema doesn't have.
*/
var unknownRunFormatting = ({ font, bold, italic, border, emphasisMark, numberForm, numberSpacing, stylisticSets, contextualAlternates }) => {
var _DEFAULT_FIGURES$toLo;
const forms = `${numberForm !== null && numberForm !== void 0 ? numberForm : "default"} ${numberSpacing !== null && numberSpacing !== void 0 ? numberSpacing : "default"}`;
if (forms !== "default default" && (bold === true || italic === true || !((_DEFAULT_FIGURES$toLo = DEFAULT_FIGURES[(font !== null && font !== void 0 ? font : "").toLowerCase()]) === null || _DEFAULT_FIGURES$toLo === void 0 ? void 0 : _DEFAULT_FIGURES$toLo.includes(forms)))) return "OpenType number forms or spacing";
if (stylisticSets === true || contextualAlternates === true) return "OpenType stylistic sets or contextual alternates";
- if (border !== void 0 && border.style !== "nil" && (border.shadow || border.frame)) return "a run border with a shadow or drawn as a frame";
+ if (border !== void 0 && border.style !== "nil" && border.style !== "single" && (border.shadow || border.frame)) return "a run border of a style other than single with a shadow or drawn as a frame";
if (border !== void 0 && border.style !== "nil" && runBorderWidth(border) === void 0) return "a run border of a style, width or space not yet followed";
return emphasisMark === void 0 || emphasisMark === "none" || EMPHASIS[emphasisMark] !== void 0 ? void 0 : "emphasis marks of a kind that isn't known";
};
@@ -7721,8 +7705,6 @@ var docxLayout = (function(exports) {
};
var DEFAULT_TAB_STOP = 36;
var TOLERANCE$2 = .01;
- var HYPHEN_ROOM = 19.8 / 20;
- var NO_HYPHEN_ROOM = 2.7 / 20;
var OLDER_PAGE_BREAK = "a page break at the end of a paragraph in a document in compatibility mode";
var STRETCH_TO_SQUEEZE = 2.015;
var MOST_SQUEEZE = .25;
@@ -7768,6 +7750,7 @@ var docxLayout = (function(exports) {
const breaks = findLineBreaks(items.filter((item) => item.type === "text"), rules);
const tokens = [];
let index = 0;
+ let afterHyphen = false;
for (const item of items) {
if (item.type === "softHyphen") {
const word = tokens[tokens.length - 1];
@@ -7777,6 +7760,7 @@ var docxLayout = (function(exports) {
at: lengthOf(word.pieces),
font: item.font
}];
+ afterHyphen = true;
}
continue;
}
@@ -7792,14 +7776,19 @@ var docxLayout = (function(exports) {
font
}, own)]
});
+ else if (afterHyphen) last.pieces.push(_objectSpread2(_objectSpread2({
+ text: character,
+ font
+ }, own), {}, { apart: true }));
else {
const piece = last.pieces[last.pieces.length - 1];
const same = piece.font === font && piece.hyphenation === hyphenation;
- last.pieces[last.pieces.length - 1 + (same ? 0 : 1)] = _objectSpread2({
+ last.pieces[last.pieces.length - 1 + (same ? 0 : 1)] = _objectSpread2(_objectSpread2({
text: same ? piece.text + character : character,
font
- }, own);
+ }, own), same && piece.apart === true ? { apart: true } : {});
}
+ afterHyphen = false;
index++;
}
}
@@ -7835,13 +7824,13 @@ var docxLayout = (function(exports) {
* A word's characters, each with the marks on it and anything a zero-width joiner joins to it, which a line never breaks
* between, in the pieces of the fonts they are in.
*/
- var charactersOf = (pieces) => pieces.reduce((all, { text, font }) => [...text].reduce((characters, character) => {
+ var charactersOf = (pieces) => pieces.reduce((all, { text, font, apart }) => [...text].reduce((characters, character, at) => {
const last = characters[characters.length - 1];
const lastPiece = last === null || last === void 0 ? void 0 : last[last.length - 1];
- if (!lastPiece || !(extendsCharacter(character) || joinsNext$1([...lastPiece.text].pop()))) return [...characters, [{
+ if (!lastPiece || !(extendsCharacter(character) || joinsNext$1([...lastPiece.text].pop()))) return [...characters, [_objectSpread2({
text: character,
font
- }]];
+ }, at === 0 && apart === true ? { apart } : {})]];
const joined = lastPiece.font === font ? [...last.slice(0, -1), {
text: `${lastPiece.text}${character}`,
font
@@ -7906,7 +7895,7 @@ var docxLayout = (function(exports) {
let [{ text, font }] = pieces;
for (const piece of pieces.slice(1)) {
total += roomBetween(font.border, piece.font.border);
- if (shaped(font) && sameFont(font, piece.font)) {
+ if (shaped(font) && sameFont(font, piece.font) && piece.apart !== true) {
text += piece.text;
continue;
}
@@ -7917,10 +7906,10 @@ var docxLayout = (function(exports) {
};
/**
* A paragraph's text in the pieces it is measured in: text next to text in the same font, kerned or with ligatures, as one,
- * across bookmarks and soft hyphens between them, as its pairs of characters are kerned and its letters joined across
- * runs, and other text on its own. So kerning and ligatures a measurer doesn't know are found across runs too. Text
- * beside a soft hyphen, which Word hasn't been seen with, is marked: text kerned or joined across one, and kerned text
- * before one in its font, with whose last letter the hyphen Word draws at the end of a line may be kerned.
+ * across bookmarks between them, as its pairs of characters are kerned and its letters joined across runs, and other text
+ * on its own. So kerning and ligatures a measurer doesn't know are found across runs too. Kerned text either side of a soft
+ * hyphen is measured apart, as Word doesn't kern across one (scripts/layout-probes/stops2/word-stops-text2.ts KE9a), and
+ * text with ligatures across one, which Word hasn't been seen joining or leaving apart, is marked.
*/
var textMeasuredTogether = (items) => {
const pieces = [];
@@ -7930,9 +7919,8 @@ var docxLayout = (function(exports) {
if (item.type === "marker") continue;
const last = pieces[pieces.length - 1];
if (item.type === "softHyphen") {
- const before = joins && last.text.length > 0;
- hyphen = before;
- if (before && isKerned(item.font) && sameFont(last.font, item.font)) pieces[pieces.length - 1] = _objectSpread2(_objectSpread2({}, last), {}, { besideSoftHyphen: true });
+ hyphen = joins && last.text.length > 0 && hasLigatures(last.font);
+ joins = hyphen;
continue;
}
if (item.type !== "text") joins = false;
@@ -8071,7 +8059,7 @@ var docxLayout = (function(exports) {
if (spacing === void 0) return { height: natural };
if (spacing.rule !== "multiple") return { height: spacing.rule === "exact" ? spacing.height : Math.max(natural, spacing.height) };
const spacingBelow = (spacing.multiple - 1) * tallest;
- return _objectSpread2({ height: natural + spacingBelow }, spacingBelow > 0 ? { spacingBelow } : {});
+ return _objectSpread2(_objectSpread2({ height: natural + spacingBelow }, spacingBelow > 0 ? { spacingBelow } : {}), heights.borderedPicture === true && spacing.multiple !== 1 ? { unsupported: "a picture in a border in a line with multiple line spacing" } : {});
};
/**
* How tall a line on a document grid's lines is: as many of them as its own height needs, from the first fraction of a
@@ -8093,7 +8081,10 @@ var docxLayout = (function(exports) {
const gridded = Math.max(1, Math.ceil(own.height / pitch - GRID_ROUNDING)) * pitch;
const height = spacing === void 0 ? gridded : Math.max(spacing.rule === "multiple" ? spacing.multiple * pitch : spacing.height, gridded);
const below = (((spacing === null || spacing === void 0 ? void 0 : spacing.rule) === "atLeast" ? gridded : height) - own.height) / 2;
- return _objectSpread2(_objectSpread2({ height }, below > 0 ? { spacingBelow: below } : {}), unsupported === void 0 ? {} : { unsupported });
+ return _objectSpread2(_objectSpread2({ height }, below > 0 ? {
+ spacingBelow: below,
+ belowOnGrid: true
+ } : {}), unsupported === void 0 ? {} : { unsupported });
};
var GRID_ROUNDING = 1e-9;
/** Whether a line has nothing on it but a list number and what follows it */
@@ -8155,17 +8146,18 @@ var docxLayout = (function(exports) {
/** Pieces of text split after this many characters */
var splitPieces = (pieces, at) => {
let count = 0;
- const parts = pieces.map(({ text, font }) => {
+ const parts = pieces.map(({ text, font, apart }) => {
const characters = [...text];
const taken = Math.max(0, Math.min(characters.length, at - count));
count += characters.length;
- return [{
+ const kept = apart === true ? { apart } : {};
+ return [_objectSpread2({
text: characters.slice(0, taken).join(""),
font
- }, {
+ }, kept), _objectSpread2({
text: characters.slice(taken).join(""),
font
- }];
+ }, kept)];
});
const written = (piece) => piece.text.length > 0;
return [parts.map(([before]) => before).filter(written), parts.map(([, after]) => after).filter(written)];
@@ -8522,11 +8514,15 @@ var docxLayout = (function(exports) {
};
/** The heights of a line with the text of the token on it too */
const withToken = (heights, token) => {
+ if (token.type === "box" && token.text !== void 0) return withFont(heights, token.font, measurer, token.text);
if (token.type === "box") {
const tallest = token.font ? Math.max(heights.tallest, measurer.measureLineHeight(token.font)) : heights.tallest;
return token.descent === void 0 ? _objectSpread2(_objectSpread2({}, heights), {}, {
picture: Math.max(heights.picture, token.height),
tallest
+ }, token.below === void 0 ? {} : {
+ descent: Math.max(heights.descent, token.below),
+ borderedPicture: true
}) : _objectSpread2(_objectSpread2({}, heights), {}, {
ascent: Math.max(heights.ascent, token.height),
descent: Math.max(heights.descent, token.descent),
@@ -8591,7 +8587,7 @@ var docxLayout = (function(exports) {
if (!squeezes || older || state.spaces - state.otherSpaces <= TOLERANCE$2) return false;
const over = state.position + tokenWidth - limitOf();
const slack = limitOf() - state.end;
- if (over / state.spaces > MOST_SQUEEZE) return false;
+ if (over / (state.spaces - state.otherSpaces) > MOST_SQUEEZE) return false;
if (alignment === "distributed") return slack * SPACE_TO_LETTER / (SPACE_TO_LETTER * state.between + state.letters) >= STRETCH_TO_SQUEEZE * (over / state.spaceCount);
const between = state.spaces - (state.position - state.end);
return between <= 0 || slack / between >= STRETCH_TO_SQUEEZE * (over / state.spaces);
@@ -8617,22 +8613,30 @@ var docxLayout = (function(exports) {
return state.position + lead + widthOf([...part, hyphen], measurer) <= limitOf() + TOLERANCE$2;
};
/**
- * Whether a word or picture past the end of a justified line could be squeezed in, were the spaces Word doesn't
- * squeeze among its spaces squeezed as the others are, beside ordinary spaces it does, or at a four-per-em space,
- * which Word hasn't been seen with
+ * Whether a word or picture past the end of a justified line could be squeezed in at a four-per-em space, which Word
+ * hasn't been seen with, or at the ordinary spaces beside en, em or ideographic spaces, which Word doesn't squeeze, and
+ * how it weighs them then hasn't been seen. Past the end by more than a quarter of the ordinary spaces' width, it isn't
+ * squeezed in, though they and the others are four times as wide (scripts/layout-probes/stops2/word-stops-text2.ts JU4a,
+ * JU4b: 10 spaces and 6 en spaces, and "lighthouse" past the end by 27% and 35% of the spaces' width)
*/
- const unsure = (state, tokenWidth) => squeezes && !older && state.otherSpaces > 0 && (state.spaces - state.otherSpaces > TOLERANCE$2 || state.text.includes(" ")) && state.position + tokenWidth - limitOf() <= MOST_SQUEEZE * state.spaces;
+ const unsure = (state, tokenWidth) => {
+ if (!squeezes || older || state.otherSpaces === 0) return false;
+ const over = state.position + tokenWidth - limitOf();
+ const ordinary = state.spaces - state.otherSpaces;
+ return state.text.includes(" ") ? over <= MOST_SQUEEZE * state.spaces : ordinary > TOLERANCE$2 && over <= MOST_SQUEEZE * ordinary;
+ };
/**
* Why where Word puts the text after a tab to one of the paragraph's own stops past the end of the line isn't known,
- * when it isn't: its probes had no right indent past the margin, indents, first line and hanging ones too
- * (scripts/layout-probes/stops2/word-stops-tabs.ts TA1a, TA1b), only with a left stop after text, a left indent with a
- * right stop at the start of a line (TA3d), a right indent only with a right stop after text, and centred and decimal
- * stops in a paragraph without indents, after text and at the start of a line (TA3a to TA3c)
+ * when it isn't. Its probes had no right indent past the margin; a left stop only after text, with first line and
+ * hanging indents too (scripts/layout-probes/stops2/word-stops-tabs.ts TA1a, TA1b); and a right indent only with a right
+ * stop after text. Right, centred and decimal stops line their text up with the end of the line whatever the left,
+ * first line and hanging indents, at the start of a line and after text (TA3a to TA3d, stops2/word-stops-text2.ts TA10a
+ * to TA10f, TA10h, TA10i)
*/
const pastEndUnknown = ({ alignment: kind }, started) => {
- if (indentRight < 0 || firstLineIndent !== 0 && (kind !== "left" || !started)) return "a tab stop past the end of the line in a paragraph with a first line or hanging indent, or indented past the margin";
- if (kind === "left") return !started && (indentLeft !== 0 || indentRight !== 0) ? "a left tab stop past the end of the line at the start of a line in an indented paragraph" : void 0;
- return indentLeft === 0 && indentRight === 0 || kind === "right" && (started ? indentLeft === 0 : indentRight === 0) ? void 0 : "a right, centred or decimal tab stop past the end of the line in an indented paragraph";
+ if (indentRight < 0) return "a tab stop past the end of the line in a paragraph indented past the margin";
+ if (kind === "left") return !started && (indentLeft !== 0 || indentRight !== 0 || firstLineIndent !== 0) ? "a left tab stop past the end of the line at the start of a line in an indented paragraph" : void 0;
+ return indentRight === 0 || kind === "right" && started ? void 0 : "a centred or decimal tab stop past the end of the line in a paragraph indented on the right, or a right one at the start of a line there";
};
const beforeStart = numberShift(content, numberAlignment, measurer);
let numberTab = numberAlignment === "right" && ((_content$ = content[1]) === null || _content$ === void 0 ? void 0 : _content$.type) === "tab";
@@ -8746,16 +8750,25 @@ var docxLayout = (function(exports) {
placeWord(rest);
return;
}
+ if (line.tabsOnly === true) {
+ var _line$unsupported4;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported4 = line.unsupported) !== null && _line$unsupported4 !== void 0 ? _line$unsupported4 : "a word with soft hyphens that doesn't fit after a tab that starts its line" });
+ }
if (line.started) {
line = wrap(line);
placeWord(token);
return;
}
}
- const overflows = line.started && line.position + needs > endOf(line) + TOLERANCE$2;
- if (token.type === "box" && token.unbroken !== void 0 && line.position + needs > endOf(line) + TOLERANCE$2) {
- var _line$unsupported4;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported4 = line.unsupported) !== null && _line$unsupported4 !== void 0 ? _line$unsupported4 : token.unbroken });
+ const beyond = line.position + needs > endOf(line) + TOLERANCE$2;
+ if (beyond && line.tabsOnly === true && token.type === "box") {
+ var _line$unsupported5;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported5 = line.unsupported) !== null && _line$unsupported5 !== void 0 ? _line$unsupported5 : "a picture that doesn't fit after a tab that starts its line" });
+ }
+ const overflows = line.started && beyond && (line.tabsOnly !== true || token.type === "box");
+ if (token.type === "box" && token.unbroken !== void 0 && beyond) {
+ var _line$unsupported6;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported6 = line.unsupported) !== null && _line$unsupported6 !== void 0 ? _line$unsupported6 : token.unbroken });
}
const neverSqueezed = snapping && alignment === "justified";
if (overflows && !neverSqueezed && unsure(line, needs)) line = _objectSpread2(_objectSpread2({}, line), {}, { unknown: true });
@@ -8763,25 +8776,29 @@ var docxLayout = (function(exports) {
if (squeezable && snapping) line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: "a distributed line on a grid that snaps to characters that only fits squeezed" });
const squeezed = squeezable && !snapping;
if (overflows && (!squeezed || alignment !== "justified") && token.type === "word" && mayHyphenate(line, token, leadOf(line))) {
- var _line$unsupported5;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported5 = line.unsupported) !== null && _line$unsupported5 !== void 0 ? _line$unsupported5 : MAY_HYPHENATE });
+ var _line$unsupported7;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported7 = line.unsupported) !== null && _line$unsupported7 !== void 0 ? _line$unsupported7 : MAY_HYPHENATE });
}
if (overflows && !squeezed) {
line = wrap(line);
skipRooms(needs, hyphens.length > 0);
tokenWidth = widthOn(line);
}
+ if (token.type === "box" && token.text !== void 0 && !squeezed && line.position + tokenWidth > endOf(line) + TOLERANCE$2) {
+ var _line$unsupported8;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported8 = line.unsupported) !== null && _line$unsupported8 !== void 0 ? _line$unsupported8 : "text fitted to a width wider than its line" });
+ }
line = _objectSpread2(_objectSpread2({}, place(line)), {}, { position: line.position + leadOf(line, skipped || overflows && !squeezed) });
if (token.type === "word" && !squeezed && line.position + tokenWidth > endOf(line) + TOLERANCE$2 && limitOf() - startOf(lines.length, false) > 0) {
let placed = false;
let partStart = line.position;
if (mayHyphenate(line, token, 0)) {
- var _line$unsupported6;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported6 = line.unsupported) !== null && _line$unsupported6 !== void 0 ? _line$unsupported6 : MAY_HYPHENATE });
+ var _line$unsupported9;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported9 = line.unsupported) !== null && _line$unsupported9 !== void 0 ? _line$unsupported9 : MAY_HYPHENATE });
}
if (token.pieces.some(({ font }) => hasLigatures(font))) {
- var _line$unsupported7;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported7 = line.unsupported) !== null && _line$unsupported7 !== void 0 ? _line$unsupported7 : "a word longer than its line with ligatures" });
+ var _line$unsupported10;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported10 = line.unsupported) !== null && _line$unsupported10 !== void 0 ? _line$unsupported10 : "a word longer than its line with ligatures" });
}
let onLine = [];
let from = line.position;
@@ -8820,7 +8837,8 @@ var docxLayout = (function(exports) {
});
}
} else {
- const text = token.type === "word" ? textOf$2(token.pieces) : "";
+ var _token$text;
+ const text = token.type === "word" ? textOf$2(token.pieces) : (_token$text = token.text) !== null && _token$text !== void 0 ? _token$text : "";
line = _objectSpread2(_objectSpread2(_objectSpread2({}, line), snapping && token.type === "word" ? { latin: snapped(line, token.pieces).latin } : {}), {}, {
position: line.position + tokenWidth,
end: line.position + tokenWidth,
@@ -8833,7 +8851,8 @@ var docxLayout = (function(exports) {
between: line.spaceCount,
heights: withToken(line.heights, token),
started: true,
- border: token.type === "word" ? lastBorder(token.pieces) : void 0
+ border: token.type === "word" ? lastBorder(token.pieces) : void 0,
+ tabsOnly: false
});
};
/**
@@ -8841,7 +8860,11 @@ var docxLayout = (function(exports) {
* font, on the line, as Word breaks it (scripts/layout-probes/word-watertight-text.ts TX10a: 12 lines, 8 of them
* ending in a hyphen, each where docx/layout's widths of Calibri end them), and a word longer than its line again on
* each line (word-breaks-and-tabs.ts SH4), after the text before it on the line, which it is kerned with by `kern`.
- * The rest of the word, which goes on to the next line, or undefined when no part of it fits
+ * The part goes on the line when its hyphen fits, as a word does: with the hyphen 3.5 to 129.4 twips short of the end
+ * of the line, and on a justified line 0.5 to 2.5 short of it (stops2/word-stops-tabs.ts SH13a to SH13h,
+ * stops2/word-stops-text2.ts SH16a to SH16l), and not a twip past it (word-breaks-and-tabs.ts SH2's line of 70, which
+ * its character spacing of whole twips put there). The rest of the word, which goes on to the next line, or undefined
+ * when no part of it fits
*/
const breakAtHyphen = (word, hyphens, kern) => {
const lead = roomBetween(line.border, firstBorder(word.pieces)) + kern;
@@ -8853,16 +8876,23 @@ var docxLayout = (function(exports) {
before,
after,
withHyphen,
- room: endOf(line) - withHyphen
+ fits: withHyphen <= endOf(line) + TOLERANCE$2
};
});
- for (const [index, { hyphen, before, after, withHyphen, room }] of splits.entries()) {
- const squeezed = room <= 0 && line.started && squeezesIn(line, withHyphen - line.position);
- if (squeezed && splits.slice(index + 1).some((shorter) => shorter.room >= HYPHEN_ROOM)) {
- var _line$unsupported8;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported8 = line.unsupported) !== null && _line$unsupported8 !== void 0 ? _line$unsupported8 : "a justified line that fits a soft hyphen's part squeezed, and a shorter one as it is" });
+ for (const [index, { hyphen, before, after, withHyphen, fits }] of splits.entries()) {
+ const squeezed = !fits && line.started && squeezesIn(line, withHyphen - line.position);
+ const shorter = squeezed ? splits.slice(index + 1).find((other) => other.fits) : void 0;
+ if (shorter !== void 0 && alignment === "justified" && limitOf() - shorter.withHyphen < STRETCH_TO_SQUEEZE * (withHyphen - limitOf())) continue;
+ if (shorter !== void 0) {
+ var _line$unsupported11;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported11 = line.unsupported) !== null && _line$unsupported11 !== void 0 ? _line$unsupported11 : "a line that fits a soft hyphen's part squeezed, and a shorter one as it is with twice as much room or more" });
}
- if (room >= HYPHEN_ROOM || squeezed) {
+ const { font: partFont } = before[before.length - 1];
+ if ((fits || squeezed) && isKerned(partFont) && sameFont(partFont, hyphen.font)) {
+ var _line$unsupported12;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported12 = line.unsupported) !== null && _line$unsupported12 !== void 0 ? _line$unsupported12 : "a line that breaks at a soft hyphen in kerned text, whose hyphen Word may kern" });
+ }
+ if (fits || squeezed) {
const placed = place(line);
line = wrap(_objectSpread2(_objectSpread2({}, placed), {}, {
position: withHyphen,
@@ -8882,14 +8912,10 @@ var docxLayout = (function(exports) {
hyphens: hyphens.filter(({ at }) => at > hyphen.at).map((later) => _objectSpread2(_objectSpread2({}, later), {}, { at: later.at - hyphen.at }))
};
}
- if (room > NO_HYPHEN_ROOM || squeezes && room > 0) {
- var _line$unsupported9;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported9 = line.unsupported) !== null && _line$unsupported9 !== void 0 ? _line$unsupported9 : "a soft hyphen whose hyphen ends this close to the end of the line" });
- }
}
};
for (const [index, token] of tokens.entries()) {
- var _line$border;
+ var _line$border2;
if (token.type === "marker") {
var _tokens;
const before = (_tokens = tokens[index - 1]) === null || _tokens === void 0 ? void 0 : _tokens.type;
@@ -8908,17 +8934,26 @@ var docxLayout = (function(exports) {
});
continue;
}
- line = token.type === "word" || token.type === "tab" && token.font.border !== void 0 && token.font.border.key === ((_line$border = line.border) === null || _line$border === void 0 ? void 0 : _line$border.key) ? line : _objectSpread2(_objectSpread2({}, line), {}, {
+ if (token.type === "box" && token.below !== void 0) {
+ var _line$border, _firstBorder2;
+ const { key } = token.font.border;
+ const following = tokens.slice(index + 1).find((other) => other.type !== "marker");
+ if (((_line$border = line.border) === null || _line$border === void 0 ? void 0 : _line$border.key) === key || ((following === null || following === void 0 ? void 0 : following.type) === "word" || (following === null || following === void 0 ? void 0 : following.type) === "space") && ((_firstBorder2 = firstBorder(following.pieces)) === null || _firstBorder2 === void 0 ? void 0 : _firstBorder2.key) === key) {
+ var _line$unsupported13;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported13 = line.unsupported) !== null && _line$unsupported13 !== void 0 ? _line$unsupported13 : "a picture in a border beside text in the same border" });
+ }
+ }
+ line = token.type === "word" || token.type === "tab" && token.font.border !== void 0 && token.font.border.key === ((_line$border2 = line.border) === null || _line$border2 === void 0 ? void 0 : _line$border2.key) ? line : _objectSpread2(_objectSpread2({}, line), {}, {
position: line.position + roomBetween(line.border, void 0),
border: void 0
});
if (snapping && token.type === "box" && (line.latin !== void 0 || token.descent !== void 0)) {
- var _line$unsupported10;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported10 = line.unsupported) !== null && _line$unsupported10 !== void 0 ? _line$unsupported10 : "an equation, or a picture after text other than Chinese, Japanese or Korean, on a grid that snaps to characters" });
+ var _line$unsupported14;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported14 = line.unsupported) !== null && _line$unsupported14 !== void 0 ? _line$unsupported14 : "an equation, or a picture after text other than Chinese, Japanese or Korean, on a grid that snaps to characters" });
}
if (snapping && token.type !== "word") line = _objectSpread2(_objectSpread2({}, line), {}, { latin: void 0 });
if (token.type === "tab") {
- var _nextStop, _line$unsupported15;
+ var _nextStop, _line$unsupported21;
const numbered = numberTab ? { stop: numberTabStop(line.position, firstLineStops, format, defaultTabStop, limitOf()) } : void 0;
numberTab = false;
const given = line.first ? firstLineStops : stops;
@@ -8927,15 +8962,14 @@ var docxLayout = (function(exports) {
const own = !numbered && given.includes(next);
const pastIndent = own && indentRight > 0 && next.position > limitOf() + TOLERANCE$2 && next.position <= marginOf() + TOLERANCE$2;
const pastEnd = own && next.position > Math.max(limitOf(), marginOf()) + TOLERANCE$2 ? next : void 0;
- const pastMargin = own && indentRight < 0 && next.alignment === "left" && next.position > marginOf() + TOLERANCE$2 && next.position + widthAfterTab(rest, measurer) > limitOf() + TOLERANCE$2;
- const unknown = pastIndent && squeezes ? "a tab stop past the paragraph's right indent in a justified line" : pastIndent && next.alignment === "left" && next.position + widthAfterTab(rest, measurer) > marginOf() + TOLERANCE$2 ? "text after a tab stop past the paragraph's right indent that goes past the margin" : pastMargin && pastEnd === void 0 ? "text after a left tab stop past the margin, in a paragraph indented past it, that goes past the end of the line" : pastEnd === void 0 ? void 0 : pastEndUnknown(pastEnd, line.started);
+ const unknown = pastIndent && squeezes && alignment !== "justified" ? "a tab stop past the paragraph's right indent in a distributed line" : pastIndent && next.alignment === "left" && next.position + widthAfterTab(rest, measurer) > marginOf() + TOLERANCE$2 ? "text after a tab stop past the paragraph's right indent that goes past the margin" : pastEnd === void 0 ? void 0 : pastEndUnknown(pastEnd, line.started);
if (unknown !== void 0) {
- var _line$unsupported11;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported11 = line.unsupported) !== null && _line$unsupported11 !== void 0 ? _line$unsupported11 : unknown });
+ var _line$unsupported15;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported15 = line.unsupported) !== null && _line$unsupported15 !== void 0 ? _line$unsupported15 : unknown });
}
if (older && !numbered && next.position > limitOf() + TOLERANCE$2) {
- var _line$unsupported12;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported12 = line.unsupported) !== null && _line$unsupported12 !== void 0 ? _line$unsupported12 : "a tab past the end of the line in a document in compatibility mode" });
+ var _line$unsupported16;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported16 = line.unsupported) !== null && _line$unsupported16 !== void 0 ? _line$unsupported16 : "a tab past the end of the line in a document in compatibility mode" });
}
if ((pastEnd === null || pastEnd === void 0 ? void 0 : pastEnd.alignment) === "left" && unknown === void 0) {
const below = line.started ? wrap(line) : line;
@@ -8948,30 +8982,63 @@ var docxLayout = (function(exports) {
}
const aligned = pastEnd !== void 0 && pastEnd.alignment !== "left" && unknown === void 0;
if (aligned && line.position + widthAfterTab(rest, measurer) > limitOf() + TOLERANCE$2) line = wrap(line);
- const stop = numbered ? numbered.stop : aligned ? {
+ let stop = numbered ? numbered.stop : aligned ? {
position: limitOf(),
alignment: "right"
} : pastIndent ? next : (_nextStop = nextStop(line.position, given, defaultTabStop, limitOf())) !== null && _nextStop !== void 0 ? _nextStop : line.started ? nextStop(startOf(lines.length + 1, false), stops, defaultTabStop, limitOf(lines.length + 1)) : void 0;
if (stop === void 0) {
- var _line$unsupported13;
+ var _line$unsupported17;
line = _objectSpread2(_objectSpread2({}, line), {}, {
end: line.position,
text: `${line.text}\t`,
heights: withToken(line.heights, token),
started: true
- }, !snapping ? {} : { unsupported: (_line$unsupported13 = line.unsupported) !== null && _line$unsupported13 !== void 0 ? _line$unsupported13 : GRID_TAB });
+ }, !snapping ? {} : { unsupported: (_line$unsupported17 = line.unsupported) !== null && _line$unsupported17 !== void 0 ? _line$unsupported17 : GRID_TAB });
continue;
}
if (!numbered && stop.position <= line.position + TOLERANCE$2) line = wrap(line);
+ /**
+ * Where the text after the tab starts at a stop, however much the spaces before it are squeezed. On a grid that
+ * snaps to characters, Chinese, Japanese or Korean text after a left stop starts at the next of the grid's
+ * cells: after a stop at 3000 twips, on a grid of cells of 225.65, at 3159, the 14th (stops2/word-stops-east-asian.ts
+ * GR10a). Other text after one, and text at a stop of another alignment, haven't been seen there
+ */
+ const startAt = (at, { position: from, border }) => {
+ const shifted = shiftAt(at.alignment, rest, measurer, border);
+ const stopped = Math.max(from, at.position - (shifted !== null && shifted !== void 0 ? shifted : widthAfterTab(rest, measurer)));
+ const cell = cellOn(lines.length);
+ return {
+ lineUp: shifted,
+ position: cell === void 0 ? stopped : Math.ceil(stopped / cell - GRID_ROUNDING) * cell
+ };
+ };
+ const after = rest.find((other) => other.type !== "marker");
+ if (!numbered && token.font.listNumber !== "separator" && !aligned && !pastIndent && line.started && line.tabsOnly !== true && ((after === null || after === void 0 ? void 0 : after.type) === "word" || (after === null || after === void 0 ? void 0 : after.type) === "box")) {
+ var _after$hyphens, _lastBorder$room4, _lastBorder4, _tokens$slice$findLas;
+ const hyphen = after.type === "word" ? (_after$hyphens = after.hyphens) === null || _after$hyphens === void 0 ? void 0 : _after$hyphens.find(({ at }) => at > 0 && at < lengthOf(after.pieces)) : void 0;
+ const needs = after.type === "box" ? after.width : roomBetween(line.border, firstBorder(after.pieces)) + (hyphen === void 0 ? widthOf(after.pieces, measurer) + ((_lastBorder$room4 = (_lastBorder4 = lastBorder(after.pieces)) === null || _lastBorder4 === void 0 ? void 0 : _lastBorder4.room) !== null && _lastBorder$room4 !== void 0 ? _lastBorder$room4 : 0) : widthOf(splitPieces(after.pieces, hyphen.at)[0], measurer) + measurer.measureWidth("-", hyphen.font));
+ const nextLine = nextStop(startOf(lines.length + 1, false), stops, defaultTabStop, limitOf(lines.length + 1));
+ const inRow = ((_tokens$slice$findLas = tokens.slice(0, index).findLast((before) => before.type !== "marker")) === null || _tokens$slice$findLas === void 0 ? void 0 : _tokens$slice$findLas.type) === "tab";
+ if (startAt(stop, line).position + needs > endOf(line) + TOLERANCE$2 && nextLine !== void 0) {
+ if (after.type === "box" || inRow) {
+ var _line$unsupported18;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported18 = line.unsupported) !== null && _line$unsupported18 !== void 0 ? _line$unsupported18 : inRow ? "a word that doesn't fit after tabs in a row" : "a picture that doesn't fit after a tab" });
+ } else {
+ if (hyphen !== void 0) {
+ var _line$unsupported19;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported19 = line.unsupported) !== null && _line$unsupported19 !== void 0 ? _line$unsupported19 : "a word with soft hyphens whose first part doesn't fit after a tab" });
+ }
+ line = wrap(line);
+ stop = nextLine;
+ }
+ }
+ }
line = _objectSpread2(_objectSpread2({}, place(line)), pastIndent ? { pastIndent } : {});
- const shift = shiftAt(stop.alignment, rest, measurer, line.border);
- const misaligned = shift === void 0 ? "text at a decimal tab stop that Word hasn't been seen lining up" : void 0;
- const stopped = Math.max(line.position, stop.position - (shift !== null && shift !== void 0 ? shift : widthAfterTab(rest, measurer)));
- const cell = cellOn(lines.length);
- const position = cell === void 0 ? stopped : Math.ceil(stopped / cell - GRID_ROUNDING) * cell;
+ const { lineUp, position } = startAt(stop, line);
+ const misaligned = lineUp === void 0 ? "text at a decimal tab stop that Word hasn't been seen lining up" : void 0;
if (snapping && (stop.alignment !== "left" || !startsWithGridCharacter(rest))) {
- var _line$unsupported14;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported14 = line.unsupported) !== null && _line$unsupported14 !== void 0 ? _line$unsupported14 : GRID_TAB });
+ var _line$unsupported20;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported20 = line.unsupported) !== null && _line$unsupported20 !== void 0 ? _line$unsupported20 : GRID_TAB });
}
line = _objectSpread2(_objectSpread2({}, line), {}, {
position,
@@ -8983,8 +9050,9 @@ var docxLayout = (function(exports) {
between: 0,
letters: 0,
otherSpaces: 0,
- started: true
- }, misaligned === void 0 ? {} : { unsupported: (_line$unsupported15 = line.unsupported) !== null && _line$unsupported15 !== void 0 ? _line$unsupported15 : misaligned });
+ started: true,
+ tabsOnly: !line.started || line.tabsOnly === true
+ }, misaligned === void 0 ? {} : { unsupported: (_line$unsupported21 = line.unsupported) !== null && _line$unsupported21 !== void 0 ? _line$unsupported21 : misaligned });
continue;
}
placeWord(token, kerning[index]);
@@ -34959,12 +35027,16 @@ var docxLayout = (function(exports) {
};
/**
* Reads a drawing in a run (`w:drawing`): a picture in the line is a box, with its run's font, and one that text doesn't
- * flow around, such as one behind the text, takes up no room.
+ * flow around, such as one behind the text, takes up no room. A picture in the line in a border of its run has its border's
+ * room around it, beside it and above and below it: one of 20 points with a border of 1.5 points 2 points away takes 400
+ * and 70 twips each side across the line, 470 above the baseline and 70 below it (scripts/layout-probes/stops2/word-stops-text2.ts
+ * RF32b).
*/
var readDrawing = (element, font, reader) => {
const [drawing] = childrenOf(element["w:drawing"]);
const inline = drawing["wp:inline"];
if (inline !== void 0) {
+ var _font$border$room, _font$border;
const children = childrenOf(inline);
const extent = attributesOf(find(children, "wp:extent"));
const effect = attributesOf(find(children, "wp:effectExtent"));
@@ -34973,12 +35045,13 @@ var docxLayout = (function(exports) {
var _numberOf;
return total + ((_numberOf = numberOf(value)) !== null && _numberOf !== void 0 ? _numberOf : 0);
}, 0);
- return [{
+ const room = (_font$border$room = (_font$border = font.border) === null || _font$border === void 0 ? void 0 : _font$border.room) !== null && _font$border$room !== void 0 ? _font$border$room : 0;
+ return [_objectSpread2({
type: "box",
- width: emus(extent.cx, effect.l, effect.r, around.distL, around.distR) / EMUS_PER_POINT,
- height: emus(extent.cy, effect.t, effect.b, around.distT, around.distB) / EMUS_PER_POINT,
+ width: emus(extent.cx, effect.l, effect.r, around.distL, around.distR) / EMUS_PER_POINT + 2 * room,
+ height: emus(extent.cy, effect.t, effect.b, around.distT, around.distB) / EMUS_PER_POINT + room,
font
- }];
+ }, room > 0 ? { below: room } : {})];
}
if (!!childrenOf(drawing["wp:anchor"]).some((child) => "wp:wrapNone" in child)) return [];
if (reader.inCell || reader.inNote || reader.inTextBox) return IN_CELL_OR_NOTE;
@@ -35324,8 +35397,8 @@ var docxLayout = (function(exports) {
/** Whether a run's text is drawn as two lines in one (`w:combine`), which Word draws at half its size */
var isTwoInOne = (properties) => isOn(attributesOf(find(properties, "w:eastAsianLayout"))["w:combine"]);
/**
- * Why a run's own formatting changes the room its text takes in a way not yet followed, when it does: text fitted to a
- * width (`w:fitText`), text across in vertical text (`w:eastAsianLayout`), but for text set across in text that runs
+ * Why a run's own formatting changes the room its text takes in a way not yet followed, when it does: text across in
+ * vertical text (`w:eastAsianLayout`), but for text set across in text that runs
* down the page, as Word sets it there (see {@link acrossOf}), unless it is compressed to fit its line (`w:vertCompress`),
* and two lines in one of other than text without Chinese, Japanese or Korean characters, without brackets and at a size
* that halves to whole half-points, across the page. Word drew "twolines" in two lines in one in a line of Calibri 11 at
@@ -35337,7 +35410,6 @@ var docxLayout = (function(exports) {
var unsupportedFormatOf = (properties, children, size, format, down) => {
var _format$position;
const { "w:combineBrackets": brackets, "w:vert": across, "w:vertCompress": compressed } = attributesOf(find(properties, "w:eastAsianLayout"));
- if (find(properties, "w:fitText") !== void 0) return "text fitted to a width";
if (isTwoInOne(properties)) {
const text = children.filter((child) => nameOf$1(child) === "w:t").flatMap((child) => contentOf$3(child).filter((part) => typeof part === "string"));
const shown = children.filter((child) => nameOf$1(child) !== "w:rPr" && nameOf$1(child) !== "_attr");
@@ -35480,12 +35552,12 @@ var docxLayout = (function(exports) {
}
case "w:footnoteRef":
case "w:endnoteRef": return reader.noteNumber === null ? "a note's number in a footnote with a mark of its own" : reader.noteNumber === void 0 ? [] : [noteNumber(reader.noteNumber, font)];
- case "w:drawing": return format.hidden ? [] : font.border ? guessedOr(reader, "a picture in text with a border", () => readDrawing(child, font, reader)) : readDrawing(child, font, reader);
+ case "w:drawing": return format.hidden ? [] : font.border && !("wp:inline" in childrenOf(child["w:drawing"])[0]) ? guessedOr(reader, "a drawing placed on the page in text with a border", () => readDrawing(child, font, reader)) : readDrawing(child, font, reader);
case "mc:AlternateContent": {
const choice = childrenOf(child["mc:AlternateContent"]).find((option) => "mc:Choice" in option);
return choice && !format.hidden ? readRun({ "w:r": [...childrenOf(choice["mc:Choice"])] }, paragraphRun, reader, removed) : [];
}
- case "w:pict": return format.hidden ? [] : font.border ? guessedOr(reader, "a picture in text with a border", () => readVml(child["w:pict"], font, reader)) : readVml(child["w:pict"], font, reader);
+ case "w:pict": return format.hidden ? [] : font.border ? guessedOr(reader, "a VML drawing in text with a border", () => readVml(child["w:pict"], font, reader)) : readVml(child["w:pict"], font, reader);
case "w:object": {
if (format.hidden) return [];
if (olderVml(reader)) return OLDER_VML;
@@ -35520,7 +35592,63 @@ var docxLayout = (function(exports) {
default: return [];
}
});
- return itemsOf(formatGuessed ? [[guessMarker(unsupportedFormat)], ...items] : items, reader);
+ const runItems = itemsOf(formatGuessed ? [[guessMarker(unsupportedFormat)], ...items] : items, reader);
+ const fitText = find(childrenOf(properties), "w:fitText");
+ return typeof runItems === "string" || format.hidden || fitText === void 0 ? runItems : fittedOf(runItems, attributesOf(fitText), reader);
+ };
+ /** The id of the region of text fitted to a width that each box of it is in, when it has one */
+ var FITTED = /* @__PURE__ */ new WeakMap();
+ /**
+ * A run's text fitted to a width (`w:fitText`), as a box of that width as tall as its text, which a line doesn't break:
+ * Word drew "fitted text" fitted to 500 twips 500 wide, and fitted to 3000 at the end of a line it didn't fit in, whole on
+ * the next (scripts/layout-probes/stops2/word-stops-text2.ts RF29b, RF29d). Or why it can't be laid out: fitted text with
+ * other than text in it, or to no width, which haven't been seen. Guessing, it is read as if it weren't fitted
+ */
+ var fittedOf = (items, { "w:val": width, "w:id": id }, reader) => {
+ var _twips;
+ const texts = items.filter((item) => item.type === "text");
+ const points = (_twips = twips(width)) !== null && _twips !== void 0 ? _twips : 0;
+ if (items.some((item) => item.type !== "text" && item.type !== "marker") || points <= 0) return guessedOr(reader, "text fitted to a width with other than text in it, or to none", () => items);
+ if (texts.length === 0) return items;
+ const box = {
+ type: "box",
+ width: points,
+ height: 0,
+ font: texts[0].font,
+ text: texts.map(({ text }) => text).join("")
+ };
+ FITTED.set(box, id === void 0 ? {} : { id: String(id) });
+ return [...items.filter((item) => item.type === "marker"), box];
+ };
+ /**
+ * A paragraph's items with the text of runs fitted to a width with the same id (`w:id`), one after the other, in one box,
+ * as Word fits them to their width together: "fitted " and a bold "text", fitted to 2000 twips, are 2000 wide
+ * (scripts/layout-probes/stops2/word-stops-text2.ts RF29c). Or why they can't be laid out: ones of other sizes or fonts,
+ * whose line Word hasn't been seen to size. Guessing, those are fitted apart
+ */
+ var withFitted = (read, reader) => {
+ if (typeof read === "string") return read;
+ const all = [];
+ for (const item of read) {
+ var _FITTED$get, _FITTED$get2;
+ const id = (_FITTED$get = FITTED.get(item)) === null || _FITTED$get === void 0 ? void 0 : _FITTED$get.id;
+ const at = all.findLastIndex((other) => other.type !== "marker");
+ if (id === void 0 || at === -1 || ((_FITTED$get2 = FITTED.get(all[at])) === null || _FITTED$get2 === void 0 ? void 0 : _FITTED$get2.id) !== id) {
+ all.push(item);
+ continue;
+ }
+ const [before, after] = [all[at], item];
+ if (before.font.font !== after.font.font || before.font.size !== after.font.size) {
+ const reason = "text fitted to a width in runs of other sizes or fonts";
+ if (!reader.guess) return reason;
+ all.push(guessMarker(reason), item);
+ continue;
+ }
+ const joined = _objectSpread2(_objectSpread2({}, before), {}, { text: `${before.text}${after.text}` });
+ FITTED.set(joined, { id });
+ all[at] = joined;
+ }
+ return all;
};
var RUN_CONTAINERS = /* @__PURE__ */ new Set([
"w:hyperlink",
@@ -35854,7 +35982,8 @@ var docxLayout = (function(exports) {
* (scripts/layout-probes/stops2/word-stops-text.ts PB5b), and a right indent's as its mark (PB5c). A hanging indent in characters puts the first line at
* the left indent and the other lines that much further in, and the left indent is in characters then, 0 when it isn't
* given: 2 characters hanging put the first line at 0 and the others at 440, with a left indent of 1440 twips or none
- * (TX7c, C3, C9). It says why when Word's way with them isn't known.
+ * (TX7c, C3, C9), as a hanging indent in twips from a left indent in characters does (word-stops-text2.ts PB5f). It says why
+ * when Word's way with them isn't known.
*/
var inPoints = (format, { listNumber, items }, markFont, styleFont, { line, characterSpace, characterPitch } = unitsOf()) => {
var _textOf$, _format$firstLineInde;
@@ -35886,8 +36015,8 @@ var docxLayout = (function(exports) {
firstLineIndent: characters(firstLineChars, first)
});
}
- if (leftChars !== 0 && firstLineChars === 0 && ((_format$firstLineInde = format.firstLineIndent) !== null && _format$firstLineInde !== void 0 ? _format$firstLineInde : 0) < 0) return "an indent in characters left of a hanging indent in twips";
- return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, spaced), right), leftChars === 0 ? {} : { indentLeft: characters(leftChars, style) }), firstLineChars === 0 ? {} : { firstLineIndent: characters(firstLineChars, first) });
+ const hanging = leftChars !== 0 && firstLineChars === 0 ? Math.max(0, -((_format$firstLineInde = format.firstLineIndent) !== null && _format$firstLineInde !== void 0 ? _format$firstLineInde : 0)) : 0;
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, spaced), right), leftChars === 0 ? {} : { indentLeft: characters(leftChars, style) + hanging }), firstLineChars === 0 ? {} : { firstLineIndent: characters(firstLineChars, first) });
};
var NO_BORDER = /* @__PURE__ */ new Set(["none", "nil"]);
/**
@@ -35984,7 +36113,7 @@ var docxLayout = (function(exports) {
* Reads a paragraph (`w:p`), in the formatting of its styles, and of its table's style when it is in a table.
*/
var readParagraph = (element, reader, tableFormats = []) => {
- var _valueOf3, _exec2, _styleChain$slice$0$n, _styleChain$slice$, _ref4, _ref5, _ref6, _list$unsupported, _ref7, _ref8, _ref9, _unknownInOlderLayout;
+ var _valueOf3, _exec2, _styleChain$slice$0$n, _styleChain$slice$, _ref4, _ref5, _ref6, _list$unsupported, _ref7, _ref8, _unknownInOlderLayout;
const { styles } = reader;
const children = contentOf$3(element);
const properties = childrenOf(find(children.filter(isObject), "w:pPr"));
@@ -36001,7 +36130,7 @@ var docxLayout = (function(exports) {
...list.level ? [list.level.paragraph] : [],
readParagraphFormat(properties)
];
- const read = withEquations(readInline(children, paragraphRun, reader), list.items.length > 0, reader);
+ const read = withEquations(withFitted(readInline(children, paragraphRun, reader), reader), list.items.length > 0, reader);
const guessed = typeof read === "string" ? void 0 : read.map(guessOf).find((reason) => reason !== void 0);
const items = typeof read === "string" ? read : read.filter((item) => guessOf(item) === void 0);
const combined = combine(formats);
@@ -36033,7 +36162,7 @@ var docxLayout = (function(exports) {
const tabStops = tabStopsOf(formats);
const otherDecimalSymbol = reader.decimalSymbol !== void 0 && reader.decimalSymbol !== "." && tabStops.some(({ alignment }) => alignment === "decimal");
const frame = readFrameOf(properties, styleChain(styles, style, "paragraph"), reader);
- const unsupported = (_ref4 = (_ref5 = (_ref6 = (_list$unsupported = list.unsupported) !== null && _list$unsupported !== void 0 ? _list$unsupported : ownCells) !== null && _ref6 !== void 0 ? _ref6 : reader.eastAsianRules !== void 0 && own.some((item) => item.type === "text" && kinsokuLanguageOf(item.language) !== void 0) ? reader.eastAsianRules : void 0) !== null && _ref5 !== void 0 ? _ref5 : reader.down === true ? unknownDownOf(own, tabStops) : void 0) !== null && _ref4 !== void 0 ? _ref4 : typeof frame === "string" ? frame : otherDecimalSymbol ? "a decimal tab stop in a document whose decimal symbol isn't a full stop" : find(properties, "w:divId") !== void 0 ? "a paragraph in an HTML division" : combined.alignment === "mediumKashida" || combined.alignment === "highKashida" ? "a paragraph justified for Arabic with a medium or high kashida" : forThaiOrArabic && typeof items !== "string" && items.some((item) => item.type === "text" && ARABIC.test(item.text)) ? "Arabic text justified for Thai or with a kashida" : (_ref7 = (_ref8 = (_ref9 = (_unknownInOlderLayout = unknownInOlderLayout(content, combined.alignment, reader)) !== null && _unknownInOlderLayout !== void 0 ? _unknownInOlderLayout : unjoinedSpacing) !== null && _ref9 !== void 0 ? _ref9 : unknownLengthIn(element)) !== null && _ref8 !== void 0 ? _ref8 : typeof format === "string" ? format : void 0) !== null && _ref7 !== void 0 ? _ref7 : typeof borders === "string" ? borders : void 0;
+ const unsupported = (_ref4 = (_ref5 = (_ref6 = (_list$unsupported = list.unsupported) !== null && _list$unsupported !== void 0 ? _list$unsupported : ownCells) !== null && _ref6 !== void 0 ? _ref6 : reader.eastAsianRules !== void 0 && own.some((item) => item.type === "text" && kinsokuLanguageOf(item.language) !== void 0) ? reader.eastAsianRules : void 0) !== null && _ref5 !== void 0 ? _ref5 : reader.down === true ? unknownDownOf(own, tabStops) : void 0) !== null && _ref4 !== void 0 ? _ref4 : typeof frame === "string" ? frame : otherDecimalSymbol ? "a decimal tab stop in a document whose decimal symbol isn't a full stop" : find(properties, "w:divId") !== void 0 ? "a paragraph in an HTML division" : combined.alignment === "mediumKashida" || combined.alignment === "highKashida" ? "a paragraph justified for Arabic with a medium or high kashida" : forThaiOrArabic && typeof items !== "string" && items.some((item) => item.type === "text" && ARABIC.test(item.text)) ? "Arabic text justified for Thai or with a kashida" : (_ref7 = (_ref8 = (_unknownInOlderLayout = unknownInOlderLayout(content, combined.alignment, reader)) !== null && _unknownInOlderLayout !== void 0 ? _unknownInOlderLayout : unjoinedSpacing) !== null && _ref8 !== void 0 ? _ref8 : typeof format === "string" ? format : void 0) !== null && _ref7 !== void 0 ? _ref7 : typeof borders === "string" ? borders : void 0;
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
type: "paragraph",
items: content,
@@ -36224,7 +36353,7 @@ var docxLayout = (function(exports) {
* bands by each row's place among all the rows, the deleted ones too (MK14j to MK14l).
*/
var readTable = (element, reader) => {
- var _twips, _reader$grid, _readTableLook, _kept$0$spacing, _kept$, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _withoutGuess$unsuppo, _read$find2, _givenWidth$share, _blocks$find, _read$0$cells, _read$, _roomOf, _roomOf2;
+ var _twips2, _reader$grid, _readTableLook, _kept$0$spacing, _kept$, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _withoutGuess$unsuppo, _read$find2, _givenWidth$share, _blocks$find, _read$0$cells, _read$, _roomOf, _roomOf2;
const children = contentOf$3(element).filter(isObject);
const properties = childrenOf(find(children, "w:tblPr"));
const style = valueOf(properties, "w:tblStyle");
@@ -36242,10 +36371,10 @@ var docxLayout = (function(exports) {
const givenSpacing = readCellSpacing(lastOf(allProperties, "w:tblCellSpacing"));
const tableSpacing = givenSpacing === "share" ? 0 : givenSpacing;
const { "w:w": indentValue, "w:type": indentType = "dxa" } = attributesOf(lastOf(allProperties, "w:tblInd"));
- const indent = indentType === "nil" ? 0 : indentType === "dxa" ? (_twips = twips(indentValue)) !== null && _twips !== void 0 ? _twips : 0 : void 0;
+ const indent = indentType === "nil" ? 0 : indentType === "dxa" ? (_twips2 = twips(indentValue)) !== null && _twips2 !== void 0 ? _twips2 : 0 : void 0;
const grid = childrenOf(find(children, "w:tblGrid")).filter((child) => "w:gridCol" in child).map((column) => {
- var _twips2;
- return (_twips2 = twips(attributesOf(column["w:gridCol"])["w:w"])) !== null && _twips2 !== void 0 ? _twips2 : 0;
+ var _twips3;
+ return (_twips3 = twips(attributesOf(column["w:gridCol"])["w:w"])) !== null && _twips3 !== void 0 ? _twips3 : 0;
});
const parts = unwrap(children);
const rows = withBookmarks(parts, "w:tr");
@@ -36350,7 +36479,7 @@ var docxLayout = (function(exports) {
return typesAt(rowIndex, rows.length, headerRows) !== typesAt(rowIndex - deletedBefore, rows.length - deletedHeaderRows, headerRows - deletedHeaderRows);
});
const { cells, edges, column: end, unsupported: cellsUnsupported } = rowCells.reduce(({ column, cells: done, edges: before, unsupported: unsupportedBefore }, [{ element: cell }, ...across], cellIndex) => {
- var _ref10, _ref11, _ref12;
+ var _ref9, _ref10, _ref11;
const cellChildren = contentOf$3(cell).filter(isObject);
const cellProperties = childrenOf(find(cellChildren, "w:tcPr"));
const spanOf = (given) => {
@@ -36377,9 +36506,9 @@ var docxLayout = (function(exports) {
bottom: rowIndex === rows.length - 1 ? rowBorderSet.bottom : rowBorderSet.insideH
}) : {};
const widthOf = (given) => {
- var _twips3, _shareOf;
+ var _twips4, _shareOf;
const { "w:w": ownWidth, "w:type": widthType = "dxa" } = attributesOf(find(given, "w:tcW"));
- const inTwips = widthType === "dxa" ? (_twips3 = twips(ownWidth)) !== null && _twips3 !== void 0 ? _twips3 : 0 : 0;
+ const inTwips = widthType === "dxa" ? (_twips4 = twips(ownWidth)) !== null && _twips4 !== void 0 ? _twips4 : 0 : 0;
return {
twips: inTwips,
given: inTwips > 0 || widthType === "pct" && ((_shareOf = shareOf(ownWidth)) !== null && _shareOf !== void 0 ? _shareOf : 0) > 0
@@ -36395,7 +36524,7 @@ var docxLayout = (function(exports) {
return _objectSpread2(_objectSpread2({
column: column + span,
edges: new Map([...before, [column + span, before.get(column) + width]])
- }, withoutUndefined({ unsupported: (_ref10 = (_ref11 = (_ref12 = unsupportedBefore !== null && unsupportedBefore !== void 0 ? unsupportedBefore : across.some((merged) => hasMergedContent(merged.element)) ? "cells merged across columns as old versions of Word wrote them, with text after the first" : void 0) !== null && _ref12 !== void 0 ? _ref12 : unsupportedCellOf(cellProperties)) !== null && _ref11 !== void 0 ? _ref11 : formatted.unsupported) !== null && _ref10 !== void 0 ? _ref10 : vertical ? unsupportedVerticalOf(cellBlocks) : void 0 })), {}, { cells: [...done, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({ column }, span > 1 ? { span } : {}), {}, { width: width - margins.left - margins.right }, hasWidth ? { ownWidth: width } : {}), {}, {
+ }, withoutUndefined({ unsupported: (_ref9 = (_ref10 = (_ref11 = unsupportedBefore !== null && unsupportedBefore !== void 0 ? unsupportedBefore : across.some((merged) => hasMergedContent(merged.element)) ? "cells merged across columns as old versions of Word wrote them, with text after the first" : void 0) !== null && _ref11 !== void 0 ? _ref11 : unsupportedCellOf(cellProperties)) !== null && _ref10 !== void 0 ? _ref10 : formatted.unsupported) !== null && _ref9 !== void 0 ? _ref9 : vertical ? unsupportedVerticalOf(cellBlocks) : void 0 })), {}, { cells: [...done, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({ column }, span > 1 ? { span } : {}), {}, { width: width - margins.left - margins.right }, hasWidth ? { ownWidth: width } : {}), {}, {
blocks: cellBlocks,
marginTop: margins.top,
marginBottom: margins.bottom,
@@ -36487,9 +36616,9 @@ var docxLayout = (function(exports) {
}, withoutUndefined({
breakBorder: placed === null || placed === void 0 ? void 0 : placed.breakBorder,
breakTop: placed === null || placed === void 0 ? void 0 : placed.breakTop
- })), {}, { cells: cells.map((_ref13, cellIndex) => {
+ })), {}, { cells: cells.map((_ref12, cellIndex) => {
var _read, _above$cells$find, _unmerged;
- let { borders: _, margins, gridWidth: __, noWrap: ___ } = _ref13, cell = _objectWithoutProperties(_ref13, _excluded2);
+ let { borders: _, margins, gridWidth: __, noWrap: ___ } = _ref12, cell = _objectWithoutProperties(_ref12, _excluded2);
const pending = [...carried, ...cellBookmarks[cellIndex]];
const marked = pending.length === 0 ? void 0 : startingAtFirst(cell.blocks, pending);
carried = marked === void 0 ? pending : [];
@@ -36514,9 +36643,9 @@ var docxLayout = (function(exports) {
const deletedRows = sized ? read.filter(({ deleted }) => deleted).map(({ row, cells }) => _objectSpread2(_objectSpread2({}, row), {}, {
borderTop: 0,
borderBottom: 0,
- cells: cells.map((_ref14) => {
- let { borders: _, margins: __, gridWidth: ___, noWrap: ____ } = _ref14;
- return _objectWithoutProperties(_ref14, _excluded3);
+ cells: cells.map((_ref13) => {
+ let { borders: _, margins: __, gridWidth: ___, noWrap: ____ } = _ref13;
+ return _objectWithoutProperties(_ref13, _excluded3);
})
})) : [];
const blocks = [...tableRows.flatMap(({ cells }) => cells.flatMap((cell) => {
@@ -36524,14 +36653,6 @@ var docxLayout = (function(exports) {
return [...cell.blocks, ...(_cell$sizing = cell.sizing) !== null && _cell$sizing !== void 0 ? _cell$sizing : []];
})), ...deletedRows.flatMap(({ cells }) => cells.flatMap((cell) => cell.blocks))];
const unfitted = read.reduce((most, { end }) => Math.max(most, end), 0) > MOST_COLUMNS ? `a table given no widths of more than ${MOST_COLUMNS} columns` : void 0;
- const lengths = unknownLengthIn([
- find(children, "w:tblPr"),
- find(children, "w:tblGrid"),
- ...rows.flatMap(({ element: row }) => {
- const rowChildren = contentOf$3(row).filter(isObject);
- return [find(rowChildren, "w:trPr"), ...unwrap(rowChildren).filter((part) => "w:tc" in part).map((cell) => find(contentOf$3(cell).filter(isObject), "w:tcPr"))];
- })
- ]);
const styleUnsupported = tableStyles.some(({ rowProperties = [], cellProperties = [] }) => changesLines(rowProperties, IGNORED_STYLE_ROW_PROPERTIES) || changesLines(cellProperties, FOLLOWED_STYLE_CELL_PROPERTIES)) ? "a table style with formatting of its rows or cells" : void 0;
const givenWidth = readTableWidth(properties);
const evenable = !(spaced && fixed) && givenWidth.share === void 0 && read.every(({ edges }) => edges.has(0));
@@ -36544,7 +36665,7 @@ var docxLayout = (function(exports) {
const older = reader.compatibilityMode !== void 0;
const marginsBeside = older && sized && givenWidth.width === void 0;
const verticalUnsupported = fits && (float !== void 0 || reader.inSizedTable === true) && tableCells.some(({ vertical }) => vertical) ? "text that runs up or down a cell of a table sized to its text, in a table cell or that text flows around" : void 0;
- const unsupported = (_ref15 = (_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_ref23 = (_ref24 = (_ref25 = (_ref26 = (_ref27 = (_ref28 = (_ref29 = (_ref30 = (_ref31 = (_ref32 = (_withoutGuess$unsuppo = withoutGuess === null || withoutGuess === void 0 ? void 0 : withoutGuess.unsupported) !== null && _withoutGuess$unsuppo !== void 0 ? _withoutGuess$unsuppo : reader.down === true ? "a table on text that runs down the page" : void 0) !== null && _ref32 !== void 0 ? _ref32 : float !== void 0 && (reader.inCell || reader.inHeader) ? "a table that text flows around in a table cell, header or footer" : void 0) !== null && _ref31 !== void 0 ? _ref31 : float !== void 0 && older ? "a table that text flows around in a document in compatibility mode" : void 0) !== null && _ref30 !== void 0 ? _ref30 : marginsBeside && fits && (reader.inCell === true || indent !== 0 || givenWidth.share !== void 0) ? "a table sized to its text in a table cell, indented or as a share of the width, in a document in compatibility mode" : void 0) !== null && _ref29 !== void 0 ? _ref29 : typeof float === "string" ? float : void 0) !== null && _ref28 !== void 0 ? _ref28 : parts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : void 0) !== null && _ref27 !== void 0 ? _ref27 : (_read$find2 = read.find((row) => row.unsupported !== void 0)) === null || _read$find2 === void 0 ? void 0 : _read$find2.unsupported) !== null && _ref26 !== void 0 ? _ref26 : unmerged) !== null && _ref25 !== void 0 ? _ref25 : fits ? unfitted : unequal && !evened ? "a table whose rows give a column different widths" : void 0) !== null && _ref24 !== void 0 ? _ref24 : fits && tableCells.some(({ noWrap }) => noWrap) ? "a table cell whose text doesn't wrap, in a table sized to its text" : void 0) !== null && _ref23 !== void 0 ? _ref23 : fits && tableCells.some(({ fitText }) => fitText) ? "text fitted to its table cell, in a table sized to its text" : void 0) !== null && _ref22 !== void 0 ? _ref22 : verticalUnsupported) !== null && _ref21 !== void 0 ? _ref21 : spacingUnsupported) !== null && _ref20 !== void 0 ? _ref20 : typeof geometry === "string" ? geometry : void 0) !== null && _ref19 !== void 0 ? _ref19 : indent === void 0 ? "a table indented by a share of the width" : void 0) !== null && _ref18 !== void 0 ? _ref18 : ((_givenWidth$share = givenWidth.share) !== null && _givenWidth$share !== void 0 ? _givenWidth$share : 0) > 1 ? "a table whose width is a share of more than the width it is in" : void 0) !== null && _ref17 !== void 0 ? _ref17 : styleUnsupported) !== null && _ref16 !== void 0 ? _ref16 : lengths) !== null && _ref15 !== void 0 ? _ref15 : (_blocks$find = blocks.find((block) => block.unsupported !== void 0)) === null || _blocks$find === void 0 ? void 0 : _blocks$find.unsupported;
+ const unsupported = (_ref14 = (_ref15 = (_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_ref23 = (_ref24 = (_ref25 = (_ref26 = (_ref27 = (_ref28 = (_ref29 = (_ref30 = (_withoutGuess$unsuppo = withoutGuess === null || withoutGuess === void 0 ? void 0 : withoutGuess.unsupported) !== null && _withoutGuess$unsuppo !== void 0 ? _withoutGuess$unsuppo : reader.down === true ? "a table on text that runs down the page" : void 0) !== null && _ref30 !== void 0 ? _ref30 : float !== void 0 && (reader.inCell || reader.inHeader) ? "a table that text flows around in a table cell, header or footer" : void 0) !== null && _ref29 !== void 0 ? _ref29 : float !== void 0 && older ? "a table that text flows around in a document in compatibility mode" : void 0) !== null && _ref28 !== void 0 ? _ref28 : marginsBeside && fits && (reader.inCell === true || indent !== 0 || givenWidth.share !== void 0) ? "a table sized to its text in a table cell, indented or as a share of the width, in a document in compatibility mode" : void 0) !== null && _ref27 !== void 0 ? _ref27 : typeof float === "string" ? float : void 0) !== null && _ref26 !== void 0 ? _ref26 : parts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : void 0) !== null && _ref25 !== void 0 ? _ref25 : (_read$find2 = read.find((row) => row.unsupported !== void 0)) === null || _read$find2 === void 0 ? void 0 : _read$find2.unsupported) !== null && _ref24 !== void 0 ? _ref24 : unmerged) !== null && _ref23 !== void 0 ? _ref23 : fits ? unfitted : unequal && !evened ? "a table whose rows give a column different widths" : void 0) !== null && _ref22 !== void 0 ? _ref22 : fits && tableCells.some(({ noWrap }) => noWrap) ? "a table cell whose text doesn't wrap, in a table sized to its text" : void 0) !== null && _ref21 !== void 0 ? _ref21 : fits && tableCells.some(({ fitText }) => fitText) ? "text fitted to its table cell, in a table sized to its text" : void 0) !== null && _ref20 !== void 0 ? _ref20 : verticalUnsupported) !== null && _ref19 !== void 0 ? _ref19 : spacingUnsupported) !== null && _ref18 !== void 0 ? _ref18 : typeof geometry === "string" ? geometry : void 0) !== null && _ref17 !== void 0 ? _ref17 : indent === void 0 ? "a table indented by a share of the width" : void 0) !== null && _ref16 !== void 0 ? _ref16 : ((_givenWidth$share = givenWidth.share) !== null && _givenWidth$share !== void 0 ? _givenWidth$share : 0) > 1 ? "a table whose width is a share of more than the width it is in" : void 0) !== null && _ref15 !== void 0 ? _ref15 : styleUnsupported) !== null && _ref14 !== void 0 ? _ref14 : (_blocks$find = blocks.find((block) => block.unsupported !== void 0)) === null || _blocks$find === void 0 ? void 0 : _blocks$find.unsupported;
const rowWidth = ((_read$0$cells = (_read$ = read[0]) === null || _read$ === void 0 ? void 0 : _read$.cells) !== null && _read$0$cells !== void 0 ? _read$0$cells : []).reduce((total, cell) => {
var _cell$ownWidth;
return total + ((_cell$ownWidth = cell.ownWidth) !== null && _cell$ownWidth !== void 0 ? _cell$ownWidth : 0);
@@ -36597,7 +36718,7 @@ var docxLayout = (function(exports) {
var readTableFloat = (element, overlap) => {
const attributes = attributesOf(element);
const position = (anchor, spec, at) => {
- var _twips4;
+ var _twips5;
const { from: anchors, alignments } = TABLE_AXES[anchor];
const given = attributes[`w:${anchor}`];
const from = given === void 0 ? anchor === "horzAnchor" ? "column" : "margin" : anchors.get(String(given));
@@ -36613,15 +36734,15 @@ var docxLayout = (function(exports) {
} : "a table that text flows around lined up in a way not yet followed";
return {
from,
- offset: (_twips4 = twips(attributes[`w:${at}`])) !== null && _twips4 !== void 0 ? _twips4 : 0
+ offset: (_twips5 = twips(attributes[`w:${at}`])) !== null && _twips5 !== void 0 ? _twips5 : 0
};
};
const horizontal = position("horzAnchor", "tblpXSpec", "tblpX");
const vertical = position("vertAnchor", "tblpYSpec", "tblpY");
if (typeof horizontal === "string" || typeof vertical === "string") return typeof horizontal === "string" ? horizontal : vertical;
const distance = (name) => {
- var _twips5;
- return (_twips5 = twips(attributes[`w:${name}FromText`])) !== null && _twips5 !== void 0 ? _twips5 : 0;
+ var _twips6;
+ return (_twips6 = twips(attributes[`w:${name}FromText`])) !== null && _twips6 !== void 0 ? _twips6 : 0;
};
return {
horizontal,
@@ -37241,27 +37362,27 @@ var docxLayout = (function(exports) {
* the same space between them, unless the section gives each column's width.
*/
var readColumns = (element, width) => {
- var _numberOf7, _twips7;
+ var _numberOf7, _twips8;
const attributes = attributesOf(element);
const given = childrenOf(element).filter((child) => "w:col" in child);
if (isOff(attributes["w:equalWidth"]) && given.length > 0) return given.map((column) => {
- var _twips6;
- return (_twips6 = twips(attributesOf(column["w:col"])["w:w"])) !== null && _twips6 !== void 0 ? _twips6 : 0;
+ var _twips7;
+ return (_twips7 = twips(attributesOf(column["w:col"])["w:w"])) !== null && _twips7 !== void 0 ? _twips7 : 0;
});
const count = Math.max(1, (_numberOf7 = numberOf(attributes["w:num"])) !== null && _numberOf7 !== void 0 ? _numberOf7 : 1);
- const space = (_twips7 = twips(attributes["w:space"])) !== null && _twips7 !== void 0 ? _twips7 : DEFAULT_COLUMN_SPACE;
+ const space = (_twips8 = twips(attributes["w:space"])) !== null && _twips8 !== void 0 ? _twips8 : DEFAULT_COLUMN_SPACE;
return Array.from({ length: count }, () => (width - space * (count - 1)) / count);
};
var CHARACTER_SPACE_UNITS = 4096;
/** How wide a section's pages are, and their margins and gutter across them, in points */
var pageAcross = (properties) => {
- var _twips8, _twips9, _margins$wLeft, _twips10, _margins$wRight, _twips11;
+ var _twips9, _twips10, _margins$wLeft, _twips11, _margins$wRight, _twips12;
const margins = attributesOf(find(properties, "w:pgMar"));
return {
- pageWidth: (_twips8 = twips(attributesOf(find(properties, "w:pgSz"))["w:w"])) !== null && _twips8 !== void 0 ? _twips8 : DEFAULT_SECTION.pageWidth,
- left: (_twips9 = twips((_margins$wLeft = margins["w:left"]) !== null && _margins$wLeft !== void 0 ? _margins$wLeft : margins["w:start"])) !== null && _twips9 !== void 0 ? _twips9 : DEFAULT_SECTION.marginLeft,
- right: (_twips10 = twips((_margins$wRight = margins["w:right"]) !== null && _margins$wRight !== void 0 ? _margins$wRight : margins["w:end"])) !== null && _twips10 !== void 0 ? _twips10 : DEFAULT_SECTION.marginRight,
- gutter: (_twips11 = twips(margins["w:gutter"])) !== null && _twips11 !== void 0 ? _twips11 : DEFAULT_SECTION.gutter
+ pageWidth: (_twips9 = twips(attributesOf(find(properties, "w:pgSz"))["w:w"])) !== null && _twips9 !== void 0 ? _twips9 : DEFAULT_SECTION.pageWidth,
+ left: (_twips10 = twips((_margins$wLeft = margins["w:left"]) !== null && _margins$wLeft !== void 0 ? _margins$wLeft : margins["w:start"])) !== null && _twips10 !== void 0 ? _twips10 : DEFAULT_SECTION.marginLeft,
+ right: (_twips11 = twips((_margins$wRight = margins["w:right"]) !== null && _margins$wRight !== void 0 ? _margins$wRight : margins["w:end"])) !== null && _twips11 !== void 0 ? _twips11 : DEFAULT_SECTION.marginRight,
+ gutter: (_twips12 = twips(margins["w:gutter"])) !== null && _twips12 !== void 0 ? _twips12 : DEFAULT_SECTION.gutter
};
};
/** How wide a section's text is: its page's, less its margins and a gutter beside it */
@@ -37280,7 +37401,7 @@ var docxLayout = (function(exports) {
* document's grid of no type (`default`) is no grid, whatever its pitch.
*/
var readGrid = (element, normalSize, { gutterAtTop }) => {
- var _numberOf8, _twips12, _twips13, _twips14;
+ var _numberOf8, _twips13, _twips14, _twips15;
const properties = childrenOf(element);
const attributes = attributesOf(find(properties, "w:docGrid"));
const type = attributes["w:type"];
@@ -37292,7 +37413,7 @@ var docxLayout = (function(exports) {
const space = ((_numberOf8 = numberOf(attributes["w:charSpace"])) !== null && _numberOf8 !== void 0 ? _numberOf8 : 0) / CHARACTER_SPACE_UNITS;
if (type === "linesAndChars") return _objectSpread2({ linePitch }, space === 0 ? {} : { characterSpace: space });
const margins = attributesOf(find(properties, "w:pgMar"));
- const columns = downOf(properties) === void 0 ? readColumns(find(properties, "w:cols"), textWidthOf(properties, gutterAtTop)) : [((_twips12 = twips(attributesOf(find(properties, "w:pgSz"))["w:h"])) !== null && _twips12 !== void 0 ? _twips12 : DEFAULT_SECTION.pageHeight) - Math.abs((_twips13 = twips(margins["w:top"])) !== null && _twips13 !== void 0 ? _twips13 : DEFAULT_SECTION.marginTop) - Math.abs((_twips14 = twips(margins["w:bottom"])) !== null && _twips14 !== void 0 ? _twips14 : DEFAULT_SECTION.marginBottom)];
+ const columns = downOf(properties) === void 0 ? readColumns(find(properties, "w:cols"), textWidthOf(properties, gutterAtTop)) : [((_twips13 = twips(attributesOf(find(properties, "w:pgSz"))["w:h"])) !== null && _twips13 !== void 0 ? _twips13 : DEFAULT_SECTION.pageHeight) - Math.abs((_twips14 = twips(margins["w:top"])) !== null && _twips14 !== void 0 ? _twips14 : DEFAULT_SECTION.marginTop) - Math.abs((_twips15 = twips(margins["w:bottom"])) !== null && _twips15 !== void 0 ? _twips15 : DEFAULT_SECTION.marginBottom)];
const room = normalSize + space;
if (room <= 0 || columns.some((width) => width / room < 1)) return "a document grid of characters with no room for one";
return columns.some((width) => width !== columns[0]) ? {
@@ -37310,7 +37431,7 @@ var docxLayout = (function(exports) {
* (`word-watertight-settings.docx` ST3).
*/
var readSection = (element, readPart, previous, { gutterAtTop, mirrorMargins }, grid) => {
- var _stringOf2, _twips15, _twips16, _twips17, _twips18, _twips19, _CHAPTER_SEPARATORS$S;
+ var _stringOf2, _twips16, _twips17, _twips18, _twips19, _twips20, _CHAPTER_SEPARATORS$S;
const properties = childrenOf(element);
const size = attributesOf(find(properties, "w:pgSz"));
const margins = attributesOf(find(properties, "w:pgMar"));
@@ -37320,24 +37441,24 @@ var docxLayout = (function(exports) {
const firstNumber = numberOf(numbering["w:start"]);
const chapterLevel = numberOf(numbering["w:chapStyle"]);
const { pageWidth, left: marginLeft, right: marginRight, gutter } = pageAcross(properties);
- const marginTop = (_twips15 = twips(margins["w:top"])) !== null && _twips15 !== void 0 ? _twips15 : DEFAULT_SECTION.marginTop;
+ const marginTop = (_twips16 = twips(margins["w:top"])) !== null && _twips16 !== void 0 ? _twips16 : DEFAULT_SECTION.marginTop;
const columns = readColumns(find(properties, "w:cols"), textWidthOf(properties, gutterAtTop));
const direction = valueOf(properties, "w:textDirection");
const down = downOf(properties);
const sectionStart = start !== void 0 && START_TYPES.has(start) ? start : "nextPage";
- const marginBottom = (_twips16 = twips(margins["w:bottom"])) !== null && _twips16 !== void 0 ? _twips16 : DEFAULT_SECTION.marginBottom;
- const unsupported = typeof grid === "string" ? grid : formatPageNumber(1, format) === void 0 ? "page numbers in a format not yet written" : direction !== void 0 && !HORIZONTAL.has(direction) && down === void 0 ? "text in a direction not yet followed" : down !== void 0 && (mirrorMargins || columns.length > 1 || gutter !== 0 && (gutterAtTop || down === "fromLeft")) ? "text that runs down the page with columns, mirrored margins, or a gutter at the top or beside lines from the left" : (previous === null || previous === void 0 ? void 0 : previous.textRunsDown) !== void 0 && (sectionStart === "nextColumn" || sectionStart === "continuous" && down !== previous.textRunsDown) ? "a continuous section break after text that runs down the page, into text that doesn't" : find(properties, "w15:footnoteColumns") !== void 0 ? "footnotes in columns of their own" : unknownLengthIn(element);
+ const marginBottom = (_twips17 = twips(margins["w:bottom"])) !== null && _twips17 !== void 0 ? _twips17 : DEFAULT_SECTION.marginBottom;
+ const unsupported = typeof grid === "string" ? grid : formatPageNumber(1, format) === void 0 ? "page numbers in a format not yet written" : direction !== void 0 && !HORIZONTAL.has(direction) && down === void 0 ? "text in a direction not yet followed" : down !== void 0 && (mirrorMargins || columns.length > 1 || gutter !== 0 && (gutterAtTop || down === "fromLeft")) ? "text that runs down the page with columns, mirrored margins, or a gutter at the top or beside lines from the left" : (previous === null || previous === void 0 ? void 0 : previous.textRunsDown) !== void 0 && (sectionStart === "nextColumn" || sectionStart === "continuous" && down !== previous.textRunsDown) ? "a continuous section break after text that runs down the page, into text that doesn't" : find(properties, "w15:footnoteColumns") !== void 0 ? "footnotes in columns of their own" : void 0;
const headers = readReferences(properties, "w:headerReference", readPart);
const footers = readReferences(properties, "w:footerReference", readPart);
const section = _objectSpread2(_objectSpread2(_objectSpread2({
pageWidth,
- pageHeight: (_twips17 = twips(size["w:h"])) !== null && _twips17 !== void 0 ? _twips17 : DEFAULT_SECTION.pageHeight,
+ pageHeight: (_twips18 = twips(size["w:h"])) !== null && _twips18 !== void 0 ? _twips18 : DEFAULT_SECTION.pageHeight,
marginTop,
marginBottom,
marginLeft,
marginRight,
- header: (_twips18 = twips(margins["w:header"])) !== null && _twips18 !== void 0 ? _twips18 : DEFAULT_SECTION.header,
- footer: (_twips19 = twips(margins["w:footer"])) !== null && _twips19 !== void 0 ? _twips19 : DEFAULT_SECTION.footer,
+ header: (_twips19 = twips(margins["w:header"])) !== null && _twips19 !== void 0 ? _twips19 : DEFAULT_SECTION.header,
+ footer: (_twips20 = twips(margins["w:footer"])) !== null && _twips20 !== void 0 ? _twips20 : DEFAULT_SECTION.footer,
gutter: gutterAtTop ? 0 : gutter,
topGutter: gutterAtTop ? gutter : 0,
start: down !== void 0 && sectionStart === "continuous" && (previous === null || previous === void 0 ? void 0 : previous.textRunsDown) !== down ? "nextPage" : sectionStart,
@@ -37508,10 +37629,10 @@ var docxLayout = (function(exports) {
}, withoutUndefined({ unsupported: found.unsupported }));
return [[String(attributesOf(child["w:num"])["w:numId"]), list]];
}));
- return _objectSpread2({ lists: new Map([...lists, ...[...otherIds].flatMap(([other, id]) => {
+ return { lists: new Map([...lists, ...[...otherIds].flatMap(([other, id]) => {
const list = lists.get(id);
return list ? [[other, list]] : [];
- })]) }, withoutUndefined({ unsupported: unknownLengthIn(xml) }));
+ })]) };
};
var CURRENT_COMPATIBILITY_MODE = 15;
var OLDER_COMPATIBILITY_MODES = /* @__PURE__ */ new Set([
@@ -37721,20 +37842,20 @@ var docxLayout = (function(exports) {
* Reads the parts of the document's settings (`w:settings`) that change how it is laid out.
*/
var readSettings = (xml) => {
- var _find$, _find4, _twips20;
+ var _find4, _twips21;
const settings = childrenOf(xml === null || xml === void 0 ? void 0 : xml["w:settings"]);
const compatibility = childrenOf(find(settings, "w:compat"));
const lists = readKinsokuLists(settings);
const mode = compatibilityModeOf(settings);
const olderMode = olderModeOf(settings);
- const unsupported = (_find$ = (_find4 = [
+ const unsupported = (_find4 = [
[mode < CURRENT_COMPATIBILITY_MODE && olderMode === void 0, "a document in a compatibility mode Word hasn't been seen laying out"],
[asksForUnfollowedCompatibility(compatibility, olderMode !== void 0), "a compatibility setting not yet followed"],
[onOff(settings, "w:bookFoldPrinting") || onOff(settings, "w:bookFoldRevPrinting"), "pages printed as a folded booklet"],
[onOff(settings, "w:linkStyles"), "styles updated from the document's template when Word opens it"]
- ].find(([applies]) => applies === true)) === null || _find4 === void 0 ? void 0 : _find4[1]) !== null && _find$ !== void 0 ? _find$ : unknownLengthIn(settings);
+ ].find(([applies]) => applies === true)) === null || _find4 === void 0 ? void 0 : _find4[1];
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
- defaultTabStop: (_twips20 = twips(attributesOf(find(settings, "w:defaultTabStop"))["w:val"])) !== null && _twips20 !== void 0 ? _twips20 : 36,
+ defaultTabStop: (_twips21 = twips(attributesOf(find(settings, "w:defaultTabStop"))["w:val"])) !== null && _twips21 !== void 0 ? _twips21 : 36,
evenAndOddHeaders: onOff(settings, "w:evenAndOddHeaders") === true,
addsParagraphSpacing: onOff(compatibility, "w:doNotUseHTMLParagraphAutoSpacing") === true
}, Object.keys(lists).length > 0 ? { breakRules: { lists } } : {}), onOff(settings, "w:autoHyphenation") === true ? { hyphenation: readHyphenation(settings) } : {}), olderMode === void 0 ? {} : { compatibilityMode: olderMode }), onOff(compatibility, "w:suppressTopSpacing") === true ? { suppressesTopSpacing: true } : {}), unsupported ? { unsupported } : {});
@@ -37828,7 +37949,7 @@ var docxLayout = (function(exports) {
* Reads a document's body (`w:body`), with the other parts of the document.
*/
var readContent = (writtenBody, writtenParts, { guess = false } = {}) => {
- var _writtenParts$dataSto, _parts$otherListIds, _parts$otherListIds2, _parts$settings, _fontOf$size2, _notesByKind$kind$get, _ref33, _ref34, _ref35, _ref36, _ref37, _ref38, _ref39, _documentContent$unsu;
+ var _writtenParts$dataSto, _parts$otherListIds, _parts$otherListIds2, _parts$settings, _fontOf$size2, _notesByKind$kind$get, _ref31, _ref32, _ref33, _ref34, _ref35, _documentContent$unsu;
const stores = (_writtenParts$dataSto = writtenParts.dataStores) !== null && _writtenParts$dataSto !== void 0 ? _writtenParts$dataSto : /* @__PURE__ */ new Map();
const body = withBoundTextWritten(writtenBody, stores);
const parts = _objectSpread2(_objectSpread2({}, writtenParts), {}, {
@@ -37837,7 +37958,7 @@ var docxLayout = (function(exports) {
endnotes: withBoundTextWritten(writtenParts.endnotes, stores)
});
const { styles } = parts;
- const { lists: numbering, unsupported: inNumbering } = readNumbering(parts.numbering, styles, (_parts$otherListIds = parts.otherListIds) !== null && _parts$otherListIds !== void 0 ? _parts$otherListIds : /* @__PURE__ */ new Map());
+ const { lists: numbering } = readNumbering(parts.numbering, styles, (_parts$otherListIds = parts.otherListIds) !== null && _parts$otherListIds !== void 0 ? _parts$otherListIds : /* @__PURE__ */ new Map());
const listIds = (_parts$otherListIds2 = parts.otherListIds) !== null && _parts$otherListIds2 !== void 0 ? _parts$otherListIds2 : /* @__PURE__ */ new Map();
const markers = {
count: 0,
@@ -38188,7 +38309,7 @@ var docxLayout = (function(exports) {
relativeReferences: markers.relative,
endnoteReferences
}, parts.fonts !== void 0 && parts.fonts.length > 0 ? { fonts: parts.fonts } : {}), readSettings(parts.settings));
- return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref33 = (_ref34 = (_ref35 = (_ref36 = (_ref37 = (_ref38 = (_ref39 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : styles.unsupported) !== null && _ref39 !== void 0 ? _ref39 : inNumbering) !== null && _ref38 !== void 0 ? _ref38 : footnotes.size > 0 ? notesUnsupported("footnote") : void 0) !== null && _ref37 !== void 0 ? _ref37 : endnotes.length > 0 ? notesUnsupported("endnote") : void 0) !== null && _ref36 !== void 0 ? _ref36 : sections.slice(Math.min(...endnoteSections)).some(({ textRunsDown }) => textRunsDown !== void 0) ? "endnotes on or before text that runs down the page" : void 0) !== null && _ref35 !== void 0 ? _ref35 : endnoteSections.some((section) => sections.slice(section + 1).some((_, after) => !sameGrid(gridOf(section), gridOf(section + 1 + after)))) ? "endnotes from a section followed by one on another document grid" : void 0) !== null && _ref34 !== void 0 ? _ref34 : unwrittenNumber ? "notes numbered in a format not yet written" : void 0) !== null && _ref33 !== void 0 ? _ref33 : unseenNumbering }));
+ return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref31 = (_ref32 = (_ref33 = (_ref34 = (_ref35 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : footnotes.size > 0 ? notesUnsupported("footnote") : void 0) !== null && _ref35 !== void 0 ? _ref35 : endnotes.length > 0 ? notesUnsupported("endnote") : void 0) !== null && _ref34 !== void 0 ? _ref34 : sections.slice(Math.min(...endnoteSections)).some(({ textRunsDown }) => textRunsDown !== void 0) ? "endnotes on or before text that runs down the page" : void 0) !== null && _ref33 !== void 0 ? _ref33 : endnoteSections.some((section) => sections.slice(section + 1).some((_, after) => !sameGrid(gridOf(section), gridOf(section + 1 + after)))) ? "endnotes from a section followed by one on another document grid" : void 0) !== null && _ref32 !== void 0 ? _ref32 : unwrittenNumber ? "notes numbered in a format not yet written" : void 0) !== null && _ref31 !== void 0 ? _ref31 : unseenNumbering }));
};
//#endregion
//#region src/layout/paginate.ts
@@ -38408,18 +38529,18 @@ var docxLayout = (function(exports) {
var rowOf = (lines, first, skip = 0, top) => {
const height = Math.max(...lines.map((line) => line.height));
const { breakAfter } = lines[lines.length - 1];
- const { spacingBelow } = lines.find((line) => line.height === height);
+ const { spacingBelow, belowOnGrid } = lines.find((line) => line.height === height);
return _objectSpread2(_objectSpread2({
first,
count: lines.length,
skip,
height
- }, top === void 0 ? {} : { top }), {}, { line: _objectSpread2(_objectSpread2({
+ }, top === void 0 ? {} : { top }), {}, { line: _objectSpread2(_objectSpread2(_objectSpread2({
height: skip + height,
markers: lines.flatMap(({ markers }) => markers),
text: lines.map(({ text }) => text).join(""),
textWidth: sum(lines.map(({ textWidth }) => textWidth))
- }, breakAfter === void 0 ? {} : { breakAfter }), spacingBelow === void 0 ? {} : { spacingBelow }) });
+ }, breakAfter === void 0 ? {} : { breakAfter }), spacingBelow === void 0 ? {} : { spacingBelow }), belowOnGrid === void 0 ? {} : { belowOnGrid }) });
};
var KEPT_FLOATING = "a paragraph kept with the next before a table that text flows around";
/**
@@ -38633,13 +38754,13 @@ var docxLayout = (function(exports) {
}) ? UNKNOWN_CHARACTER : void 0;
/**
* Why how Word kerns a paragraph's text, or joins its letters into ligatures, isn't known to the measurer, when it
- * isn't. Text in the same font, kerned or with ligatures, is measured across runs, and so is checked across them.
- * Whether Word kerns it and joins its letters across a soft hyphen, and kerns the hyphen it draws at the end of a line
- * with the letter before it, hasn't been seen
+ * isn't. Text in the same font, kerned or with ligatures, is measured across runs, and so is checked across them. Kerned
+ * text isn't kerned across a soft hyphen (see `textMeasuredTogether`), but whether Word joins letters into ligatures
+ * across one hasn't been seen
*/
const unknownShapingIn = (inline) => {
const together = textMeasuredTogether(inline);
- return together.some(({ besideSoftHyphen }) => besideSoftHyphen) ? "kerning or ligatures beside a soft hyphen" : together.map(({ text, font }) => {
+ return together.some(({ besideSoftHyphen }) => besideSoftHyphen) ? "ligatures beside a soft hyphen" : together.map(({ text, font }) => {
var _measurer$unknownShap;
return (_measurer$unknownShap = measurer.unknownShaping) === null || _measurer$unknownShap === void 0 ? void 0 : _measurer$unknownShap.call(measurer, text, font);
}).find(Boolean);
@@ -38752,10 +38873,11 @@ var docxLayout = (function(exports) {
* Whether a paragraph is in one box of borders with a block next to it: a paragraph with the same borders and indents,
* whatever their between borders (`word-paragraph-formats.docx` B5f, scripts/layout-probes/stops2/word-stops-text.ts
* PB1a to PB1c), unless a page break comes between them, where Word ends the box at the foot of one page and starts
- * another, with its top border, on the next (PB3b)
+ * another, with its top border, on the next (PB3b). The empty paragraph that ends a section is in a box of its own, after
+ * a table too, where it takes a line, so the boxes either side of it end there (stops2/word-stops-text2.ts PB3c to PB3e)
*/
const sharesBorders = (one, other, side) => {
- if (one.borders === void 0 || (other === null || other === void 0 ? void 0 : other.type) !== "paragraph" || other.sectionBreak || other.borders === void 0) return false;
+ if (one.borders === void 0 || one.sectionBreak || (other === null || other === void 0 ? void 0 : other.type) !== "paragraph" || other.sectionBreak || other.borders === void 0) return false;
return other.borders.outline === one.borders.outline && !(side === "before" ? one : other).format.pageBreakBefore;
};
const measureParagraph = (paragraph, width, before, after, inCell = false) => {
@@ -38780,6 +38902,14 @@ var docxLayout = (function(exports) {
});
};
const linesHeight = (lines) => sum(lines.map(({ height }) => height));
+ /** The space below the text of the last line of what is kept together, which may go below the page, and whether a grid leaves it */
+ const belowOf = (last) => {
+ var _last$spacingBelow;
+ return {
+ spacingBelow: (_last$spacingBelow = last === null || last === void 0 ? void 0 : last.spacingBelow) !== null && _last$spacingBelow !== void 0 ? _last$spacingBelow : 0,
+ belowOnGrid: (last === null || last === void 0 ? void 0 : last.belowOnGrid) === true
+ };
+ };
/** How tall lines are on a page, at the bottom of which the multiple spacing of their last can go below it */
const heightToFit = (lines) => {
var _lines$at$spacingBelo, _lines$at;
@@ -38789,7 +38919,7 @@ var docxLayout = (function(exports) {
* Whether what is kept together, `height` tall from `from`, fits above `end`, with its last line's multiple spacing
* below it when that can be (`hangsBelow`)
*/
- const fitsAbove = (from, { height, spacingBelow }, end, aboveNotes) => from + height <= end + TOLERANCE || from + height - spacingBelow <= end + TOLERANCE && hangsBelow(aboveNotes);
+ const fitsAbove = (from, { height, spacingBelow, belowOnGrid }, end, aboveNotes) => from + height <= end + TOLERANCE || from + height - spacingBelow <= end + TOLERANCE && hangsBelow(aboveNotes, false, belowOnGrid === true);
/**
* How narrow and how wide the paragraphs and tables in a table cell can be, and whether Word may hyphenate a word as
* wide as the narrowest of them
@@ -39151,15 +39281,18 @@ var docxLayout = (function(exports) {
return text === void 0 ? {} : { pageNumber: text };
};
/**
- * Whether the space a line's multiple spacing adds below its text, or a document grid leaves below it, can go below the
- * bottom of the page, as Word lets it (`word-mixed-heights.docx` MH1c, `word-grid.docx` G1), for a line that fits only
- * without it, and below the bottom of columns evened out by a continuous section break (scripts/layout-probes/stops2/word-stops-text.ts
+ * Whether the space a line's multiple spacing adds below its text, or a document grid leaves below it (`onGrid`), can go
+ * below the bottom of the page, as Word lets it (`word-mixed-heights.docx` MH1c, `word-grid.docx` G1), for a line that
+ * fits only without it, and below the bottom of columns evened out by a continuous section break (scripts/layout-probes/stops2/word-stops-text.ts
* PB7b: the last of four lines at double spacing at the foot of the second column, as it would be without its space
- * below counted). Stops where Word hasn't shown it: above footnotes, which it would go into, and above a paragraph's
- * border below. Guessing, it goes there too
+ * below counted). Above footnotes, multiple spacing's can't go into them: a line at double spacing that fits above the
+ * page's footnote only without its space below goes on to the next page (stops2/word-stops-text2.ts PB7e). Stops where
+ * Word hasn't shown it: a grid's room above footnotes, and room above a paragraph's border below. Guessing, it goes
+ * there
*/
- const hangsBelow = (aboveNotes, aboveBorder = false) => {
- if (aboveNotes) stopAt("a line whose room below its text goes below it into the footnotes");
+ const hangsBelow = (aboveNotes, aboveBorder = false, onGrid = false) => {
+ if (aboveNotes && !onGrid) return false;
+ if (aboveNotes) stopAt("a line whose room a document grid leaves below its text goes below it into the footnotes");
if (aboveBorder) stopAt("a line whose room below its text goes below the page, above its paragraph's border");
return true;
};
@@ -40890,7 +41023,7 @@ var docxLayout = (function(exports) {
const room = linesBottom() - position - space;
const ends = index + linesUpTo(rows.length) === lines.length;
const notesOnPage = noteArea > 0 || reserved() > 0;
- const hangs = (upTo) => hangsBelow(notesOnPage || notesOf(upTo).length > 0, ends && upTo === remaining.length && paragraph.borderBelow > 0);
+ const hangs = (upTo) => hangsBelow(notesOnPage || notesOf(upTo).length > 0, ends && upTo === remaining.length && paragraph.borderBelow > 0, remaining[upTo - 1].belowOnGrid === true);
const { fits, count: kept } = linesThatFit(remaining, room, paragraph, isFirstLine, (upTo) => noteCost(leastNoteRoom(notesOf(upTo))) + (ends && upTo === remaining.length ? paragraph.borderBelow : 0), hangs);
const moved = movedFromPage();
const movedLine = remaining.findIndex(({ markers }) => markers.some((marker) => moved.includes(marker)));
@@ -41587,7 +41720,7 @@ var docxLayout = (function(exports) {
* of a paragraph's lines, or the first lines of a longer one, or a table's first row.
*/
const keptHeight = (index, width) => {
- var _kept$spaceAfter, _kept, _nextLines$at$spacing, _nextLines$at;
+ var _kept$spaceAfter, _kept;
const chain = keptChain(index);
const measured = (offset) => {
var _blocks, _blocks2;
@@ -41599,14 +41732,12 @@ var docxLayout = (function(exports) {
const keptNotes = notesIn(kept.flatMap(({ lines }) => lines.flatMap(({ markers }) => markers)));
const anchor = blocks[index + chain].block;
if (anchor.type === "paragraph" && anchor.sectionBreak) {
- var _kept$lines$at$spacin, _kept2;
- return {
- height: keptLines,
- spacingBelow: (_kept$lines$at$spacin = (_kept2 = kept[kept.length - 1]) === null || _kept2 === void 0 || (_kept2 = _kept2.lines.at(-1)) === null || _kept2 === void 0 ? void 0 : _kept2.spacingBelow) !== null && _kept$lines$at$spacin !== void 0 ? _kept$lines$at$spacin : 0,
+ var _kept2;
+ return _objectSpread2(_objectSpread2({ height: keptLines }, belowOf((_kept2 = kept[kept.length - 1]) === null || _kept2 === void 0 ? void 0 : _kept2.lines.at(-1))), {}, {
notes: keptNotes,
kept: keptNotes,
keptWith: "nothing"
- };
+ });
}
if (anchor.type === "table") {
const stops = ({ unsupported, noGuess }) => unsupported !== void 0 && (!guess || noGuess === true);
@@ -41624,9 +41755,7 @@ var docxLayout = (function(exports) {
const next = measured(index + chain);
const firstLines = next.keepLines || next.widowControl && next.lines.length <= 3 ? next.lines.length : next.widowControl ? 2 : 1;
const nextLines = next.lines.slice(0, firstLines);
- return _objectSpread2({
- height: keptLines + between(lastAfter, next.spaceBefore) + next.borderAbove + linesHeight(nextLines) + (nextLines.length === next.lines.length ? next.borderBelow : 0),
- spacingBelow: nextLines.length === next.lines.length && next.borderBelow > 0 ? 0 : (_nextLines$at$spacing = (_nextLines$at = nextLines.at(-1)) === null || _nextLines$at === void 0 ? void 0 : _nextLines$at.spacingBelow) !== null && _nextLines$at$spacing !== void 0 ? _nextLines$at$spacing : 0,
+ return _objectSpread2(_objectSpread2({ height: keptLines + between(lastAfter, next.spaceBefore) + next.borderAbove + linesHeight(nextLines) + (nextLines.length === next.lines.length ? next.borderBelow : 0) }, belowOf(nextLines.length === next.lines.length && next.borderBelow > 0 ? void 0 : nextLines.at(-1))), {}, {
notes: [...keptNotes, ...notesIn(nextLines.flatMap(({ markers }) => markers))],
kept: keptNotes,
keptWith: chain === 0 ? "nothing" : firstLines === next.lines.length && !next.pageBreakBefore ? "whole" : "part"
@@ -41642,7 +41771,7 @@ var docxLayout = (function(exports) {
* table, aren't measured here (see {@link KEPT_BESIDE}).
*/
const keptBeside = (index, width) => {
- var _nextRows$at, _lastRow$spacingBelow;
+ var _nextRows$at;
const chain = keptChain(index);
const anchor = blocks[index + chain].block;
const kept = blocks.slice(index, index + chain).map(({ block }) => block);
@@ -41674,16 +41803,11 @@ var docxLayout = (function(exports) {
const keptLines = kept.flatMap((paragraph, offset) => rowsHere(paragraph, offset, measuredAt(offset)).rows.map(({ line }) => line));
const keptNotes = notesIn(keptLines.flatMap(({ markers }) => markers));
const keptHeightSoFar = y - position;
- if (anchor.type === "paragraph" && anchor.sectionBreak) {
- var _keptLines$at$spacing, _keptLines$at;
- return {
- height: keptHeightSoFar,
- spacingBelow: (_keptLines$at$spacing = (_keptLines$at = keptLines.at(-1)) === null || _keptLines$at === void 0 ? void 0 : _keptLines$at.spacingBelow) !== null && _keptLines$at$spacing !== void 0 ? _keptLines$at$spacing : 0,
- notes: keptNotes,
- kept: keptNotes,
- keptWith: "nothing"
- };
- }
+ if (anchor.type === "paragraph" && anchor.sectionBreak) return _objectSpread2(_objectSpread2({ height: keptHeightSoFar }, belowOf(keptLines.at(-1))), {}, {
+ notes: keptNotes,
+ kept: keptNotes,
+ keptWith: "nothing"
+ });
const next = measuredAt(chain);
const { rows, placed, space: nextSpace } = rowsHere(anchor, chain, next);
const firstRows = next.keepLines || next.widowControl && rows.length <= 3 ? rows.length : next.widowControl ? 2 : 1;
@@ -41691,9 +41815,7 @@ var docxLayout = (function(exports) {
const nextLines = sum(nextRows.map(({ count }) => count));
const sinks = placed.some(({ line, drawing: { drawing, keepOut } }) => line < nextLines && (drawing.vertical.from === "paragraph" || drawing.vertical.from === "line") && keepOut.bottom > linesBottom() + TOLERANCE);
const lastRow = (_nextRows$at = nextRows.at(-1)) === null || _nextRows$at === void 0 ? void 0 : _nextRows$at.line;
- return _objectSpread2({
- height: sinks ? Number.POSITIVE_INFINITY : keptHeightSoFar + nextSpace + sum(nextRows.map(({ line }) => line.height)) + (nextRows.length === rows.length ? next.borderBelow : 0),
- spacingBelow: nextRows.length === rows.length && next.borderBelow > 0 ? 0 : (_lastRow$spacingBelow = lastRow === null || lastRow === void 0 ? void 0 : lastRow.spacingBelow) !== null && _lastRow$spacingBelow !== void 0 ? _lastRow$spacingBelow : 0,
+ return _objectSpread2(_objectSpread2({ height: sinks ? Number.POSITIVE_INFINITY : keptHeightSoFar + nextSpace + sum(nextRows.map(({ line }) => line.height)) + (nextRows.length === rows.length ? next.borderBelow : 0) }, belowOf(nextRows.length === rows.length && next.borderBelow > 0 ? void 0 : lastRow)), {}, {
notes: [...keptNotes, ...notesIn(nextRows.flatMap(({ line }) => line.markers))],
kept: keptNotes,
keptWith: chain === 0 ? "nothing" : firstRows === rows.length && !next.pageBreakBefore ? "whole" : "part"
@@ -41768,7 +41890,6 @@ var docxLayout = (function(exports) {
const next = (_blocks6 = blocks[index + 1]) === null || _blocks6 === void 0 ? void 0 : _blocks6.block;
if (block.sectionBreak && block.format.autoSpaceAfter === true && (next === null || next === void 0 ? void 0 : next.type) === "paragraph" && (next.format.autoSpaceBefore === true || ((_next$format$spaceBef = next.format.spaceBefore) !== null && _next$format$spaceBef !== void 0 ? _next$format$spaceBef : 0) > 0)) stopAt("automatic spacing after the empty paragraph that ends a section, before space of the next section's");
if (previous !== void 0 && sharesBorders(block, previous.block, "before") && previous.section !== blocks[index].section) stopAt("paragraphs with the same borders either side of a section break");
- if (block.sectionBreak && [previous === null || previous === void 0 ? void 0 : previous.block, next].some((other, at) => sharesBorders(block, other, at === 0 ? "before" : "after"))) stopAt("the empty paragraph that ends a section with the same borders as the paragraph before or after it");
}
if (block.type === "paragraph" && block.sectionBreak && !endsAfterTable(index)) {
var _blocks7;
diff --git a/live-examples/lib/shapes.iife.js b/live-examples/lib/shapes.iife.js
index 9cd4194027..f8ba0e4de8 100644
--- a/live-examples/lib/shapes.iife.js
+++ b/live-examples/lib/shapes.iife.js
@@ -4545,34 +4545,15 @@ var docxShapes = (function(exports, docx) {
return (METRIC.has(unit) ? Math.round(inUnits) : Math.floor(inUnits + ROUNDING)) / perPoint;
};
/**
- * A run's size (`w:sz`, or `w:szCs` for complex scripts) in points, from half-points, or from points, which Word rounds down to a half-point:
- * "11.75pt" is 11.5. Word ignores a size in inches, centimeters or millimeters, as if it had none (word-units2).
+ * A run's size (`w:sz`, or `w:szCs` for complex scripts) in points, from half-points, or from a length in any unit, which
+ * Word rounds down to a half-point, with or without a style that gives a size: "11.75pt" is 11.5, "0.4in" 28.5, "1cm" and
+ * "10mm" 28, and "0.3cm" 8.5, as it reads centimeters and millimeters to the nearest twip first (word-units2.ts V3,
+ * scripts/layout-probes/stops2/word-stops-text.ts RF27a to RF27c, word-stops-text2.ts RF27d to RF27g)
*/
var sizeOf = (value) => {
var _MEASURE$exec;
const unit = typeof value === "string" ? (_MEASURE$exec = MEASURE.exec(value)) === null || _MEASURE$exec === void 0 ? void 0 : _MEASURE$exec[4] : void 0;
- return unit === void 0 || unit === "pt" ? pointsOf(value, 2) : void 0;
- };
- /**
- * Why how Word reads a length in formatted XML isn't known, when it isn't: a size in a unit other than points, which Word's
- * PDFs showed it ignores in sizes that aren't whole half-points with no style giving a size (word-units2.ts V3), and
- * draws at its length in whole half-points in a run whose style gives one (scripts/layout-probes/stops2/word-stops-text.ts
- * RF27a to RF27c), which leaves which of the two decides unknown. Its minus sign is the whole number's only, as for every
- * length: "-2.5pt" lowers text by 1.5 points, "-0.5pt" and "-0.3cm" raise it, and "-0.5mm" spaces letters further apart
- * (RF26a, RF26b, RF28a, RF28b). Undefined when every length's reading is known.
- */
- var unknownLengthIn = (element, name = "") => {
- if (Array.isArray(element)) return element.reduce((found, child) => found !== null && found !== void 0 ? found : unknownLengthIn(child, name), void 0);
- if (!isObject(element)) return;
- return Object.entries(element).reduce((found, [key, child]) => {
- if (found !== void 0 || key !== "_attr") return found !== null && found !== void 0 ? found : unknownLengthIn(child, key);
- return Object.values(child).reduce((reason, value) => {
- const measure = typeof value === "string" ? MEASURE.exec(value) : null;
- if (reason !== void 0 || !measure) return reason;
- const [, , , , unit] = measure;
- return (name === "w:sz" || name === "w:szCs") && unit !== "pt" ? "a size given in a unit other than points" : void 0;
- }, void 0);
- }, void 0);
+ return unit === void 0 || !METRIC.has(unit) ? pointsOf(value, 2) : Math.floor(pointsOf(value, 20) * 2 + ROUNDING) / 2;
};
var isOff = (value) => value === false || value === 0 || value === "false" || value === "0" || value === "off";
/**
@@ -4827,7 +4808,7 @@ var docxShapes = (function(exports, docx) {
return (_styles$find = styles.find((style) => style.isDefault && style.definition.type === type)) === null || _styles$find === void 0 ? void 0 : _styles$find.id;
};
const byId = new Map(styles.map((style) => [style.id, style.definition]));
- return _objectSpread2({
+ return {
run: combine(defaults.map((children) => readRunFormat(find(childrenOf(find(children, "w:rPrDefault")), "w:rPr"), themeFonts))),
paragraph: combine(defaults.map((children) => readParagraphFormat(find(childrenOf(find(children, "w:pPrDefault")), "w:pPr")))),
styles: byId,
@@ -4835,7 +4816,7 @@ var docxShapes = (function(exports, docx) {
defaultCharacterStyle: defaultStyle("character"),
defaultTableStyle: defaultStyle("table"),
themeFonts
- }, withoutUndefined({ unsupported: unknownLengthIn(xml) }));
+ };
};
/**
* Reads the margins of a table's cells (`w:tblCellMar`), or of one cell (`w:tcMar`), in points.
@@ -4959,12 +4940,15 @@ var docxShapes = (function(exports, docx) {
* How wide a run's border is as Word draws it, in eighths of a point: as a paragraph's of its style. A border of no style
* ("none") takes its space still, but no width (scripts/layout-probes/word-run-formatting.ts RF7h). An art border's size
* is in points, so apples of 12 take 12 points (scripts/layout-probes/stops2/word-stops-text.ts RF25c), and Word draws a
- * single border of an eighth of a point, and a double one of none, as given (RF25f, RF25e). Undefined when Word hasn't been
- * seen to draw it.
+ * single border of an eighth of a point, and a double one of none, as given (RF25f, RF25e). A shadow doubles a single
+ * line, as a paragraph's (`word-paragraph-formats.docx` B6), and one drawn as a frame is as wide: one of 1.5 points 2
+ * points from the text takes 100 twips beside and above and below it with a shadow, and 70 as a frame
+ * (scripts/layout-probes/stops2/word-stops-text2.ts RF24c, RF24d). Undefined when Word hasn't been seen to draw it.
*/
var runBorderWidth = ({ style, size, shadow, frame }) => {
var _BORDER_WIDTHS$style, _BORDER_WIDTHS$style2, _SEEN_RUN_BORDERS$sty;
- if (shadow || frame || size === void 0) return style === "none" && !shadow && !frame ? 0 : void 0;
+ if (size === void 0) return style === "none" && !shadow && !frame ? 0 : void 0;
+ if (shadow || frame) return style === "single" && size >= 2 && size <= 96 ? (shadow ? 2 : 1) * size : void 0;
if (!LINE_BORDERS.has(style)) return size >= 1 && size <= WIDEST_ART_BORDER ? size * EIGHTHS_PER_POINT : void 0;
if (style === "single" && size === 1 || style === "double" && size === 0) return BORDER_WIDTHS[style](size);
return style === "none" ? 0 : size < 2 || size > 96 ? void 0 : (_BORDER_WIDTHS$style = (_BORDER_WIDTHS$style2 = BORDER_WIDTHS[style]) === null || _BORDER_WIDTHS$style2 === void 0 ? void 0 : _BORDER_WIDTHS$style2.call(BORDER_WIDTHS, size)) !== null && _BORDER_WIDTHS$style !== void 0 ? _BORDER_WIDTHS$style : (_SEEN_RUN_BORDERS$sty = SEEN_RUN_BORDERS[style]) === null || _SEEN_RUN_BORDERS$sty === void 0 ? void 0 : _SEEN_RUN_BORDERS$sty[size];
diff --git a/usage/layout.md b/usage/layout.md
index 7339e0197f..1cc5f1c01e 100644
--- a/usage/layout.md
+++ b/usage/layout.md
@@ -195,18 +195,18 @@ A blank page that Word adds so a section starts on an odd or even page has nothi
The pages are laid out with the widths and heights of the characters of the fonts Word documents use most: Calibri, Cambria, Arial, Times New Roman and Courier New, and of Office's other fonts that Word installs: Calibri Light, Aptos, Aptos Narrow, Trebuchet MS, Georgia, Verdana, Tahoma, Century Gothic, Consolas, Candara, Corbel, Constantia, Book Antiqua, Franklin Gothic Book, Gill Sans MT and Impact; and the heights of the lines of the Chinese, Japanese and Korean fonts Office has, and how far each goes below its baseline, such as MS Mincho, Yu Gothic, SimSun, Microsoft YaHei, PMingLiU and Malgun Gothic. The widths are those of the letters of Western and Central European languages, Turkish, Vietnamese, Greek and Cyrillic, of punctuation and the spaces other than U+0020, and of currency signs, arrows and mathematical symbols, as Word draws them in each font, plain, bold, italic and bold italic, and in each of the fonts, plain and bold, and in Calibri's, Cambria's, Arial's, Times New Roman's and Courier New's italics, those of Hebrew, Thai, the Arabic-Indic and Devanagari digits, box drawing, shapes such as `docx`'s bullets ● ○ ■, symbols and dingbats, which Word draws in the font, or in another where the font lacks them, such as Calibri's Thai in Tahoma and its ★ in Segoe UI Symbol, whose ascent and descent a line with them takes, but for Cambria's and Times New Roman's Devanagari digits. A letter a font doesn't have, Word draws in another font, whatever the text's language, such as Gill Sans MT's Cyrillic, Greek and Latin letters with a macron in Calibri, and Book Antiqua's less common Latin letters, such as ƀ, in Cambria, which the layout measures as Word does where that font is Calibri, Cambria, Arial, Times New Roman or Tahoma, with a line as tall as that font's. Italic text in a font without an italic face, such as Tahoma or Impact, is as wide as the upright text, as Word slants it, and Word draws Trebuchet MS bold italic as its bold, slanted. Bold text in a font without a bold face, Calibri Light, Franklin Gothic Book and Impact, is in the bold Word makes itself: each character 20 thousandths of an em wider than the regular at any size, but for the spaces, kerned and joined as the regular, and its lines as tall. It follows:
- the document's styles, and each paragraph's and run's own formatting: fonts, sizes, bold, italics, kerning and ligatures (see [Kerning and ligatures](#kerning-and-ligatures)), capitals, and hidden text. A paragraph whose mark is hidden (`run: { vanish: true }`) is joined to the next, on its lines, as Word joins it, in its own alignment, indents, space before, tab stops and borders, and the next one's space after, and each line spaced as the paragraph whose text it ends in, from the line the next one's text starts on. One at the end of a content control is joined to the paragraph after it too. In a table sized to its text, the two size the columns as one. Where both are in a list, the next one's number is counted but not shown, so the paragraph after them has the number after it. One with no paragraph after it, before a table or at the end of a table cell or of the document, stays as it is. A paragraph with nothing shown whose mark is hidden, such as one of a hidden style, takes no room, whatever its formatting, as in Word: before another paragraph or a table, and at the end of the document, but for one at the end of a table cell, which is a line of its own. The paragraph after it keeps its own formatting, one in a list takes a number, its fields are counted where it is, and its bookmarks start with what is after it. The paragraphs around it go by its style for their contextual spacing, one kept with the next (`keepNext`) is kept with the paragraph after it, and two with the same borders either side of it are in one box, as Word lays them out. So does one that ends a section before a section that starts on its page and is otherwise alike. A page break or picture in hidden text takes no room either, and a footnote or endnote reference none, but Word lays out its note, and counts it in the numbers of the notes after it. Chinese, Japanese and Korean are in the run's East Asian font (`font: { eastAsia }`), or in MS Mincho when that font has none of their characters, as Word draws them. A right-to-left run (`rightToLeft`) is in the run's font, size, bold and italics for complex scripts (`font: { cs }`, `sizeComplexScript`, `boldComplexScript`, `italicsComplexScript`), as Word draws it
-- lengths given with units, such as `margin: { top: "1in" }`, `size: "12pt"` or a table's `width: { size: "6in", type: WidthType.DXA }`, as well as those given in numbers. Word reads each as a whole number of twips: rounded down from inches, points and picas, and to the nearest from centimeters and millimeters, and a size in points rounded down to a half-point, so `size: "10.75pt"` is 10.5 points. It reads the minus sign of a negative length as the whole number's only, and adds the fraction: `"-10.7pt"` is -9.3 points, a position of `"-2.5pt"` lowers text 1.5 points, and `"-0.5mm"` and `"-0.3cm"` are as much more
-- where lines break, as Word breaks them: at spaces, and at en, em, four-per-em and ideographic spaces, which go past the end of a line as spaces do, after hyphens, en and em dashes and zero-width spaces, and between Chinese and Japanese characters. A word breaks at a soft hyphen (`SoftHyphen`), at the last one whose part of the word and a hyphen fit on the line with a little room left, about a point, with the hyphen at the end of the line, and again on the next line when the rest is longer than a line. A soft hyphen takes no room where the line doesn't break, and a justified line squeezes a word with soft hyphens onto it whole where it would squeeze one without, and otherwise breaks it at the last soft hyphen whose part and hyphen it can squeeze on, as Word does. A word in a border breaks at its soft hyphens too, and one whose part before its first soft hyphen is longer than a line breaks after the last character that fits. Word doesn't break lines at the other spaces, such as the thin space, so neither does the layout. In text in Japanese or Chinese (`language: { eastAsia: "ja-JP" }`), Word's lists keep characters such as closing brackets and `、` from starting a line, and opening brackets from ending one, so the character before moves to the next line with it. Text with no East Asian language, or in Korean or English, has no such rules in Word. Korean, Thai and the other scripts without spaces between words break at their spaces, as Word breaks them, and a word wider than the line breaks after the last character that fits. A paragraph's `wordWrap`, which writes Word's "Allow Latin text to wrap in the middle of a word", lets the words of runs in an East Asian font or language break anywhere, as Word breaks them. Right-to-left paragraphs (`bidirectional`) break where left-to-right ones do
-- spacing before and after paragraphs, line spacing, indents and tab stops. A decimal tab stop (`TabStopType.DECIMAL`) lines up the first full stop of the text after it, such as that of `$1,234.50` or `e.g. 7`, or the end of a number, of digits and commas, that comes first and has none, such as the `12` of `12%`, the `12,` of `12, 34` or the `1` of `1 234.5`, or else the end of the text, as Word lays it out. Past the end of the line, the text after a right, centred or decimal tab stop of the paragraph's own lines up with the end of the line, or of the next line when it doesn't fit, after text or at the start of a line, and a left one takes a line of its own, below the text before it, and the text after it goes to the start of the next line, in a paragraph with a first line or hanging indent too, as Word lays it out. A tab stop between the paragraph's right indent and the margin, left, right, centred or decimal, lines its text up with it on the line, past the indent. Text in a border lines up with a tab stop by its box: a right stop with the end of the box, a centred one with its middle, and a decimal one with its text, and a box goes on round a tab in it. The other cases stop the layout (see below). A line in one font is as tall as Word makes it, to a fraction of a twip (a twentieth of a point): 268.55 twips for Calibri 11. A line in several fonts is as tall as Word makes it from the tallest of them above the baseline and the deepest below it, so a word of Courier New in a line of Calibri 11 makes it 275.53 twips, taller than either font's own line. Multiple line spacing (`line` with `LineRuleType.AUTO`) adds its share of the tallest font's own line below the text, and the last line on a page, or in a column, can have that space below the bottom of the page, as Word lays it out, but for the cases it stops at (see below). Contextual spacing (`contextualSpacing`) leaves out only its paragraph's own share of the space between it and a paragraph of the same style, as Word does: all of its space after, or as much of its space before as is more than the space after the paragraph above it. At the edges of a table cell, Word compares a paragraph with the one next to it in the document: the first cell's first paragraph with the paragraph before the table, and the last paragraph of each row with the end of the row, which is in the default paragraph style, so contextual spacing leaves out the space before a table's first paragraph of the same style as the paragraph before the table, and the space after a row's last paragraph in the default style, such as Normal
-- justified paragraphs (`AlignmentType.JUSTIFIED`), whose spaces Word squeezes to fit one more word on a line, so they can have more words to a line than left-aligned ones. It squeezes them, in proportion to their widths, when that takes less of their width than a quarter, and less than they would stretch by with the word on the next line divided by 2.015. Spaces at the start of a line, those before a tab, no-break spaces, and en, em and ideographic spaces aren't squeezed, so a line whose only spaces are those isn't, and a line with text in a border is squeezed as any other. Distributed paragraphs (`AlignmentType.DISTRIBUTE`) are squeezed less often, as their letters can stretch too, and Latin and Thai text justified for Thai (`THAI_DISTRIBUTE`), and Latin text with a low kashida (`LOW_KASHIDA`), as justified text is
+- lengths given with units, such as `margin: { top: "1in" }`, `size: "12pt"` or a table's `width: { size: "6in", type: WidthType.DXA }`, as well as those given in numbers. Word reads each as a whole number of twips: rounded down from inches, points and picas, and to the nearest from centimeters and millimeters, and a size in any unit rounded down to a half-point, so `size: "10.75pt"` is 10.5 points and `size: "1cm"` 28. It reads the minus sign of a negative length as the whole number's only, and adds the fraction: `"-10.7pt"` is -9.3 points, a position of `"-2.5pt"` lowers text 1.5 points, and `"-0.5mm"` and `"-0.3cm"` are as much more
+- where lines break, as Word breaks them: at spaces, and at en, em, four-per-em and ideographic spaces, which go past the end of a line as spaces do, after hyphens, en and em dashes and zero-width spaces, and between Chinese and Japanese characters. A word breaks at a soft hyphen (`SoftHyphen`), at the last one whose part of the word and a hyphen fit on the line, as a word fits, with the hyphen at the end of the line, and again on the next line when the rest is longer than a line. A soft hyphen takes no room where the line doesn't break, and kerned text either side of it isn't kerned across it. A justified line squeezes a word with soft hyphens onto it whole where it would squeeze one without, and otherwise breaks it at the last soft hyphen whose part and hyphen it can squeeze on, unless a shorter part fits as it is with less than twice as much room as the longer part needs squeezed, as Word does. A word in a border breaks at its soft hyphens too, and one whose part before its first soft hyphen is longer than a line breaks after the last character that fits. Word doesn't break lines at the other spaces, such as the thin space, so neither does the layout. In text in Japanese or Chinese (`language: { eastAsia: "ja-JP" }`), Word's lists keep characters such as closing brackets and `、` from starting a line, and opening brackets from ending one, so the character before moves to the next line with it. Text with no East Asian language, or in Korean or English, has no such rules in Word. Korean, Thai and the other scripts without spaces between words break at their spaces, as Word breaks them, and a word wider than the line breaks after the last character that fits. A paragraph's `wordWrap`, which writes Word's "Allow Latin text to wrap in the middle of a word", lets the words of runs in an East Asian font or language break anywhere, as Word breaks them. Right-to-left paragraphs (`bidirectional`) break where left-to-right ones do
+- spacing before and after paragraphs, line spacing, indents and tab stops. A decimal tab stop (`TabStopType.DECIMAL`) lines up the first full stop of the text after it, such as that of `$1,234.50` or `e.g. 7`, or the end of a number, of digits and commas, that comes first and has none, such as the `12` of `12%`, the `12,` of `12, 34` or the `1` of `1 234.5`, or else the end of the text, as Word lays it out. Past the end of the line, the text after a right, centred or decimal tab stop of the paragraph's own lines up with the end of the line, or of the next line when it doesn't fit, after text or at the start of a line, whatever the left, first line and hanging indents, and a left one takes a line of its own, below the text before it, and the text after it goes to the start of the next line, in a paragraph with a first line or hanging indent too, as Word lays it out. A tab stop between the paragraph's right indent and the margin, left, right, centred or decimal, lines its text up with it on the line, past the indent, in a justified paragraph too. A word that doesn't fit after a tab goes on to the next line with the tab, which moves to its stop there, and breaks there after the last character that fits, or at a soft hyphen, as Word lays it out. Text in a border lines up with a tab stop by its box: a right stop with the end of the box, a centred one with its middle, and a decimal one with its text, and a box goes on round a tab in it. The other cases stop the layout (see below). A line in one font is as tall as Word makes it, to a fraction of a twip (a twentieth of a point): 268.55 twips for Calibri 11. A line in several fonts is as tall as Word makes it from the tallest of them above the baseline and the deepest below it, so a word of Courier New in a line of Calibri 11 makes it 275.53 twips, taller than either font's own line. Multiple line spacing (`line` with `LineRuleType.AUTO`) adds its share of the tallest font's own line below the text, and the last line on a page, or in a column, can have that space below the bottom of the page, though not into the page's footnotes, where the line goes on to the next page, as Word lays it out, but for the cases it stops at (see below). Contextual spacing (`contextualSpacing`) leaves out only its paragraph's own share of the space between it and a paragraph of the same style, as Word does: all of its space after, or as much of its space before as is more than the space after the paragraph above it. At the edges of a table cell, Word compares a paragraph with the one next to it in the document: the first cell's first paragraph with the paragraph before the table, and the last paragraph of each row with the end of the row, which is in the default paragraph style, so contextual spacing leaves out the space before a table's first paragraph of the same style as the paragraph before the table, and the space after a row's last paragraph in the default style, such as Normal
+- justified paragraphs (`AlignmentType.JUSTIFIED`), whose spaces Word squeezes to fit one more word on a line, so they can have more words to a line than left-aligned ones. It squeezes them, in proportion to their widths, when that takes less of their width than a quarter, and less than they would stretch by with the word on the next line divided by 2.015. Spaces at the start of a line, those before a tab, no-break spaces, and en, em and ideographic spaces aren't squeezed, so a line whose only spaces are those isn't, nor one past its end by more than a quarter of its ordinary spaces' width, and a line with text in a border is squeezed as any other. Distributed paragraphs (`AlignmentType.DISTRIBUTE`) are squeezed less often, as their letters can stretch too, and Latin and Thai text justified for Thai (`THAI_DISTRIBUTE`), and Latin text with a low kashida (`LOW_KASHIDA`), as justified text is
- automatic hyphenation (`hyphenation: { autoHyphenation: true }`), where Word certainly leaves the word after a line whole: in a paragraph that suppresses hyphenation (`w:suppressAutoHyphens`, in templates), and where its dictionary breaks no word like it. In compatibility mode 15, Word hyphenates a word that doesn't fit at the end of a line whenever a part of it fits with a hyphen, however little room that leaves: it has no hyphenation zone, so `hyphenationZone` changes nothing. Its English dictionary, which it hyphenates text in English or in no language by, leaves at least two letters before the hyphen, and breaks no word of fewer than five letters, nor numbers. It doesn't hyphenate text not checked for spelling (`noProof`), or in no language (`language: { value: "zxx" }`), nor words in capitals, typed so or shown so with `allCaps`, when the document says so (`doNotHyphenateCaps`). On a justified line it squeezes a word in rather than hyphenate it, and doesn't squeeze the spaces to fit a part. `consecutiveHyphenLimit` only leaves more words whole. Which parts Word breaks other words into is in its dictionaries, which the layout doesn't have, so it stops there (see below)
- paragraph borders (`border`, and `thematicBreak`), with the room Word gives them: a border above or below a paragraph takes its width and the space between it and the text, also at the top of a page, and at its foot, where the last line goes to the next page when its border doesn't fit below it. The space before and after goes outside the borders. Paragraphs next to each other with the same borders and the same left and right indents are one box, as Word draws them, whatever their borders between them: the top border above the first, the bottom border below the last, the border between them (`between`) of the first of each two between them, and no border where a page breaks the box. A paragraph with a page break before it starts a box of its own, with its top border, on the next page. The empty paragraph that ends a section takes no room for its borders, and paragraphs with the same borders either side of it, when it has none, are boxes of their own. Borders at the sides take no room, and leave the lines as wide as they are. Each style takes the room Word gives it: a double line three times its width, a triple line five times, and a wave 3 points whatever its width
- Word's automatic spacing (`beforeAutoSpacing`, `afterAutoSpacing`), as documents made from HTML have it: 14 points, the larger of two between paragraphs, in place of the space given. Word puts none above the first paragraph of the document, a table cell or a header, below the last of a cell, or between the paragraphs of a list, of one level or several, nor any for the empty paragraph that ends a section, and contextual spacing leaves it out as it does the space given. In a footnote it puts 14 points below the separator too, and keeps the last paragraph's space after at the foot of the page
-- indents in characters (`firstLineChars`, and the left, right and hanging indents in characters of documents Word made), and space before and after in lines, which Word takes in place of those in twips. A character of a first line or hanging indent is as wide as the paragraph's first character is tall, one of a left indent as its style's text, and one of a right indent as its mark, and a hanging indent in characters puts the first line at the left indent and the other lines further in. A first line indent in twips starts the first line that much further in from a left indent in characters. A line is 12 points, whatever the font
+- indents in characters (`firstLineChars`, and the left, right and hanging indents in characters of documents Word made), and space before and after in lines, which Word takes in place of those in twips. A character of a first line or hanging indent is as wide as the paragraph's first character is tall, one of a left indent as its style's text, and one of a right indent as its mark, and a hanging indent in characters puts the first line at the left indent and the other lines further in, as a hanging indent in twips from a left indent in characters does. A first line indent in twips starts the first line that much further in from a left indent in characters. A line is 12 points, whatever the font
- keeping a paragraph with the next, keeping its lines together, widow and orphan control, and page breaks
- numbered and bulleted lists, including those a paragraph's style numbers it in, counted as Word counts them: lists made from the same definition count on from one another, and a list's own first number for a level, which `docx` writes for each `instance` of a list, starts that level there at the list's first paragraph of that level. A level starts again after any level above it, or only after the level it gives, or never (`w:lvlRestart`), and a legal level (`isLegalNumberingStyle`) writes every level's number in decimal. A number is in its paragraph mark's formatting (`run` on a `Paragraph`), but for what its level gives it (`style.run`), and makes its line taller only above the baseline, with multiple line spacing a share of its text's line more, as Word lays it out. Its emphasis marks, and a number raised or lowered, take room as text's do. A line with nothing but a number is as tall as its paragraph's mark, or as the number above the baseline where that is taller. A number aligned to the right (`AlignmentType.END` or `RIGHT`) ends at the start of its paragraph's first line, and a centred one, with the space after it, is centred there, so a wide number can go into the margin, as Word puts it, and the text after it goes on from its end, at the hanging indent or the next tab stop after it. After a number aligned to the right, the tab goes to the next stop past its end, or, without a first line or hanging indent, to the left indent, where the number ends. Word measures the space after a number (`LevelSuffix.SPACE`) in Arial, and so does the layout. Word writes Thai and Hindi words (`thaiCounting`, `hindiCounting`) from 1 to 5. A level whose text shows a level its list doesn't have, or aligned as justified text is (`w:lvlJc` both), Word leaves out, as though it weren't there: its paragraphs have no number, nor the level's indent, and another level's number shows nothing for it
- footnotes, which take room at the bottom of the page their reference is on, and endnotes, which follow the text. A footnote that doesn't fit below its reference continues at the bottom of the next page, as Word continues it: it breaks between its paragraphs and table rows, and inside a paragraph keeping to its widow and orphan control, and its reference's line moves to the next page with it when too little of it would stay. A first paragraph kept together, or kept with the next, stays with its reference whole, with the first lines of what it is kept with. A footnote breaks before a later paragraph kept together, and before paragraphs kept with the next with what they are kept with, as the text does, unless they start its part on the page, which would leave none of it, where it breaks as without them, as the text does at the top of a page. It breaks before a table row whose lines widow control keeps together, and in a row whose lines could go on both pages, between its cells' lines, as a row of the text breaks, with the rest of the row at the top of the next page's footnotes, as Word breaks it. A footnote or endnote that ends with a table has a line below it for the empty paragraph Word puts after the table. A table's header rows aren't repeated above the rest of a footnote on the next page, nor left alone at the bottom of a page, as the table goes on the next page then. The footnote of a line kept with a longer paragraph goes below the first lines of it that the line is kept with, and of one kept with a table, below its first row, and the rest goes on the next page. One longer than a page fills the pages after it, and the text goes on above its end. Before the next section, whether it starts on a new page or not, and before a paragraph with a page break before it, the rest of a footnote goes on pages of its own, which belong to the section its reference is in, and the new section or paragraph starts after them. Before a continuous section numbered afresh, Word numbers each of those pages with the section's first number, and so does `docx/layout`. Before a continuous section, the number of pages of the section the footnote is in isn't worked out, as Word counts it its own way, and the next section's is its own pages, as Word counts them. A line whose footnote can't go on a page with it, such as one that starts with a paragraph kept together that is taller than a page, goes at the top of a page, with the text after it, and the footnote starts on the next page, with those referred to after it after it. A table row refers to footnotes as a line does: it moves to the next page with a footnote that doesn't fit below it, and one that breaks across pages has each line's footnote on the page the line is on, and breaks after a line whose footnote continues. Where its footnotes fit whole below fewer of its lines, with the lines that refer to them, it breaks there instead, as Word breaks a row with a table in a cell beside a line whose footnote would otherwise continue. In columns, the footnotes of a page are laid out in the columns too, as Word lays them out: one after the other from the first column, evened out, each part broken at the width of the column it is in, and every column ends above them. Footnotes from another section on the page go on in the columns of its first footnote's. A line or table row in columns whose footnotes don't fit below it moves to the next column, or the next page, with all of them, as Word moves it, and the page is left as it was when a reference moves on as its columns are laid out again for its footnote. At the top of the page's columns, or of the column a section starts in after the section before's, a line stays, and its footnote goes on the page as far as it fits below the lines of every column, with the text going on above it, and continues at the foot of the next page's columns. At the top of a later column, the columns before it are laid out again above as much of the footnote as leaves the line on the page, as Word lays them out: a footnote of 120 lines referred to from line 11 of the first of 2 columns takes 44 lines of each, the columns above it 6, and its reference goes on in the second. The separator above the endnotes goes on the page of their first line, and on each page after the first they are on, the continuation separator is above them, as Word puts them. Each is a line of its paragraph style's text tall, at single spacing, whatever its own spacing, line spacing and size, as Word lays them out. A footnote's paragraph borders take room as in the text. Below the continuation separator, as many lines of endnotes go on the page as fit on it without it, so the last can go past the bottom margin by as much as the separator takes, as Word puts them. Footnotes and endnotes are numbered as Word numbers them, 1, 2, 3 and i, ii, iii, or in the format and from the number a document or its sections give, afresh in each section when they say so, and footnotes afresh on each page. A section's own start number adds to the number of notes before it, as Word adds it: after 27 footnotes, a section numbered from 5 numbers its first 32. A footnote with a mark of its own in place of its number isn't counted, and a section's footnotes can go just below the text of their page, rather than at its bottom, as Word puts them. Word puts the endnotes of a section that says they go at the end of it at the end of the document, unless the document's settings say so too, and so does `docx/layout`
-- run formatting that changes how much room text takes, as Word lays it out. Superscript and subscript (`superScript`, `subScript`) are drawn at 65% of the text's size, to the nearest half-point and down from a quarter, so 7 points at 11 and 9.5 at 15, and small capitals (`smallCaps`) at 80%, so 9 points at 11; both take up the line of their run's own size, so they never make a line taller. Raised and lowered text (`position`) raises the line's top or lowers its bottom by as much as it goes past the rest of the line: a word raised 6 points makes a line of Calibri 11 120 twips taller, and a smaller word raised a little none. Emphasis marks (`emphasisMark`) take a quarter of their line, over it, or under it for dots below, and both on a line with marks over and under it, with a picture in the line counted in it; line spacing that gives a line less room than a quarter of it adds it below the marks' room, and spacing that gives it at least that, such as 1.25 lines, holds the marks, and spacing of less than a line makes the line and the marks' room that share of themselves. A border around text (`border` on a `TextRun`) takes its space and its width on each side of the text, and above and below it, as wide as a paragraph's border of its style, an art border its size in points, and a space past 31 points only what is left over 32: two runs next to each other with the same border are in one box, a box that goes on to the next line starts again there, also in a word broken across lines, and a line keeps room for its box to end after its last word. Two lines in one (`w:eastAsianLayout` with `w:combine`) of text that isn't Chinese, Japanese or Korean is drawn at half its size on one row, as Word draws it
+- run formatting that changes how much room text takes, as Word lays it out. Superscript and subscript (`superScript`, `subScript`) are drawn at 65% of the text's size, to the nearest half-point and down from a quarter, so 7 points at 11 and 9.5 at 15, and small capitals (`smallCaps`) at 80%, so 9 points at 11; both take up the line of their run's own size, so they never make a line taller. Raised and lowered text (`position`) raises the line's top or lowers its bottom by as much as it goes past the rest of the line: a word raised 6 points makes a line of Calibri 11 120 twips taller, and a smaller word raised a little none. Emphasis marks (`emphasisMark`) take a quarter of their line, over it, or under it for dots below, and both on a line with marks over and under it, with a picture in the line counted in it; line spacing that gives a line less room than a quarter of it adds it below the marks' room, and spacing that gives it at least that, such as 1.25 lines, holds the marks, and spacing of less than a line makes the line and the marks' room that share of themselves. A border around text (`border` on a `TextRun`) takes its space and its width on each side of the text, and above and below it, as wide as a paragraph's border of its style, an art border its size in points, and a space past 31 points only what is left over 32: two runs next to each other with the same border are in one box, a box that goes on to the next line starts again there, also in a word broken across lines, and a line keeps room for its box to end after its last word. A shadow doubles a single border's width, and one drawn as a frame takes the room it takes without (`w:shadow`, `w:frame`, in documents Word made), and a picture in the line in a run with a border has its border's room around it, beside it and above and below it. Text fitted to a width (`w:fitText`, in documents Word made) is one box of that width, which goes on to the next line whole when it doesn't fit, and runs one after the other fitted with the same id are one box. Two lines in one (`w:eastAsianLayout` with `w:combine`) of text that isn't Chinese, Japanese or Korean is drawn at half its size on one row, as Word draws it
- pictures in the line, which stand on the baseline, so a line with text in it is as tall as the picture and the text below the baseline, as Word makes it. A line with a picture is at least as tall as a line of the picture's run's font, and its multiple line spacing adds a share of that, as Word's does. A line of only a picture isn't as tall as a larger paragraph mark, at single spacing
- pictures, shapes and charts that text wraps around (`floating` with a `wrap`), as Word lays the text out around them. A line beside a drawing has the room beside it, with the drawing's distances from the text (`margins`) and the room its effects take, such as a shape's line or shadow, and a line with no room beside it goes below it. Square, tight and through wrapping put the text beside the drawing's box, on the side or sides its wrapping's `side` says, the left first, and Word puts as many words in the room on a side as fit there, and none when the next word doesn't fit, nor in a room narrower than 18 points, so a line with no wider room goes below the drawing. Top and bottom wrapping puts the lines below the drawing. Drawings that overlap keep the text out of all their room. A drawing in a margin, where there is no text, leaves the lines as they are. A line beside a drawing starts at the drawing's edge or the paragraph's left indent, whichever is further in, and its first line is indented from there. A drawing is placed against the page, its margins, the column, or the paragraph or line it is anchored in, as its `horizontalPosition` and `verticalPosition` say: at an offset, which places the drawing without its effects, lined up with them, with its effects, or at a percentage of them, as `docx/shapes` places shapes, and its percentage sizes are a share of the page or its margins: the inside and outside margins are those it is placed against on its page. Lined up inside or outside against the margins, it is lined up with them, and against the page, down it, it is at the top of the page, inside on odd pages and outside on even ones, half the header's distance from the page's top below it, and at the bottom otherwise, half the footer's distance above it. One placed by its simple position is placed from the page's top left corner by that. Placed against its paragraph, it is at the top of the paragraph, below the space after the paragraph before, which is that paragraph's, and above its own space before, and no higher than the top of the page's text. Where it would go past the bottom of the page's text, the paragraph moves to the next column or page with it, above footnotes too, and a paragraph whose first line goes below a drawing with top and bottom wrapping keeps its own space before above that line. Placed against its line, it is at the line its anchor is on before the text goes round it, though the text going round it can move the anchor on to the next line. One anchored in a line that goes on to the next page goes there with it, against the top of the paragraph's part on that page. The text before a drawing's paragraph on its page goes round it too, as Word lays the page out again with it, and the drawing stays where it was first placed, though its paragraph moves down: with top and bottom wrapping, the lines before it that its distance above it reaches go below it. Where that moves the paragraph on to the next page, it starts there with the drawing, and the page is laid out again without it. Of two drawings that may not overlap (`allowOverlap: false`), the later is moved out of the way across the page, at the height it was placed at: to the right of the other, their boxes side by side, or to the left of it when it is lined up at the right. A table that fits beside a drawing at its indent goes beside it, as does one that fits past a drawing on its left, with its indent from there, and one that doesn't fit goes below it; one sized to its text goes beside it as wide as it is in the column. Paragraphs kept with the next are kept with as many of the next paragraph's lines beside a drawing as they would be without it, and move to the next page with a paragraph that moves there with its drawing. Those with drawings of their own move to the next page with the next, and their drawings with them, and those kept with a table stay where they are when the next starts on their page. Columns are evened out with the drawings in them. A turned picture wraps the text around its box as it is before it is turned. A drawing that text wraps around in a header or footer, placed against the page or its margins, is on each page that shows the header or footer, and the body's text goes round it as round its own, as Word lays it out. Drawings behind or in front of the text don't move the body's lines. A drawing beside the page's footnotes leaves their lines as they are
- tables that text wraps around (a table's `float`), as Word lays the text out around them: the text after the table goes beside it, as beside a picture with square wrapping, kept from it by its distances from the text (`leftFromText`, `rightFromText`, `topFromText` and `bottomFromText`). A table is placed across against the page, its margins or the column (`horizontalAnchor`), and down against the page, its margins or the top of the paragraph after it (`verticalAnchor`), at a distance (`absoluteHorizontalPosition`, `absoluteVerticalPosition`) or lined up with them (`relativeHorizontalPosition`, `relativeVerticalPosition`). Without `horizontalAnchor` it is placed against the column, and without `verticalAnchor` against the margins, and lined up inline against the text (`RelativeVerticalPosition.INLINE`), it is at the top of the paragraph after it. Its room is as wide as its rows with the halves of its borders left and right, on one side or both, or 0.75 points wider than its rows without any borders, which borders between its rows alone count as, and as tall as its rows, and its indent doesn't move it. It is below the space after the paragraph before, and the paragraph after it has all of its space before below that, as after a table. It is placed against the top of what comes after it: a paragraph, the empty paragraph that ends its section, which takes a line after it then, and whose next section on the page goes round it too, a table, or the empty paragraph Word adds after it at the end of the document. Tables one after the other before a paragraph each go round it, and the paragraphs after it go round it too while they are beside it. Its footnotes are on its page. Of two that may not overlap (`overlap: OverlapType.NEVER`), the later moves to the right until the room it keeps the text out of is beside the other's, or to the left of the other when it has no room on the right, or is lined up at the right. One that goes past the bottom of the page is broken between its rows: those that fit stay where it was placed, the rest go at the top of the next pages, below its header rows, which go there again, and the paragraph after it starts beside its last rows. One in a footnote or an endnote is laid out in the note's text, as a table that doesn't float. One before a table that moves on to the next page stays where it was placed, as does one anchored in a paragraph kept with the next that moves on to the next page with the next
@@ -237,7 +237,7 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- a line in a table cell taller than a page, a table row whose paragraph is kept together that is taller than a column, or one set to a height taller than a page in columns, a row set to at least a height taller than a page whose text is taller than a page too, with a footnote, and one set to a height taller than a page with two footnotes or one with others on its page, the text of a cell merged down into it from a row above or out of it that doesn't fit in it, or as a header row
- a table in a table cell where it breaks across pages with the text of a cell merged down its rows that goes on past the first of them, or with space between its cells
- the text of a cell merged down table rows that goes on across a page break between its rows, or across more than two pages but in the last of them, and one that goes on across pages from a table's header rows, or with a footnote in it
-- a line whose multiple line spacing would go below the bottom of the page in a table row that breaks across pages, into the footnotes at the bottom of the page, or above its paragraph's border below, and a line of only pictures in a paragraph at multiple line spacing whose mark is in a larger font than the pictures' runs
+- a line whose multiple line spacing would go below the bottom of the page in a table row that breaks across pages, or above its paragraph's border below, a line whose room on a document grid would go into the footnotes at the bottom of the page, and a line of only pictures in a paragraph at multiple line spacing whose mark is in a larger font than the pictures' runs
- a footnote in a table row that holds back lines of a cell beside it, which would fit on the page above the footnote without it, and a table row that fits on an empty page, but not with its footnote
- a table border in a style Word's PDFs haven't shown, such as a picture border, or a wave or 3D border of a width Word doesn't offer, and two cells' borders of different styles that meet beside text whose margin is less than half the wider, where Word draws the narrower
- the last row of a table with space between its cells that breaks across pages, and such a table with borders and header rows that breaks across pages
@@ -247,22 +247,21 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- a long word in a cell merged across columns, which Word makes room for in a way not yet followed: a word longer than those columns' longest words together, with or without more text beside it, when a table given no widths is narrowed to fit, and one whose share would leave a column narrower than its longest line or its width
- 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 Garamond, Segoe UI or Roboto, 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: Word makes the bold face itself, each character 20 thousandths of an em wider, but from a file of its own, as it drew Pacifico, which a document embedded, in the copy of it Office downloads, whose letters are narrower
- text in a font given as a file or embedded in the document that Office also offers, such as Pacifico, Roboto or Lato, but for those of the width tables, such as Aptos, and the East Asian characters of the East Asian fonts in them, such as Microsoft YaHei, whose Latin letters stop: Word for Mac draws it in Office's own copy of the font, which it downloads, rather than in the file, as it drew Pacifico, whose letters in Office's copy are narrower and whose lines are shorter than in `demo/assets/Pacifico.ttf`'s. The fonts Office offers are those of Office's catalog of its cloud fonts, which has every font of Microsoft's list, [Cloud fonts in Office](https://support.microsoft.com/en-us/office/cloud-fonts-in-office-f7b009fe-037f-45ed-a556-b5fe6ede6adb), and those it has added since
-- kerning and ligatures Word's PDFs haven't shown (see [Kerning and ligatures](#kerning-and-ligatures)): kerned text in a font whose kerning isn't known, such as Carlito or an East Asian font that isn't monospaced, or with a character outside Windows-1252, such as Greek or Cyrillic, or one that takes no room, such as a zero-width space or a combining mark; kerned Cambria before a hyphen, en dash, no-break space, ™, backslash or à; kerned text with ligatures other than standard and contextual ones in a font Word kerns only without ligatures, such as Trebuchet MS; Times New Roman's discretional ligatures, kerned, beside some characters; ligatures in a font whose ligatures aren't known, of a setting Word's Font dialog doesn't write, in regular Cambria, or beside a character outside Windows-1252 but for a Latin letter; kerning and ligatures across a soft hyphen, and kerned text before one in its font, with which the hyphen Word draws at the end of a line may be kerned; a word longer than its line with ligatures, as Word may break it inside one; text kerned or with ligatures on a document grid of characters; and in a font's file, substitutions other than ligatures in the setting's features, such as contextual ones. Text with OpenType number forms or spacing, stylistic sets or contextual alternates (`w14:numForm`, `w14:numSpacing`, `w14:stylisticSets`, `w14:cntxtAlts`) stops too, as their widths aren't known, but for lining tabular figures in regular Calibri and Cambria, and old-style tabular ones in regular Calibri, which are as wide as the font's default figures
+- kerning and ligatures Word's PDFs haven't shown (see [Kerning and ligatures](#kerning-and-ligatures)): kerned text in a font whose kerning isn't known, such as Carlito or an East Asian font that isn't monospaced, or with a character outside Windows-1252, such as Greek or Cyrillic, or one that takes no room, such as a zero-width space or a combining mark; kerned Cambria before a hyphen, en dash, no-break space, ™, backslash or à; kerned text with ligatures other than standard and contextual ones in a font Word kerns only without ligatures, such as Trebuchet MS; Times New Roman's discretional ligatures, kerned, beside some characters; ligatures in a font whose ligatures aren't known, of a setting Word's Font dialog doesn't write, in regular Cambria, or beside a character outside Windows-1252 but for a Latin letter; ligatures across a soft hyphen, and a line that breaks at a soft hyphen in kerned text, whose hyphen Word may kern with the letter before it; a word longer than its line with ligatures, as Word may break it inside one; text kerned or with ligatures on a document grid of characters; and in a font's file, substitutions other than ligatures in the setting's features, such as contextual ones. Text with OpenType number forms or spacing, stylistic sets or contextual alternates (`w14:numForm`, `w14:numSpacing`, `w14:stylisticSets`, `w14:cntxtAlts`) stops too, as their widths aren't known, but for lining tabular figures in regular Calibri and Cambria, and old-style tabular ones in regular Calibri, which are as wide as the font's default figures
- 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 a font whose widths aren't in the tables, such as most mathematical symbols, which Word draws in Cambria Math, or in Arial or Times New Roman where their line gap could make the line taller than the font's own, which no Word PDF has shown, such as Gill Sans MT's and Franklin Gothic Book's IPA letters and Hebrew in Arial; a few that Word drew in a way their widths can't be read from, such as Ž and Ё in Courier New; Arabic and Devanagari letters, which Word joins into forms of other widths, and Cambria's and Times New Roman's Devanagari digits, which Word draws in a font whose lines' height isn't known; and Hebrew, Thai, box drawing, shapes such as `docx`'s bullets ● ○ ■, symbols and dingbats in the italics of Office's other fonts, such as Aptos, so a list of `docx`'s bullets in italic Aptos stops at its bullet; and a symbol font's own symbol, such as Wingdings' tick (`SymbolRun`), or a symbol whose character isn't four hexadecimal digits
- in a document that hyphenates its words, a line Word may end with a part of the next word and a hyphen: one with room for the word's first two letters and a hyphen, or its first letter in a language other than English, when the word has five letters or more, or two in such a language. A word longer than its line, a word squeezed onto a distributed line, and a table sized to its text whose columns are narrowed past a word Word may hyphenate, or given less than one, stop it too, as Word sizes columns to the parts of the words it hyphenates
- text in Chinese, Japanese or Korean (`language: { eastAsia }`) in a document that compresses its punctuation, or uses Word's strict rules for the characters that can't start a line. Text in no language is laid out as it is without them, as Word lays it out
-- a soft hyphen where Word hasn't been seen breaking at it: where its hyphen ends a few twips before the end of the line, or at its end in a justified line, in a justified line that fits a part of the word squeezed and a shorter part as it is, and in a table whose columns Word sizes to their text or widens for long words
+- a soft hyphen where Word hasn't been seen breaking at it: in a line that fits a part of the word squeezed and a shorter part as it is with twice as much room or more, or in a distributed one, in a word whose first part doesn't fit after a tab, or that doesn't fit after a tab at the start of a line, and in a table whose columns Word sizes to their text or widens for long words
- a hidden paragraph mark Word hasn't been seen with, or lays out in a way not yet followed: between paragraphs of different styles, or that differ in more than their alignment, indents, space, line spacing, tab stops and borders, of exact or at-least line spacing, or more than two of different line spacing, before a content control, and ending a section, but for one of a paragraph with nothing shown before a section that starts on its page and is otherwise alike. So do a paragraph with nothing shown and its mark hidden at the end of a header or footer, or of a note, which Word joins to the next note's first paragraph, or with a field, note reference or list number after a paragraph joined to the next, and a footnote reference with a mark of its own in hidden text
-- text at a decimal tab stop with a picture before where it would line up, a decimal tab stop in a document whose decimal symbol isn't a full stop, and one of a paragraph's own tab stops past the end of the line in a paragraph indented past the margin, or in one with a first line or hanging indent, but for a left one after text, a left one at the start of a line in an indented paragraph, and a right, centred or decimal one in an indented paragraph, but for a right one after text indented on the right, and at the start of a line indented on the left; and a tab stop past the right indent in a justified line, or a left one whose text goes past the margin, and a left one past the margin in a paragraph indented past it, whose text goes past the end of the line
-- borders Word hasn't been seen to draw, or to lay out in a box: a style such as an art border, thin and thick lines narrower than half a point, or wider than 2¼ with a small gap or 3 with a medium or large one, a shadow on a style other than single, or a frame; a paragraph at the top of a page in one box with the paragraph before, whose border between them is another; a box of borders that goes on across a section break, or through the empty paragraph that ends a section when it has the same borders; and a border in a footnote across pages or in columns, or with the same borders as the footnote before it
+- text at a decimal tab stop with a picture before where it would line up, a decimal tab stop in a document whose decimal symbol isn't a full stop, and one of a paragraph's own tab stops past the end of the line in a paragraph indented past the margin, a left one at the start of a line in an indented paragraph, and a centred or decimal one in a paragraph indented on the right, or a right one at the start of a line there; a tab stop past the right indent in a distributed line, or a left one whose text goes past the margin; and a picture, or a word after tabs in a row, that doesn't fit after a tab, and a picture that doesn't fit after a tab at the start of a line
+- borders Word hasn't been seen to draw, or to lay out in a box: a style such as an art border, thin and thick lines narrower than half a point, or wider than 2¼ with a small gap or 3 with a medium or large one, a shadow on a style other than single, or a frame; a paragraph at the top of a page in one box with the paragraph before, whose border between them is another; a box of borders across a section break that ends a paragraph with text in it; and a border in a footnote across pages or in columns, or with the same borders as the footnote before it
- automatic spacing in a footnote across pages or in columns, after the empty paragraph that ends a section before space of the next section's, and between the paragraphs of lists made from the same definition
-- indents in characters where the size Word measures them in isn't known: a right indent of a paragraph whose mark is another size than its style, a first line indent of a list's paragraph whose number is another size than its text, and a hanging indent in characters with a left indent of 0 characters and one in twips, or a left indent in characters with a hanging indent in twips
-- a size given in a unit other than points, such as `size: "1cm"`, which Word ignores where it isn't a whole number of half-points and no style gives a size, and draws where it is and a style gives one
+- indents in characters where the size Word measures them in isn't known: a right indent of a paragraph whose mark is another size than its style, a first line indent of a list's paragraph whose number is another size than its text, and a hanging indent in characters with a left indent of 0 characters and one in twips
- emphasis marks with line spacing on a line with a picture or with marks both over and under text, and on a line taller than its fonts' own lines, such as one with raised text, at line spacing of less than a line or at least a height
- on text that runs down the page: a table, endnotes, and endnotes from text before it, a tab to a stop other than a left one, a soft hyphen or picture, a drawing that text wraps around, Chinese, Japanese or Korean text in a font whose characters aren't all an em, such as Yu Mincho, raised text and small capitals, two lines in one, text set across the line of more than two characters or of Chinese, Japanese or Korean ones, columns, mirrored margins, a gutter at the top or beside lines from the left, a footer that goes above the bottom margin, and a continuous section break after it into text that doesn't run down the page the same way; and text in a direction Word's documents don't write
- on a document grid: a grid of characters without the pitch of its lines; on a grid that snaps to characters in columns of different widths, a table, a footnote, an indent in characters and a line beside a drawing that text wraps around; on a grid that snaps to characters, a tab but for a left one before Chinese, Japanese or Korean text, a picture after other text, an equation, a soft hyphen at the end of a line, kerning, an indent of part of a character and a distributed line that only fits squeezed; on a grid of lines and characters, a number, punctuation or text of another size in an East Asian font next to a Chinese, Japanese or Korean character, which Word may space in a way not yet followed; ligatures on a grid of characters; emphasis marks with at-least line spacing; and endnotes from a section that one on another grid follows, which Word may end with their own section
-- a border around text of a style or width Word hasn't been seen to draw, as for paragraphs above but for an art border, thick and thin lines with a large gap of 4.5 points, a single line of an eighth of a point and a double line of none, or with a shadow or a frame, and a picture in text with a border
-- a paragraph justified for Arabic with a medium or high kashida (`MEDIUM_KASHIDA` and `HIGH_KASHIDA`), and Arabic text in one justified for Thai or with a low kashida, whose lines Word hasn't been seen breaking, and a justified or distributed line that only fits with its spaces squeezed when it has a four-per-em space, or en, em or ideographic spaces beside ordinary ones
+- a border around text of a style or width Word hasn't been seen to draw, as for paragraphs above but for an art border, thick and thin lines with a large gap of 4.5 points, a single line of an eighth of a point and a double line of none, or with a shadow or a frame on a style other than single; a drawing placed on the page, or a VML drawing, in text with a border; and a picture in a border beside text in the same border, or in a line with multiple line spacing
+- a paragraph justified for Arabic with a medium or high kashida (`MEDIUM_KASHIDA` and `HIGH_KASHIDA`), and Arabic text in one justified for Thai or with a low kashida, whose lines Word hasn't been seen breaking, and a justified or distributed line that only fits with its spaces squeezed when it has a four-per-em space, or en, em or ideographic spaces beside ordinary ones and goes past its end by no more than a quarter of the ordinary ones' width
- page numbers in Thai and Hindi words (`thaiCounting` and `hindiCounting`), and page numbers Word writes as an error: any in `none`, 0 in Hebrew, Arabic, Thai and Hindi digits and Chicago's symbols, and those past where a format's letters run out, such as 781 in letters. Page numbers in Hebrew past 100, and in Hindi letters past 75 (`hindiVowels`) and 37 (`hindiConsonants`), haven't been checked in Word yet
- a chapter number from a heading in a table or a text frame
- a list number whose text or place Word hasn't shown: one in a format not yet written, such as Thai and Hindi words (`thaiCounting`, `hindiCounting`) past 5, or past where Word's lists start over, such as 32768 in roman numerals; one that shows a level not counted yet that its list starts at a number of its own; a number with a border; a line with nothing but a number of another size or font than its paragraph's mark, before the paragraph's text; a number at another level of a list with a level aligned both; and a number after a paragraph at a level Word leaves out above it, which may start it again. So do bullets that are pictures, which Word drew none of, numbers laid out as Word 6 laid them out, a list defined by a list style that isn't found, or whose own list gives levels of its own, and numbers aligned other than to the left, the centre or the right, or both, which `docx` doesn't write
@@ -271,7 +270,7 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- a page reference, number of pages or page number in a format other than those above, or with a picture Word's text isn't known for, as above, or past what its format writes, such as 781 in letters
- in a document in compatibility mode, which Word lays out as Word 2010, 2007 or 2003 did (one saved by those versions of Word, or by an application that writes their mode, or given `compatibility: { version: 14 }`, 12 or 11), what those versions lay out unlike Word 2013 or haven't been seen laying out: a tab to a stop past the end of the line, whose text they put past the margin, a line beside a picture or frame in a gap narrower than 135 points, which they may leave empty, a page break at the end of a paragraph, a table that text wraps around, a table sized to its text in a table cell, indented or as a share of the width, or widened for a long word with no width of its own, a distributed paragraph, or one justified for Thai or with a low kashida, ligatures unless Word's `enableOpenTypeFeatures` is on, as Word 2010 writes it, and any of the `compatibility` options, which Word 2013 leaves out in its own mode, but the older ones may follow; and in Word 2007's and 2003's modes, Chinese, Japanese and Korean text and VML drawings that take room. The rest is laid out as in Word 2013's mode, but that justified lines aren't squeezed, so they break as lines aligned left do, and a table sized to its text has its first and last cells' margins beside the page's text, as Word 2010 and before line a table's text up with the margins rather than its borders. A mode Word doesn't have, such as 13, stops the layout
- a compatibility setting that changes how Word lays out lines in compatibility mode 15 in a way not yet followed: with `suppressTopSpacing`, the first line of a page or column at at-least line spacing less than its text's height or at multiple spacing, a paragraph's line after its first at the top of a page, and such a line in a table cell, on a document grid, or below the space before a section's first paragraph or a border; with `useFELayout`, Chinese, Japanese and Korean text, and any text where another of the East Asian `compatibility` options is on too. `suppressTopSpacing` is followed otherwise: Word leaves out the space above the text of the first line of a page or column at exact spacing, all but 9.6 points of the 80% of the line above its baseline, and at at-least spacing, all but 9.6 points of the line, and leaves a line of single spacing as it is. `useFELayout` leaves the lines of other paragraphs as they are. The other `compatibility` options, which ask for an older Word's or another application's layout, Word lays out lines with as without them in its own mode, so they don't stop it, and `doNotUseHTMLParagraphAutoSpacing` is followed. In [templates](#templates), Word's own settings (`overrideTableStyleFontSizeAndJustification`, `enableOpenTypeFeatures`, `doNotFlipMirrorIndents`, `differentiateMultirowTableHeaders`, `useWord2013TrackBottomHyphenation`, `allowHyphenationAtTrackBottom` and `allowTextAfterFloatingTableBreak`) leave Word's lines as they are too, and those it doesn't know, such as ones a later Word may write, stop it whether they are on or off. Settings for other applications, whose `w:uri` isn't Word's, are left to them, as Word leaves them
-- in [templates](#templates), what `docx` doesn't write and Word lays out in ways not yet followed: space between a row's cells as a share of the table's width, rows with different space between their cells, space between cells of another type than twips, a table indented by a share of the width, a row with table properties of its own other than borders and cell margins, or with borders of its own in a table with space between its cells, a table style with formatting of its rows or cells other than its rows' height and its cells' margins, or a part of one for some cells with properties other than borders, margins, a height for its rows and space between cells, its parts for its bands of rows in a header of four rows or more with its first row turned off, text with a phonetic guide, text fitted to a width, or to its cell in a table sized to its text, two lines in one with brackets, of Chinese, Japanese or Korean text or at a size of a fraction of a point, and horizontal in vertical text, ink and other content parts, a subdocument, a paragraph in an HTML division, a table cell whose text doesn't wrap in a table sized to its text, cells merged across columns as old versions of Word wrote them with text after the first, footnotes in columns of their own, endnotes numbered afresh on each page, footnotes numbered afresh on each page of a section that shares a page with another, notes numbered on through the document after a section that numbers its own afresh, or in a format not yet written, footnotes anywhere but at the bottom of the page or just below the text, and below the text of columns, after space below the page's last paragraph or going on across pages, endnotes at the end of each section when the document's settings put them there, an endnote with a mark of its own in place of its number, a content control bound to custom XML or the document's properties that Word fills in with other text than is written in it when it opens the document (one whose text is already the XML's is laid out as it is), pages printed as a folded booklet, styles Word updates from the document's template when it opens it, and an imported document (`w:altChunk`) in another format than `.docx`, such as HTML, RTF or plain text, which Word converts its own way, of more than one section, whose formatting is kept as it is (`w:matchSrc`), with a style of its own where its defaults leave out some of the template's, or with a page reference or number of pages, whose number `docx` can't write in it
+- in [templates](#templates), what `docx` doesn't write and Word lays out in ways not yet followed: space between a row's cells as a share of the table's width, rows with different space between their cells, space between cells of another type than twips, a table indented by a share of the width, a row with table properties of its own other than borders and cell margins, or with borders of its own in a table with space between its cells, a table style with formatting of its rows or cells other than its rows' height and its cells' margins, or a part of one for some cells with properties other than borders, margins, a height for its rows and space between cells, its parts for its bands of rows in a header of four rows or more with its first row turned off, text with a phonetic guide, text fitted to a width with other than text in it, wider than its line or in runs of other sizes or fonts, or fitted to its cell in a table sized to its text, two lines in one with brackets, of Chinese, Japanese or Korean text or at a size of a fraction of a point, and horizontal in vertical text, ink and other content parts, a subdocument, a paragraph in an HTML division, a table cell whose text doesn't wrap in a table sized to its text, cells merged across columns as old versions of Word wrote them with text after the first, footnotes in columns of their own, endnotes numbered afresh on each page, footnotes numbered afresh on each page of a section that shares a page with another, notes numbered on through the document after a section that numbers its own afresh, or in a format not yet written, footnotes anywhere but at the bottom of the page or just below the text, and below the text of columns, after space below the page's last paragraph or going on across pages, endnotes at the end of each section when the document's settings put them there, an endnote with a mark of its own in place of its number, a content control bound to custom XML or the document's properties that Word fills in with other text than is written in it when it opens the document (one whose text is already the XML's is laid out as it is), pages printed as a folded booklet, styles Word updates from the document's template when it opens it, and an imported document (`w:altChunk`) in another format than `.docx`, such as HTML, RTF or plain text, which Word converts its own way, of more than one section, whose formatting is kept as it is (`w:matchSrc`), with a style of its own where its defaults leave out some of the template's, or with a page reference or number of pages, whose number `docx` can't write in it
When laying out the pages 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, and `layoutDocument` lays out the pages without them.
@@ -294,7 +293,7 @@ const doc = new Document({
Its guesses, by what it would stop at:
- text in a font that isn't in the width tables, isn't given as a file and isn't embedded is measured as the most similar font that is: Segoe UI as Calibri, a serif font such as Garamond as Times New Roman, a monospaced one as Courier New, and the others, such as Roboto, as Arial. Word draws them with their own widths, when it has them: in Word's PDF, Segoe UI was 1% wider than its guess and Garamond 3% narrower (`word-watertight-text.docx` TX18). Bold text in a font given or embedded without a bold face is measured as the most similar font of the tables too, and text in a font given or embedded that Office also offers is measured from the file. A character whose width in its font isn't known is measured as an average letter of the font
-- kerning and ligatures Word's PDFs haven't shown are measured as the layout measures the rest: a pair whose kerning isn't known as if not kerned, a word longer than its line with ligatures with them, and text either side of a soft hyphen as one word
+- kerning and ligatures Word's PDFs haven't shown are measured as the layout measures the rest: a pair whose kerning isn't known as if not kerned, a word longer than its line with ligatures with them, and text with ligatures either side of a soft hyphen as one word
- a date or time is measured as it is written, where Word writes the date and time it opens the document
- a setting or formatting the layout doesn't follow, such as hyphenation, a compatibility setting or mode, a document grid, a text frame or an indent in characters it hasn't seen, is laid out as if it weren't there, a page number in a format it can't write is written in figures, and a table whose widths it can't work out as Word does is sized as it sizes others. A table that text wraps around where Word's way with it hasn't been seen is laid out in the text, as one it doesn't wrap around
- what it can't read at all, such as a text box, an equation, ink, or a picture or shape that text wraps around in a table cell or a note, is left out, and the rest of its paragraph is laid out without it. Text with a phonetic guide is laid out as its base, what is written in a content control bound to custom XML as it is, and a footnote with a mark of its own as the others are
The unique identifier for this abstract numbering definition.