mirror of
https://github.com/dolanmiu/docx.git
synced 2026-11-30 16:47:55 +01:00
* feat(layout): lay out documents in compatibility modes 14, 12 and 11, suppressTopSpacing and useFELayout, as Word does Word laid out the same 22 pages alike in compatibility modes 15, 14, 12 and 11 (word-stops-compat-15.docx to -11) but for justified lines, which Word 2010 and before don't squeeze, a table sized to its text, which they give its cells' margins beside the room, tabs past the margin, a narrow gap beside a frame, and in 12 and 11 East Asian text and VML text boxes. The layout now lays out documents in those modes, and stops only at what they lay out otherwise or haven't been seen with: those, a page break at a paragraph's end, floating tables, tables sized to their text in cells, indented or as a share, distributed lines, ligatures without enableOpenTypeFeatures, and the schema's compatibility settings, seen leaving lines alone only in Word 2013's mode. suppressTopSpacing leaves out the space above the text of the first line of a page or column at exact and at-least spacing (word-stops-top-spacing.docx ST1 to ST5), and useFELayout leaves paragraphs without East Asian text as they are (word-stops-fe-layout.docx FE1). Paragraphs kept together taller than some of 3 columns of different widths, and those kept with them, a gutter at the top with mirrored margins or below a negative top margin, a table row in an HTML division and pages printed two to a sheet no longer stop (word-stops-pages.docx, word-stops-two-on-one.docx). word-stops-compat2.ts writes the probes of what these left open, for the next round of Word's PDFs. * docs(layout): list the compatibility and settings probes in stops2/README.md, as #3678 lists the batch's for the folder in scripts/layout-probes/README.md. The compatibility-mode, pages and settings probes are listed there now, rather than in rows of their own. * perf(layout): look for a paragraph's East Asian text only in documents that lay it out otherwise unknownInOlderLayout scanned every character of every paragraph for East Asian text, though only Word 2007's and 2003's modes and useFELayout lay it out otherwise. * docs(layout): say FE1b turns off only autoSpaceDN, and probe both East Asian auto spacings off in FE2d docx's autoSpaceEastAsianText writes only w:autoSpaceDN, so word-stops-fe-layout.docx FE1b, which Word saved, has autoSpaceDE on, though its script's header said both were off. The header now says what it is, and word-stops-compat2.ts's FE2d writes both off, in the paragraph's properties in the schema's order, for the next batch.