mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 10:17:02 -06:00
File > Place could not place a Word document: a .docx file was "not a format VectorCraft reads". The reference app's File > Place reads Microsoft Word files as text. File > Place now reads .docx files, written from ECMA-376 Part 1 (WordprocessingML, Transitional and Strict), and sets their text as area type the way a text or RTF file is placed. The package is read through its relationships. The formatting comes from the document defaults, the paragraph style (else the default paragraph style), the character style (else the default character style), the styles each is based on, and direct formatting. Bold, italic, caps, small caps, strikethrough and hidden text are toggle properties: a style that turns one on reverses the state the styles before it give. Each run keeps its font (theme fonts from the theme part), size, bold and italic, underline, strikethrough, all caps, small caps, superscript or subscript (in Document Setup's proportions), raised or lowered text and color. Each paragraph keeps its alignment, start, end, first-line and hanging indents, space before and after, and direction; the start indent of a right-to-left paragraph is its right indent. Table cells are separated by tabs and each table row is a paragraph. Text in insertions, hyperlinks, content controls and fields' results is read. Hidden and deleted text, field instructions, pictures, text boxes, headers, footers, notes and list numbers are left out. A ZIP archive named .docx, or one that holds word/document.xml, is read as a Word document. fileio/zip.rs gains a reader for stored and deflated files that checks each file's CRC. A package with more than 10,000 files, a part that unpacks to more than 16 MiB or nests elements more than 256 deep, and a document with more than 4 MiB of text or 100,000 paragraphs or runs are refused with an error. The Place dialog lists Word files, and file.place, file.place.info and file.place.queue report the format `docx`. .doc files are still not read. The Word document tests in tests_textimport.rs fail without the change, and text_import_fuzz.rs places random and damaged packages. Docs: docs/file-format-parity.md, docs/mcp.md, docs/target-app-parity.md.