mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-06 18:51:26 +00:00
Gap 19: ODT in-line frames placed against the text; saved on the baseline
Found with LibreOffice's style templates.
- An in-line frame placed against the text (`style:vertical-rel` "text"
or "char", with `middle`, `top` or `bottom`) stood on the baseline. It
is now raised or lowered against the text's height, from the size of
the text it sits in. Measured in LibreOffice, `middle` centres the
frame on the text: its middle half the ascent less the descent above
the baseline. Placement against the line still stands on the
baseline.
- An in-line picture or chart was saved with no placement style. In
LibreOffice that puts it at the line's top (measured: the title beside
the Finances logo moved up 19 pt). It is now saved standing on the
baseline ("top" to "baseline"), as WordCraft and Word show it.
Two templates' round-trip differences fall from 1,874 and 1,433 pixels
to 521 and 586. Across the corpus the difference falls from 47k to 45k,
and no document gets worse.
Left in these templates:
- template instantiation: LibreOffice refreshes a template's fixed dates
and fills its sender fields from the user's data when opening it;
- a first-page footer's frame placed against the page content;
- a page background picture centred in the margins rather than on the
page.
gaps.md row 19 lists them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLyDnrG8Tn1yDQcUabC
This commit is contained in:
8 files changed
+92
-27
No files matched your search
@@ -394,6 +394,11 @@ impl Body<'_> {
|
||||
self.fmt.last().cloned().unwrap_or_default()
|
||||
}
|
||||
|
||||
/// The size of the text being read, points (its own, else the document's).
|
||||
pub(in crate::odt) fn text_size(&self) -> f32 {
|
||||
self.cur_fmt().size.or_else(|| self.styles.doc_size()).unwrap_or(12.0)
|
||||
}
|
||||
|
||||
/// Reading the body itself, not a table cell or a frame.
|
||||
fn in_body(&self) -> bool {
|
||||
self.containers.len() == 1 && self.tables.is_empty() && self.frame.is_none()
|
||||
@@ -884,7 +889,7 @@ impl Body<'_> {
|
||||
let h = get(a, "svg:height").and_then(length);
|
||||
self.frame = Some((w, h, None, String::new(), None, None, None));
|
||||
let g = get(a, "draw:style-name").map(|s| self.styles.graphic(s)).unwrap_or_default();
|
||||
self.frame_float = Some(super::frames::place(a, w.unwrap_or(0.0), h.unwrap_or(0.0), &g));
|
||||
self.frame_float = Some(super::frames::place(a, w.unwrap_or(0.0), h.unwrap_or(0.0), &g, self.text_size()));
|
||||
self.member_start(a, w.unwrap_or(0.0), h.unwrap_or(0.0), None);
|
||||
// Without a height, a text box in it grows to its text (`fo:min-height` below).
|
||||
self.frame_look = g.look(h.is_none(), &self.styles.defs);
|
||||
|
||||
@@ -314,7 +314,7 @@ impl Body<'_> {
|
||||
let at = |v: Option<f32>| v.map(crate::odt::writer::pt);
|
||||
crate::odt::frames::float_of(get(a, "text:anchor-type"), at(x).as_deref(), at(y).as_deref(), &g)
|
||||
} else {
|
||||
crate::odt::frames::place(a, w, h, &g)
|
||||
crate::odt::frames::place(a, w, h, &g, self.text_size())
|
||||
};
|
||||
(float.flip_h, float.flip_v) = (flip_h, flip_v);
|
||||
self.shape_flip = (false, false);
|
||||
|
||||
@@ -382,8 +382,9 @@ pub(super) fn float_of(anchor: Option<&str>, x: Option<&str>, y: Option<&str>, g
|
||||
}
|
||||
|
||||
/// Where a frame or shape `w` × `h` (points) sits: anchored as its `text:anchor-type` says, at
|
||||
/// its `svg:x`/`svg:y`, or turned and moved by its `draw:transform`, in graphic style `g`.
|
||||
pub(super) fn place(a: &Attrs, w: f32, h: f32, g: &Graphic) -> Float {
|
||||
/// its `svg:x`/`svg:y`, or turned and moved by its `draw:transform`, in graphic style `g`, in
|
||||
/// text `size` points tall.
|
||||
pub(super) fn place(a: &Attrs, w: f32, h: f32, g: &Graphic, size: f32) -> Float {
|
||||
let turned = get(a, "draw:transform").and_then(|t| transform(t, w, h));
|
||||
let (x, y) = match turned {
|
||||
Some((x, y, _)) => (Some(pt(x)), Some(pt(y))),
|
||||
@@ -394,7 +395,7 @@ pub(super) fn place(a: &Attrs, w: f32, h: f32, g: &Graphic) -> Float {
|
||||
f.rot = rot;
|
||||
}
|
||||
if f.wrap == Wrap::Inline {
|
||||
f.y = inline_raise(g, y.as_deref().and_then(length), h);
|
||||
f.y = inline_raise(g, y.as_deref().and_then(length), h, size);
|
||||
}
|
||||
f
|
||||
}
|
||||
@@ -403,14 +404,28 @@ pub(super) fn place(a: &Attrs, w: f32, h: f32, g: &Graphic) -> Float {
|
||||
/// baseline (points, negative lowered; WordCraft keeps it in an inline [`Float`]'s `y`): its
|
||||
/// `style:vertical-pos` relative to the baseline (§20.387, §20.388; LibreOffice's placement
|
||||
/// when no `style:vertical-rel` is given) — `top` stands on it, `middle` is centred on it,
|
||||
/// `bottom` hangs from it, `from-top` has its top `svg:y` below it. Placement relative to the
|
||||
/// character or line stays on the baseline.
|
||||
fn inline_raise(g: &Graphic, y: Option<f32>, h: f32) -> f32 {
|
||||
// Measured from the baseline; a relation an in-line frame can't have (a paragraph's, from
|
||||
// a parent style for anchored frames) is the baseline too, as LibreOffice reads it.
|
||||
if matches!(g.vrel.as_deref(), Some("char" | "line" | "text")) || !h.is_finite() {
|
||||
/// `bottom` hangs from it, `from-top` has its top `svg:y` below it. Relative to the text
|
||||
/// (`char`, `text`, in text `size` points tall), it is placed against the text's height, from
|
||||
/// its descent to its ascent (a serif face's, as LibreOffice's templates use): `middle` centred
|
||||
/// on it (measured in LibreOffice), `top` at its top, `bottom` at its bottom. Placement relative
|
||||
/// to the line stays on the baseline.
|
||||
fn inline_raise(g: &Graphic, y: Option<f32>, h: f32, size: f32) -> f32 {
|
||||
if !h.is_finite() || g.vrel.as_deref() == Some("line") {
|
||||
return 0.0;
|
||||
}
|
||||
if matches!(g.vrel.as_deref(), Some("char" | "text")) {
|
||||
let size = if size.is_finite() { size.clamp(1.0, 1638.0) } else { 12.0 };
|
||||
let (ascent, descent) = (TEXT_ASCENT * size, TEXT_DESCENT * size);
|
||||
let raise = match g.vpos.as_deref() {
|
||||
Some("middle") => (ascent - descent) / 2.0 - h / 2.0,
|
||||
Some("top") => ascent - h,
|
||||
Some("bottom") => -descent,
|
||||
_ => 0.0,
|
||||
};
|
||||
return raise.clamp(-MAX_RAISE, MAX_RAISE);
|
||||
}
|
||||
// Measured from the baseline; a relation an in-line frame can't have (a paragraph's, from
|
||||
// a parent style for anchored frames) is the baseline too, as LibreOffice reads it.
|
||||
let raise = match g.vpos.as_deref() {
|
||||
Some("middle") => -h / 2.0,
|
||||
Some("bottom") => -h,
|
||||
@@ -423,6 +438,11 @@ fn inline_raise(g: &Graphic, y: Option<f32>, h: f32) -> f32 {
|
||||
/// Most an inline frame is raised or lowered, points (22 inches).
|
||||
const MAX_RAISE: f32 = 1584.0;
|
||||
|
||||
/// The text's height above and below the baseline, of its size (Liberation Serif's ascent and
|
||||
/// descent), for frames placed against the text.
|
||||
const TEXT_ASCENT: f32 = 0.891;
|
||||
const TEXT_DESCENT: f32 = 0.216;
|
||||
|
||||
/// Most operations of a `draw:transform` read.
|
||||
const MAX_TRANSFORMS: usize = 16;
|
||||
|
||||
|
||||
@@ -56,6 +56,50 @@ fn wrap_modes_and_offsets() {
|
||||
assert_eq!(float(&open("", r#"text:anchor-type="as-char""#)).wrap, Wrap::Inline);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_inline_frame_placed_against_the_text_is_raised_from_its_size() {
|
||||
// LibreOffice's style templates: a logo centred on the text (`middle` relative to `text`)
|
||||
// stands with its middle at the text's (measured: half the text's ascent less its descent
|
||||
// above the baseline), in the paragraph's 12 pt text.
|
||||
let pic = {
|
||||
let img = image::RgbaImage::from_fn(4, 4, |_, _| image::Rgba([10, 20, 30, 255]));
|
||||
let mut png = Vec::new();
|
||||
img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap();
|
||||
png
|
||||
};
|
||||
let raise = |vpos: &str, rel: &str| {
|
||||
let content = format!(
|
||||
r#"<office:document-content {NS} {NS_D}><office:automatic-styles><style:style style:name="P" style:family="paragraph"><style:text-properties fo:font-size="12pt"/></style:style><style:style style:name="g1" style:family="graphic"><style:graphic-properties style:vertical-pos="{vpos}" style:vertical-rel="{rel}"/></style:style></office:automatic-styles><office:body><office:text><text:p text:style-name="P"><draw:frame draw:style-name="g1" text:anchor-type="as-char" svg:width="1in" svg:height="1in"><draw:image xlink:href="Pictures/p.png"/></draw:frame>Title</text:p></office:text></office:body></office:document-content>"#,
|
||||
NS = NS_T
|
||||
);
|
||||
let doc = import(&zip_of(&[("content.xml", content.as_bytes()), ("Pictures/p.png", &pic)])).unwrap();
|
||||
let p = doc.body.iter().find_map(|b| b.as_para()).unwrap();
|
||||
let (off, _) = p.objects_with_offsets().next().unwrap();
|
||||
p.props_at(off + wordcraft_doc::para::OBJ.len_utf8()).position.map_or(0.0, |v| (v * 10.0).round() / 10.0)
|
||||
};
|
||||
// (0.891 - 0.216) / 2 × 12 − 36.
|
||||
assert_eq!(raise("middle", "text"), -32.0);
|
||||
assert_eq!(raise("middle", "char"), -32.0);
|
||||
assert_eq!(raise("top", "text"), -61.3);
|
||||
assert_eq!(raise("bottom", "text"), -2.6);
|
||||
// Against the line: on the baseline.
|
||||
assert_eq!(raise("middle", "line"), 0.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_inline_picture_is_saved_standing_on_the_baseline() {
|
||||
// LibreOffice puts an in-line frame without placement at the line's top (measured): a
|
||||
// picture standing on the baseline, as in Word, says so.
|
||||
let d = float_doc_inline();
|
||||
let out = crate::odt::tests::content_of(&export(&d).unwrap());
|
||||
assert!(out.contains(r#"style:vertical-pos="top" style:vertical-rel="baseline""#), "{out}");
|
||||
}
|
||||
|
||||
/// A document with one picture in line with its text.
|
||||
fn float_doc_inline() -> Document {
|
||||
open("", r#"text:anchor-type="as-char""#)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_picture_alone_in_its_paragraph_keeps_its_raise_and_the_paragraphs_size() {
|
||||
// LibreOffice's elegant agenda: a rule raised 0.2 in above the baseline (its parent style's
|
||||
|
||||
@@ -197,13 +197,9 @@ impl Writer {
|
||||
(n, link)
|
||||
}
|
||||
};
|
||||
let (anchor, style) = match place {
|
||||
Place::Text(None) => (" text:anchor-type=\"as-char\"".to_string(), String::new()),
|
||||
_ => {
|
||||
let (anchor, props, xy) = placement(place, c.w, c.h);
|
||||
(anchor, format!(" draw:style-name=\"{}\"{xy}", self.graphic_style(props)))
|
||||
}
|
||||
};
|
||||
// Always placed by a style (see `image_frame`).
|
||||
let (anchor, props, xy) = placement(place, c.w, c.h);
|
||||
let (anchor, style) = (anchor, format!(" draw:style-name=\"{}\"{xy}", self.graphic_style(props)));
|
||||
out.push_str(&format!(
|
||||
"<draw:frame draw:name=\"{}Chart{n}\"{style}{anchor} svg:width=\"{}\" svg:height=\"{}\" draw:z-index=\"0\">{inner}",
|
||||
self.prefix,
|
||||
|
||||
@@ -290,13 +290,11 @@ impl Writer {
|
||||
fn image_frame(&mut self, img: &model::Img, place: Place<'_>, inner: &str, out: &mut String) {
|
||||
let n = self.pictures.len();
|
||||
let clip = clip_attr(img);
|
||||
let (anchor, style) = match place {
|
||||
Place::Text(None) if clip.is_empty() => (" text:anchor-type=\"as-char\"".to_string(), String::new()),
|
||||
_ => {
|
||||
let (anchor, props, xy) = placement(place, img.w, img.h);
|
||||
(anchor, format!(" draw:style-name=\"{}\"{xy}", self.graphic_style(format!("{}{props}{clip}", super::GRAPHICS_PARENT))))
|
||||
}
|
||||
};
|
||||
// Always placed by a style: in line, standing on the baseline (LibreOffice puts a frame
|
||||
// with no placement at the line's top).
|
||||
let (anchor, props, xy) = placement(place, img.w, img.h);
|
||||
let (anchor, style) =
|
||||
(anchor, format!(" draw:style-name=\"{}\"{xy}", self.graphic_style(format!("{}{props}{clip}", super::GRAPHICS_PARENT))));
|
||||
out.push_str(&format!(
|
||||
"<draw:frame draw:name=\"{}Image{n}\"{style}{anchor} svg:width=\"{}\" svg:height=\"{}\" draw:z-index=\"0\">{inner}",
|
||||
self.prefix,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# File-format parity with Microsoft Word
|
||||
|
||||
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-02 · **Change:** trivial (ODT charts written back as they were while unchanged; frames' drawn outline; default header height); previously trivial (ODT header rows only where they repeat); previously trivial (ODT padding without a border; unequal columns; column breaks); previously trivial (ODT lines of only pictures laid out as LibreOffice does; default page without a layout); previously trivial (ODT pictures alone in a paragraph keep its size; in-line frames raised under an inherited paragraph relation); previously trivial (ODT tables fit the margins and keep their space above and below; header spacing kept); previously trivial (ODT frames anchored and placed by their style); previously trivial (ODT default font size saved; page-anchored frames placed from the page; text box paragraph styles kept; empty paragraphs keep their size); previously trivial (ODT default font size; locale-ordered dates); previously trivial (ODT page background pictures); previously trivial (ODT tables fixed layout; tables starting a page); previously trivial (emphasis marks: model, layout, DOCX `w:em`, ODT `style:text-emphasize`, `format.emphasisMark`); previously trivial (ODT variables as SET/REF fields; character styles keep what they turn off); previously trivial (ODT styles keep what they turn off; WMF/EMF pictures kept; pictures in text boxes shown by LibreOffice); previously trivial (ODT unstated page margins are LibreOffice's 2 cm; drawings outside a paragraph join the next one); previously trivial (ODT placeholders as content controls, template dates, user name fields, unsized pages, style-only templates, found with LibreOffice's own templates); previously trivial (ODT hidden form controls kept; `.ott` templates opened and saved); previously trivial (ODT fidelity re-estimated at ~90%; a kept form control made another kind is saved as that kind); previously trivial (ODT form control sizes and buttons kept); previously trivial (ODT turned text in cells and text boxes); previously trivial (ODT macros and unknown package parts kept); previously trivial (ODT table cell formulas as formula fields); previously trivial (ODT custom shapes drawn from their own geometry); previously trivial (ODT bibliography marks as citations of sources); previously trivial (ODT linked text boxes); previously trivial (ODT picture crops and contour wrapping); previously trivial (ODT fidelity re-estimated at ~85%); previously trivial (ODT custom document properties and user fields as DOCPROPERTY); previously trivial (ODT connectors read and written glued); previously trivial (ODT borders around text read and written); previously trivial (ODT index marks read and written as XE fields; an index held around its entries updates); previously trivial (ODT ruby read and written); previously trivial (ODT page breaks after a paragraph, kept lines, widow control, hyphenation, table alignment and width and row heights); previously trivial (in-line drawings raised or lowered by their run's position; ODT in-line frames keep their place on the baseline; leading's space after the last line; text box borders shown by LibreOffice); previously trivial (ODT form controls opened and saved as content controls); previously trivial (password-protected ODT opened and saved); previously trivial (ODT headers and footers keep their shapes, text boxes, charts and embedded objects on save); previously trivial (ODT embedded spreadsheets and OLE objects kept whole instead of lost; flat ODT sub-documents valid `office:document`s); previously trivial (ODT charts in drawing groups drawn on open); previously trivial (ODT charts opened and saved as editable charts; flat ODT sub-documents no longer end the body); previously trivial (ODT leading read as an at-least spacing); previously trivial (ODT tracked formatting changes; changed regions named by `xml:id`); previously trivial (ODT drop caps; tab stops no longer drop a paragraph's background); previously trivial (flat ODT `.fodt` opened and saved; ODT fidelity re-estimated at ~80%); previously trivial (ODT page settings; a footnote no longer takes a footer's text); previously trivial (ODT dates in their formats, sequences, chapters and references); previously trivial (ODT bookmarks over text); previously trivial (ODT tables of contents and indexes; ODT fidelity re-estimated); previously trivial (ODT polygons, polylines and paths); previously trivial (ODT arrowheads, dashes and gradients); previously trivial (ODT groups of shapes and pictures); previously trivial (ODT rotated and mirrored shapes and pictures); previously trivial (ODT drawing shapes read and written); previously trivial (ODT text box frames keep their line, fill, padding and fit); previously trivial (ODT Asian and complex-script fonts); previously trivial (ODT right-to-left paragraphs); previously trivial (ODT text boxes kept); previously trivial (ODT unnumbered headings detached from the outline); previouslyLine truncated
|
||||
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-02 · **Change:** trivial (ODT in-line frames placed against the text; in-line pictures saved standing on the baseline); previously trivial (ODT charts written back as they were while unchanged; frames' drawn outline; default header height); previously trivial (ODT header rows only where they repeat); previously trivial (ODT padding without a border; unequal columns; column breaks); previously trivial (ODT lines of only pictures laid out as LibreOffice does; default page without a layout); previously trivial (ODT pictures alone in a paragraph keep its size; in-line frames raised under an inherited paragraph relation); previously trivial (ODT tables fit the margins and keep their space above and below; header spacing kept); previously trivial (ODT frames anchored and placed by their style); previously trivial (ODT default font size saved; page-anchored frames placed from the page; text box paragraph styles kept; empty paragraphs keep their size); previously trivial (ODT default font size; locale-ordered dates); previously trivial (ODT page background pictures); previously trivial (ODT tables fixed layout; tables starting a page); previously trivial (emphasis marks: model, layout, DOCX `w:em`, ODT `style:text-emphasize`, `format.emphasisMark`); previously trivial (ODT variables as SET/REF fields; character styles keep what they turn off); previously trivial (ODT styles keep what they turn off; WMF/EMF pictures kept; pictures in text boxes shown by LibreOffice); previously trivial (ODT unstated page margins are LibreOffice's 2 cm; drawings outside a paragraph join the next one); previously trivial (ODT placeholders as content controls, template dates, user name fields, unsized pages, style-only templates, found with LibreOffice's own templates); previously trivial (ODT hidden form controls kept; `.ott` templates opened and saved); previously trivial (ODT fidelity re-estimated at ~90%; a kept form control made another kind is saved as that kind); previously trivial (ODT form control sizes and buttons kept); previously trivial (ODT turned text in cells and text boxes); previously trivial (ODT macros and unknown package parts kept); previously trivial (ODT table cell formulas as formula fields); previously trivial (ODT custom shapes drawn from their own geometry); previously trivial (ODT bibliography marks as citations of sources); previously trivial (ODT linked text boxes); previously trivial (ODT picture crops and contour wrapping); previously trivial (ODT fidelity re-estimated at ~85%); previously trivial (ODT custom document properties and user fields as DOCPROPERTY); previously trivial (ODT connectors read and written glued); previously trivial (ODT borders around text read and written); previously trivial (ODT index marks read and written as XE fields; an index held around its entries updates); previously trivial (ODT ruby read and written); previously trivial (ODT page breaks after a paragraph, kept lines, widow control, hyphenation, table alignment and width and row heights); previously trivial (in-line drawings raised or lowered by their run's position; ODT in-line frames keep their place on the baseline; leading's space after the last line; text box borders shown by LibreOffice); previously trivial (ODT form controls opened and saved as content controls); previously trivial (password-protected ODT opened and saved); previously trivial (ODT headers and footers keep their shapes, text boxes, charts and embedded objects on save); previously trivial (ODT embedded spreadsheets and OLE objects kept whole instead of lost; flat ODT sub-documents valid `office:document`s); previously trivial (ODT charts in drawing groups drawn on open); previously trivial (ODT charts opened and saved as editable charts; flat ODT sub-documents no longer end the body); previously trivial (ODT leading read as an at-least spacing); previously trivial (ODT tracked formatting changes; changed regions named by `xml:id`); previously trivial (ODT drop caps; tab stops no longer drop a paragraph's background); previously trivial (flat ODT `.fodt` opened and saved; ODT fidelity re-estimated at ~80%); previously trivial (ODT page settings; a footnote no longer takes a footer's text); previously trivial (ODT dates in their formats, sequences, chapters and references); previously trivial (ODT bookmarks over text); previously trivial (ODT tables of contents and indexes; ODT fidelity re-estimated); previously trivial (ODT polygons, polylines and paths); previously trivial (ODT arrowheads, dashes and gradients); previously trivial (ODT groups of shapes and pictures); previously trivial (ODT rotated and mirrored shapes and pictures); previously trivial (ODT drawing shapes read and written); previously trivial (ODT text box frames keep their line, fill, padding and fit); previously trivial (ODT Asian and complex-script fonts); previously trivial (ODT right-to-left paragraphs); previouslyLine truncated
|
||||
|
||||
Every format Word opens or saves, what WordCraft does with it, and how it's tested. Fidelity is the
|
||||
share of a typical real-world file's content and formatting that survives (read: shows correctly;
|
||||
@@ -280,6 +280,7 @@ Custom document properties retain their bookmark link targets through DOCX saves
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-02 | trivial | ODT, found with LibreOffice's style templates: an in-line frame placed against the text (`style:vertical-rel="text"` or `"char"`: `middle`, `top`, `bottom`) stood on the baseline; it's raised or lowered against the text's height from its size (measured in LibreOffice: `middle` centres it on the text). An in-line picture or chart was saved with no placement, which LibreOffice puts at the line's top (measured); it's saved standing on the baseline, as WordCraft and Word show it. Two templates round-trip with a third to a half of their difference (`floats::an_inline_frame_placed_against_the_text_is_raised_from_its_size`, `floats::an_inline_picture_is_saved_standing_on_the_baseline`). Left in them: template instantiation (LibreOffice refreshes a template's fixed dates and fills its sender fields from the user's data when opening it), a first-page footer's frame placed against the page content, and a page background picture centred in the margins rather than on the page |
|
||||
| 2026-11-02 | trivial | ODT: a chart lost the look WordCraft doesn't model (its fonts and sizes, axis and grid lines) on save, written anew from WordCraft's chart. The chart object as read is kept (through drawing it again when it opens or is resized), and written back whole while the chart reads the same; an edited chart is written from WordCraft's chart as before. The chart documents round-trip pixel-identical (`charts::an_unchanged_chart_is_written_back_as_it_was_and_an_edited_one_anew`, `engine::tests::redrawing_a_chart_keeps_the_chart_as_read`). Found with LibreOffice's serif business letter: a text frame outlined by its drawn stroke (`draw:stroke`, no `fo:border`) lost its outline; it's the frame's line. A header or footer whose style states no height (or that has none) was 0 tall; it's LibreOffice's 0.5 cm (measured), so the text no longer moves up. The letter round-trips to 116 differing pixels (from 4,223) (`text_boxes::a_frames_drawn_stroke_is_its_line_when_it_has_no_border`, `headers::a_header_without_a_stated_height_is_half_a_centimetre`) |
|
||||
| 2026-11-02 | trivial | ODT, found with LibreOffice's agendas: saving wrote every table's first row as a header row (`table:table-header-rows`), repeated at the top of each page, because a table style's header row (on by default in Word's table look) was taken for Repeat as header row; a table crossing a page showed its first row twice. Only rows set to repeat are written so. The agendas round-trip to about 145 differing pixels (from 5,269 and 5,086), their text the same (`tables::only_rows_set_to_repeat_are_written_as_header_rows`) |
|
||||
| 2026-11-02 | trivial | ODT, found with LibreOffice's report templates and one-page résumé. A paragraph's padding on a side without a border (measured: LibreOffice gives it room) was dropped; it's kept, laid out (see layout-parity) and written back. Unequal columns (`style:column` `style:rel-width` and indents, on pages and sections) were made equal; they keep their widths, written back as shares, without the gap LibreOffice ignores them beside. Columns with no stated gap have none (it had been Word's 0.5 in). A paragraph starting a column (`fo:break-before="column"`) didn't; it starts with Word's column break, written back on the paragraph. The report templates round-trip to 0–11 differing pixels (from 9,600), the résumé to 24 (from 6,286) (`para_borders::padding_without_a_border_keeps_its_room`, `odt::tests::unequal_columns_keep_their_widths_and_columns_without_a_gap_have_none`, `odt::tests::a_paragraph_starting_a_column_starts_with_a_column_break`) |
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
# Where WordCraft falls short of Word
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-02 · **Change:** trivial (#19: ODT charts kept as read; frame outlines; default header height); previously trivial (#19: ODT tables no longer gain repeated header rows); previously trivial (#19: ODT padding without a border, unequal columns, column breaks, picture-only lines); previously trivial (#19: ODT tables' margins and spacing, header spacing, pictures alone in a paragraph); previously trivial (#19: no LibreOffice template changes page count through a save); previously trivial (#19: ODT variables, emphasis marks, page backgrounds, fixed tables, default size); previously trivial (#19: ODT checked against LibreOffice's own templates: placeholders, first-page styles, unsized pages, metafile logos, `.ott`); previously trivial (#19: ODT at ~90%: custom shapes, cell formulas, macros kept, turned text, control sizes and buttons); previously trivial (#19 narrowed: ODT read and written nearly whole; estimate 18–27 h → 10–16 h); previously trivial (#10 narrowed: text in a turned text box is drawn turned with it); previously trivial (gap 19 narrowed: ODT heading numbering read and written); previously trivial (gap 19 narrowed: ODT table borders and padding read and written); previously trivial (gap 19 narrowed: ODT heading style looks read and written); previously trivial (gap 19 narrowed: ODT tab stops read and written); previously trivial (gap 19 narrowed: ODT character formatting read and written); previously trivial (gap 19 narrowed: ODT list formats read and written); previously trivial (gap 19 narrowed: ODT comments read and written); previously trivial (gap 19 narrowed: ODT footnotes and endnotes read and written); previously trivial (gap 19 narrowed: ODT headers and footers written, text fields and paragraph spacing read and written); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font Line truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-02 · **Change:** trivial (#19: ODT in-line frames placed against the text; template instantiation listed as left); previously trivial (#19: ODT charts kept as read; frame outlines; default header height); previously trivial (#19: ODT tables no longer gain repeated header rows); previously trivial (#19: ODT padding without a border, unequal columns, column breaks, picture-only lines); previously trivial (#19: ODT tables' margins and spacing, header spacing, pictures alone in a paragraph); previously trivial (#19: no LibreOffice template changes page count through a save); previously trivial (#19: ODT variables, emphasis marks, page backgrounds, fixed tables, default size); previously trivial (#19: ODT checked against LibreOffice's own templates: placeholders, first-page styles, unsized pages, metafile logos, `.ott`); previously trivial (#19: ODT at ~90%: custom shapes, cell formulas, macros kept, turned text, control sizes and buttons); previously trivial (#19 narrowed: ODT read and written nearly whole; estimate 18–27 h → 10–16 h); previously trivial (#10 narrowed: text in a turned text box is drawn turned with it); previously trivial (gap 19 narrowed: ODT heading numbering read and written); previously trivial (gap 19 narrowed: ODT table borders and padding read and written); previously trivial (gap 19 narrowed: ODT heading style looks read and written); previously trivial (gap 19 narrowed: ODT tab stops read and written); previously trivial (gap 19 narrowed: ODT character formatting read and written); previously trivial (gap 19 narrowed: ODT list formats read and written); previously trivial (gap 19 narrowed: ODT comments read and written); previously trivial (gap 19 narrowed: ODT footnotes and endnotes read and written); previously trivial (gap 19 narrowed: ODT headers and footers written, text fields and paragraph spacing read and written); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its contenLine truncated
|
||||
> **Highlight update:** 2026-10-25 · Highlight shortcut toggles the last chosen colour off when the whole selection has it; explicit colour commands remain setters (#4085). Readiness estimates unchanged.
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (#15: bibliography sources keep a corporate author, #4848); previously trivial (Table Properties applies to the selected rows, columns and cells, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (#7: Custom Document Properties dialog, #2982; previously trivial: egui 0.37 migration: the interface catalogs stay shared and pinned by `craft-i18n.rev` at `9205108cfdced5177706264038848b68b2422d2b` (27 languages, English fallback); input-method handling has new regressions but managed CI passed, and native IME acceptance plus native-speaker catalog review remain open; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: small follow-ups from the field, table and AutoFormat batch, #4232; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously minor: #8 narrowed: Spanish proofing (Spain, Mexico, Latin America, Uruguay) from the installed Hunspell dictionaries, #3360, #3553; previously trivial: gap 10: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; obstacle routing still missing; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: the ranked gap list held two rows each for #19, #20 and #21; each gap appears once now; a document with many relationships opens in the time its part takes, #3411; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no lonLine truncated
|
||||
|
||||
@@ -370,6 +370,7 @@ Recipient label generation (#4880) now includes all selected recipients across a
|
||||
| 2026-10-12 | trivial | #811: large-table scrolling fixed; performance gap (#20) narrowed |
|
||||
| 2026-10-12 | trivial | #13: radar, stock and other undrawn chart types show a placeholder instead of blank space (#998) |
|
||||
| 2026-10-19 | trivial | Personal templates in File › New and Save as Word Template (#2852); no gap entry tracked it |
|
||||
| 2026-11-02 | trivial | #19 narrowed: ODT in-line frames placed against the text, and in-line pictures saved standing on the baseline. Left from LibreOffice's style templates: template instantiation (fixed dates refreshed and sender fields filled from the user's data when LibreOffice opens a template), a first-page footer's frame against the page content, a page background picture centred in the margins |
|
||||
| 2026-11-02 | trivial | #19 narrowed: ODT charts keep their look on save (the object as read, while unchanged); a frame's drawn outline is kept; a header with no stated height is LibreOffice's 0.5 cm. The corpus round-trip difference falls from 60k to 47k pixels; 41 of 125 documents round-trip pixel-identical |
|
||||
| 2026-11-02 | trivial | #19 narrowed: ODT tables no longer gain a repeated header row on save; all 16 LibreOffice agenda templates now round-trip with their text the same (91 of 125 corpus documents). The corpus round-trip difference falls from 82k to 60k pixels |
|
||||
| 2026-11-02 | trivial | #19 narrowed: ODT documents open with LibreOffice's layout where it differs from Word (`Settings::odf_layout`: lines of only pictures, padding without a border); unequal columns and column breaks kept. The corpus round-trip difference falls from 155k to 82k pixels (408k this morning); 38 of 125 documents round-trip pixel-identical. Left: columns nested in a page's columns (WordCraft's own rendering; no Word equivalent), cell background pictures |
|
||||
|
||||
Reference in new issue
Block a user