Skip to content

Latest commit

 

History

History
142 lines (105 loc) · 6.05 KB

File metadata and controls

142 lines (105 loc) · 6.05 KB

officework 0.5.0

日本語: RELEASE.ja.adoc

To try it: pip install officework

This is the release after 0.4.0, and it carries everything the nine betas fixed. It was all one job: the engine reads what the file says, and prints what the file says.

Plenty is still broken. There is a list of what we know about below. It is a clear improvement on 0.4.0 all the same, so the beta marker comes off. Please report what breaks at the GitHub issues.

The engine is what ships. pip install officework installs it and nothing else; the apps are not distributed yet.

The spreadsheet gives Excel’s answer

The function list is 404 entries. Statistics, finance, engineering, database and the distribution family are in. Every documented function takes every argument Excel takes, and array constants ({1,2;3,4}) parse.

Insert Function has Excel’s classic shape: a category list, the functions, the description, and the argument fields with a running result. The function manual is generated from the same material the dialog shows, so the two cannot drift apart.

Numbers are shown the way LibreOffice shows them. In a cell with no number format =1.1-1 is 0.1. Fifteen significant digits; an integer below 2^53 stays an integer; a decimal exponent of 15 or more, or -15 or less, switches to scientific. =1/3*3 is 1, following approxAdd and approxSub. A narrow column drops digits before it falls back to #.

Column widths match Excel’s, numbers no longer spill into the next cell, and a cell’s format is read in full: number format, borders, fill, alignment, font.

A Word document prints the way the file states it

Table provisions are read one at a time: table styles (w:tblStylePr conditions, bands, the heading row, the first column), the width as a percentage, the table indent, the heading row repeated across pages, cell margins, the diagonal through a cell, text spread across a cell, and paragraph indents inside cells.

Default formatting comes in five layers: the application’s defaults, w:docDefaults, the table style, the paragraph style, direct formatting. The bottom two were not being read. A document written by python-docx carries almost no direct formatting, so without them it looked like a different document.

Letter spacing reaches the page. Text that the file squeezes with w:spacing is printed squeezed. It used to be laid out by the font’s own advances, so lines grew and ran over the rules.

Also fixed:

  • pagination follows Word’s rules; line heights are written into the file

  • paragraph styles take effect, and bullets and the rule under a title come from styles

  • line height comes from the font, and the baseline sits at the font’s ascent

  • a paragraph border draws the sides the file names, and w:between lands where LibreOffice puts it

  • bold is one run, not one glyph at a time, and its weight is a thirtieth of the font height

  • opening and saving leaves the original parts untouched

Measured against the published PDFs, matching lines by their text:

Document Mean error at the end of a line Lines within 1pt

Survey form (110 lines)

9.01pt → 2.50pt

5 → 68

Notice (141 lines)

3.71pt → 2.54pt

5 → 83

Shapes, pictures and equations

All 187 DrawingML preset shapes are drawn from the spec’s own definitions. An unknown shape used to come out as a rectangle. Colours come from the document’s theme palette with the modifiers (lumMod and the rest) resolved, and position and size follow the whole relative-from table.

Text boxes made by other software print. Pictures placed on a sheet print. A shape anchored to two cells takes its size from those cells.

The engine typesets equations itself. No Python, no TeX: typst and mitex are inside it. Word’s and Excel’s equations (OMML) are read as LaTeX, so they print instead of vanishing.

Paper belongs to the section

Pages are stacked one after another as the ordinary view. Paper, orientation, margins and columns apply to the section the cursor is in, so one document can hold an A4 portrait section and an A3 landscape one.

The Python API runs the upstream examples unchanged

python-docx’s and openpyxl’s own examples run without edits. docx.shared, docx.enum, docx.styles, the chart classes and an RGBColor that passes python-docx’s own type checks are in. Misspell an attribute of Doc, Book or Sheet and it is refused rather than silently ignored.

The xlwings idiom (from officework import calc as xw) is unchanged.

What is still broken

The apps are not distributed. pip install officework gives you the engine. The GUI can be built from source (see "Building from source" in the README).

Known gaps in the engine:

  • table column widths come from w:gridCol. Where Word uses the per-cell w:tcW, a line can break one character early

  • a nested table is lifted out of its parent and placed in the body flow

  • some spreadsheet forms paginate differently from the original. Two tax forms come out at 11 and 12 pages against the original’s 8 and 7

  • a shape’s style reference (a:fillRef) contributes its colour only; a gradient in the theme is painted as one colour

  • AsciiDoc reading and writing is not distributed yet. Against Asciidoctor’s own pages, 129 of the 172 readable ones give the same HTML

Manuals

There is one page per button (256 of them). The index, the two learn-by-example booklets, the button reference and the Word/Excel differences have English versions. The booklets are written as plain prose: one thing per sentence.

Internals

kumihan gained omml (OMML to LaTeX) and suushiki (typesetting LaTeX). The shape table moved out of the drawing code into definition data, so the screen and the page read the same table.

The release gate and the daily tests are separate; the gate looks only at whether what we distribute is broken. Which documents ship is decided by docs/engine-docs.txt. A tool counts every tag in a docx or xlsx and lists the ones no reader touches, with a reason for each deliberate omission (tools/tag_check.py).