diff --git a/api/classes/index.AbstractNumbering.html b/api/classes/index.AbstractNumbering.html
index 7dd33611dd..48b5b73624 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 5de12b30eb..66a3e7a392 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 d0ab8c933a..6aaf7fc0e1 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 02541a9898..8d9dee0d34 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 7e4b25415a..5327ed9f06 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 396403e909..84ad742581 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 6b08a9aa34..5d90c7bef4 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 56aea0e668..632998de4d 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 0352d721f9..350287db0a 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 3c844576b9..2e3ad5e8d5 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 70424bdfbc..0b5e2df394 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 266f7beca6..94aca94ba6 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 6e36c780ed..f332129ac5 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 770cdc5798..f9b572e0f6 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 0f41f2b7ec..6d1d362eaf 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 23ee00acc1..d221920bd3 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 72e4310949..230935673c 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 656fc4da59..ff3c1fad9d 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 9fa86403fe..66a189201e 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 c0a356a0c4..c0fe5ad29a 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 d6fe5f0229..1507736ad2 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 6df4a7a440..43eb46b369 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 c5bd90fee9..504e1e2a46 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 ada9c24e94..0a2eee7fb2 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 f37eb340b7..06926af4f5 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 ced5aae350..95e4c6d482 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 73ed3ece5d..f1687f509d 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 dbb1003375..21b0020269 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 daa9144236..b27fbc262a 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 4a84258d3f..ac5349fa16 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 6434df3fd5..1e91e01404 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 0be9ea8e9b..48a642cc05 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 0087862660..92e552f300 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 249e77ab72..a9d492070a 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 90b402c62e..67324b5340 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 b8b0bca75b..b01141e4f2 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 749f400a09..b7fbf748a2 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 421089383b..006dd449fc 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 9b253946e9..4b1e009216 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 f43bc3a5b3..8a5d1561d4 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 db959e5430..ca6e2bf1a2 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 9e85953476..135dd4aa7a 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 6d9521b4e2..c78ac7bd7d 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 6d5e6852fc..97fd6b563b 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 627b6317f8..9787ef23ad 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 4d10779df6..5e733b8468 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 736cf80ebe..ea8e0e7325 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 ab868f489c..f011e2f23d 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 7ee01a06f3..28a19afca7 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 f150ac5229..f31e725ab3 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 15733cb703..60f86c4169 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 96c83af8f2..45f6dae39d 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 9afa8bba45..859c5dbdea 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 c0c81660f3..94079d3701 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 1e701bd6ce..285e4abdf4 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 a799702b89..f476e9cdb0 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 5f4799eaca..073ffffc57 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 148dae2691..8c47c9b08d 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 8ca69b112b..e1ed03994a 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 1950ab65ba..d3731815a5 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 7a61f12af7..7a03a17aa5 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 77fd25c26b..2ab021e261 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 295ab9e80b..93f44916c2 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 184260c608..bf61f6546e 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 cbf3a58474..9d8d3df233 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 3bf4c2561f..c2556f5408 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 a19a16b3fc..eb6d789c38 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 a9eea1a1cd..0d12122349 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 c52401ec94..682a03f150 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 40d31d95fa..5e14a35712 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 0eb4d12a4a..ab65f4598e 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 c61bfd2c3c..3bd1d51cb2 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 2394efd478..e70fb18537 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 6dbea100b1..3ec081400e 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 acc6dc90f2..19182e480d 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 9a063277a4..ce23d3af8f 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 a3cca4fa3f..cc088c47b1 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 9f677bdec1..2b953742a0 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 73dc47c6f4..cfbc863fc6 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 a5b3ce5050..4267f99faa 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 c52437b2e7..6f811dd48a 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 379617c030..96a18c0868 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 ff7321ab15..1d0dfa453b 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 4ea016669d..98830f50f4 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 13af14df8d..c4746877df 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 573f6682e4..227147c168 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 27dab824d1..102a652423 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 40a2b91390..79010e1f15 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 e7f4a51473..2a99202bfc 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 4d4b003cbc..70ebceb191 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 90f223a1e4..104f127085 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 d63ab1ebd3..cc4df63d78 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 f513996a91..39df9af037 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 0d3f9d9fc4..22c9025250 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 6147a33ba3..37d12aea95 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 010d2a10ee..7c589cb73f 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 c2af663857..6ee463e198 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 55788b93d0..57cb4bf33a 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 52337690c7..20d870d7f2 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 084c068c04..2506d43406 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 b050773372..489ee398e3 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 55e4b5faae..833b986832 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 d474508be8..80c30870b9 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 19263dcaaa..8a848fab5b 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 1645b18c80..8509ff1750 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 1e05b0bcd6..55799bb8a0 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 daea401233..bb65a11452 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 0ba941a0d1..33fdf4f49d 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 e5c2b2f2bd..ff9fbf8cbd 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 a589dda45d..942d7b0e63 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 6130dfca15..c50cbfd2c2 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 c4af649fec..ba2749b69d 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 216220ede3..9d1280af5d 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 5310502e11..3ee1a4bbb0 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 707cb0b5cb..a7e458d675 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 01300b6f47..0f6c11fc63 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 4f30f61676..b05d2f5d93 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 a44831ca67..1d9cad7818 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 e0888a2209..a78613ed84 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 c125587e61..958f09feb5 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 46e5a16e54..0f0f836f87 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 7de9390ef5..af14992f1e 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 674971bb87..685cc193f1 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 af79103a21..c8d18999b3 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 97173f4bb9..3d681b00f9 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 e66e5fb95e..9050d9ef60 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 38cb025e28..a38c753254 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 66387483d7..2be5552150 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 241ff81e84..3ed746e75a 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 9ef8ff6e2a..8aa4e9fb00 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 302f556520..c9306f5d29 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 037ece5bbf..38509b43f2 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 473addcfb0..76d2f1c99e 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 554066a3a9..f90ce3f76e 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 962adacbdc..ff08dd1c02 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 f358351f14..e3153a75b7 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 13ca46af41..0fc1a243de 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 a56c60bb12..5f8d8bd2eb 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 323c6015c7..d399169d26 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 8ced812cb9..61f02aae61 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 ab20f9b27d..64566139f1 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 cb139df97a..ba1d82f86a 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 6dfd8343fe..babb0d1cf7 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 4fb616d71d..9072da4475 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 f4eff83e4d..73aea12d87 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 edfa6f6c3c..c160f09623 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 b2a00ad8d8..f9e91bc029 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 01dec231af..cab18cb309 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 2fdd798a74..a00e95ea2e 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 069195601e..fbc74c7a61 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 bfb882ae46..843a04b990 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 41b2a9e4b8..0c0d5e931f 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 c34d8647df..77275636f9 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 4a0a190523..d04a69440a 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 f219fdd787..080d62ed28 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 7fef6877d9..0f4de8cd88 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 b199813c23..40a3fd47bb 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 3259ef7573..a178912357 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 bf1d0222a3..ed18f2e06c 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 fbe3821974..26cf8ec174 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 c08d59d379..8b2a52fb80 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 410fbcb048..ca20aa3bf6 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 8ef6e6dee9..23f6261307 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 9e1688f418..999db2eae3 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 bb782bc8d6..a57ab50a7c 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 f732939f76..8aad678d5f 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 7a6822ceba..1a765840ad 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 3384b81738..a3769a5dbe 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 7dce9b4649..511e3b9c9b 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 085edd9bc3..f15d71244f 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 eebcfb8076..93bd6f0a43 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 0fd1ff3879..aa298edcea 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 e2fdbb6887..7b52d59f3f 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 492b115fb0..d2e1524943 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 aa435e73c6..26ff6ed312 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 e29574c5e1..b00a08c8e7 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 9e7dcea17f..f0ac90bf1a 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 f28ffbd69f..1e5af837c0 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 741e7dfa7c..daa7c5090f 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 24f3af9b88..a77b4924c7 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 1eba4e7723..91683eaed8 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 003b230742..6b47fa39f8 100644
--- a/live-examples/lib/layout.iife.js
+++ b/live-examples/lib/layout.iife.js
@@ -1,5 +1,241 @@
var docxLayout = (function(exports) {
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
+ //#region src/text-layout/arabic-widths.ts
+ /**
+ * How wide Word draws Arabic's letters in each of the forms it joins them in, the lam-alef ligatures and the tatweel, in
+ * the fonts of the width tables whose Arabic Word lays out with its glyphs' own widths, plain and bold, and the font it
+ * draws them in.
+ *
+ * Generated by scripts/generate-arabic-widths.ts from Word's PDF of scripts/layout-probes/stops2/word-stops-arabic.ts,
+ * saved from Word 16 for Mac. Do not edit by hand.
+ *
+ * @module
+ */
+ /**
+ * The letters the widths are for, in their order: Arabic's (U+0621 to U+063A and U+0641 to U+064A), and Persian's peh,
+ * tcheh, jeh, keheh, gaf and farsi yeh
+ */
+ var ARABIC_LETTERS = "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی";
+ /** The alefs lam joins with into a ligature, in the order of their widths */
+ var LAM_ALEFS = "آأإا";
+ var ARABIC_WIDTHS = [
+ {
+ name: "Arial",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1l01tS1l01tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AE!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AD!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Times New Roman",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1k/1tS1l01tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AE!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AD!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Cambria",
+ drawnIn: "Times New Roman",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1k/1tS1k/1tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AD!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AE!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Courier New",
+ regular: "1tN!*021tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*08",
+ bold: "1tN!*021tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*08"
+ }
+ ];
+ //#endregion
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
+ function _typeof(o) {
+ "@babel/helpers - typeof";
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
+ return typeof o;
+ } : function(o) {
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+ }, _typeof(o);
+ }
+ //#endregion
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
+ function toPrimitive(t, r) {
+ if ("object" != _typeof(t) || !t) return t;
+ var e = t[Symbol.toPrimitive];
+ if (void 0 !== e) {
+ var i = e.call(t, r || "default");
+ if ("object" != _typeof(i)) return i;
+ throw new TypeError("@@toPrimitive must return a primitive value.");
+ }
+ return ("string" === r ? String : Number)(t);
+ }
+ //#endregion
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
+ function toPropertyKey(t) {
+ var i = toPrimitive(t, "string");
+ return "symbol" == _typeof(i) ? i : i + "";
+ }
+ //#endregion
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
+ function _defineProperty(e, r, t) {
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
+ value: t,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0
+ }) : e[r] = t, e;
+ }
+ //#endregion
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
+ function ownKeys(e, r) {
+ var t = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var o = Object.getOwnPropertySymbols(e);
+ r && (o = o.filter(function(r) {
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
+ })), t.push.apply(t, o);
+ }
+ return t;
+ }
+ function _objectSpread2(e) {
+ for (var r = 1; r < arguments.length; r++) {
+ var t = null != arguments[r] ? arguments[r] : {};
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
+ _defineProperty(e, r, t[r]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
+ });
+ }
+ return e;
+ }
+ //#endregion
+ //#region src/text-layout/arabic-shaping.ts
+ /**
+ * Arabic's letters in the forms Word joins them in: each letter isolated, final, initial or medial as the letters beside it
+ * join it, and lam with the alef after it as one ligature, with the widths of {@link ARABIC_WIDTHS}.
+ *
+ * @module
+ */
+ var RIGHT_JOINING = /* @__PURE__ */ new Set([..."آأؤإاةدذرزوژ"]);
+ var NON_JOINING = /* @__PURE__ */ new Set(["ء"]);
+ var TATWEEL = "ـ";
+ var ZERO_WIDTH_JOINER = "";
+ var ZERO_WIDTH_NON_JOINER = "";
+ var LAM = "ل";
+ /** How a character joins the letters beside it, where the widths know it, and as a character of another script otherwise */
+ var joiningOf = (character) => {
+ if (character === TATWEEL || character === ZERO_WIDTH_JOINER) return "C";
+ if (character === ZERO_WIDTH_NON_JOINER || NON_JOINING.has(character)) return "U";
+ if (new RegExp("[\\p{Mn}\\p{Me}\\p{Cf}]", "u").test(character)) return "T";
+ if (RIGHT_JOINING.has(character)) return "R";
+ return "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(character) ? "D" : "U";
+ };
+ /** The forms of a letter, in the order of the widths */
+ var ISOLATED = 0;
+ var FINAL = 1;
+ var INITIAL = 2;
+ var MEDIAL = 3;
+ var LIGATURES = ARABIC_LETTERS.length * 4;
+ var TATWEEL_WIDTH = LIGATURES + LAM_ALEFS.length * 2;
+ /** The digits the widths are written in */
+ var DIGITS$3 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/";
+ var twoDigitsIn$1 = (encoded, at) => DIGITS$3.indexOf(encoded[at]) * 64 + DIGITS$3.indexOf(encoded[at + 1]);
+ var decoded$2 = /* @__PURE__ */ new Map();
+ /** Reads a face's widths, in thousandths of an em, as {@link ARABIC_WIDTHS} writes them */
+ var decodeFace$1 = (encoded, drawnIn) => {
+ const known = decoded$2.get(encoded);
+ if (known) return known;
+ const widths = [];
+ let last;
+ for (let at = 0; at < encoded.length;) if (encoded[at] === "*") {
+ widths.push(...new Array(twoDigitsIn$1(encoded, at + 1)).fill(last));
+ at += 3;
+ } else {
+ last = encoded[at] === "!" ? void 0 : (DIGITS$3.indexOf(encoded[at]) * 4096 + twoDigitsIn$1(encoded, at + 1)) / 10;
+ widths.push(last);
+ at += encoded[at] === "!" ? 1 : 3;
+ }
+ const face = _objectSpread2({ widths }, drawnIn === void 0 ? {} : { drawnIn });
+ decoded$2.set(encoded, face);
+ return face;
+ };
+ /**
+ * The widths of Arabic in a font of the tables, by its name there, plain or bold, when Word's PDF has them: not Calibri's,
+ * which Word lays out otherwise, nor italic
+ */
+ var arabicFaceOf = (name, bold, italic) => {
+ const font = ARABIC_WIDTHS.find((known) => known.name === name);
+ return font === void 0 || italic ? void 0 : decodeFace$1(bold ? font.bold : font.regular, font.drawnIn);
+ };
+ var KERNED = /* @__PURE__ */ new Set([
+ "Arial",
+ "Times New Roman",
+ "Cambria"
+ ]);
+ /**
+ * Why Word's widths of Arabic text in a font of the tables aren't known, when they aren't: letters side by side, with
+ * nothing but marks between them, which Word kerns by pairs the widths don't have, in a font it kerns them in, but for lam
+ * and an alef, which it joins into one glyph
+ */
+ var unknownArabicKerning = (text, name) => {
+ if (!KERNED.has(name)) return;
+ const letters = [...text].filter((character) => joiningOf(character) !== "T");
+ return letters.some((character, index) => index > 0 && "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(character) && "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(letters[index - 1]) && !(letters[index - 1] === LAM && "آأإا".includes(character))) ? "Arabic letters side by side, which Word kerns by pairs not yet known" : void 0;
+ };
+ /** Whether a character is one of Arabic's letters the widths have, or the tatweel */
+ var isJoinedLetter = (character) => character === TATWEEL || "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(character);
+ /**
+ * The widths of the letters of text Word joins, by the index of each among its characters, in thousandths of an em: each
+ * letter in the form the letters beside it join it in, in the text, as Word joins those of a word, and lam and an alef
+ * after it as a ligature, whose width is lam's, the alef taking none. A letter joins the letter before it when it joins
+ * either way, or only that one, and that letter joins the next too, or is a tatweel, and the letter after it when it joins
+ * both and that letter joins the one before it; marks between them leave them joined.
+ */
+ var joinedWidthsOf = (characters, face) => {
+ const joinings = characters.map(joiningOf);
+ /** The next character's index from one, either way, that isn't a mark */
+ const nextLetter = (index, step) => {
+ let at = index + step;
+ while (joinings[at] === "T") at += step;
+ return at;
+ };
+ const widths = /* @__PURE__ */ new Map();
+ for (const [index, character] of characters.entries()) {
+ if (!isJoinedLetter(character)) continue;
+ if (character === TATWEEL) {
+ widths.set(index, face.widths[TATWEEL_WIDTH]);
+ continue;
+ }
+ const joining = joinings[index];
+ const before = joinings[nextLetter(index, -1)];
+ const after = nextLetter(index, 1);
+ const joinsBefore = (joining === "D" || joining === "R") && (before === "D" || before === "C");
+ const next = characters[after];
+ const alef = next === void 0 ? -1 : LAM_ALEFS.indexOf(next);
+ if (character === LAM && alef >= 0) {
+ widths.set(index, face.widths[LIGATURES + alef * 2 + (joinsBefore ? FINAL : ISOLATED)]);
+ widths.set(after, 0);
+ continue;
+ }
+ if (widths.has(index)) continue;
+ const joinsAfter = joining === "D" && [
+ "D",
+ "R",
+ "C"
+ ].includes(joinings[after]);
+ const form = joinsBefore ? joinsAfter ? MEDIAL : FINAL : joinsAfter ? INITIAL : ISOLATED;
+ widths.set(index, face.widths[ARABIC_LETTERS.indexOf(character) * 4 + form]);
+ }
+ return widths;
+ };
+ /**
+ * Whether the last letter of a run's text and the first of the next's are Arabic letters Word joins, whose forms
+ * {@link joinedWidthsOf}, measuring each run's text on its own, doesn't know
+ */
+ var joinsAcross = (before, after) => {
+ const last = [...before].reverse().find((character) => joiningOf(character) !== "T");
+ const first = [...after].find((character) => joiningOf(character) !== "T");
+ return last !== void 0 && first !== void 0 && ["D", "C"].includes(joiningOf(last)) && [
+ "D",
+ "R",
+ "C"
+ ].includes(joiningOf(first)) && (isJoinedLetter(last) || isJoinedLetter(first));
+ };
+ //#endregion
//#region src/text-layout/font-widths.ts
/**
* The characters the widths are for, as ranges of code points: printable ASCII; Latin-1, Latin Extended-A and B, IPA and
@@ -5733,67 +5969,6 @@ var docxLayout = (function(exports) {
}
];
//#endregion
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
- function _typeof(o) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
- return typeof o;
- } : function(o) {
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
- }, _typeof(o);
- }
- //#endregion
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
- function toPrimitive(t, r) {
- if ("object" != _typeof(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
- }
- //#endregion
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
- function toPropertyKey(t) {
- var i = toPrimitive(t, "string");
- return "symbol" == _typeof(i) ? i : i + "";
- }
- //#endregion
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
- function _defineProperty(e, r, t) {
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
- value: t,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[r] = t, e;
- }
- //#endregion
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
- function ownKeys(e, r) {
- var t = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r) {
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
- })), t.push.apply(t, o);
- }
- return t;
- }
- function _objectSpread2(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
- _defineProperty(e, r, t[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
- });
- }
- return e;
- }
- //#endregion
//#region src/text-layout/kerning.ts
/**
* Kerning and ligatures in the fonts of the width tables, as Word draws them: which letters a font's ligatures join into
@@ -6750,10 +6925,16 @@ var docxLayout = (function(exports) {
const measured = _objectSpread2(_objectSpread2({}, font), {}, { font: (_eastAsian$latin = eastAsian === null || eastAsian === void 0 ? void 0 : eastAsian.latin) !== null && _eastAsian$latin !== void 0 ? _eastAsian$latin : font.font });
return _objectSpread2(_objectSpread2({}, faceOf(measured)), {}, {
more: moreFaceOf(measured),
+ arabic: eastAsian === void 0 ? arabicFaceOf(widthsOf(measured.font).name, font.bold === true, font.italic === true) : void 0,
monospaced: (eastAsian === null || eastAsian === void 0 ? void 0 : eastAsian.monospaced) === true
});
};
/**
+ * The widths of the letters of text Word joins, Arabic's, by the index of each among its characters, in the forms Word
+ * joins them in, where its face's are known (see `arabic-shaping.ts`)
+ */
+ var joinedIn = (characters, arabic) => arabic !== void 0 && characters.some(isJoinedLetter) ? joinedWidthsOf(characters, arabic) : void 0;
+ /**
* The first character of text whose width in its font isn't known, so isn't what Word lays out: one of the tables'
* characters that Word draws in a font whose widths the tables don't have when the font doesn't have it, such as Cambria
* Math, or in one whose line gap could make the line taller, such as Arial, or whose width Word's PDFs don't show, such as
@@ -6763,11 +6944,14 @@ var docxLayout = (function(exports) {
* characters the tables don't have, as an average letter.
*/
var unknownCharacter = (text, font = {}) => {
- const { widths, more, monospaced } = measuresOf(font);
+ var _font$characterSpacin;
+ const { widths, more, arabic, monospaced } = measuresOf(font);
+ const joined = arabic !== void 0 && ((_font$characterSpacin = font.characterSpacing) !== null && _font$characterSpacin !== void 0 ? _font$characterSpacin : 0) === 0;
return [...text].find((character) => {
const code = character.codePointAt(0);
const index = CHARACTER_INDEX.get(code);
const moreIndex = MORE_CHARACTER_INDEX.get(code);
+ if (isJoinedLetter(character) && !monospaced) return !joined;
if (monospaced || index === void 0 && moreIndex === void 0) return isPrivate(code) || !monospaced && JOINED_SCRIPT.test(character) && !takesNoRoom(character);
return index === void 0 ? (more === null || more === void 0 ? void 0 : more.widths[moreIndex]) === void 0 : widths[index] === void 0;
});
@@ -6840,11 +7024,16 @@ var docxLayout = (function(exports) {
* @param start - Where the text starts on its line, in points
*/
var measureTextWidth = (text, font = {}, start = 0) => {
- const { widths, more, monospaced } = measuresOf(font);
+ const { widths, more, arabic, monospaced } = measuresOf(font);
const widthOf = monospaced ? monospacedWidth : (character) => characterWidth(widths, more, character);
const size = sizeOf$3(font);
const { characterSpacing = 0, scale = 100 } = font;
- return [...text].reduce((position, character) => character === " " ? (Math.floor(position / TAB_STOP$2) + 1) * TAB_STOP$2 : position + widthOf(character) * size * scale / 1e5 + characterSpacing, start) - start;
+ const characters = [...text];
+ const joined = joinedIn(characters, arabic);
+ return characters.reduce((position, character, index) => {
+ var _joined$get;
+ return character === " " ? (Math.floor(position / TAB_STOP$2) + 1) * TAB_STOP$2 : position + ((_joined$get = joined === null || joined === void 0 ? void 0 : joined.get(index)) !== null && _joined$get !== void 0 ? _joined$get : widthOf(character)) * size * scale / 1e5 + characterSpacing;
+ }, start) - start;
};
/**
* How wide a line of text is, in points, as Word draws it: kerned, and with its letters joined into ligatures, when it
@@ -6906,6 +7095,8 @@ var docxLayout = (function(exports) {
*/
var unknownShaping = (text, font = {}) => {
var _eastAsianFontOf, _font$font4;
+ const arabic = measuresOf(font).arabic === void 0 ? void 0 : unknownArabicKerning(text, widthsOf(font.font).name);
+ if (arabic !== void 0) return arabic;
const ligatures = hasLigatures(font);
if (!isKerned(font) && !ligatures || ((_eastAsianFontOf = eastAsianFontOf((_font$font4 = font.font) !== null && _font$font4 !== void 0 ? _font$font4 : "Times New Roman")) === null || _eastAsianFontOf === void 0 ? void 0 : _eastAsianFontOf.monospaced) === true) return;
const shaping = shapingFor(font);
@@ -6961,6 +7152,7 @@ var docxLayout = (function(exports) {
noLineEnd: ""
}
};
+ var STRICT_JAPANESE_NO_LINE_START = "ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶー";
var EAST_ASIAN = new RegExp("[\\u1100-\\u11ff\\u2e80-\\u2fff\\u3000-\\u30ff\\u3130-\\u318f\\u31c0-\\u33ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\ua960-\\ua97f\\uac00-\\ud7ff\\uf900-\\ufaff\\ufe30-\\ufe4f\\uff00-\\uffef\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}]", "u");
var HANGUL = new RegExp("\\p{Script=Hangul}", "u");
var DASHES = /* @__PURE__ */ new Set([
@@ -7003,9 +7195,11 @@ var docxLayout = (function(exports) {
noLineStart: /* @__PURE__ */ new Set(),
noLineEnd: /* @__PURE__ */ new Set()
};
- var listOf = (language, { lists = {} }) => {
+ var listOf = (language, { lists = {}, strict = false }) => {
var _lists$language;
- const { noLineStart = WORD_LISTS[language].noLineStart, noLineEnd = WORD_LISTS[language].noLineEnd } = (_lists$language = lists[language]) !== null && _lists$language !== void 0 ? _lists$language : {};
+ const words = WORD_LISTS[language];
+ const wordsStart = strict && language === "japanese" ? words.noLineStart + STRICT_JAPANESE_NO_LINE_START : words.noLineStart;
+ const { noLineStart = wordsStart, noLineEnd = words.noLineEnd } = (_lists$language = lists[language]) !== null && _lists$language !== void 0 ? _lists$language : {};
return {
noLineStart: new Set(noLineStart),
noLineEnd: new Set(noLineEnd)
@@ -7313,6 +7507,7 @@ var docxLayout = (function(exports) {
widowControl: onOff(children, "w:widowControl"),
tabs: readTabs(find(children, "w:tabs")),
kinsoku: onOff(children, "w:kinsoku"),
+ rightToLeft: onOff(children, "w:bidi"),
wordWrap: onOff(children, "w:wordWrap"),
suppressAutoHyphens: onOff(children, "w:suppressAutoHyphens"),
snapToGrid: onOff(children, "w:snapToGrid"),
@@ -7610,12 +7805,13 @@ var docxLayout = (function(exports) {
var fontOfSlot = (format, slot) => {
const font = plainFontOf(format);
if (slot === "latin") return scripted(font, format);
- const { eastAsiaFont, complexScriptFont, complexScriptSize, complexScriptBold, complexScriptItalic } = format;
+ const { eastAsiaFont, complexScriptFont, complexScriptSize, complexScriptBold, complexScriptItalic, rightToLeft } = format;
return scripted(slot === "eastAsian" ? _objectSpread2(_objectSpread2({}, font), {}, { font: isEastAsianFont(eastAsiaFont) ? eastAsiaFont : FALLBACK_EAST_ASIAN_FONT }) : withoutUndefined(_objectSpread2(_objectSpread2({}, font), {}, {
font: complexScriptFont,
size: complexScriptSize,
bold: complexScriptBold,
- italic: complexScriptItalic
+ italic: complexScriptItalic,
+ rightToLeft: rightToLeft === true ? true : void 0
})), format);
};
/**
@@ -8072,13 +8268,13 @@ var docxLayout = (function(exports) {
* of the page, as multiple spacing's can: a line of Times New Roman 8 that ends 82 twips below it is on the page, and one
* of Times New Roman 12 that would end there isn't (G1, G14a). Emphasis marks take their room in the line before it is
* put on the grid (G11d), and with multiple line spacing too: lines of MS Mincho 10.5 with marks at 1.5 lines are 540
- * twips on a grid of 360 (stops2/word-stops-east-asian.ts GR3). With at least a height, they haven't been seen
+ * twips on a grid of 360 (stops2/word-stops-east-asian.ts GR3), and with at least a height, which is that height: 400 twips
+ * at least 20 points (word-stops-east-asian2.ts GR16d)
*/
var gridHeightOf = (given, spacing, pitch) => {
- var _own$unsupported;
if ((spacing === null || spacing === void 0 ? void 0 : spacing.rule) === "exact") return heightOf(given, spacing);
const own = heightOf(given, void 0);
- const unsupported = given.marks !== void 0 && (spacing === null || spacing === void 0 ? void 0 : spacing.rule) === "atLeast" ? "emphasis marks on a line with at least a height of line spacing on a document grid" : (_own$unsupported = own.unsupported) !== null && _own$unsupported !== void 0 ? _own$unsupported : heightOf(given, spacing).unsupported;
+ const { unsupported } = heightOf(given, spacing);
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;
@@ -8385,12 +8581,15 @@ var docxLayout = (function(exports) {
}
return _objectSpread2({ items: spaced.filter((item) => item.type !== "text" || item.text.length > 0) }, unsupported === void 0 ? {} : { unsupported });
};
- var GRID_TAB = "a tab on a grid that snaps to characters, but for a left one before Chinese, Japanese or Korean text";
- /** Whether the text after a tab starts with a Chinese, Japanese or Korean character, which a grid that snaps to characters puts in its cells */
- var startsWithGridCharacter = (tokens) => {
+ var GRID_TAB = "a tab on a grid that snaps to characters, but for a left one before text, or a right or centred one before Chinese, Japanese or Korean text";
+ /**
+ * Whether the text after a tab starts with a word, and whether that starts with a Chinese, Japanese or Korean character,
+ * which a grid that snaps to characters puts in its cells
+ */
+ var startOfText = (tokens) => {
const next = tokens.find((token) => token.type !== "marker");
- const first = (next === null || next === void 0 ? void 0 : next.type) === "word" ? [...textOf$2(next.pieces)][0] : void 0;
- return first !== void 0 && isGridCharacter(first);
+ if ((next === null || next === void 0 ? void 0 : next.type) !== "word") return;
+ return isGridCharacter([...textOf$2(next.pieces)][0]) ? "grid" : "word";
};
/**
* A paragraph's content with its text set across in text that runs down the page as pieces of room of their own, as long
@@ -8407,14 +8606,90 @@ var docxLayout = (function(exports) {
font: item.font
};
});
+ /** The two tokens after one, by its index, but for markers */
+ var nextTwo = (tokens, index) => {
+ const next = [];
+ for (let at = index + 1; at < tokens.length && next.length < 2; at++) if (tokens[at].type !== "marker") next.push(tokens[at]);
+ return next;
+ };
+ var RIGHT_TO_LEFT = new RegExp("[\\p{Script=Hebrew}\\p{Script=Arabic}\\p{Script=Syriac}\\p{Script=Thaana}\\p{Script=Nko}]", "u");
+ /**
+ * Whether pieces of text start, or end, with a right-to-left letter: the first, or last, of their letters is Hebrew's,
+ * Arabic's or another right-to-left script's. Text with no letters is taken as left to right
+ */
+ var rightToLeftAt = (pieces, edge) => {
+ const text = pieces.map(({ text: piece }) => piece).join("");
+ if (!RIGHT_TO_LEFT.test(text)) return false;
+ const letters = [...text].filter((character) => new RegExp("\\p{L}", "u").test(character));
+ return RIGHT_TO_LEFT.test(edge === "start" ? letters[0] : letters[letters.length - 1]);
+ };
+ /**
+ * What the space between two words is at the end of a line, in a left-to-right paragraph, as Word breaks it: room the
+ * line has for it, when it is in a right-to-left run between right-to-left words, as a word of Arabic that fits only
+ * without it goes on to the next line, where Word puts those that fit with it (stops2/word-stops-arabic.ts AR2e, AR2h,
+ * AR2i), or hanging past the end of the line, as it does between left-to-right words, and between right-to-left and
+ * left-to-right ones, either way, in runs that aren't right to left: Hebrew's last letters, and a label before the
+ * next, end lines a space short of the margin (stops2/word-stops-more-widths.ts W139, W278). Word breaks the lines of a
+ * right-to-left paragraph where it breaks those of a left-to-right one (scripts/layout-probes/word-unicode.ts R2, R8). Where
+ * it hasn't been seen, it is unknown: in a right-to-left run beside left-to-right text, and between right-to-left words
+ * in a run that isn't right to left
+ */
+ var spaceAtEnd = (before, space, after) => {
+ const [end, start] = [rightToLeftAt(before, "end"), rightToLeftAt(after, "start")];
+ if (!end && !start) return "hanging";
+ const inRightToLeftRun = space.some(({ font }) => font.rightToLeft === true);
+ return end && start ? inRightToLeftRun ? "room" : "unknown" : inRightToLeftRun ? "unknown" : "hanging";
+ };
+ /**
+ * A paragraph's indents on a grid that snaps to characters, whose lines start on its cells: the cell an indent of part of
+ * one ends in, as Word rounds it up, and a hanging indent's other lines that many more cells in, rounded up too. On a grid
+ * of cells of 225.65 twips, a paragraph indented 1.2, 1.5 or 1.7 characters, or 300 twips, starts its lines at the 3rd
+ * cell, one with a first line indent of half a character starts its first line at the 2nd and the others at the 1st, and
+ * one indented 2 characters and hanging half a character starts its first line at the 3rd and the others at the 4th, past
+ * its left indent (scripts/layout-probes/stops2/word-stops-east-asian.ts GR6, word-stops-east-asian2.ts GR14a to GR14e). A
+ * right indent of part of a cell leaves the line the cells before it, as the cells that fit do (GR14f). It says why when
+ * Word's way with them isn't known: a first line indent of part of a cell beside a left indent of part of one, which may
+ * be rounded together or apart, and a line that starts before the margin.
+ */
+ var indentsOnCells = (format, cell) => {
+ const { indentLeft = 0, firstLineIndent = 0 } = format;
+ const whole = (length) => cell === void 0 || Math.abs(length / cell - Math.round(length / cell)) <= TOLERANCE$2 / cell;
+ if (cell === void 0 || whole(indentLeft) && whole(firstLineIndent)) return { format };
+ const cells = (length) => (whole(length) ? Math.round(length / cell) : Math.ceil(length / cell)) * cell;
+ const first = indentLeft + firstLineIndent;
+ if (Math.min(indentLeft, first) < -.01) return {
+ format,
+ unsupported: "an indent of part of a character before the margin on a grid that snaps to characters"
+ };
+ if (firstLineIndent < 0) {
+ const hanging = cells(-firstLineIndent);
+ return {
+ format: _objectSpread2(_objectSpread2({}, format), {}, {
+ indentLeft: cells(first) + hanging,
+ firstLineIndent: -hanging
+ }),
+ rounded: true
+ };
+ }
+ if (!whole(indentLeft) && !whole(firstLineIndent)) return {
+ format,
+ unsupported: "a first line indent of part of a character beside a left indent of part of one on a grid that snaps to characters"
+ };
+ return {
+ format: _objectSpread2(_objectSpread2({}, format), {}, {
+ indentLeft: cells(indentLeft),
+ firstLineIndent: cells(first) - cells(indentLeft)
+ }),
+ rounded: true
+ };
+ };
/**
* Breaks a paragraph into lines, as Word breaks it.
*
* @param items - The paragraph's content, in order
*/
- var layoutLines = (paragraphItems, { width, format = {}, tabStops = [], defaultTabStop = DEFAULT_TAB_STOP, markFont = {}, measurer = DEFAULT_MEASURER, breakRules, numberAlignment, hyphenation, grid = {}, compatibilityMode }) => {
- var _spaced$items, _spaced$unsupported, _content$;
- const { indentLeft = 0, indentRight = 0, firstLineIndent = 0, lineSpacing, lineSpacingFrom, alignment } = format;
+ var layoutLines = (paragraphItems, { width, format: givenFormat = {}, tabStops = [], defaultTabStop = DEFAULT_TAB_STOP, markFont = {}, measurer = DEFAULT_MEASURER, breakRules, numberAlignment, hyphenation, grid = {}, compatibilityMode }) => {
+ var _spaced$items, _ref2, _ref3, _onCells$unsupported, _content$;
const items = withAcross(paragraphItems, measurer);
const { linePitch, characterSpace, characterPitch, characterRoom } = grid;
/**
@@ -8429,6 +8704,9 @@ var docxLayout = (function(exports) {
const column = typeof room === "number" ? room : room.end;
return column / Math.max(1, Math.floor(column / characterRoom + GRID_ROUNDING));
};
+ const onCells = indentsOnCells(givenFormat, cellOn(0));
+ const { format } = onCells;
+ const { indentLeft = 0, indentRight = 0, firstLineIndent = 0, lineSpacing, lineSpacingFrom, alignment } = format;
const snapping = characterPitch !== void 0 || characterRoom !== void 0;
const spaced = characterSpace === void 0 ? void 0 : spacedOnGrid(items, characterSpace);
const content = (_spaced$items = spaced === null || spaced === void 0 ? void 0 : spaced.items) !== null && _spaced$items !== void 0 ? _spaced$items : items;
@@ -8444,23 +8722,33 @@ var docxLayout = (function(exports) {
* twips, and "abc de" between ideographs 3 cells (scripts/layout-probes/word-grid.ts CC1 to CC4, CD1 to CD4). Text in a
* run that doesn't snap to the grid is as wide as it is (CC5)
*/
- const snapped = (state, pieces) => {
+ const snapped = (state, pieces, kern = 0) => {
let { position, latin } = state;
- for (const { text, font } of pieces) for (const character of text) {
- const characterWidth = measurer.measureWidth(character, font);
- if (font.snapToGrid === false) {
- position += characterWidth;
- latin = void 0;
- } else if (isGridCharacter(character)) {
- position = (latin ? latin.start + cellsOf(latin.width) : position) + cellsOf(characterWidth);
- latin = void 0;
- } else {
- var _latin$start, _latin$width;
- latin = {
- start: (_latin$start = latin === null || latin === void 0 ? void 0 : latin.start) !== null && _latin$start !== void 0 ? _latin$start : position,
- width: ((_latin$width = latin === null || latin === void 0 ? void 0 : latin.width) !== null && _latin$width !== void 0 ? _latin$width : 0) + characterWidth
- };
- position = latin.start + cellsOf(latin.width);
+ let lead = kern;
+ let before;
+ let beforeFont;
+ for (const { text, font, apart } of pieces) {
+ if (beforeFont === void 0 || apart === true || !sameFont(beforeFont, font)) before = void 0;
+ beforeFont = font;
+ for (const character of text) {
+ const characterWidth = measurer.measureWidth(character, font);
+ if (font.snapToGrid === false) {
+ position += characterWidth;
+ latin = void 0;
+ } else if (isGridCharacter(character)) {
+ position = (latin ? latin.start + cellsOf(latin.width) : position) + cellsOf(characterWidth);
+ latin = void 0;
+ } else {
+ var _latin$start, _latin$width;
+ const kerned = before !== void 0 && isKerned(font) ? measurer.measureWidth(before + character, font) - measurer.measureWidth(before, font) : characterWidth;
+ latin = {
+ start: (_latin$start = latin === null || latin === void 0 ? void 0 : latin.start) !== null && _latin$start !== void 0 ? _latin$start : position,
+ width: ((_latin$width = latin === null || latin === void 0 ? void 0 : latin.width) !== null && _latin$width !== void 0 ? _latin$width : 0) + lead + kerned
+ };
+ position = latin.start + cellsOf(latin.width);
+ }
+ lead = 0;
+ before = font.snapToGrid === false || isGridCharacter(character) ? void 0 : character;
}
}
return {
@@ -8468,10 +8756,10 @@ var docxLayout = (function(exports) {
latin
};
};
- const firstCell = cellOn(0);
- const offCells = firstCell !== void 0 && [indentLeft, indentLeft + firstLineIndent].some((start) => Math.abs(start / firstCell - Math.round(start / firstCell)) > TOLERANCE$2 / firstCell);
- const shapedOnGrid = items.some((item) => item.type === "text" && item.font.snapToGrid !== false && (snapping && shaped(item.font) || characterSpace !== void 0 && hasLigatures(item.font))) ? "ligatures on a document grid of characters, or kerning on one that snaps to characters" : void 0;
- const unknownOnGrid = offCells ? "an indent of part of a character on a grid that snaps to characters" : (_spaced$unsupported = spaced === null || spaced === void 0 ? void 0 : spaced.unsupported) !== null && _spaced$unsupported !== void 0 ? _spaced$unsupported : shapedOnGrid;
+ /** How far text after a tab, up to the next, goes on a grid that snaps to characters, from the start of one of its cells */
+ const cellsAfterTab = (tokens) => textAfterTab(tokens).reduce((state, token) => token.type === "box" ? { position: state.position + cellsOf(token.width) } : token.type === "word" || token.type === "space" ? snapped(state, token.pieces) : state, { position: 0 }).position;
+ const shapedOnGrid = items.some((item) => item.type === "text" && item.font.snapToGrid !== false && (snapping || characterSpace !== void 0) && hasLigatures(item.font)) ? "ligatures on a document grid of characters" : void 0;
+ const unknownOnGrid = (_ref2 = (_ref3 = (_onCells$unsupported = onCells.unsupported) !== null && _onCells$unsupported !== void 0 ? _onCells$unsupported : onCells.rounded && items.some((item) => item.type === "tab") ? "a tab in a paragraph indented part of a character on a grid that snaps to characters" : void 0) !== null && _ref3 !== void 0 ? _ref3 : spaced === null || spaced === void 0 ? void 0 : spaced.unsupported) !== null && _ref2 !== void 0 ? _ref2 : shapedOnGrid;
let markHeight;
const markLineHeight = () => {
var _markHeight;
@@ -8670,12 +8958,12 @@ var docxLayout = (function(exports) {
].includes(lineSpacingFrom.marker) ? lineSpacingFrom.lineSpacing : lineSpacing;
const marked = state.started ? withMarkOf(state.heights) : markHeightsOf();
const heights = typeof marked === "string" ? state.heights : marked;
- const _ref2 = linePitch === void 0 ? heightOf(heights, spacing) : gridHeightOf(heights, spacing, linePitch), { unsupported: unknownHeight } = _ref2, height = _objectWithoutProperties(_ref2, _excluded$1);
+ const _ref4 = linePitch === void 0 ? heightOf(heights, spacing) : gridHeightOf(heights, spacing, linePitch), { unsupported: unknownHeight } = _ref4, height = _objectWithoutProperties(_ref4, _excluded$1);
const unsupported = state.unknown ? "a justified line that only fits squeezed at a four-per-em space, or at an en, em or ideographic space beside ordinary spaces" : (_state$unsupported = state.unsupported) !== null && _state$unsupported !== void 0 ? _state$unsupported : markMatters(withNumber(heights)) ? "a picture alone in a line of a paragraph whose mark is larger, with multiple line spacing" : typeof marked === "string" ? marked : unknownHeight;
- lines.push(_objectSpread2(_objectSpread2(_objectSpread2({}, height), {}, { markers: [...state.markers, ...state.pending] }, breakAfter ? { breakAfter } : {}), {}, {
+ lines.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, height), {}, { markers: [...state.markers, ...state.pending] }, breakAfter ? { breakAfter } : {}), {}, {
text: state.text,
textWidth: Math.max(0, state.end - state.start)
- }, unsupported === void 0 ? {} : { unsupported }));
+ }, onCells.rounded && roomOf(lines.length) === void 0 ? { start: state.start } : {}), unsupported === void 0 ? {} : { unsupported }));
};
const wrap = (state) => {
finish(_objectSpread2(_objectSpread2({}, state), {}, { pending: [] }));
@@ -8726,29 +9014,30 @@ var docxLayout = (function(exports) {
* Puts a word or picture on the line, or on the next, or breaks it across lines. A word is kerned with the text
* before it on the line by `kern`, unless it starts the next line
*/
- const placeWord = (token, kern = 0) => {
+ const placeWord = (token, kern = 0, after = 0, unsureAfter = false) => {
var _lastBorder$room2, _lastBorder2, _token$hyphens;
+ const kernOn = (state) => state.latin === void 0 ? 0 : kern;
/** How wide the token is on the line, which on a grid that snaps to characters depends on the text before it */
- const widthOn = (state) => token.type === "box" ? !snapping ? token.width : cellsOf(token.width) : !snapping ? widthOf(token.pieces, measurer) : snapped(state, token.pieces).position - state.position;
+ const widthOn = (state) => token.type === "box" ? !snapping ? token.width : cellsOf(token.width) : !snapping ? widthOf(token.pieces, measurer) : snapped(state, token.pieces, kernOn(state)).position - state.position;
let tokenWidth = widthOn(line);
- const leadOf = (state, wrapped = false) => (token.type === "word" ? roomBetween(state.border, firstBorder(token.pieces)) : 0) + (wrapped ? 0 : kern);
+ const leadOf = (state, wrapped = false) => (token.type === "word" ? roomBetween(state.border, firstBorder(token.pieces)) : 0) + (wrapped || snapping ? 0 : kern);
const boxEnd = token.type === "word" ? (_lastBorder$room2 = (_lastBorder2 = lastBorder(token.pieces)) === null || _lastBorder2 === void 0 ? void 0 : _lastBorder2.room) !== null && _lastBorder$room2 !== void 0 ? _lastBorder$room2 : 0 : 0;
- const needs = leadOf(line) + tokenWidth + boxEnd;
+ const needs = leadOf(line) + tokenWidth + boxEnd + (unsureAfter ? 0 : after);
+ if (unsureAfter && line.position + needs <= endOf(line) + TOLERANCE$2 && line.position + needs + after > endOf(line) + TOLERANCE$2) {
+ var _line$unsupported2;
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported2 = line.unsupported) !== null && _line$unsupported2 !== void 0 ? _line$unsupported2 : "a word beside right-to-left text that fits on its line only without the space after it, which Word hasn't been seen breaking" });
+ }
const hyphens = token.type === "word" ? ((_token$hyphens = token.hyphens) !== null && _token$hyphens !== void 0 ? _token$hyphens : []).filter(({ at }) => at > 0 && at < lengthOf(token.pieces)) : [];
const skipped = skipRooms(needs, hyphens.length > 0);
const squeezedIn = squeezes && line.started && squeezesIn(line, needs);
if (token.type === "word" && hyphens.length > 0 && !squeezedIn && line.position + needs > endOf(line) + TOLERANCE$2) {
- if (snapping) {
- var _line$unsupported2;
- line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported2 = line.unsupported) !== null && _line$unsupported2 !== void 0 ? _line$unsupported2 : "a soft hyphen at the end of a line on a grid that snaps to characters" });
- }
if (line.started && mayHyphenate(line, token, leadOf(line))) {
var _line$unsupported3;
line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported3 = line.unsupported) !== null && _line$unsupported3 !== void 0 ? _line$unsupported3 : MAY_HYPHENATE });
}
const rest = breakAtHyphen(token, hyphens, kern);
if (rest !== void 0) {
- placeWord(rest);
+ placeWord(rest, 0, after, unsureAfter);
return;
}
if (line.tabsOnly === true) {
@@ -8757,7 +9046,7 @@ var docxLayout = (function(exports) {
}
if (line.started) {
line = wrap(line);
- placeWord(token);
+ placeWord(token, 0, after, unsureAfter);
return;
}
}
@@ -8771,10 +9060,10 @@ var docxLayout = (function(exports) {
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";
+ const neverSqueezed = snapping && (alignment === "justified" || alignment === "distributed");
if (overflows && !neverSqueezed && unsure(line, needs)) line = _objectSpread2(_objectSpread2({}, line), {}, { unknown: true });
const squeezable = overflows && !line.unknown && !neverSqueezed && squeezesIn(line, needs);
- if (squeezable && snapping) line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: "a distributed line on a grid that snaps to characters that only fits squeezed" });
+ if (squeezable && snapping) line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: "a line justified for Thai or with a kashida 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$unsupported7;
@@ -8840,7 +9129,7 @@ var docxLayout = (function(exports) {
} else {
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 } : {}), {}, {
+ line = _objectSpread2(_objectSpread2(_objectSpread2({}, line), snapping && token.type === "word" ? { latin: snapped(line, token.pieces, kernOn(line)).latin } : {}), {}, {
position: line.position + tokenWidth,
end: line.position + tokenWidth,
text: line.text + text,
@@ -8925,7 +9214,7 @@ var docxLayout = (function(exports) {
}
if (token.type === "space") {
const spaces = widthOf(token.pieces, measurer);
- line = _objectSpread2(_objectSpread2(_objectSpread2({}, line), !snapping ? { position: line.position + roomBetween(line.border, firstBorder(token.pieces)) + kerning[index] + spaces } : snapped(line, token.pieces)), {}, {
+ line = _objectSpread2(_objectSpread2(_objectSpread2({}, line), !snapping ? { position: line.position + roomBetween(line.border, firstBorder(token.pieces)) + kerning[index] + spaces } : snapped(line, token.pieces, line.latin === void 0 ? 0 : kerning[index])), {}, {
text: line.text + textOf$2(token.pieces),
spaces: line.started ? line.spaces + spaces : 0,
spaceCount: line.started ? line.spaceCount + lengthOf(token.pieces) : 0,
@@ -8948,9 +9237,9 @@ var docxLayout = (function(exports) {
position: line.position + roomBetween(line.border, void 0),
border: void 0
});
- if (snapping && token.type === "box" && (line.latin !== void 0 || token.descent !== void 0)) {
+ if (snapping && token.type === "box" && token.descent !== void 0) {
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" });
+ line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported14 = line.unsupported) !== null && _line$unsupported14 !== void 0 ? _line$unsupported14 : "an equation on a grid that snaps to characters" });
}
if (snapping && token.type !== "word") line = _objectSpread2(_objectSpread2({}, line), {}, { latin: void 0 });
if (token.type === "tab") {
@@ -8998,19 +9287,26 @@ var docxLayout = (function(exports) {
continue;
}
if (!numbered && stop.position <= line.position + TOLERANCE$2) line = wrap(line);
+ const starting = startOfText(rest);
+ /** Whether the text at a stop takes its cells on a grid that snaps to characters, wherever they are */
+ const inCells = (at) => snapping && starting === "grid" && (at.alignment === "right" || at.alignment === "center");
/**
* 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
+ * snaps to characters, text after a left stop starts at the next of the grid's cells: Chinese, Japanese or Korean
+ * text after a stop at 3000 twips, on a grid of cells of 225.65, at 3159, the 14th, and Latin words too
+ * (stops2/word-stops-east-asian.ts GR10a, word-stops-east-asian2.ts GR16c). Chinese, Japanese or Korean text after
+ * a right or centred stop takes its cells, which end at the stop, or are centred on it, wherever that puts them:
+ * 6 ideographs at a right stop at 6000 start at 4646.1, and at a centred one at 4000 at 3323.1 (GR16c). Other
+ * text at those, and text at a decimal stop, 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 textWidth = inCells(at) ? cellsAfterTab(rest) : shifted !== null && shifted !== void 0 ? shifted : widthAfterTab(rest, measurer);
+ const stopped = Math.max(from, at.position - (inCells(at) && at.alignment === "center" ? textWidth / 2 : textWidth));
const cell = cellOn(lines.length);
return {
lineUp: shifted,
- position: cell === void 0 ? stopped : Math.ceil(stopped / cell - GRID_ROUNDING) * cell
+ position: cell === void 0 || inCells(at) ? stopped : Math.ceil(stopped / cell - GRID_ROUNDING) * cell
};
};
const after = rest.find((other) => other.type !== "marker");
@@ -9037,7 +9333,7 @@ var docxLayout = (function(exports) {
line = _objectSpread2(_objectSpread2({}, place(line)), pastIndent ? { pastIndent } : {});
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))) {
+ if (snapping && !inCells(stop) && (stop.alignment !== "left" || starting === void 0)) {
var _line$unsupported20;
line = _objectSpread2(_objectSpread2({}, line), {}, { unsupported: (_line$unsupported20 = line.unsupported) !== null && _line$unsupported20 !== void 0 ? _line$unsupported20 : GRID_TAB });
}
@@ -9056,7 +9352,10 @@ var docxLayout = (function(exports) {
}, misaligned === void 0 ? {} : { unsupported: (_line$unsupported21 = line.unsupported) !== null && _line$unsupported21 !== void 0 ? _line$unsupported21 : misaligned });
continue;
}
- placeWord(token, kerning[index]);
+ const [space, nextWord] = token.type === "word" && format.rightToLeft !== true ? nextTwo(tokens, index) : [];
+ const spaceAt = token.type === "word" && (space === null || space === void 0 ? void 0 : space.type) === "space" && (nextWord === null || nextWord === void 0 ? void 0 : nextWord.type) === "word" ? spaceAtEnd(token.pieces, space.pieces, nextWord.pieces) : "hanging";
+ const spaceWidth = spaceAt !== "hanging" && (space === null || space === void 0 ? void 0 : space.type) === "space" ? widthOf(space.pieces, measurer) : 0;
+ placeWord(token, kerning[index], spaceWidth, spaceAt === "unknown");
}
if (!end) finish(line);
else {
@@ -36139,7 +36438,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, _unknownInOlderLayout;
+ var _valueOf3, _exec2, _styleChain$slice$0$n, _styleChain$slice$, _ref4, _ref5, _ref6, _ref7, _list$unsupported, _ref8, _ref9, _unknownInOlderLayout;
const { styles } = reader;
const children = contentOf$3(element);
const properties = childrenOf(find(children.filter(isObject), "w:pPr"));
@@ -36188,7 +36487,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 = (_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;
+ const unsupported = (_ref4 = (_ref5 = (_ref6 = (_ref7 = (_list$unsupported = list.unsupported) !== null && _list$unsupported !== void 0 ? _list$unsupported : ownCells) !== null && _ref7 !== void 0 ? _ref7 : unknownEastAsianRules(reader.eastAsianRules, own, combined.alignment)) !== null && _ref6 !== void 0 ? _ref6 : joinedAcrossRuns(own) ? "Arabic letters joined across runs" : 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" : (_ref8 = (_ref9 = (_unknownInOlderLayout = unknownInOlderLayout(content, combined.alignment, reader)) !== null && _unknownInOlderLayout !== void 0 ? _unknownInOlderLayout : unjoinedSpacing) !== null && _ref9 !== void 0 ? _ref9 : typeof format === "string" ? format : void 0) !== null && _ref8 !== void 0 ? _ref8 : typeof borders === "string" ? borders : void 0;
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
type: "paragraph",
items: content,
@@ -36385,7 +36684,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 _twips2, _reader$grid, _readTableLook, _kept$0$spacing, _kept$, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _withoutGuess$unsuppo, _read$find2, _givenWidth$share, _blocks$find, _read$0$cells, _read$, _roomOf, _roomOf2;
+ var _twips2, _reader$grid, _readTableLook, _kept$0$spacing, _kept$, _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");
@@ -36467,7 +36766,7 @@ var docxLayout = (function(exports) {
}, void 0);
const gridWidth = (from, to) => grid.slice(from, to).reduce((total, value) => total + value, 0);
const read = rows.map(({ element: row, bookmarks: rowBookmarks }, rowIndex) => {
- var _formatsOf$height, _numberOf4, _ref12, _onOff2;
+ var _formatsOf$height, _numberOf4, _ref13, _onOff2;
const rowChildren = contentOf$3(row).filter(isObject);
const rowProperties = childrenOf(find(rowChildren, "w:trPr"));
const rowParts = unwrap(rowChildren);
@@ -36511,7 +36810,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 _ref9, _ref10, _ref11;
+ var _ref10, _ref11, _ref12;
const cellChildren = contentOf$3(cell).filter(isObject);
const cellProperties = childrenOf(find(cellChildren, "w:tcPr"));
const spanOf = (given) => {
@@ -36556,7 +36855,7 @@ var docxLayout = (function(exports) {
return _objectSpread2(_objectSpread2({
column: column + span,
edges: new Map([...before, [column + span, before.get(column) + 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 } : {}), {}, {
+ }, 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 } : {}), {}, {
blocks: cellBlocks,
marginTop: margins.top,
marginBottom: margins.bottom,
@@ -36587,13 +36886,13 @@ var docxLayout = (function(exports) {
rule: rule === "exact" ? "exact" : "atLeast"
} } : {}), {}, {
header: onOff(rowProperties, "w:tblHeader") === true,
- cantSplit: ((_ref12 = (_onOff2 = onOff(rowProperties, "w:cantSplit")) !== null && _onOff2 !== void 0 ? _onOff2 : formatsOf({
+ cantSplit: ((_ref13 = (_onOff2 = onOff(rowProperties, "w:cantSplit")) !== null && _onOff2 !== void 0 ? _onOff2 : formatsOf({
row: rowIndex,
rows: rows.length,
cell: 0,
cells: rowCells.length,
headerRows
- }).cantSplit) !== null && _ref12 !== void 0 ? _ref12 : styleKept) === true
+ }).cantSplit) !== null && _ref13 !== void 0 ? _ref13 : styleKept) === true
}, widthBefore === void 0 ? {} : { before: widthBefore })
});
});
@@ -36655,9 +36954,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((_ref14, cellIndex) => {
var _read, _above$cells$find, _unmerged;
- let { borders: _, margins, gridWidth: __ } = _ref13, cell = _objectWithoutProperties(_ref13, _excluded2);
+ let { borders: _, margins, gridWidth: __ } = _ref14, cell = _objectWithoutProperties(_ref14, _excluded2);
const pending = [...carried, ...cellBookmarks[cellIndex]];
const marked = pending.length === 0 ? void 0 : startingAtFirst(cell.blocks, pending);
carried = marked === void 0 ? pending : [];
@@ -36683,9 +36982,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: ___ } = _ref14;
- return _objectWithoutProperties(_ref14, _excluded3);
+ cells: cells.map((_ref15) => {
+ let { borders: _, margins: __, gridWidth: ___ } = _ref15;
+ return _objectWithoutProperties(_ref15, _excluded3);
})
})) : [];
const blocks = [...tableRows.flatMap(({ cells }) => cells.flatMap((cell) => {
@@ -36704,7 +37003,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((cell) => cell.vertical && !isVerticalWidthKnown(cell)) ? "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 = (_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 && _ref29 !== void 0 ? _ref29 : float !== void 0 && (reader.inCell || reader.inHeader) ? "a table that text flows around in a table cell, header or footer" : void 0) !== null && _ref28 !== void 0 ? _ref28 : float !== void 0 && older ? "a table that text flows around in a document in compatibility mode" : void 0) !== null && _ref27 !== void 0 ? _ref27 : 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 && _ref26 !== void 0 ? _ref26 : typeof float === "string" ? float : void 0) !== null && _ref25 !== void 0 ? _ref25 : parts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : void 0) !== null && _ref24 !== void 0 ? _ref24 : (_read$find2 = read.find((row) => row.unsupported !== void 0)) === null || _read$find2 === void 0 ? void 0 : _read$find2.unsupported) !== null && _ref23 !== void 0 ? _ref23 : unmerged) !== null && _ref22 !== void 0 ? _ref22 : fits ? unfitted : unequal && !evened ? "a table whose rows give a column different widths" : void 0) !== null && _ref21 !== void 0 ? _ref21 : verticalUnsupported) !== null && _ref20 !== void 0 ? _ref20 : spacingUnsupported) !== null && _ref19 !== void 0 ? _ref19 : typeof geometry === "string" ? geometry : void 0) !== null && _ref18 !== void 0 ? _ref18 : indent === void 0 ? "a table indent of a type not yet followed" : void 0) !== null && _ref17 !== void 0 ? _ref17 : ((_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 && _ref16 !== void 0 ? _ref16 : styleUnsupported) !== 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 = (_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 : 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 indent of a type not yet followed" : 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 : (_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);
@@ -37865,17 +38164,48 @@ var docxLayout = (function(exports) {
} });
};
/**
- * Why text in Japanese, Chinese or Korean can't be laid out as Word does for the document's settings, when it can't: with
- * Word's strict rules for the characters that can't start a line (`w:strictFirstAndLastChars`), or its punctuation, or
- * its punctuation and kana, compressed (`w:characterSpacingControl`). Word left the lines of Japanese text in no language
- * as they are without them, as it leaves out its rules for the characters that can't start or end a line there
- * (scripts/layout-probes/stops2/word-stops-east-asian.ts EA1 to EA3: small kana, iteration marks and closing brackets
- * started lines, and opening brackets ended them, at 42 ideographs a line). In text in one of those languages, they
- * haven't been seen.
+ * Whether a paragraph's runs end and start with Arabic letters Word joins across them, which are measured a run at a time,
+ * so not in the forms Word joins them in. Bookmarks and the like between them leave them joined
*/
+ var joinedAcrossRuns = (items) => {
+ const texts = items.filter((item) => item.type !== "marker");
+ return texts.some((item, index) => {
+ const next = texts[index + 1];
+ return item.type === "text" && (next === null || next === void 0 ? void 0 : next.type) === "text" && joinsAcross(item.text, next.text);
+ });
+ };
+ /** The document's settings for text in an East Asian language that Word lays out only in some of it, when it has any */
var readEastAsianRules = (settings) => {
const spacingControl = valueOf(settings, "w:characterSpacingControl");
- return onOff(settings, "w:strictFirstAndLastChars") === true ? "the strict rules for the characters that can't start a line, in text in an East Asian language" : spacingControl !== void 0 && spacingControl !== "doNotCompress" ? "punctuation compressed in text in an East Asian language" : void 0;
+ const rules = {
+ strict: onOff(settings, "w:strictFirstAndLastChars") === true,
+ compressed: spacingControl !== void 0 && spacingControl !== "doNotCompress",
+ ownJapaneseList: readKinsokuLists(settings).japanese !== void 0
+ };
+ return rules.strict || rules.compressed ? rules : void 0;
+ };
+ var HALF_WIDTH_SMALL_KANA = /[ァ-ッー]/u;
+ /**
+ * Why a paragraph's text in Japanese, Chinese or Korean can't be laid out as Word does for the document's settings, when it
+ * can't. Word left the lines of Japanese text in no language as they are with them, as it leaves out its rules for the
+ * characters that can't start or end a line there (scripts/layout-probes/stops2/word-stops-east-asian.ts EA1 to EA3:
+ * small kana, iteration marks and closing brackets started lines, and opening brackets ended them, at 42 ideographs a
+ * line). In text in Japanese, its strict rules kept small kana from starting a line: lines of 37 ideographs and kana where
+ * 42 fit, ended before the ideograph before them (`word-stops-east-asian2.ts` EA4a). Punctuation compressed, or punctuation
+ * and kana, Word left as it is in Japanese text aligned left: lines of 41 ideographs, kana and brackets, as many as without
+ * (EA4b, EA4c). Those rules in Chinese and Korean text haven't been seen, nor the strict ones with the document's own list
+ * for Japanese, or before the half-width small katakana they may keep from the start of a line, nor compressed punctuation
+ * in a justified or distributed line, which may squeeze it to fit more.
+ */
+ var unknownEastAsianRules = (rules, items, alignment) => {
+ const texts = items.filter((item) => item.type === "text");
+ const languages = new Set(texts.map((item) => kinsokuLanguageOf(item.language)).filter((language) => language !== void 0));
+ if (rules === void 0 || languages.size === 0) return;
+ const japanese = texts.filter((item) => kinsokuLanguageOf(item.language) === "japanese");
+ const otherLanguage = [...languages].some((language) => language !== "japanese");
+ if (rules.strict && (otherLanguage || rules.ownJapaneseList || japanese.some((item) => HALF_WIDTH_SMALL_KANA.test(item.text)))) return otherLanguage ? "the strict rules for the characters that can't start a line, in text in Chinese or Korean" : "the strict rules for the characters that can't start a line of Japanese, with the document's own list of them or before half-width small katakana";
+ const stretched = alignment !== void 0 && alignment !== "left" && alignment !== "center" && alignment !== "right";
+ if (rules.compressed && (otherLanguage || stretched)) return otherLanguage ? "punctuation compressed in text in Chinese or Korean" : "punctuation compressed in a justified or distributed paragraph of text in Japanese";
};
/**
* Reads the parts of the document's settings (`w:settings`) that change how it is laid out.
@@ -37885,6 +38215,7 @@ var docxLayout = (function(exports) {
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 breakRules = _objectSpread2(_objectSpread2({}, Object.keys(lists).length > 0 ? { lists } : {}), onOff(settings, "w:strictFirstAndLastChars") === true ? { strict: true } : {});
const mode = compatibilityModeOf(settings);
const olderMode = olderModeOf(settings);
const unsupported = (_find4 = [
@@ -37897,7 +38228,7 @@ var docxLayout = (function(exports) {
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 } : {});
+ }, Object.keys(breakRules).length > 0 ? { breakRules } : {}), onOff(settings, "w:autoHyphenation") === true ? { hyphenation: readHyphenation(settings) } : {}), olderMode === void 0 ? {} : { compatibilityMode: olderMode }), onOff(compatibility, "w:suppressTopSpacing") === true ? { suppressesTopSpacing: true } : {}), unsupported ? { unsupported } : {});
};
/**
* The faces of the fonts a document embeds, which Word draws text in those fonts in. Each is the face of the font the
@@ -37988,7 +38319,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, _ref30, _ref31, _ref32, _ref33, _ref34, _documentContent$unsu;
+ var _writtenParts$dataSto, _parts$otherListIds, _parts$otherListIds2, _parts$settings, _fontOf$size2, _notesByKind$kind$get, _ref31, _ref32, _ref33, _ref34, _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), {}, {
@@ -38052,7 +38383,6 @@ var docxLayout = (function(exports) {
mirrorMargins: onOff(settings, "w:mirrorMargins") === true
};
const grids = /* @__PURE__ */ new Map();
- const sameGrid = (one, other) => JSON.stringify(one) === JSON.stringify(other);
/** The document grid of a section, by its index, when it has one that is followed */
const gridOf = (section) => {
if (!grids.has(section)) {
@@ -38068,8 +38398,9 @@ var docxLayout = (function(exports) {
const readNoteContent = (kind, id, shows, content = contentOf$3((_notesByKind$kind$get = notesByKind[kind].get(id)) !== null && _notesByKind$kind$get !== void 0 ? _notesByKind$kind$get : { [`w:${kind}`]: [] })) => {
var _noteBlocks;
const separator = shows === void 0;
- const grid = separator ? void 0 : gridOf(sections.length);
- const down = !separator && downOf(childrenOf(sectionElements[sections.length])) !== void 0;
+ const section = kind === "endnote" ? lastSection : sections.length;
+ const grid = separator ? void 0 : gridOf(section);
+ const down = !separator && downOf(childrenOf(sectionElements[section])) !== void 0;
const readerOfNote = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, readerOf(false)), {}, { inNote: true }, kind === "endnote" ? { inEndnote: true } : {}), separator ? {} : { noteNumber: shows }), grid === void 0 ? {} : { grid }), down ? { down } : {});
const noteBlocks = readBlocks(content, readerOfNote);
return separator || ((_noteBlocks = noteBlocks[noteBlocks.length - 1]) === null || _noteBlocks === void 0 ? void 0 : _noteBlocks.type) !== "table" ? noteBlocks : [...noteBlocks, paragraphAfterTable(kind, readerOfNote)];
@@ -38137,6 +38468,7 @@ var docxLayout = (function(exports) {
const properties = sectionPropertiesOf(element);
return properties === void 0 ? [] : [properties];
});
+ const lastSection = elements.some((element) => nameOf$1(element) === "w:sectPr") ? sectionElements.length - 1 : sectionElements.length;
/** How a section numbers and places its notes of a kind: as it says, or the document does, or as Word does */
const notePropertiesOf = (kind, section) => _objectSpread2(_objectSpread2(_objectSpread2({}, NOTE_DEFAULTS[kind]), readNoteProperties(find(settings, `w:${kind}Pr`))), readNoteProperties(find(childrenOf(sectionElements[section]), `w:${kind}Pr`)));
const endnoteReferences = /* @__PURE__ */ new Map();
@@ -38348,7 +38680,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: (_ref30 = (_ref31 = (_ref32 = (_ref33 = (_ref34 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : footnotes.size > 0 ? notesUnsupported("footnote") : void 0) !== null && _ref34 !== void 0 ? _ref34 : endnotes.length > 0 ? notesUnsupported("endnote") : void 0) !== null && _ref33 !== void 0 ? _ref33 : sections.slice(Math.min(...endnoteSections)).some(({ textRunsDown }) => textRunsDown !== void 0) ? "endnotes on or before text that runs down the page" : void 0) !== null && _ref32 !== void 0 ? _ref32 : 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 && _ref31 !== void 0 ? _ref31 : unwrittenNumber ? "notes numbered in a format not yet written" : void 0) !== null && _ref30 !== void 0 ? _ref30 : unseenNumbering }));
+ return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref31 = (_ref32 = (_ref33 = (_ref34 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : footnotes.size > 0 ? notesUnsupported("footnote") : void 0) !== null && _ref34 !== void 0 ? _ref34 : endnotes.length > 0 ? notesUnsupported("endnote") : void 0) !== null && _ref33 !== void 0 ? _ref33 : endnoteSections.some((section) => sections.slice(section + 1).some(({ textRunsDown }) => textRunsDown !== sections[section].textRunsDown)) ? "endnotes from a section followed by one whose text runs another way" : endnoteSections.length > 0 && sections[sections.length - 1].textRunsDown !== void 0 ? "endnotes after text that runs down the page" : 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
@@ -39810,8 +40142,8 @@ var docxLayout = (function(exports) {
* `left`: a column, or the page's text. The first line of a paragraph starts at its first line indent
*/
const placedLine = (line, { indentLeft = 0, indentRight = 0, firstLineIndent = 0 }, isFirst, left, width, y, room) => {
- var _room$start, _room$end;
- const indent = (_room$start = room === null || room === void 0 ? void 0 : room.start) !== null && _room$start !== void 0 ? _room$start : indentLeft + (isFirst ? firstLineIndent : 0);
+ var _ref2, _room$start, _room$end;
+ const indent = (_ref2 = (_room$start = room === null || room === void 0 ? void 0 : room.start) !== null && _room$start !== void 0 ? _room$start : line.start) !== null && _ref2 !== void 0 ? _ref2 : indentLeft + (isFirst ? firstLineIndent : 0);
return {
text: line.text,
x: left + indent,
diff --git a/live-examples/lib/shapes.iife.js b/live-examples/lib/shapes.iife.js
index 62199d71ba..f0265b1a9c 100644
--- a/live-examples/lib/shapes.iife.js
+++ b/live-examples/lib/shapes.iife.js
@@ -3309,6 +3309,153 @@ var docxShapes = (function(exports, docx) {
}
};
//#endregion
+ //#region src/text-layout/arabic-widths.ts
+ /**
+ * How wide Word draws Arabic's letters in each of the forms it joins them in, the lam-alef ligatures and the tatweel, in
+ * the fonts of the width tables whose Arabic Word lays out with its glyphs' own widths, plain and bold, and the font it
+ * draws them in.
+ *
+ * Generated by scripts/generate-arabic-widths.ts from Word's PDF of scripts/layout-probes/stops2/word-stops-arabic.ts,
+ * saved from Word 16 for Mac. Do not edit by hand.
+ *
+ * @module
+ */
+ /**
+ * The letters the widths are for, in their order: Arabic's (U+0621 to U+063A and U+0641 to U+064A), and Persian's peh,
+ * tcheh, jeh, keheh, gaf and farsi yeh
+ */
+ var ARABIC_LETTERS = "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی";
+ /** The alefs lam joins with into a ligature, in the order of their widths */
+ var LAM_ALEFS = "آأإا";
+ var ARABIC_WIDTHS = [
+ {
+ name: "Arial",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1l01tS1l01tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AE!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AD!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Times New Roman",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1k/1tS1l01tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AE!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AD!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Cambria",
+ drawnIn: "Times New Roman",
+ regular: "10u!*020wm0zT!!0wm0zT!!13x13x!!0wm0zT!!1zK1rY0C90C90wm0zT!!1Lu1Lu0C90C90I60WC!!1Lu1Lu0C90C91Lu1Lu0C90C91n+1ib1iO1iO1n+1ib1iO1iO1n+1ib1iO1iO0QK0QK!!0QK0QK!!1co1co!!1co1co!!20l20l1iY1iX20l20l1iY1iX2HB2HB24e24e2HC2HB24e24e1qT*071l016m1ib0ZA1l016m1ib0ZA1Xe1Xe0FQ0F31qT1qT0FQ0F31tX1tX0ZA0ZA1f81f70wm0wm0QP0QP0ZA0ZA1ib1ib0C90C90I60WC16m0ZA13x13x!!1zK1rY0C90C91zK1rY0C90C91Lu1Lu0C90C91n+1ib1iO1iO1co1co!!1+U2hK0ZA1gq1+U2hK0ZA1gq1zK1rY0C90C91l01tS1k/1tS1k/1tS1l01tS0wm",
+ bold: "19g!*020Bf0DC!!0xU0AD!!16w16v!!0xU0AD!!1AJ1qb0Gr0Gq0xU0AE!!1Bu1Bu0Gr0Gq0RA10S!!1Bu1Bu0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO1qc1ni1hO1hO1qc1ni1hO1hO0RA0Rz!!0RA0Rz!!13C13C!!13C13C!!2cy2cy1v41v32cy2cy1v41v32C12C11Uz1Uy2C12C11Uz1Uy1hO*071ky19f1ky0Uj1ky19f1ky0Uj1Sq1Sq0LD0OG1vH1vH0LD0OG1ky1ky0Uj0Uj16w16v0AD0AD0Uk0Uj10S10S1ky1ky0Gr0Gq0RA10S19f16v16w16v!!1AJ1mC0Gr0Gq1AJ1qb0Gr0Gq1Bu1Bu0Gr0Gq1qc1ni1hO1hO13C13C!!1Sg29l0Uj1kH1Sg29l0Uj1kH1AJ1mC0Gr0Gq1ky1t51b/1ky1b/1ky1b/1ky0u/"
+ },
+ {
+ name: "Courier New",
+ regular: "1tN!*021tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*08",
+ bold: "1tN!*021tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN1tN!!1tN1tN!!1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*021tO1tN1tN!!1tN*021tO1tN*021tO1tN*021tO1tN*08"
+ }
+ ];
+ //#endregion
+ //#region src/text-layout/arabic-shaping.ts
+ /**
+ * Arabic's letters in the forms Word joins them in: each letter isolated, final, initial or medial as the letters beside it
+ * join it, and lam with the alef after it as one ligature, with the widths of {@link ARABIC_WIDTHS}.
+ *
+ * @module
+ */
+ var RIGHT_JOINING = /* @__PURE__ */ new Set([..."آأؤإاةدذرزوژ"]);
+ var NON_JOINING = /* @__PURE__ */ new Set(["ء"]);
+ var TATWEEL = "ـ";
+ var ZERO_WIDTH_JOINER = "";
+ var ZERO_WIDTH_NON_JOINER = "";
+ var LAM = "ل";
+ /** How a character joins the letters beside it, where the widths know it, and as a character of another script otherwise */
+ var joiningOf = (character) => {
+ if (character === TATWEEL || character === ZERO_WIDTH_JOINER) return "C";
+ if (character === ZERO_WIDTH_NON_JOINER || NON_JOINING.has(character)) return "U";
+ if (new RegExp("[\\p{Mn}\\p{Me}\\p{Cf}]", "u").test(character)) return "T";
+ if (RIGHT_JOINING.has(character)) return "R";
+ return "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(character) ? "D" : "U";
+ };
+ /** The forms of a letter, in the order of the widths */
+ var ISOLATED = 0;
+ var FINAL = 1;
+ var INITIAL = 2;
+ var MEDIAL = 3;
+ var LIGATURES = ARABIC_LETTERS.length * 4;
+ var TATWEEL_WIDTH = LIGATURES + LAM_ALEFS.length * 2;
+ /** The digits the widths are written in */
+ var DIGITS$1 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/";
+ var twoDigitsIn$1 = (encoded, at) => DIGITS$1.indexOf(encoded[at]) * 64 + DIGITS$1.indexOf(encoded[at + 1]);
+ var decoded$1 = /* @__PURE__ */ new Map();
+ /** Reads a face's widths, in thousandths of an em, as {@link ARABIC_WIDTHS} writes them */
+ var decodeFace = (encoded, drawnIn) => {
+ const known = decoded$1.get(encoded);
+ if (known) return known;
+ const widths = [];
+ let last;
+ for (let at = 0; at < encoded.length;) if (encoded[at] === "*") {
+ widths.push(...new Array(twoDigitsIn$1(encoded, at + 1)).fill(last));
+ at += 3;
+ } else {
+ last = encoded[at] === "!" ? void 0 : (DIGITS$1.indexOf(encoded[at]) * 4096 + twoDigitsIn$1(encoded, at + 1)) / 10;
+ widths.push(last);
+ at += encoded[at] === "!" ? 1 : 3;
+ }
+ const face = _objectSpread2({ widths }, drawnIn === void 0 ? {} : { drawnIn });
+ decoded$1.set(encoded, face);
+ return face;
+ };
+ /**
+ * The widths of Arabic in a font of the tables, by its name there, plain or bold, when Word's PDF has them: not Calibri's,
+ * which Word lays out otherwise, nor italic
+ */
+ var arabicFaceOf = (name, bold, italic) => {
+ const font = ARABIC_WIDTHS.find((known) => known.name === name);
+ return font === void 0 || italic ? void 0 : decodeFace(bold ? font.bold : font.regular, font.drawnIn);
+ };
+ /** Whether a character is one of Arabic's letters the widths have, or the tatweel */
+ var isJoinedLetter = (character) => character === TATWEEL || "ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيپچژکگی".includes(character);
+ /**
+ * The widths of the letters of text Word joins, by the index of each among its characters, in thousandths of an em: each
+ * letter in the form the letters beside it join it in, in the text, as Word joins those of a word, and lam and an alef
+ * after it as a ligature, whose width is lam's, the alef taking none. A letter joins the letter before it when it joins
+ * either way, or only that one, and that letter joins the next too, or is a tatweel, and the letter after it when it joins
+ * both and that letter joins the one before it; marks between them leave them joined.
+ */
+ var joinedWidthsOf = (characters, face) => {
+ const joinings = characters.map(joiningOf);
+ /** The next character's index from one, either way, that isn't a mark */
+ const nextLetter = (index, step) => {
+ let at = index + step;
+ while (joinings[at] === "T") at += step;
+ return at;
+ };
+ const widths = /* @__PURE__ */ new Map();
+ for (const [index, character] of characters.entries()) {
+ if (!isJoinedLetter(character)) continue;
+ if (character === TATWEEL) {
+ widths.set(index, face.widths[TATWEEL_WIDTH]);
+ continue;
+ }
+ const joining = joinings[index];
+ const before = joinings[nextLetter(index, -1)];
+ const after = nextLetter(index, 1);
+ const joinsBefore = (joining === "D" || joining === "R") && (before === "D" || before === "C");
+ const next = characters[after];
+ const alef = next === void 0 ? -1 : LAM_ALEFS.indexOf(next);
+ if (character === LAM && alef >= 0) {
+ widths.set(index, face.widths[LIGATURES + alef * 2 + (joinsBefore ? FINAL : ISOLATED)]);
+ widths.set(after, 0);
+ continue;
+ }
+ if (widths.has(index)) continue;
+ const joinsAfter = joining === "D" && [
+ "D",
+ "R",
+ "C"
+ ].includes(joinings[after]);
+ const form = joinsBefore ? joinsAfter ? MEDIAL : FINAL : joinsAfter ? INITIAL : ISOLATED;
+ widths.set(index, face.widths[ARABIC_LETTERS.indexOf(character) * 4 + form]);
+ }
+ return widths;
+ };
+ //#endregion
//#region src/text-layout/font-widths.ts
/**
* The characters the widths are for, as ranges of code points: printable ASCII; Latin-1, Latin Extended-A and B, IPA and
@@ -4323,20 +4470,31 @@ var docxShapes = (function(exports, docx) {
const measured = _objectSpread2(_objectSpread2({}, font), {}, { font: (_eastAsian$latin = eastAsian === null || eastAsian === void 0 ? void 0 : eastAsian.latin) !== null && _eastAsian$latin !== void 0 ? _eastAsian$latin : font.font });
return _objectSpread2(_objectSpread2({}, faceOf(measured)), {}, {
more: moreFaceOf(measured),
+ arabic: eastAsian === void 0 ? arabicFaceOf(widthsOf(measured.font).name, font.bold === true, font.italic === true) : void 0,
monospaced: (eastAsian === null || eastAsian === void 0 ? void 0 : eastAsian.monospaced) === true
});
};
/**
+ * The widths of the letters of text Word joins, Arabic's, by the index of each among its characters, in the forms Word
+ * joins them in, where its face's are known (see `arabic-shaping.ts`)
+ */
+ var joinedIn = (characters, arabic) => arabic !== void 0 && characters.some(isJoinedLetter) ? joinedWidthsOf(characters, arabic) : void 0;
+ /**
* How wide a line of text is, in points. Tabs move to the next half inch, counted from the start of the line.
*
* @param start - Where the text starts on its line, in points
*/
var measureTextWidth = (text, font = {}, start = 0) => {
- const { widths, more, monospaced } = measuresOf(font);
+ const { widths, more, arabic, monospaced } = measuresOf(font);
const widthOf = monospaced ? monospacedWidth : (character) => characterWidth(widths, more, character);
const size = sizeOf$1(font);
const { characterSpacing = 0, scale = 100 } = font;
- return [...text].reduce((position, character) => character === " " ? (Math.floor(position / TAB_STOP) + 1) * TAB_STOP : position + widthOf(character) * size * scale / 1e5 + characterSpacing, start) - start;
+ const characters = [...text];
+ const joined = joinedIn(characters, arabic);
+ return characters.reduce((position, character, index) => {
+ var _joined$get;
+ return character === " " ? (Math.floor(position / TAB_STOP) + 1) * TAB_STOP : position + ((_joined$get = joined === null || joined === void 0 ? void 0 : joined.get(index)) !== null && _joined$get !== void 0 ? _joined$get : widthOf(character)) * size * scale / 1e5 + characterSpacing;
+ }, start) - start;
};
new RegExp("\\p{L}\\p{L}", "u");
new RegExp("^\\p{Script=Latin}$", "u");
@@ -4734,6 +4892,7 @@ var docxShapes = (function(exports, docx) {
widowControl: onOff(children, "w:widowControl"),
tabs: readTabs(find(children, "w:tabs")),
kinsoku: onOff(children, "w:kinsoku"),
+ rightToLeft: onOff(children, "w:bidi"),
wordWrap: onOff(children, "w:wordWrap"),
suppressAutoHyphens: onOff(children, "w:suppressAutoHyphens"),
snapToGrid: onOff(children, "w:snapToGrid"),
@@ -5013,12 +5172,13 @@ var docxShapes = (function(exports, docx) {
var fontOfSlot = (format, slot) => {
const font = plainFontOf(format);
if (slot === "latin") return scripted(font, format);
- const { eastAsiaFont, complexScriptFont, complexScriptSize, complexScriptBold, complexScriptItalic } = format;
+ const { eastAsiaFont, complexScriptFont, complexScriptSize, complexScriptBold, complexScriptItalic, rightToLeft } = format;
return scripted(slot === "eastAsian" ? _objectSpread2(_objectSpread2({}, font), {}, { font: isEastAsianFont(eastAsiaFont) ? eastAsiaFont : FALLBACK_EAST_ASIAN_FONT }) : withoutUndefined(_objectSpread2(_objectSpread2({}, font), {}, {
font: complexScriptFont,
size: complexScriptSize,
bold: complexScriptBold,
- italic: complexScriptItalic
+ italic: complexScriptItalic,
+ rightToLeft: rightToLeft === true ? true : void 0
})), format);
};
/**
@@ -5081,6 +5241,7 @@ var docxShapes = (function(exports, docx) {
}
return i;
}
+ new RegExp("[\\p{Script=Hebrew}\\p{Script=Arabic}\\p{Script=Syriac}\\p{Script=Thaana}\\p{Script=Nko}]", "u");
//#endregion
//#region src/shapes/shape-floating.ts
/**
diff --git a/usage/layout.md b/usage/layout.md
index b60c57721f..92ce4e06cb 100644
--- a/usage/layout.md
+++ b/usage/layout.md
@@ -192,11 +192,11 @@ A blank page that Word adds so a section starts on an odd or even page has nothi
## What it follows
-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 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, and in Arial, Times New Roman, Cambria and Courier New, plain and bold, those of Arabic's and Persian's letters in each of the forms Word joins them in, isolated, final, initial and medial, and of the lam-alef ligatures, which Word draws in the font, and Cambria's in Times New Roman. Word kerns Arabic's letters side by side in Arial, Times New Roman and Cambria, by pairs not yet known, so only Courier New's Arabic, and letters alone, or lam with an alef, which Word joins into one glyph, are laid out. 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 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
+- 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. In a left-to-right one, a line of right-to-left words in a right-to-left run (`rightToLeft`) has room for the space after its last word when a right-to-left word follows it, as that space is in the line, between them, and the space between right-to-left and left-to-right words in runs that aren't right to left hangs past the end of the line, as Word lays them out
- 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)
@@ -217,7 +217,7 @@ The pages are laid out with the widths and heights of the characters of the font
- tables, with their columns' widths (`columnWidths`, or their cells' widths), their rows' heights, cell margins and borders. The columns of a table given no widths are sized to their text, as Word sizes them: each as wide as its longest line, or narrower when they don't all fit, but never narrower than its longest word, and a column whose cells give it a width keeps it. A cell merged across columns (`columnSpan`) widens them where its longest line needs more room, each in proportion to how wide it is, and a table in a cell counts as wide as its columns. In a table whose cells all have widths, a column with a word longer than its cells give it is widened to fit the word, and the other columns are narrowed to make room, as Word does, unless the table's layout is fixed. A table with a width of its own in twips is fitted to it, as Word fits it: when its columns are narrower, they are widened in proportion, and when they are wider, they are narrowed toward their longest words, or, when its layout is fixed, whatever is in them, each by the same share of the room for its text. When a word is longer than the table, its column is as wide as the word, and the table goes past the margin. Without a width of its own in twips, or with all of the width, a table whose columns' longest words don't fit in the room has each column narrowed to a share of it in proportion to its longest word, whatever width its cells give it, and the words break across lines, as Word breaks them. A table of a share of less than the width (`WidthType.PERCENTAGE`) whose columns' longest words don't fit in its share is as wide as they are, up to the room, and past it is narrowed as one of all of the width. A table sized to its text, or of a share of the width, has half of each of its left and right borders inside the room it fills, outside its columns, as Word draws them, where one of a width in twips has them outside it. Where the rows of a table give a column different widths, each column is as wide as the widest a row gives it, and a cell merged across columns that is wider than they are widens the last of them, before they are fitted to the table's width, in twips or as a share of the width, or, without one, narrowed to the room, unless its layout is fixed. In [templates](#templates), a row that starts past the first column (`w:gridBefore`) gives it its width before it (`w:wBefore`), as a cell does. A word in a cell merged across columns that is longer than they are wide is shared among them in proportion to each column's longest word and its longest line, or its width, added together, as Word shares it, and those columns keep its width when the others are narrowed. A long word with more text beside it widens them as its line does. Rows break across pages between the lines of their cells, as Word breaks them, keeping to widow and orphan control and lines kept together, and with room on the page for the space after a cell's paragraph that ends there. They move to the next page whole when a cell would have none of its lines on the page, when they are kept whole (`cantSplit`), and when the page hasn't room for the height they are set to. A row kept whole, or whose paragraph is kept together, that is taller than a page moves to a new page and breaks there as other rows do, and a row set to a height taller than a page takes a page of its own, cut off at its bottom, as Word lays them out. The text of a cell merged down from such a row, or to it from a row above, goes in all of its set height, past the bottom of the page, and the rest goes on in the rows after it on the next page, keeping to widow control. The row's footnotes start at the bottom of the next page, one after the other. A header row set to a height taller than a page isn't repeated on the next page, and what comes after its table goes on the page after the one the table ends on, as Word lays it out. A row set to at least a height taller than a page, whose text is taller than a page too, breaks where its text does, and each part of it fills its page. In columns, a row kept whole, or whose paragraph is kept together, that is taller than a column goes down only the first column of each page, from the top of a new page unless it is at the top of this one, as a paragraph kept together does, and what comes after one set to a height taller than a column goes on the next page. Where a table breaks across pages, Word draws its bottom border below the last of it on the page, which takes room there too, or its cells' own bottom borders. Header rows are repeated at the top of each page and column a table is on, and they aren't left alone at the foot of a page: when none of the row after them goes there, as it is kept whole, kept with the next or set to a height, they go on to the next page with it, as Word moves them. The text of a cell merged down rows (`verticalMerge`) goes down from below the border above its first row across the others, to above the border below the last, and makes the last of them taller when it needs the room. Where one of its rows breaks across pages, its text breaks with the row, as far down the page as its lines go, keeping to widow control, as Word breaks it, and the rest of it goes on from the top of its rows on the next page, and on across the pages after. Where the page breaks between its rows, as the next is kept whole or set to a height, the text that doesn't fit in its rows on the page goes on in its rows on the next, all of it where widow control leaves none of it on the page. A table in a cell breaks with its row, between its own rows and in them between the lines of their cells, as Word breaks it: as a table in the text breaks, keeping to widow control, with its bottom border below the last of it on the page and its cells' margins around their lines on each page, and with its rows kept whole, or of a set height, moving to the next page whole. On the next page, Word draws its top border above the rest of it, and doesn't repeat its header rows. A table in a cell merged down rows breaks as one in a cell of a row, and so does one with cells merged down its rows whose text is in their first rows, or whose rows are all on the page. An empty paragraph that ends a cell after a table in it takes no room, as Word lays it out
- table formatting, as Word lays it out. Borders come from the table's style and the table (`borders`), side by side, from its cells (`TableCell`'s `borders`), and from the parts of its style for some of its cells. Where two cells meet, Word draws the heavier of their borders, by its width and a weight for its style, but makes room for the wider, so each row is as much taller as the widest border above its cells and below those above it. Double, triple and the other styles of border take the room Word gives them, such as three times their width for a double border, and a border's `space` adds to it. In [templates](#templates), an art border takes as many points above and below a cell's text as its size. A cell's text is as far in from its left and right edges as its margin, or half its own border there when that is more, whichever of two borders that meet Word draws. A row of an exact height (`HeightRule.EXACT`) has the border above it inside that height, and one of at least a height has it outside, as Word lays them out. A row is as tall as its tallest cell's text, with the largest margins above and below of its cells, which needn't be the same cell's. Space between cells (`cellSpacing`) goes around each cell and inside the table's edges, and the table keeps its width, its columns narrowed for the space as Word narrows them, or widened to it in proportion, the space aside, and a column with a long word widened for it as in a table without the space. Where its rows give a column different widths, they are evened out as in a table without it, unless its layout is fixed. Each cell's own borders take room inside it, left and right of its text as well as above and below it, and the table's own go around the space. Where such a table breaks across pages, Word draws its bottom border below the last of it on the page, and its top border above the rest of it on the next, but for below its header rows repeated there, which have it above them. A row's own space between its cells (`TableRow`'s `cellSpacing`) goes around its cells in place of the table's, at the table's edges too, as do its own borders (`w:tblPrEx`, in [templates](#templates)), and the table's columns are as wide as they would be without it, where the table has a width of its own and its cells have widths. Space given as a share of the table's width, or of the type `auto`, is none, as Word lays them out. A row whose first cell's first paragraph is kept with the next (`keepNext`) is kept on the page with the next row, or, for the last row, with the paragraph after the table, and rows kept together that don't fit on a page of their own start a new page and break where it ends. Text that runs up or down a cell (`textDirection`) makes a row of only such cells as tall as a line of its last paragraph's mark, and a row with other cells no taller, as Word breaks it into lines as long as the row is tall, and a row with it breaks across pages as other rows do, the text on the page of its first part. In a table sized to its text, its column is as wide as a line of each of its paragraphs with text, however long, with the space before and after them, its lines as far apart as Word lays them out at their line spacing: a quarter of their size further than their size in Calibri, and as far as across the page in Times New Roman, Arial, Cambria and Courier New. A long word in it widens nothing, and the table's other columns are sized as they would be beside any other column. Text down with East Asian characters upright is laid out as text that runs down, and across with them on their side as text across. A table sized to its text that is indented (`indent`) is sized in the room the indent leaves, and one indented by a share of the width (`WidthType.PERCENTAGE`) is laid out as though it weren't indented, as Word lays it out. The parts of a table style for some cells, such as its first row, its last column or its bands of rows, apply where the table turns them on (`tableLook`), and where it doesn't say, as Word turns them on: its first row and column and its bands of rows. A header of several rows (`tableHeader`) is the table's first row, all of it, with the parts for its corner cells in each of its rows, and the bands of rows start below it, as Word applies them, but for a header of three rows or more with the first row turned off, whose bands start at its first row. A table style's own cell margins apply to its cells, its rows kept whole (`w:cantSplit`) are kept whole, and its own row height doesn't apply, as in Word, and a part of it for some rows gives them its height, and keeps them whole, and not its space between cells. In [templates](#templates), a row's own table borders and cell margins (`w:tblPrEx`) apply to its cells, cells merged across columns as old versions of Word wrote them (`w:hMerge`) are one cell across them, and a cell whose text Word is told not to wrap (`w:noWrap`) has it wrapped all the same, and text fitted to its cell (`w:tcFitText`) is on one line a paragraph, as Word lays them out. In a table sized to its text, the one makes its column as wide as its lines, as though they didn't wrap, and the other as wide as its column in the table's grid. In [templates](#templates), an empty last paragraph of a cell whose mark is hidden (`w:hideMark`) takes no room
- sections, with their page sizes, margins, columns, headers and footers, how they start, and their page numbering. Page numbers are written in Word's number formats as Word writes them, such as roman numerals, letters, words ("twenty-one") and the numbers of other languages, but for those it leaves blank (see below), and with chapter numbers in front of them (`chapterHeadingLevel`), such as 2-5 for page 5 of chapter 2. Each column's lines are broken at its own width, so a paragraph that goes on into a column of another width is broken again there, as Word breaks it. Widow control counts the lines left for the next column as they are broken in the column before, as Word counts them, and a table sized to its text keeps the widths it was sized to in each column it goes on into, as Word keeps them, going past the edge of a narrower one. Columns before a continuous section break are evened out, as Word evens them out, unless a column break is in them or a section in them started in the next column, and the next section starts below the longest. A section that starts in the next column (`SectionType.NEXT_COLUMN`) starts in the next column of the page when the section before has as many columns and one is left, as Word starts it, and on a new page otherwise. When its own columns are of other widths, it is laid out in the page's, where they are and as wide as they are, as Word lays it out, and in its own on the pages after. Its footnotes are laid out in its own columns. A continuous section numbered afresh (`pageNumbers: { start }`) leaves the page it starts on its number, and numbers the next on from its own first number, as Word does: 8 after a section numbered from 7 starts on page 12. When none of it fits on the page before, the page it starts at the top of is its first, numbered 7. One that starts in the next column of a page numbers on through the document, as Word numbers it. A gutter is beside the page's text, or above it in a document that puts it at the top (`w:gutterAtTop`), as Word takes it from the page's height, on every page with mirrored margins too, and below a negative top margin, which the header doesn't push the text below. A paragraph kept together that is taller than a column goes down only the first column of each page, as Word lays it out, from the top of a new page unless it is at the top of this one, and what follows it goes on below it. In columns of different widths it does when it is taller than each of them. One taller than some of them but not others goes in the first column, from where it is, that it fits in, as Word moves it: from the top of a narrow first column to a wide second, and past a narrow second column to a new page, in 3 columns or more as in 2, and the paragraphs kept with the next before it go with it. Paragraphs kept with the next before one taller than each column go to the new page with it, unless they are at the top of the page already, and it moves on to the next page, as Word moves them, so they are alone on theirs. A section that ends with a table has a line below it for the empty paragraph that ends the section, as Word has it
-- a section's document grid (`grid`), as Chinese and Japanese documents and Word's templates for them have it. On a grid of lines (`DocumentGridType.LINES`), each line takes as many of the grid's lines (`linePitch`) as its own height needs, with its text in the middle, as Word lays it out: at 360 twips, a line of Times New Roman of up to 15.5 points takes one, and from 16 points two. Multiple line spacing takes the grid's lines times the spacing when that is more, so 1.08 lines are 388.8 twips, at least a height takes that height when it is more, and exact spacing is as it is without the grid. The space before and after a paragraph isn't put on the grid's lines, a line of space before or after (in lines) is one of them, and the room below the last line's text can go below the bottom of the page. The lines of table cells, headers and footers aren't on the grid, nor the lines above footnotes and endnotes, but footnotes and endnotes are. A paragraph whose `snapToGrid` is off, in documents Word made, isn't on the grid's lines. A grid of lines and characters (`DocumentGridType.LINES_AND_CHARS`) also adds its `charSpace`, in 4096ths of a point, after each character, and a quarter of a character more between Chinese, Japanese or Korean characters and Latin letters, as Word does. One that snaps to characters (`DocumentGridType.SNAP_TO_CHARS`) puts each Chinese, Japanese or Korean character in as many cells as it needs, as many cells as fit across a column at the size of the Normal style's text and the `charSpace` more, spread evenly across it, and the other text between them on a line in as many cells as it needs together, with text spaced out by its run (`characterSpacing`) as wide as it is spaced. In columns of different widths each column has cells of its own. A left tab before Chinese, Japanese or Korean text, and a line beside a drawing, start at the next cell, a picture in the line takes as many cells as it needs, a word longer than its line goes on to the next, and a justified line isn't squeezed. Characters of indents are the grid's characters, and footnotes are on the grid as the body is. On a grid of lines and characters kerned text is kerned, and text in a font that isn't East Asian, such as digits in Calibri, has no quarter of a character beside Chinese, Japanese or Korean characters. Emphasis marks take their room in the line before it is put on the grid, with multiple line spacing too. A run with `snapToGrid: false` isn't on a grid of characters, and headers and footers aren't. Sections whose text direction (`page: { textDirection }`) runs across the page are laid out as those without one
+- a section's document grid (`grid`), as Chinese and Japanese documents and Word's templates for them have it. On a grid of lines (`DocumentGridType.LINES`), each line takes as many of the grid's lines (`linePitch`) as its own height needs, with its text in the middle, as Word lays it out: at 360 twips, a line of Times New Roman of up to 15.5 points takes one, and from 16 points two. Multiple line spacing takes the grid's lines times the spacing when that is more, so 1.08 lines are 388.8 twips, at least a height takes that height when it is more, and exact spacing is as it is without the grid. The space before and after a paragraph isn't put on the grid's lines, a line of space before or after (in lines) is one of them, and the room below the last line's text can go below the bottom of the page. The lines of table cells, headers and footers aren't on the grid, nor the lines above footnotes and endnotes, but footnotes and endnotes are. A paragraph whose `snapToGrid` is off, in documents Word made, isn't on the grid's lines. A grid of lines and characters (`DocumentGridType.LINES_AND_CHARS`) also adds its `charSpace`, in 4096ths of a point, after each character, and a quarter of a character more between Chinese, Japanese or Korean characters and Latin letters, as Word does. One that snaps to characters (`DocumentGridType.SNAP_TO_CHARS`) puts each Chinese, Japanese or Korean character in as many cells as it needs, as many cells as fit across a column at the size of the Normal style's text and the `charSpace` more, spread evenly across it, and the other text between them on a line in as many cells as it needs together, with text spaced out by its run (`characterSpacing`) as wide as it is spaced. In columns of different widths each column has cells of its own. A left tab, and a line beside a drawing, start at the next cell, Chinese, Japanese or Korean text at a right or centred tab ends at the stop, or is centred on it, in its cells, a picture in the line takes as many cells as it needs after the text before it, a word longer than its line goes on to the next, a word with soft hyphens breaks at the last whose part fits in the cells left, and a justified or distributed line isn't squeezed. Characters of indents are the grid's characters, an indent of part of one is rounded up to the next cell, and a hanging indent's other lines go that many more cells in, as Word lays them out. Footnotes are on the grid as the body is, and endnotes on the last section's grid. Kerned text is kerned on a grid of characters, and on one that snaps to characters takes as many cells as it needs kerned. On a grid of lines and characters, text in a font that isn't East Asian, such as digits in Calibri, has no quarter of a character beside Chinese, Japanese or Korean characters. Emphasis marks take their room in the line before it is put on the grid, with multiple line spacing and at least a height too. A run with `snapToGrid: false` isn't on a grid of characters, and headers and footers aren't. Sections whose text direction (`page: { textDirection }`) runs across the page are laid out as those without one
- text that runs down the page (`page: { textDirection: PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT }`, and the other directions down it of documents Word made), as Chinese and Japanese documents have it, laid out as Word lays it out: each line runs from the top margin to the bottom one, and the lines go across the page from the right margin, or from the left for the directions that put them that way, each as far from the one before as it is tall, on the section's grid if it has one. Chinese, Japanese and Korean characters in fonts whose characters are all an em, such as MS Mincho and SimSun, are an em down the line, and Latin text is on its side, as wide as it is across a page. Indents are from the top and bottom margins, and the space before and after a paragraph is across the page. Half-width katakana are on their side, half an em each. A tab to a left stop, a border around text or around the paragraph, emphasis marks, superscript and subscript, and a justified line with spaces take the room they take across the page, and a footnote goes below the text, at the left of the page. Two digits set across the line (`w:eastAsianLayout w:vert`) take as much room along it as the line is tall. A gutter is beside the right margin, a negative top or bottom margin is as far from the edge as a positive one, and a grid that snaps to characters puts its cells along the lines. The header and footer stay across the top and bottom of the page, and a header doesn't push the lines down. A section whose text runs down the page starts a new page after one whose text runs across it, as a continuous section does too, and a continuous one goes on on the page after text that runs down it the same way
## What it leaves blank
@@ -248,9 +248,11 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- 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; 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
+- 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 letters in Calibri, which Word draws narrower than their glyphs in places, in italic, spaced out, or in a font other than Cambria, Arial, Times New Roman and Courier New, and Arabic's other letters, such as alef wasla; 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
+- Arabic letters side by side in Arial, Times New Roman and Cambria, which Word kerns by pairs not yet known, and Arabic letters joined across runs, which are measured a run at a time
+- a word beside right-to-left text, in a paragraph that isn't right to left, that fits on its line only without the space after it, where that space is in a right-to-left run beside left-to-right text, or between right-to-left words in a run that isn't right to left
+- text in Chinese 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, and text in Japanese with those strict rules and the document's own list of those characters, or with half-width small katakana, or with its punctuation compressed in a justified or distributed paragraph. Word's strict rules keep small kana and the prolonged sound mark from the start of a line of Japanese, and its compressed punctuation leaves Japanese aligned left, centred or right as it is, as it leaves text in no language, and so does the layout
- 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, 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
@@ -258,8 +260,8 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- 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
- 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
+- on text that runs down the page: a table, endnotes after it, and endnotes from a section followed by one whose text runs another way, which Word ends with their own section, 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 decimal tab, a right or centred one before text that isn't Chinese, Japanese or Korean, an equation, a first line indent of part of a character beside a left indent of part of one, an indent of part of a character before the margin, a tab in a paragraph with an indent of part of a character, and a line justified for Thai or with a kashida 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; and ligatures on a grid of characters
- 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
@@ -326,7 +328,7 @@ Where Word's PDFs don't show how it kerns or joins text, the layout stops, as [W
## How close it is
-Text in fonts made with the same widths as those five is measured exactly as them: Carlito as Calibri, Caladea as Cambria, Liberation Sans, Arimo and Helvetica as Arial, Liberation Serif and Tinos as Times New Roman, and Liberation Mono and Cousine as Courier New. Text in the fonts the document embeds (`fonts`) is measured from their files, as Word draws it in them, but for fonts Office also offers, which stop the layout: Word for Mac drew Pacifico, which a document embedded, in the copy Office downloads, whose letters are narrower than `demo/assets/Pacifico.ttf`'s. Text in Aptos, Office's default font since 2023, and Office's other fonts of the tables is measured with Word's own files of them: each word of a line of prose in each of them but Verdana, whose line Word's PDF broke in two, kerned and with ligatures as Word's Normal template has them, is within half a point of where Word puts it, across lines of 1,100 to 1,400 points. Text in other fonts, such as Garamond, stops the layout (see [What it leaves blank](#what-it-leaves-blank)), unless their files are given (see [Measuring fonts from their files](#measuring-fonts-from-their-files)). Hebrew, Thai, the Arabic-Indic and Devanagari digits, box drawing, shapes such as the bullets ● and ■, symbols and dingbats are measured as Word draws them in each font of the tables, plain and bold, and in Calibri's, Cambria's, Arial's, Times New Roman's and Courier New's italics, but for Cambria's and Times New Roman's Devanagari digits, and stop the layout in the italics of Office's other fonts, whose widths of them Word's PDFs haven't shown, as those Devanagari digits do. Arabic and Devanagari letters, which Word joins into forms of other widths, stop it too. Other characters the width tables don't have, such as Armenian letters and emoji, are measured as an average letter of the font, or an em for emoji. The Latin letters of the East Asian fonts that aren't monospaced, such as Yu Gothic, and East Asian fonts Office doesn't have stop the layout too.
+Text in fonts made with the same widths as those five is measured exactly as them: Carlito as Calibri, Caladea as Cambria, Liberation Sans, Arimo and Helvetica as Arial, Liberation Serif and Tinos as Times New Roman, and Liberation Mono and Cousine as Courier New. Text in the fonts the document embeds (`fonts`) is measured from their files, as Word draws it in them, but for fonts Office also offers, which stop the layout: Word for Mac drew Pacifico, which a document embedded, in the copy Office downloads, whose letters are narrower than `demo/assets/Pacifico.ttf`'s. Text in Aptos, Office's default font since 2023, and Office's other fonts of the tables is measured with Word's own files of them: each word of a line of prose in each of them but Verdana, whose line Word's PDF broke in two, kerned and with ligatures as Word's Normal template has them, is within half a point of where Word puts it, across lines of 1,100 to 1,400 points. Text in other fonts, such as Garamond, stops the layout (see [What it leaves blank](#what-it-leaves-blank)), unless their files are given (see [Measuring fonts from their files](#measuring-fonts-from-their-files)). Hebrew, Thai, the Arabic-Indic and Devanagari digits, box drawing, shapes such as the bullets ● and ■, symbols and dingbats are measured as Word draws them in each font of the tables, plain and bold, and in Calibri's, Cambria's, Arial's, Times New Roman's and Courier New's italics, but for Cambria's and Times New Roman's Devanagari digits, and stop the layout in the italics of Office's other fonts, whose widths of them Word's PDFs haven't shown, as those Devanagari digits do. Arabic's and Persian's letters are measured in the forms Word joins them in, in Arial, Times New Roman, Cambria and Courier New, plain and bold. Side by side in Arial, Times New Roman and Cambria, which Word kerns by pairs not yet known, they stop it, and so they do in Calibri, which Word kerns too, and in the other fonts. Word doesn't kern Courier New's. Devanagari letters, which Word joins into forms of other widths, stop it too. Other characters the width tables don't have, such as Armenian letters and emoji, are measured as an average letter of the font, or an em for emoji. The Latin letters of the East Asian fonts that aren't monospaced, such as Yu Gothic, and East Asian fonts Office doesn't have stop the layout too.
Each change to `docx/layout` is checked against LibreOffice's layout of a set of documents, and against the pages Word marked in documents it saved. Word lays out some things differently from LibreOffice, so turn `updateFields` on if the page numbers must be Word's own once the document is opened in Word: Word then asks to update the fields, and works them out again. LibreOffice rounds the height of each line to whole twips, 269 for Calibri 11, so where a line only just fits on a page, it can be on the next page in LibreOffice and on this one in Word, and in `docx/layout`, which follows Word.
The unique identifier for this abstract numbering definition.