Commit Graph
77 Commits
Author SHA1 Message Date
aiongg 0c560ea96b feat: write the values that follow the language of the last session
Decode the save history of the document (chunk 0x1D8): one record per
session, with a u16 language code. The layout parses 4,431 of the
4,439 distinct valid corpus files (not the six InDesign 2.x files and
two without the chunk) and all 803 pairs. Code 0x0101 in the last
record marks a session of a Japanese or Chinese edition: all 149
Japanese pairs have it.

The converter uses it for values that IDML writes in the exporting
InDesign's language:

- spread FlattenerPreference without chunk 0x10833: 400/400 for
  0x0101, otherwise 300/150, none when the history cannot be read
  (7,481 of 7,490 spreads of all pairs; the 9 others are one pair
  exported in a session the INDD does not record)
- IndexOptions without chunk 0x13010: BetweenEntriesSeparator "、" or
  "; " (789 of 791 pairs) and Title "索引" for 0x0101 (158 of 159);
  no title for other codes, whose titles vary by language
- EndnoteOption without chunk 0x2261E: separator U+3000 and
  RubyMarker for 0x0101, tab and SuperscriptMarker otherwise (140 of
  141)

The endnote title and the Assignment Name do not follow the code and
stay out (objects.md, save history, has the counts).

compare.py --exclude own/:
- trustworthy coverage 97.71% -> 97.72% (+1,119 values: flattener
  resolutions 5,065 -> 5,404 of 5,413 each, index title 10 -> 136,
  separator 481 -> 604 of 606, endnote separator and marker position
  301 -> 397 of 398)
- all pairs 95.88% -> 95.89% (+1,679)
- extra values unchanged (26,256; all pairs 304,533)
- compare.py --all with schemas: 0 conversion and 0 schema failures
  on pairs
2026-10-08 13:34:24 +00:00
aiongg fb283101c3 feat: read the frame type and orientation of stories
Story chunk 0x2EE also holds the text orientation (u16 at 0: 0
Horizontal, 1 Vertical) and the frame type (u16 at 14: 0
TextFrameType, 1 FrameGridType). Over the 28,669 stories of all corpus
pairs both match the IDML in every story; stories without the chunk
are all TextFrameType and Horizontal. The converter writes
StoryPreference FrameType and StoryOrientation from it; the
orientation of the story's frames is used only for an unknown code.

compare.py --exclude own/:
- trustworthy coverage 97.55% -> 97.71% (11,986,627 -> 12,006,265);
  StoryPreference FrameType 0 -> 19,424 of 19,424, StoryOrientation
  19,210 -> 19,424 of 19,424
- all pairs 95.72% -> 95.88%
- extra values 26,256 (unchanged); all pairs 303,866 -> 304,533: the
  two attributes on the stories of stale pairs that the reference does
  not have
2026-10-08 13:15:38 +00:00
aiongg b0c886f77d feat: read the column direction of pages
The last u16 of page chunk 0x528 is the column direction (1 vertical,
0 horizontal), inherited from the master page with the columns. It
replaces the constant Horizontal the writer wrote on every page.

compare.py --exclude own/:
- trustworthy value coverage 98.03% -> 98.03% (+14 values); all pairs
  +14
- Page/MarginPreference ColumnDirection 9,274 of 9,274 (14 vertical)
- extra values unchanged; no key lost values
2026-10-08 08:35:25 +00:00
aiongg 64f08256e3 feat: take story, frame, clipping and ink constants from the value files
The writer wrote these as literals. element_values.py now collects
Story, XmlStory, Story/StoryPreference, the InCopyExportOption of
stories, rectangles, ovals and polygons, the ClippingPathSettings of
images, PDF and EPS graphics, and Ink; the writer reads them from
element_values.xml after the values it reads from the INDD.

- UserText (a WhenWritten value) is written from version 11.2, where
  IDML starts to have it (was 12).
- Ink ConvertToProcess is read from byte 56 after the ink name; it was
  the only ink value that varies (3 inks true).
- InCopyExportOption of ovals and the EPS clipping values follow the
  versions the corpus shows (ovals from DOM 8, EPS up to DOM 20).

compare.py --exclude own/:
- trustworthy value coverage 98.03% -> 98.03% (+771 values: UserText
  768, ConvertToProcess 3); all pairs 96.12% -> 96.13% (+1,211)
- extra values: trustworthy unchanged; all pairs +43 (UserText in
  stale pairs whose IDML is older)
- compare.py --all with schemas: 0 schema failures on pairs; files
  without a reference as before
2026-10-08 08:21:32 +00:00
aiongg cd7116ff8d feat: read the numbering lists and AppliedNumberingList
Preferences chunk 0x1A49B lists the default numbering list and the
others; each list (class 0x1A483) has its name and two flags in chunk
0x1A49A. The converter writes every list in designmap.xml, the default
first, in place of the constant default list, which it keeps only for a
file whose lists it cannot read. Paragraph attribute 0x1A417
(AppliedNumberingList) names a list by UID.

compare.py --exclude own/:
- trustworthy value coverage 97.65% -> 97.66% (+896 values); all pairs
  95.63% -> 95.64% (+1,231)
- NumberingList 705 of 705 (216 more), AppliedNumberingList +32
- extra values unchanged; no key lost values
- diff_outputs.py: other outputs differ only in the position of the
  AppliedNumberingList property
2026-10-08 07:38:55 +00:00
aiongg 98889a8bfc feat: read story title, direction and optical margin from their chunks
Story chunks 0xA44C (StoryTitle), 0x50F96 (StoryDirection, 1 right to
left) and 0x2EE (OpticalMarginSize and OpticalMarginAlignment) replace
the constant values the writer wrote for every story. Without a chunk
the story keeps the value of every story without it.

compare.py --exclude own/:
- trustworthy value coverage 97.64% -> 97.65% (+1,566 values); all
  pairs 95.61% -> 95.63% (+3,461)
- StoryDirection 780, OpticalMarginAlignment 441, OpticalMarginSize 315
  and StoryTitle 30 more stories right
- extra values unchanged; no key lost values
2026-10-08 07:31:48 +00:00
aiongg 53746658d9 feat: decode style export flags, AllowOverrides and the document label
- Paragraph and character styles: SplitDocument, EmitCss and
  IncludeClass from the u16 values after the tag map count of chunk
  0x28F0 (when the style has no tag maps); false, true, true without
  the chunk.
- Page items of master spreads: AllowOverrides from chunk 0x142D
  (1 false, else true). Placed graphics and items of document spreads
  have none.
- Document/Properties/Label from document chunk 0x1630B.

compare.py --exclude own/:
- trustworthy value coverage 97.48% -> 97.64% (+18,499 values); all
  pairs 95.46% -> 95.61% (+22,885)
- AllowOverrides 11,791 of 11,791; paragraph style SplitDocument +3,403
  and IncludeClass +2,869; document label 436 of 438
- extra values +3 (ParagraphStyle SplitDocument); no key lost values
- compare.py --all with schemas: 0 schema failures on pairs; files
  without a reference as before
2026-10-08 07:25:44 +00:00
aiongg f0bd7f1e3b feat: decode default styles, grids, guide colours and other preferences
From the preferences object:
- TextDefault AppliedParagraphStyle and AppliedCharacterStyle (chunks
  0x28D4, 0x28D5); PageItemDefault graphic, text and grid object styles
  (chunk 0x1B959).
- LayoutGridDataInformation and StoryGridDataInformation (chunks 0xCD2F,
  0xCD2E): font, font style, sizes, akis, scales, character count size.
- MasterTextFrame and CreatePrimaryTextFrame (chunk 0x59C),
  BlendingSpace (0x1081F), AllowPageShuffle, GuidesShown, snapping,
  GuidesInBack, BaselineGridRelativeOption, ZeroPoint, layout
  adjustment, ShowTextThreads (from version 21.1), AbutTextToTextWrap
  and HonourTextIndentsWithTextWrap.
- Interface colours of guides, grids, margins, columns and the
  pasteboard, with four more named colours (LightGray, GridBlue, Peach,
  Burgundy).
Node::merge no longer adds observed text or children to a typed value,
so a colour list is not merged with an observed colour name.

compare.py --exclude own/:
- trustworthy value coverage 97.42% -> 97.48% (+6,332 values); all
  pairs 95.41% -> 95.46% (+8,463)
- extra values: trustworthy unchanged; all pairs +1 (ShowTextThreads in
  one pair whose IDML is from an earlier version)
- compare.py --all with schemas: 0 schema failures on pairs; files
  without a reference as before
2026-10-08 07:00:27 +00:00
aiongg b8ef0d51d8 feat: decode font name flags, all font types and missing-font records
- FontType codes 0 Type1, 3 ATC and 0xFFFFFFFF Unknown.
- TypekitID from INDD version 9.2 (was 12).
- The key flag of the native style name gives FontStyleNameNative a
  $ID/ prefix; the key flag of the family name gives $ID/ to the family
  name in FontFamily, Font Name and every AppliedFont.
- Missing-font records (kind 3) parse: no fonts, or short font records
  with style, platform name and Unknown type.
- The family name in the font's own script replaces the name when the
  family's writing script is the script byte of the document users.

compare.py --exclude own/:
- trustworthy value coverage 97.36% -> 97.42% (+7,627 values); all
  pairs 95.35% -> 95.41% (+9,808)
- TypekitID +3,483, FontStyleNameNative +1,262, FontType +664, 196
  more Font elements matched, AppliedFont and BulletsFont +235
- extra values 26,348 -> 24,144 (Font elements whose Self now matches)
- warnings 413 -> 406 (missing-font records now parse)
- compare.py --all with schemas: 0 schema failures on pairs; files
  without a reference as before
2026-10-08 06:27:03 +00:00
aiongg 6f27a77b9b refactor: parse the index groups chunk by its layout
Chunk 0x1307E is now read field by field: each group's name, include
byte and header variant, then its header variants and their sections.
This replaces the search for group names. objects.md gives the layout.

diff_outputs.py: 0 differing outputs, 0 changed failures and warnings
over 4,274 files.
2026-10-08 06:10:28 +00:00
aiongg f7fe41e65d feat: write the index, its topics and the page reference topics
The index object (class 0x13004) lists its sections (class 0x13005);
chunk 0x13007 of a section holds its topic records depth first, with
their level, name, sort order and page references. The converter
writes the Index element in designmap.xml with its nested Topic
elements, and gives each PageReference its ReferencedTopic and
PageReferenceType. Evidence: docs/format/index.md.

compare.py --exclude own/:
- trustworthy value coverage 97.17% -> 97.36% (+21,617 values); all
  pairs 95.21% -> 95.35% (+21,808)
- Topic 2,185 of 2,185 with Name and SortOrder; Index 16 of 16;
  PageReference ReferencedTopic and PageReferenceType 7,523 of 7,523
- extra values +15: the 3 topics and 3 page references one INDD has
  and its earlier IDML lacks
- compare.py --all with schemas: 0 schema failures on pairs; files
  without a reference as before. One of them (DOM 19) has topic
  records of another length; its sections are left out with a warning
  (21 warnings).
2026-10-08 06:09:17 +00:00
aiongg 78b59b6319 feat: write the spread flattener resolutions without the flattener chunk
Spreads without chunk 0x10833 get LineArtAndTextResolution 300 and
GradientAndMeshResolution 150. No INDD field decides these values:
5,045 of the 5,074 trustworthy spreads without the chunk have them; the
other 29 (all spreads of 9 documents) have 400 and 400. The evidence is
in objects.md and idml-values.md.

compare.py --exclude own/:
- trustworthy value coverage 97.03% -> 97.12% (+10,090 values); all
  pairs 95.07% -> 95.16% (+13,836)
- Spread/FlattenerPreference resolutions: 5,074 missing -> 29 wrong
- extra values: trustworthy unchanged; all pairs +306 (the attributes
  on spreads of stale pairs that their IDML no longer has)
2026-10-08 05:13:20 +00:00
aiongg 261e378d07 feat: write notes, page references, tracked changes and hidden XML markers
- Notes (class 0xA429): their text and a Note element in place of the
  U+FEFF, with dates by the link time rule, user name and document user.
- Index markers (class 0x13006): a PageReference with Self and Id in
  place of the U+FEFF (topics are not written yet).
- Tracked changes: deleted text (class 0xA40A) as Change DeletedText
  before the following character; inserted runs (strand run kind
  0xA466) wrapped in Change InsertedText inside each character range,
  closed at tables, anchored items and XML markers.
- XML markers are left out of the text when the node store cannot be
  read.
- Character-level sources open before an element character (note,
  destination), apart from paragraph destinations, which the schema
  does not allow in them.

Trustworthy pairs: reproduced 10,772,444 -> 11,266,452 (92.60 % ->
96.85 %); stories with identical text 18,574 -> 18,602 of 18,610;
PageReference 7,523 with Id; 1,709 more hyperlink sources and
hyperlinks (in deleted text). Notes 211 of 211 and changes 6,024 of
6,027 match the reference attributes (multisets per pair, no Self).
Extra values 26,107 -> 26,333: 220 from Change elements written inside
sources where InDesign writes an empty Change before them, 9 from
PageReference. HyperlinkTextSource/Note loses 3 elements for the same
reason (the source's first child is now the Change). Schema
validation: 0 failures.
2026-10-08 04:15:15 +00:00
aiongg adc397f871 feat: write cell and table style groups
Groups (class 0xCA8B) listed by the root cell or table style group are
written as CellStyleGroup or TableStyleGroup elements holding their
styles, in the order of the group's children (objects.md).

compare.py --exclude own/, trustworthy pairs: CellStyleGroup elements
0 -> 2 of 2 (4 values); no other change, no new extras, no conversion
or schema failures.
2026-10-08 00:32:07 +00:00
aiongg eacc1be120 fix: name grouped styles with their group path and escape colons
A style's IDML Name is its group path and its own name joined by ":",
with a ":" inside a name written "\:" and "$ID/" before the whole path
of a built-in style; Self is that name escaped (objects.md, style
groups). Object and cell styles now include their group path too, and
every reference uses the same name. A font with an empty style name is
named "<family> Regular" with the family alone in Self (fonts.md).

compare.py, trustworthy pairs: extra values 33,181 -> 30,379 (0.27 %);
value coverage 92.45 % -> 92.50 % (10,307,358 values; grouped style
names, styles now matched); no value lost; 14 documents >= 99 %,
median 96.5 %. No conversion or schema failures; story text
18,509/18,610.
2026-10-07 22:34:08 +00:00
aiongg 8b0f46837b feat: write unnamed colours and gradients only when something refers to them
IDML writes a colour or gradient without a name only if a value in the
package refers to it, a gradient stop or tint uses the colour, or the
page item defaults name it in one of the two entry tables of chunk
0x6E07 (objects.md, colours; preferences.md). The graphic part is now
written last, from the references in the other parts; the second table
of chunk 0x6E07 is read.

compare.py, trustworthy pairs: extra values 155,956 -> 33,181 (unnamed
Color -114,734, Gradient -3,498, GradientStop -4,543). 463 values are
no longer reproduced: 10 unnamed colours and 22 unnamed gradients with
their stops that IDML writes though nothing refers to them (open, see
objects.md). Value coverage 92.46 % -> 92.45 %. No conversion or schema
failures; story text 18,509/18,610.

The previous commit (09e87fa), measured alone: extra values 635,511 ->
155,956, value coverage 92.41 % -> 92.46 %; 39 values lost (7 opacity
stops and 8 drop shadows IDML writes with values equal to the style,
5 StrokeWeight, 1 TextColumnFixedWidth).
2026-10-07 22:33:58 +00:00
aiongg 09e87fadea feat: write page item values only where they differ from the object style
IDML leaves out the values of a page item that equal those of its
applied object style. The writer now compares with the style's
effective values (its own, then the styles it is based on, then [None]):

- TextFramePreference: an attribute is written when its category is off
  in the style's category list (chunk 0x1B92E, also for [None]) or its
  value differs; TextColumnMaxWidth (DOM 8), TextColumnCount (DOM 10)
  and InsetSpacing (DOM 11) are always written; footnote values from
  13.1 (objects.md, text frame preferences).
- Fill, stroke, miter and corner attributes (attributes.md).
- Transparency effects: only differing values, and an effect element
  only when it has one or its opacity stops differ (transparency.md).

New decoding: object style chunk 0x1B924 fields for balance, fixed
width, justification, first baseline offset (code 4 = XHeight, also for
frames) and auto-sizing; chunk 0x1B92C (style transparency). Object
styles get the DOM 12 text frame values from DOM 8 and
FootnotesEnableOverrides from 13.1 (idml-values.md).
2026-10-07 22:19:20 +00:00
aiongg 17c6ace935 feat: leave out values IDML does not write (layers, root styles, version gates)
Rules from the corpus, each documented in docs/format/:

- ItemLayer only on items directly under a spread (objects.md).
- The root object style [None] gets no Enable… attributes and no effects
  category settings; EnableTextFrameColumnRuleOptions from 15.1, and the
  footnote values of an object style's TextFramePreference from 13.1.
- The root paragraph style has no NextStyle and no AllNestedStyles;
  TextDefault has AllNestedStyles only when the list has items; the
  empty TabList is written from DOM 8 (attributes.md).
- DOM 7 has no EPubExportPreference or HTMLExportPreference.
- Row and column Self use a hexadecimal index (tables.md).
- Cell CellType from DOM 11; Document Name from DOM 13; ColorGroup Self
  is the UID before 11.3.
- The internal layer is the first of the document's layer list, whatever
  its name.
- A CR in a name is %0d in Self (colours, gradients, tints, hyperlink
  destinations, styles).

compare.py, trustworthy pairs (after the compare fix of 48d184f):
extra values 705,523 -> 635,511; value coverage 92.25 % -> 92.41 %
(10,296,599 values); 2 ItemLayer values lost (the 2 grouped items whose
IDML has one); 12 documents >= 99 %. No conversion or schema failures.
2026-10-07 22:01:28 +00:00
aiongg 6511128e7f feat: write per-corner attributes and paragraph border and shading corners
Page items, object styles and PageItemDefault: each corner radius and
corner option from its own attribute ID (top left 0x6E70/0x6E6F, top
right 0x6E94/0x6E91, bottom left 0x6E92/0x6E8F, bottom right
0x6E93/0x6E90), with the corner codes InsetCorner, BevelCorner and
FancyCorner. Object styles no longer need all four corners equal.

Paragraph styles and text: ParagraphShadingTopLeft/BottomLeftCornerRadius
(0x1DF12, 0x1DF14); the tied groups of border corner radii, shading
right corner radii and shading corner options when their IDs agree; the
shading and border origin pairs for the known code pairs.

compare.py --all --exclude own/ (trustworthy pairs): value coverage
91.61% -> 92.25% (+71,545 values); documents >= 99 %: 5 -> 11; median
95.7% -> 96.3%; no key lower. Extra values 709,654 -> 718,266
(+8,612): the per-corner attributes follow the presence of CornerRadius
and CornerOption in the item's list, so each of the existing 2,055
extra CornerRadius values (items whose IDML leaves the value to the
object style) now has four per-corner extras, and likewise the
CornerOption extras. 0 conversion and 0 schema failures.
2026-10-07 21:26:29 +00:00
aiongg 5b7e0ecf1f feat: write link attributes and placed graphic settings
Links: LinkResourceModified, ShowInUI, LinkImportStamp and the two link
times from chunk 0x8C9B, PDFIdentifier from chunk 0x1B6, the size and
format name from the resource's chunk 0x8C92, and the values every link
has. Link times are written in the time zone of the XMP date nearest in
day of the year (the INDD has no time zone; compare.py does not score
them): 3,886 of 4,446 import times and 3,316 of 4,434 modification
times right.

Images, PDF, EPS and SVG graphics: the page item settings and object
style, Space, ActualPpi and EffectivePpi (chunk 0x1708 and the scale on
the spread), ImageTypeName, Profile (chunk 0x7C0F), fill colour and
gradients, vector colour policies (chunk 0x7C42 or the document's
policies), PDFAttribute (chunk 0x251B), GraphicLayerOption with the
GraphicLayer tree (chunk 0x177A) and LayerCompOption (chunk 0x9209),
and ImageIOPreference from chunk 0x1714 in place of chunk 0x8C39.
The placed graphic writer moves to idml/graphic.rs.

compare.py --all --exclude own/ (trustworthy pairs): value coverage
90.00% -> 91.61% (+179,834 values); documents >= 99 %: 1 -> 5; median
94.2% -> 95.7%; no key lower. Extra values 709,643 -> 709,654 (+11 in
SVG elements that are not in the reference). New warnings: 178 layer
chunks in 3 InDesign 3.0 files, whose layout differs, are left out.
0 conversion and 0 schema failures.
2026-10-07 21:13:31 +00:00
aiongg 9de24aa28f feat: read object export options of page items (chunk 0x1E206)
ObjectExportOption now takes its alternative text, actual text and
tagging values from chunk 0x1E206 of the item, and its other attributes
from a table by INDD major and minor version (8.0-9.1, 9.2, 10.0, 10.1
on, 21.0, 21.1, 21.4), for page items from version 8 and for every
object style, [None] included, from version 9. Page items of version 7
get no ObjectExportOption, as in their IDML.

compare.py --all --exclude own/ (trustworthy pairs): value coverage
88.72% -> 90.00% (+142,324 values); documents >= 99 %: 0 -> 1; median
92.4% -> 94.2%; no key lower. Extra values 713,688 -> 709,643: -4,319
from the DOM 7 rectangles that no longer get the element; +274 more
values in GraphicLine, Oval and TextFrame elements that are not in the
reference (more attributes per element). 0 conversion and 0 schema
failures.
2026-10-07 20:51:44 +00:00
aiongg 59e7f6d168 feat: write the page colour of master spreads 2026-10-07 17:23:56 +00:00
aiongg 4359207564 feat: write GraphicType for empty graphic frames 2026-10-07 16:49:41 +00:00
aiongg fd4f25c52e fix: read the transform of groups that store it in chunk 0x40D 2026-10-07 16:36:22 +00:00
aiongg 6f8a8fe932 feat: write the stroke weight of items that have none of their own 2026-10-07 16:24:18 +00:00
aiongg 3da31dc6c2 feat: write style keyboard shortcuts and empty nested, line and GREP style flags 2026-10-07 16:05:18 +00:00
aiongg 1e26e1e8bd feat: read text, margin, anchor, pasteboard, XML tag and page item defaults 2026-10-07 15:40:54 +00:00
aiongg 8e8cb28d40 feat: read colour settings, view, grid, watermark and text defaults from the preferences 2026-10-07 15:14:54 +00:00
aiongg 3196061da1 feat: write every object style category from its category IDs
With the larger corpus each Enable attribute of object styles, and the
transparency flag of the four effects categories, follows one ID or a
group of IDs that always occur together in the category list.

Value coverage on trustworthy pairs: 87.13 % to 87.31 %.
2026-10-07 14:34:23 +00:00
aiongg deebe0e8a7 feat: write the constant shade every document lists
The pasted smooth shade object of lowest UID with a constant shading
becomes a PastedSmoothShade whose contents are its numbers in big-endian
order, with the values every constant shade has in IDML.

Value coverage on trustworthy pairs: 87.08 % to 87.13 %.
2026-10-07 14:19:32 +00:00
aiongg 44f2d9c1a7 feat: write the index sort options of every document
The index groups of the preferences object become IndexingSortOption
elements in their stored order, with their include flag and a header
type by group and header variant.

Value coverage on trustworthy pairs: 86.86 % to 87.08 %.
2026-10-07 14:01:56 +00:00
aiongg 3f1f10799d feat: write the InCopy assignment of every document
Each assignment object becomes an Assignment with the values every IDML
has. Its name depends on the language of the computer that exported the
IDML, so it is left out of the output and of value coverage.

Value coverage on trustworthy pairs: 86.83 % to 86.86 %.
2026-10-07 13:45:28 +00:00
aiongg 27cfef8fd7 feat: write named grids and object style export options
designmap.xml gets the document's named grids with the layout grid
settings all its pages share. Object styles other than [None] get the
export options every IDML of their version has, now also before
InDesign 12.

Value coverage on trustworthy pairs: 86.72 % to 86.83 %.
2026-10-07 13:29:58 +00:00
aiongg 5344dc2148 fix: tell polygons from ovals and rectangles by the stored shape code
Chunk 0x6204 of a frame holds a shape code that gives the IDML element
(line, rectangle, oval or polygon). Without a code, a closed four-point
path is an oval only when all its points are of type 0. About 5,000
shapes of the trustworthy pairs that were written as ovals are polygons,
with all their attributes and children.

Value coverage on trustworthy pairs: 84.50 % to 86.72 %.
2026-10-07 13:11:59 +00:00
aiongg 2d52b399c4 feat: write table of contents styles and the stories they made
Styles.xml gets a TOCStyle for each TOC style object, with its name,
title, title style and numbering, anchor and line break settings, and
stories get AppliedTOCStyle through the table of contents object that
made them. Entries are not decoded yet.

Value coverage on trustworthy pairs: 84.29 % to 84.50 %.
2026-10-07 12:41:09 +00:00
aiongg e6dd2d629f feat: write style import flags, unique IDs and common style values
Paragraph and character styles get Imported (the u16 after the style
kind) and StyleUniqueId (the GUID after the name) from the INDD, and the
values every non-root style has in IDML, such as PreviewColor, from
observation. The values generator leaves root styles out of the style
paths.

Value coverage on trustworthy pairs: 84.07 % to 84.29 %.
2026-10-07 12:14:48 +00:00
aiongg 463fef540a feat: write swatch library, alternate colour and guide settings
Colours get SwatchCreatorID and their alternate colour from the INDD,
HSB colours are written as RGB with ConvertToHsb, and every swatch names
its colour group swatch from DOM 12 on. Guides get Locked, GuideZone,
OverriddenPageItemProps and PageIndex, which counts pages from the
spine. Tints, gradients and the None swatch get the values every IDML
has on them.

Value coverage on trustworthy pairs: 83.37 % to 84.07 %.
2026-10-07 11:54:33 +00:00
aiongg 09782f6af0 feat: write more text frame settings
TextFramePreference gets the maximum column width, fixed column width,
auto-sizing minimums, text wrap override, column rule width and colour,
footnote spacings and the inset spacing (from the frame), read from
their chunks. Attributes that IDML writes only on some frames, with one
value wherever it does, are generated as WhenWritten values and also
give the versions from which column rules and footnotes exist.

Value coverage on trustworthy pairs: 82.03 % to 83.37 %.
2026-10-07 11:34:20 +00:00
aiongg 722fddfe97 feat: write languages, document users and document settings
designmap.xml gets the document's languages from their INDD objects,
with the quotes every IDML gives each language, the document users from
the document object, and the settings elements every IDML of the version
has (watermark, linked story and page item options, footnote and
endnote options and others) with their common values. User colours are
set by the exporting InDesign, not the INDD, and are left out of value
coverage.

Value coverage on trustworthy pairs: 81.65 % to 82.03 %.
2026-10-07 11:08:03 +00:00
aiongg fbe1e7f6ca feat: write spread, page, section and layer settings
Spreads get AllowPageShuffle and their FlattenerPreference, master
spreads ShowMasterItems, pages their tab order, overrides, layout grid
use, layout rule, colour, alternate layout and numbering descriptor,
sections their prefix, marker and alternate layout, and layers their
printing, guide, UI, wrap and colour settings. Interface colours are
named from one table shared with XML tags. Values every IDML has on
these elements, and the two built-in trap presets, are written from
observation.

Value coverage on trustworthy pairs: 80.03 % to 81.65 %.
2026-10-07 10:45:11 +00:00
aiongg 3d968bea8a feat: write the settings every page item has
Page items get Name, Visible, Locked, the interface change counts,
OverriddenPageItemProps, the layout constraints and the gradient angles
and highlights, read from their chunks and attribute lists, with the IDML
defaults where a chunk is absent. Groups take the gradient values their
children share. tools/element_values.py collects the values every IDML
of a version has on an element; the converter writes those of page items
and their export options, now for every version.

Value coverage on trustworthy pairs: 62.62 % to 80.03 %.
2026-10-07 10:09:02 +00:00
aiongg f5c73f9460 fix: convert or clearly reject every file in the fetched sample batch
- InDesign 5.0: read document chunk 0x13501 with the 3.0/4.0 layout
  (four UID lists); the 6.0 layout failed on 17 files.
- Reject files that are shorter than their database pages as truncated,
  and check the signature before the size so that short files of other
  kinds are reported as not INDD files. The corpus tests accept both.
- Hyperlink page destinations: write view setting 0 as Fixed (567 of 567
  in the pairs); leave out a zoom outside the schema's 5-4000 %.
- Leave out, with a warning, values the IDML schema does not allow: ink
  neutral density -1, writing script 0xFFFFFFFF, negative drop shadow
  size and other out-of-range transparency values. The IDML writer now
  returns its own warnings.
2026-10-07 07:59:23 +00:00
aiongg 3e89cad3bd fix: convert or clearly reject every file in the new sample batch
- Bullet list: the font style can be followed by 1 and four bytes.
- InDesign 2.0: in-object strings start with 1, not 2.
- InDesign 2.0-5.0: XML tag names are a flag byte and a string, in
  either byte order.
- InDesign 3.0 and 4.0: the document's hyperlink lists start at offset
  0 and include page destinations.
- XMP: the packet can be shorter than its object; take its length.
- InDesign 1.x files (no signature, DOCUMENT at 0x5C) are reported as
  not supported; files whose page directory lies beyond the database
  pages as having no object database.
- Schema: leave out hyperlink sources that hold an anchored object, and
  the characters U+FFFE and U+FFFF, which XML does not allow.

tests/corpus.rs accepts the two rejections above and skips the paths
listed in the local corpus/exclude.txt.
2026-10-07 06:27:26 +00:00
aiongg bf72b93d23 test: download fixtures from pinned sources instead of committing them
Remove the sample documents, PDF and licence copies from tests/fixtures/.
tests/fixtures/manifest.json lists each file's download URL (pinned to a
commit for GitHub sources), size and SHA-256. tools/fetch_fixtures.py
downloads them into the git-ignored tests/fixtures/files/ and verifies
them. The fixture tests read from there and skip when it is absent.
2026-10-07 05:47:17 +00:00
aiongg 790d22d483 feat: write first baseline offset code 3 as EmboxHeight 2026-10-07 05:17:22 +00:00
aiongg 4bc6768fb0 feat: write vertical story orientation
A text frame's multi-column frame stores a matrix (chunk 0x2DE) that is
the identity for horizontal text and a quarter turn for vertical text.
A story whose frames all have the quarter turn is written Vertical
instead of the Horizontal every sample's IDML has.
2026-10-07 04:27:07 +00:00
aiongg 6a357f4287 feat: write the Kanji page number style
Section style code 0x4C12 is Kanji, shown by the Chinese-numeral folios
of a vertically typeset sample's print PDF. Pages in such a section are
named with Chinese digits, as the folios show.
2026-10-07 04:26:16 +00:00
aiongg 9fef3b0516 feat: read the page binding
DocumentPreference PageBinding comes from the document preferences
(u16 at 64) instead of the value every sample's IDML has. A vertically
typeset sample bound on the right stores 1, RightToLeft.
2026-10-07 04:25:39 +00:00
aiongg 7c89bdfe8a fix: write only colour models the samples show
Code 1 is Spot in two pairs; code 3 has no sample, so its Model is now
left out with a warning instead of written as MixedInkModel.
2026-10-07 04:15:57 +00:00
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