Commit Graph
12 Commits
Author SHA1 Message Date
aiongg a9985b3775 fix: validate every corpus output and fix the two schema failures
compare.py --all now also converts the INDD and INDT files that have no
same-version IDML (any version, either byte order), validates them and
counts converter warnings by kind. validate.sh runs Jing once per schema
instead of once per file, which makes validating the whole corpus take
about 3 minutes.

Two schema failures showed up in files without an IDML:

- Gradient swatch midpoints are stored as positions from the start of
  the gradient. IDML wants them relative to the gap between two stops,
  as for opacity gradient stops. Values outside 13-87 are left out with
  a warning.
- The style kind is a u16, not a u32. One InDesign 7.5 template has a
  non-zero u16 after it, which made 151 character styles paragraph
  styles.
2026-10-07 03:50:08 +00:00
aiongg 3f4a68dfe6 feat: write object style settings for every object style
Object styles other than [None] now get their text frame, story, text
wrap and frame fitting settings, fill, stroke and corner attributes,
applied paragraph style and some category flags from the INDD (chunks
0x1B92B, 0x1B924, 0x285B, 0x50F28, 0x3776, 0x3777, 0x1B92E, 0x1B946),
and the values every such style has in the corpus IDML files, collected
by tools/root_values.py into src/idml/object_style_values.xml. The root
style gets the same INDD values in place of observed ones.
2026-10-07 01:33:21 +00:00
aiongg 0dc40563ab feat: write preference values that every exported IDML has 2026-10-07 00:35:38 +00:00
aiongg 7c3c38446b feat(compare): compare effect elements inside transparency settings 2026-10-06 23:55:15 +00:00
aiongg 36b7ae9eaf feat: write root style values that every exported IDML has
Collect the root style attributes, Properties and child elements that are
the same in every corpus IDML (tools/root_values.py) and write them on the
root paragraph, character, object, cell and table styles. Values read from
the INDD take precedence; values that first appear after DOM 7 are gated
by InDesign version. Also write the default numbering list, and write a
style only once when two style objects share a name.
2026-10-06 22:04:05 +00:00
aiongg 7c95144d4a feat(compare): compare list properties and attribute-only properties
TabList, AllNestedStyles and other list-typed <Properties> children are
compared as one canonical string. Empty property elements such as
BulletChar are compared by their attributes.
2026-10-06 21:14:52 +00:00
aiongg fb2bc7cd9e chore: compare embedded contents by digest and add --bin option 2026-10-06 18:22:23 +00:00
aiongg 69573c8461 feat: convert document and text frame preferences
Write DocumentPreference (page size, facing pages, bleeds, intent) and
TextFramePreference (columns, gutter, column width, vertical
justification, auto-sizing). compare.py now also compares child elements
without Self and the preference elements.
2026-10-06 17:26:36 +00:00
aiongg 602065453e feat: validate output against the IDML schemas
Add tools/validate.sh, which checks every XML part of an IDML package
against InDesign's generated RelaxNG schemas with Jing, and a --schemas
option in compare.py. Output for all 75 corpus pairs validates.

Do not write BindingLocation on master spreads, which the schema does not
allow.
2026-10-06 17:11:34 +00:00
aiongg 5f87710d92 feat: convert text formatting
Parse attribute lists in style objects and in paragraph and character
style runs, and write 40 text attributes (font, style, size, leading,
colour, tracking, kerning method, indents, spacing, justification,
underline, rules, hyphenation and more) on styles and text ranges. Read
font family names.

tools/compare.py now also compares text range attributes at matching text
offsets; every mapped attribute matches the reference in all ranges.
2026-10-06 16:33:53 +00:00
aiongg 0da35fd644 feat: first INDD to IDML conversion
Build a document model (layers, spreads, master spreads, pages, page
items with path geometry, text frame threading, stories with paragraph
and character style runs, style names and hierarchy) and write it as an
IDML package with a minimal stored-ZIP writer.

Add tools/compare.py, which converts every corpus pair and compares the
result with the reference IDML. First run: all 351 little-endian files
convert; 921 of 1120 stories match exactly.
2026-10-06 16:17:00 +00:00
aiongg 8d156bfeba feat: read INDD header and set up clean-room project
Decode the signature, byte-order flag and InDesign version from the INDD
header, add an `indd info` command, and add smoke tests on four
open-licensed sample files plus an optional local corpus test.

Document the clean-room method and the header layout with the evidence
for each field.
2026-10-06 15:22:17 +00:00