Commit Graph
177 Commits
Author SHA1 Message Date
aiongg 129f5b1dca feat: write the transform attributes of object styles
Chunk 0x1E234 of an object style holds four u16 flags and four f64:
X, Y, height and width of TransformAttributeOption. IDML writes each
value whose flag is 1 (36 styles; 2,390 with all flags 0 have none).

compare.py --exclude own/, trustworthy pairs: TransformAttrWidth
0 -> 30/30, TransformAttrHeight 0 -> 11/11, TransformAttrX 0 -> 3/3,
TransformAttrY 0 -> 1/1; no extra values.
2026-10-10 13:23:29 +00:00
aiongg 3ba72f54ce feat: write DesiredGlyphScaling of paragraph ranges
Text attribute 0x1B33 is DesiredGlyphScaling, a fraction written x100.
Paragraph run overrides in 10 documents store 0.96 to 0.99, matching the
22 IDML ParagraphStyleRange values; root styles and text defaults store
1.0 (IDML 100).

compare.py --exclude own/, trustworthy pairs: TextRange
PSR.DesiredGlyphScaling 0 -> 89/89, Cell/ParagraphStyleRange 0 -> 1/1;
no extra values.
2026-10-10 13:23:29 +00:00
aiongg c513cdf03d feat: write the drop shadow colour and ColumnRuleOverride of page items
- Item attribute 0x10837 is the drop shadow EffectColor, written by the
  object style comparison of the other transparency values. Where the
  style stores no swatch, Black is left out: one item has it, and its
  IDML has no EffectColor.
- ColumnRuleOverride is the u32 at 0 of chunk 0x22646 and is written as
  true or false.

compare.py --exclude own/, trustworthy pairs: DropShadowSetting
EffectColor 0 -> 11/11, TextFramePreference ColumnRuleOverride
21,165 -> 21,167/21,167, 4 more Color elements (swatches the shadows
use). No new extra values; no pair loses values.
2026-10-10 12:51:16 +00:00
aiongg bdf62e7646 feat: write GREP and line styles, more nested style codes and composite fonts
- GREP styles (0x1BBA) and line styles (0x1BBB) are decoded and written
  as AllGREPStyles and AllLineStyles on styles, text defaults and
  paragraph ranges; empty lists are not written.
- Nested style delimiters (^c), ^t, ^L, ^p, ^9 and ^S in brackets map to
  Dropcap, Tabs, Repeat, EndNestedStyle, Digits and Sentence.
- An AppliedFont whose family name (with <hhhh> escapes decoded) is a
  composite font's name is written as CompositeFont/<name>, except in
  character styles, which keep the name.

compare.py --exclude own/, trustworthy pairs: ParagraphStyle
AllGREPStyles 152/152, TextDefault 48/48, text ranges 320/320,
AllLineStyles 6/6 and 9/9, ParagraphStyle AllNestedStyles 54 -> 124/124,
TextDefault 4 -> 10/10, ParagraphStyle AppliedFont 4,664 -> 4,803/4,804,
TextDefault 1,232 -> 1,250/1,251, text ranges 84,909 -> 85,587/85,587.
No new extra values; no pair loses values.
2026-10-10 12:51:16 +00:00
aiongg e0e1f99b7a feat: read the export options and language quotes, and write values of the exporting edition
Decoded chunks:
- EPUB (0x21A1A), HTML (0x21A19), fixed layout EPUB (0x21A25) and
  Publish Online (0x21A20) export options; the EPUB chunk is read in the
  layout of its two variable blocks that ends at the chunk's end. Files
  without a chunk get the values every such file has.
- Adjust layout (0x7020): EnableAdjustLayout,
  AllowFontSizeAndLeadingAdjustment, EnableAutoAdjustMargins.
- Language quotes (0x2D26), and $ID/ for an empty vendor of a language
  whose vendor is never stored; Romanian quotes without the chunk.

Values without a field follow the InDesign that exported the IDML,
taken from the save history or the edition that made the document (the
language of its assignment name); preferences.md lists the rules and
their exceptions: DOMVersion by the last session's release, Publish
Online resolution and PublishPdf, EnableAdjustLayout after 14.0.0 and
14.0.1, the index title and separator, SnapZone, BaselineFrameGridColor
and ColumnGuideColor by the last session's language code, and style
shortcut key codes by its platform (also on character styles of DOM 7
to 12, which got none).

compare.py --exclude own/, trustworthy pairs: 98.74 % -> 98.96 %
together with the three commits before (+62,457 values, 0 lost on any
key); e.g. EPubExportPreference 0 -> 1,242 per attribute, DOMVersion
668 -> 1,164 of 1,251, IndexOptions Title 284 -> 1,162, SnapZone 68 ->
1,240, Language HyphenationVendor 1,945 -> 2,818 of 2,829,
BaselineFrameGridColor 934 -> 1,154 (object styles 4,163 -> 5,136),
ColumnGuideColor 406 -> 1,228, CharacterStyle KeyboardShortcut 2,547 ->
3,154 of 3,154. Extra values 93,502 -> 92,838: +346 on Language
elements the reference IDML leaves out (their new vendors and quotes),
one PublishPdf of an IDML exported by another release.
2026-10-10 09:40:07 +00:00
aiongg 8f8a3bff96 feat: read the TOC style flags IncludeBookDocuments and CreateBookmarks
The eight bytes after a TOC style's name are a u16 (0 in every style),
the u16 IncludeBookDocuments and the u32 CreateBookmarks. They match all
1,520 TOC styles of the corpus whose IDML style has the same name.

compare.py --exclude own/, trustworthy pairs: TOCStyle
IncludeBookDocuments and CreateBookmarks 0 -> 1,304 of 1,304 each; no
extra value.
2026-10-10 09:39:52 +00:00
aiongg 27b9733d83 fix: read centred tab stops and tab stops aligned on a character
Tab alignment code 1 is CenterAlign and code 3 CharacterAlign; a stop
with code 3 stores its alignment character as a UTF-16 unit after the
code, so a list with such a stop was not read at all. The character is
written as AlignmentCharacter. Evidence in attributes.md: 79 centred and
36 character-aligned stops, all matching.

compare.py --exclude own/, trustworthy pairs: P.TabList of paragraph
styles 1,803 -> 1,841 of 1,841, of text ranges 24,844 -> 24,900 of
24,900, of story paragraph ranges 968 -> 975 of 975 and of text
defaults 1,237 -> 1,242 of 1,242; no extra value. The mixed ink commit
before gains 1,206 values on its elements, not 1,140.
2026-10-10 09:39:46 +00:00
aiongg 265cf651c6 feat: write mixed inks, mixed ink groups and the alternate colour of tints
A colour object with model code 3 is a mixed ink: chunk 0x1F09 lists its
inks, chunk 0x1F01 (colour space 9) their fractions and chunk 0x102D the
spot colours. With chunk 0x1F24 it is a mixed ink group; colours of
space 9 whose chunk 0x117 names a group are its members and take the
group's lists. They are written as MixedInkGroup and MixedInk elements
after the inks (mixed inks sorted by name) instead of Color elements,
and fills and colour group swatches refer to them. A tint gets the
alternate colour of its base colour. Evidence in objects.md.

compare.py --exclude own/, trustworthy pairs: 81 of 81 mixed inks and
groups with every attribute (+1,140 values), Tint AlternateSpace and
AlternateColorValue 0 -> 171 of 171, ColorGroupSwatch and fill colour
references +132; 0 lost on any key. Extra values: the 1,077 values of
Color elements written for mixed inks are gone; 66 more on tints the
reference IDML leaves out (their two new attributes).
2026-10-10 09:39:21 +00:00
aiongg d34092793e feat: read more preference chunks and write the values of files without them
Chunks of the preferences object: the story settings of new frames
(0x2EE) and the story orientation (byte 116 of 0x280), the text wrap of
new page items (0x3720), DocumentGridShown (0x566),
EnableStylePreviewMode (0xCAF3), three highlight flags (0xCA62, 0xCAD3,
0xCAD4), four layout grid flags (0xCD14, 0xCD1C to 0xCD1E),
MojikumiUiSettings (0x42DB), the tagged PDF structure order and
dictionary recomposition (0x11C69), CreateLinkToXML (0x1BC0B), the
pasteboard theme colour flag (byte 32 of 0x5D2), and the footnote
EosPlacement and minimum first baseline offset (0x2820).

Where every file without a chunk has one value, the converter writes it:
anchored object, story and text wrap settings, footnote options,
index options, chapter numbering, booklet margins, layout adjustment,
smart text reflow flags. TaggedPDFPreference is written from 7.5.
Evidence in preferences.md and footnotes.md.

compare.py --exclude own/, trustworthy pairs, with the two commits
before: 98.51 % -> 98.74 % (+67,661 values, 0 lost on any key), e.g.
MojikumiUiPreference and TaggedPDFPreference elements 0 -> 1,251 and
1,242, ChapterNumberPreference 73 -> 1,251, IndexOptions 66 -> 1,251
per attribute. Extra values unchanged (93,502). The text range count
in d7bc060 is 1,605, not 1,562.
2026-10-10 09:05:25 +00:00
aiongg d7bc060fd4 feat: read eleven more text attributes and the page item default angles and scales
Text attribute IDs that every text default list has, with styles and
runs: KeepFirstLines (0x1B3A), KeepLastLines (0x1B3B),
AllowArbitraryHyphenation (0x42C1), GridGyoudori (0x4264),
RotateSingleByteCharacters (0x4268), AutoTcy (0x4261),
ScaleAffectsLineHeight (0x42A3), ParagraphShadingOverprint (0x1BD4),
ParagraphBorderType (0x1BFD, a stroke type), RubyFont (0x4233) and
KentenFillColor (0x4257). The root style values for them are dropped
from root_values.xml, which keeps only values the converter does not
read.

PageItemDefault gets GradientFillAngle, GradientStrokeAngle,
Nonprinting and the two arrowhead scales from the page item defaults
list, and the line end code 0x5A0C is SquareSolidArrowHead. Evidence
in attributes.md and preferences.md.

compare.py --exclude own/, trustworthy pairs: +15,104 values for the
text attributes (TextDefault 1,251 of 1,251 for each, paragraph and
character styles and 1,562 text ranges), +5,737 for PageItemDefault
(RightLineEnd 1,247 -> 1,251 of 1,251); 0 lost, no extra value.
2026-10-10 09:05:14 +00:00
aiongg 1a2ce02c4f feat: read anchored object settings field by field
Chunk 0x2800 has one u16 per attribute: AnchoredPosition at 40,
HorizontalReferencePoint at 42, VerticalReferencePoint at 44, AnchorPoint
from 46 and 50, HorizontalAlignment at 48, VerticalAlignment at 52,
SpineRelative at 54 and PinPosition at 56, with the two offsets at 0 and
16. The grouped tables written before were the combinations the smaller
corpus showed. Every field matches the 6,363 object styles, 1,076
anchored items and 1,295 preference chunks of the corpus.

An anchored item gets every value when its object style turns the
anchored object category off (670 items, with LockPosition and
AnchorSpaceAbove from the value files), else the values that differ
from the style's. Preferences and object styles without the chunk get
the values every such file has.

compare.py --exclude own/, trustworthy pairs: 98.46 % -> 98.51 %
(+11,653 values, 0 lost on any key); ObjectStyle SpineRelative
2,031 -> 5,556 of 5,556, preference SpineRelative 0 -> 1,251 of 1,251,
anchored text frames, rectangles, ovals, polygons, lines and groups
gain their settings (TextFrame PinPosition 2 -> 556 of 556). Extra
values unchanged (93,502).
2026-10-10 09:04:37 +00:00
aiongg 2a09aa923f feat: write form fields and multi-state objects
Buttons, check boxes, radio buttons and multi-state objects list their
states in chunk 0x14521 and the items each state shows in chunk 0x14526;
their transform is chunk 0x14527. Text boxes, combo boxes and signature
fields hold their items in chunk 0x15B. The converter writes the
elements with their State elements (type from the state ID), the groups
of states named by their type, PathBoundingBox from the items' paths,
and the name, description, export value, required flag, text box font
and flags from the attribute list (objects.md, form fields). The value
files gain the constant values of buttons and multi-state objects.

Text boxes anchored in table cells now replace their U+FFFC, so those
stories' text matches.

compare.py (trustworthy pairs, with the commits before it): coverage
97.92 % -> 98.46 %, story text 37,112 -> 37,129 of 37,150; the form
field elements of all 48 documents are written (Button, Group, State,
Rectangle and their children about 150,000 values). Extra values from
anchored fields without a known object style are avoided by leaving
their anchor settings out.
2026-10-10 07:25:35 +00:00
aiongg a9919bde85 feat: write axial pasted smooth shades
A shade whose chunk 0x5532 holds shading type 5 is written as a
PastedSmoothShade with ContentsType AxialShade: the matrix of the chunk
and the shading data with every field converted to big-endian, by the
grammar in objects.md. A shade is written when something refers to it
or the page item defaults name it, as unnamed colours are, and page
item fills that hold its UID refer to it.

compare.py (trustworthy pairs): all 891 axial shades of 12 documents
(11,574 values) and 884 more Rectangle FillColor values; none of the
2,813 shades IDML leaves out is written.
2026-10-10 07:25:17 +00:00
aiongg fd967676ee feat: write the empty Change before a source that starts with inserted text
Where an inserted change run starts at a hyperlink source's first
character and ends before the source does, IDML writes an empty Change
before the source and the first character without one; a paragraph-level
source gets a character range of its own for the deleted text and the
empty Change. The converter now writes the same 1,681 empty changes as
the trustworthy references (385 of 385 in stale pairs).

Deleted text owned by a table cell's terminating return is written as
the cell's last child. All 1,889 deleted-text changes of the trustworthy
pairs are now written.

compare.py (trustworthy pairs), together with the form fields that
follow: TextRange (element not produced) 6,062 -> 758 values,
TextRange (story text differs) 8,417 -> 3,979.
2026-10-10 07:25:03 +00:00
aiongg b34a8cdbed feat: read the attributes of XML elements
The 22 bytes after tag and content in node part 0xBF0D end with an
attribute count; each attribute is a name, a u16 and a value as text.
Nodes with attributes made their story's XML structure unreadable
("XML node of unknown layout", 108 stories in 30 pairs). The converter
writes them as XMLAttribute elements, which equal the IDML's in every
pair with attributes.

compare.py (trustworthy pairs): 213 XMLAttribute and 240 XMLElement
values more; the stale pairs gain 12,247 attributes.
2026-10-10 07:24:49 +00:00
aiongg 8e4d67b9f4 feat: read the 126-byte document setup of InDesign 7.0 and 7.5
The chunk has 16 bytes before the page size, and its fields from the
facing pages flag on are 20 bytes earlier than in the 146-byte chunk.
The page size, facing pages, intent, binding, bleeds and slugs match
the IDML in 11 of 11 pairs.

compare.py (trustworthy pairs): 135 more DocumentPreference values in
9 documents (15 attributes each), no extra value; the warning
"document preferences of 126 bytes are not known" is gone.
2026-10-10 07:24:32 +00:00
aiongg cdb1450354 feat: write the overprint of page items
OverprintFill and OverprintStroke come from attributes 0x6E6A and 0x6E67
of the item's attribute list, where the fill or stroke puts ink on the
page, compared with the object style as the fill colour is.

compare.py (trustworthy pairs): all 3,448 OverprintFill and 121
OverprintStroke values of polygons, rectangles, text frames, EPS text,
ovals and graphic lines are reproduced (0 before), with no extra value.
Coverage 97.91 % -> 97.92 %. Group overprint (313 values) is left out.
2026-10-10 07:24:13 +00:00
aiongg cbf12fbed2 feat: write user composite fonts and the paragraph border gap colour
Every composite font is written, in UID order. Chunk 0xCB02 is read as
four flagged strings, a u32, a u16 and the entry list, which ends the
chunk; the count search remains for other layouts (it took a wrong
position in one 12.1 document). Entries get RelativeSize and
BaselineShift (the first two f64), HorizontalScale and VerticalScale,
Locked from the u16 after the numbers (204 false), and no
CustomCharacters on the first entry of each font, the base font (1,434
of 1,434). Text attribute 0x1BFA is ParagraphBorderGapColor, 0 being
Swatch/None. Evidence in fonts.md and attributes.md.

compare.py --exclude own/, trustworthy pairs: 97.84 % -> 97.91 %
(+17,964 values, 0 lost on any key); CompositeFontEntry 7,306 -> 8,589
of 8,589 elements (AppliedFont 8,553: one document whose IDML names its
families in English), CompositeFont 1,434 of 1,434, TextRange
PSR.P.ParagraphBorderGapColor 0 -> 2,745 of 2,745. Extras 93,569 ->
93,520: the 49 CustomCharacters extras are gone.
2026-10-10 05:47:59 +00:00
aiongg 01261ba47a feat: decode frame fitting, object style overprint, style IDs and export settings
- Frame fitting: AutoFit 1 (true), FittingAlignment 1 (TopCenterAnchor)
  and 3 (LeftCenterAnchor). A rectangle, oval or polygon whose object
  style turns the fitting category off (0x1B960 not in chunk 0x1B92E)
  gets all seven attributes, the item's or the style's; this holds for
  the root [None] too (22 trustworthy documents, 9,560 items; none in
  the 883 others). A style with the category on writes only the item's
  values that differ. The preference FrameFittingOption writes all seven,
  0 or code 0 where the page item defaults list lacks one (1,251 of
  1,251 pairs each).
- Object style OverprintFill, OverprintStroke and OverprintGap (0x6E6A,
  0x6E67, 0x6E8B) where the colour carries ink (not None, Paper, tint 0
  or a white process colour), on every style from 21.4.
- StyleUniqueId on every paragraph and character style when 11.2 saved
  the document: the GUID after the name's string (GUID form only), else
  $ID/. A 36-character style name is no longer taken for the GUID.
- Chunk 0x28F0 parsed with its export tag maps: SplitDocument, EmitCss
  (10.1 on) and IncludeClass (13.0 on) on every text style, root styles
  and styles with tag maps included, EmitCss and IncludeClass on object
  styles; StyleExportTagMap elements. The WhenWritten values of these
  attributes are dropped from element_values.xml.

Evidence in objects.md, preferences.md and idml-values.md.

compare.py --exclude own/, trustworthy pairs: 97.60 % -> 97.84 %
(+71,229 values, 0 lost on any key); Oval/Polygon/Rectangle
FrameFittingOption AutoFit 32,300 -> 44,868 of 44,868, preference
FrameFittingOption 1,251 of 1,251 per attribute, StyleUniqueId 6,424 ->
10,047 of 10,051, ObjectStyle OverprintStroke 0 -> 1,512 of 1,512,
StyleExportTagMap 0 -> 306 of 306 elements, export flags of every
style. Extras 94,157 -> 93,569: 444 FrameFittingOption elements and 168
SplitDocument and EmitCss values gone; 24 StyleUniqueId values are new,
in five 11.4 pairs whose IDML was exported by 11.0.
2026-10-10 05:47:49 +00:00
aiongg b2cf1e2a2f fix: write percentages with every digit of the product
IDML writes a fraction attribute (HorizontalScale, VerticalScale,
AutoLeading, the spacing and glyph scaling attributes, RubyXScale,
KentenXScale) as the stored value times 100 with its binary noise, for
example 112.99999999999999. Rounding to 9 decimals matched none of the
24,055 reference values with more than 9 decimals in the trustworthy
pairs; the full product matches 23,910, and the exact matches among the
shorter values stay the same (140,887 of 142,524). Evidence in
attributes.md, percentages.

compare.py compares numbers to 6 significant digits, so its counts do
not change.
2026-10-10 05:47:35 +00:00
aiongg 1c5fa7fb58 feat: write page item stroke attributes, stroke types and drop shadow offsets
Page items get StrokeTint, GapColor, GapTint, EndCap, EndJoin, the line
ends and ArrowHeadAlignment from their attribute list (the IDs of object
styles), by the rule of the fill and stroke colour: the stored or base
value where it differs from the object style's, every value where the
style turns the category off, every value without a style. A stored tint
of 100 is written as -1 and differs from a style value of -1. Items
without a style refer to AppliedObjectStyle="n". New codes: stroke types
Dashed, Canned Dashed 4x4, Wavy, Straight Hash, Right Slant Hash, White
Diamond, ThinThick, ThickThin, ThickThinThick (one table for every list,
with the former cell-only codes), EndCap 2, EndJoin 2, four line ends and
StrokeAlignment 2 (OutsideAlignment). StrokeType and StrokeAlignment are
compared with the style too. Drop shadows get BlendMode (0x1081F),
Opacity (0x1081E), XOffset (0x1081B), YOffset (0x1081C) and Spread
(0x1084A); transparency values are compared with the style's in every
digit. Evidence in attributes.md and transparency.md.

compare.py --exclude own/, trustworthy pairs: 97.47 % -> 97.60 %
(+36,947 values, 0 lost on any key); for example GraphicLine EndCap
0 -> 5,346 of 5,346, Polygon StrokeTint 0 -> 4,352 of 4,352,
GraphicLine StrokeType 445 -> 3,715 of 3,720, DropShadowSetting XOffset
and YOffset 0 -> 580 of 580 each. Extras 94,233 -> 94,157: the 77
StrokeType and StrokeAlignment extras are gone; one polygon that stores
StrokeTint 100 has none in IDML.
2026-10-10 05:47:29 +00:00
aiongg e1286924ff fix: read four more page number styles and index topics with cross references
Section page number styles 0x4C1A SingleLeadingZeros, 0x4C13
DoubleLeadingZeros, 0x4C19 LowerLetters and 0x4C16 UpperRoman, from
pairs that had warned about them (89 sections with an IDML section, no
contradiction). Pages of these sections get names in that style; in the
page Descriptor of a SingleLeadingZeros section IDML writes the section
prefix as a string in place of the style (1,249 of 1,249 descriptors).

An index topic record ends with a u32 count of cross references, their
UIDs and a u32, not with 8 fixed bytes. 29 pairs whose topic has one
cross reference lost the whole index section with a warning; their
topics are now written. CrossReference elements are not written yet.

Also documents the colour model code 3 (mixed inks, written by IDML as
MixedInk elements) and the 104-byte object style frame settings of
InDesign 4.0 to 6.0 (no pair), which stay unconverted.

compare.py --exclude own/, trustworthy pairs: +727 values before the
descriptor rule (Section PageNumberStyle 1,257 -> 1,344 of 1,344, Page
Name 645 -> 553 wrong, 29 Topic elements), 0 lost on any key; with the
rule, the page descriptors of the subsets checked are all reproduced.
2026-10-10 03:22:50 +00:00
aiongg 10c0d36d88 feat: decode settings that vary in the larger corpus
Keys that the regeneration dropped because a few documents differ are
read from the INDD instead (evidence in objects.md and attributes.md):

- Spread PageTransitionType and PageTransitionDirection: chunk 0x2050C
  (five transition codes, four direction codes; none without it).
- Object style StrokeTint, GapColor, EndCap, EndJoin, LeftLineEnd,
  RightLineEnd and ArrowHeadAlignment: page item attribute IDs 0x6E66,
  0x6E89, 0x6E6B, 0x6E6C, 0x6E71, 0x6E72 and 0x6E84 of the style's list.
- Paragraph and character style PreviewColor: the u32 14 bytes before
  the name, 0 or an interface colour.
- Object style ApplyNextParagraphStyle (chunk 0x1B94D),
  KeyboardShortcut "0 0" (key 0 after the name in chunk 0x1B907),
  ApplyToMasterPageOnly (wrap chunk u16 at 40), and
  UseNoLineBreaksForAutoSizing (chunk 0x1B924 u16 at 140).
- AnchorXoffset and HorizontalReferencePoint of anchored object
  settings (chunk 0x2800, f64 at 16 and u16 at 42), for object styles,
  anchored frames and the preferences.

compare.py --exclude own/, trustworthy pairs: +58,048 values, 0 lost on
any key; Spread transitions 0 -> 9,509 of 9,509 each, CharacterStyle
PreviewColor 0 -> 3,154 of 3,154, the object style keys 5,550 to 5,556
of 5,556 (KeyboardShortcut 4,262 of 4,305: other keys left out).
Extras 94,249 -> 94,233.
2026-10-10 03:02:20 +00:00
aiongg 8ce6c388e7 feat: write the frame baseline grid and footnote options and the document frame defaults
Text frames get BaselineFrameGridOption from chunk 0x2834 of their
multi-column frame, and TextFrameFootnoteOptionsObject from DOM 12, both
by the category rule of TextFramePreference (all values when the
category is off or the frame has no style, else the values that differ
from the style's). FootnotesSpanAcrossColumns comes from chunk 0x22608
u16 at 2. Frames without chunk 0x2CE, or with the 22-byte chunk of 7.0,
now get their TextFramePreference. Object styles write their baseline
grid from chunk 0x1B924 at 82 (code 1 is TopOfMargin). The document's
TextFramePreference reads the column rule and footnote values of the
preferences chunks 0x22646 and 0x22608.

The 13.1 boundary of the Footnotes... values and of
MergeConsecutiveParaBorders counts as reached when the header or the
last session of the save history is 13.1: 109 pairs whose header says
13.0 have them, 93 of which a 13.1 session saved last. Evidence and
re-checked counts in objects.md, footnotes.md and idml-values.md.

compare.py --exclude own/, trustworthy pairs: +48,405 values (+43,158
for the elements, +5,247 for the 13.1 rule), 0 lost on any key.
TextFrameFootnoteOptionsObject 17,002 -> 20,096 of 20,096 on written
frames; BaselineFrameGridOption 0 -> 1,961 of 1,961; TextFramePreference
elements 48,038 -> 48,708; document column rule 0 -> 576 of 576.
Extras: the 82 FootnotesSpanAcrossColumns values are gone, 3
EnableOverrides values are new.
2026-10-10 03:01:34 +00:00
aiongg 05548275df fix: write the NextFrame and NextOddPage paragraph break types
ParagraphBreakType (0x1B6A) codes 3 and 4 are NextFrame and NextOddPage,
the codes of StartParagraph. Aligned with the character ranges of 112
pairs whose IDML has a break type other than Anywhere: 76 NextFrame
ranges in 19 trustworthy documents and 5 NextOddPage ranges in one, with
no contradiction. A chapter break that starts on an odd page now keeps
that break.

compare.py --exclude own/, trustworthy pairs: CSR.ParagraphBreakType
787 -> 847 of 847 (all pairs 869 -> 929 of 929); no extra value.
2026-10-10 03:00:45 +00:00
aiongg 10b008e77a feat: regenerate the value files over the larger corpus
tools/root_values.py collects the object styles other than [None] and
the preferences from the pairs compare.py compares, like the root
styles, instead of the part of the corpus it had first: 1,585 pairs,
1,448 distinct IDML files. tools/element_values.py reads 1,495 distinct
IDML files. The DOM 8 to 11 merge of the DOM 12 object style frame
values is gone: the file has those versions itself.

Values that vary in the larger corpus are dropped, also where only one
document differs and the converter does not read the value from the
INDD: 209 keys, most of them preferences (EPubExportPreference,
TextDefault, PageItemDefault, IndexOptions, TextPreference), object
style values (line ends, gap colour, stroke tint, anchored object and
text wrap settings, baseline frame grid before DOM 18), Spread
PageTransitionType and PageTransitionDirection, and character style
PreviewColor. Evidence in idml-values.md.

compare.py --exclude own/, trustworthy pairs: coverage 97.79 % ->
97.09 % (-212,444 values on dropped keys, +11,501 on keys whose first
version is now earlier); documents >= 99 % 514 -> 106 of 1,251; all
pairs 96.55 % -> 95.85 %. Extras 94,610 -> 94,328. Every lost value is
on a regenerated key. No new failures; story text unchanged.
2026-10-10 02:08:29 +00:00
aiongg 39e81d0247 feat: generate the root style values from the compared pairs
tools/root_values.py collects the root styles from the pairs that
compare.py compares (little-endian, same major version, without the
privately held samples): 794 distinct IDML files, DOM 7 to 21, instead
of the 88 the corpus had first. The pair rule leaves out an IDML with no
root styles beside a newer INDD and a big-endian pair. The other object
styles and the preferences stay pinned to SOURCE; their files are
unchanged. The root table style writes every mapped attribute of its
list, since the stroke weights, spacing and end tints now vary between
files and are no longer in the values file. The root object style's
varying values (named grid, optical margin size, baseline frame grid
colour, corner radii, gutter, first baseline offset) are read from the
INDD. Evidence in idml-values.md and tables.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.53 % ->
98.56 % (+2,942 values whose first DOM version is now earlier:
IncludeClass, EpubAriaRole, paragraph border options,
ParagraphKashidaWidth, shading overprint, TransformAttributeOption and
FlexLayoutAttributeOption), documents >= 99 % 278 -> 313; all pairs
96.65 % -> 96.67 %. No pair loses a reproduced value; extras unchanged
(8,968 trustworthy, 278,333 all). No new failures.
2026-10-09 19:46:58 +00:00
aiongg 7085facf9d feat: write fill, stroke and corner values that items take from the base list
Every document has one object of class 0x6E02 whose chunk 0x6E03 is a
page item attribute list. An item that does not store a fill, stroke or
corner attribute has the value of this list; IDML writes it where it
differs from the object style's effective value. When the object style
turns the attribute's category off, IDML writes the item's value even
where it equals the style's (EnableFill: fill; EnableStroke: stroke
colour; EnableStrokeAndCornerOptions: the other stroke and corner
attributes). This replaces StrokeWeight="1" for items with [None]: the
base list has 0.2835 in 125 of 606 trustworthy documents, which
explains the 0.1 mm stroke weights, and corner radii of 14.1732 in the
same documents. Groups are left out; EPS text takes no corner values.
Evidence in attributes.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.41 % ->
98.53 % (StrokeColor of rectangles, text frames, ovals, polygons and
lines 3,964 missing -> 4; StrokeWeight 256 wrong and 200 missing -> 0;
corner radii and options about 10,000 missing -> 24; fill, miter and
category-off values), documents >= 99 % 268 -> 278; all pairs 96.54 %
-> 96.65 %. Extras unchanged on trustworthy pairs (8,968); over all
pairs +93: 4 StrokeWeight values in 3 stale pairs and attributes of
items the reference does not have. No new failures.
2026-10-09 19:33:37 +00:00
aiongg 15d6af5eee feat: write the grid starting point, TOC story direction and object style optical margin
- Page GridStartingPoint from the u32 at 0 of chunk 0xCD04 (0
  TopOutside, 4 CenterVertical; other codes are in no pair and are
  left out).
- TOCStyle SetStoryDirection from the first u16 field of chunk 0x11605
  (0 Horizontal, 1 Vertical). It is no longer a WHEN_WRITTEN key of
  element_values.py (the regenerated file is unchanged).
- ObjectStyle StoryPreference OpticalMarginSize and
  OpticalMarginAlignment from the f64 at 2 and u16 at 12 of chunk
  0x285B, as in the story chunk 0x2EE.

Evidence in objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.32 % ->
98.41 % (Page GridStartingPoint 10,080 missing -> 0, TOCStyle
SetStoryDirection 620 missing -> 0, object style OpticalMarginSize 261
and OpticalMarginAlignment 4 wrong -> 0), documents >= 99 % 225 -> 268;
all pairs 96.46 % -> 96.54 %. Extras unchanged on trustworthy pairs
(8,968); over all pairs +182, the new attribute on pages of stale pairs
that the reference does not have. No new failures.
2026-10-09 18:51:48 +00:00
aiongg 29b8757ef6 feat: write the named grid of stories and object styles
Read chunk 0xCD32 of stories and object styles (u16 1 and a named grid
UID, or u16 0 for none) and write AppliedNamedGrid as the grid's Self,
or n. Evidence in objects.md, named grids.

compare.py --exclude own/, trustworthy pairs: coverage 98.16 % ->
98.32 % (Story AppliedNamedGrid 19,424 missing -> 0, ObjectStyle
AppliedNamedGrid 37 wrong -> 0), documents >= 99 % 187 -> 225; all
pairs 96.30 % -> 96.46 % (26,805 of 26,805 stories, 3,515 of 3,515
object styles). Extras unchanged (8,968), no new failures.
2026-10-09 18:37:34 +00:00
aiongg 5ee17cb100 feat: write the baseline frame grid colour and two text preferences
Write TextPreference UseCidMojikumi and UseNewVerticalScaling from
bytes 168 and 170 of preferences chunk 0x280 when they are equal (803
of 803 pairs). Write BaselineFrameGridColor in the preferences and in
every object style by an observed rule over stored data: the interface
colour of chunk 0x2834 (u32 at 20) when not 0, otherwise Charcoal if
byte 168 of chunk 0x280 is 1 and LightBlue if it is 0 (803 of 803
pairs). Evidence in preferences.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.15 % ->
98.16 % (wrong values fixed: object style colours 581, preference
colour 132, UseCidMojikumi and UseNewVerticalScaling 129 each),
documents >= 99 % 184 -> 187; all pairs 96.29 % -> 96.30 %. Extras
unchanged (8,968), no new failures or warnings, schema failures 0 on
pairs.

diff_outputs.py: 4,077 outputs differ, only in Resources/Preferences.xml
and Resources/Styles.xml: the two text preferences now come from the
INDD (order of attributes; values change where byte 168 is 1), and the
colour changes where the rule gives Charcoal.
2026-10-08 17:38:34 +00:00
aiongg a5de84e81f feat: write frame grids and the layout grid of their stories
A text frame whose multi-column frame object has chunk 0xCD41 starting
with u16 1 is a frame grid: write its GridDataInformation (grid view,
character count at the bottom, the document's character count size).
A frame grid story writes its own chunk 0xCD02 as the story's
GridDataInformation. Story FrameType already comes from chunk 0x2EE
and is unchanged. Evidence in objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.14 % ->
98.15 % (+1,600 values: 246 TextFrame and 56 Story grid elements with
all their attributes); all pairs 96.28 % -> 96.29 %, 248 of 248 frame
grids and 57 of 57 story grids. Extras unchanged (8,968), no new
failures or warnings, schema failures 0 on pairs.

diff_outputs.py: 99 outputs differ, in the spreads and stories of
documents with frame grids.
2026-10-08 17:23:05 +00:00
aiongg 7aa63682b8 feat: write layout grid sizes and named grid settings
Write PointSize, CharacterAki and LineAki of layout grids whatever
their value: the corpus now has pages and named grids with other
values, all equal to the IDML. Read the flag before the grid's font
style (1 = built-in key, $ID/). Named grids take their own chunk 0xCD02
when they have one (grids made by the user), otherwise the document's
layout grid preference, which the built-in [Page Grid] equals in 803 of
803 pairs; before, they took the pages' grid. One reader now decodes
the grid layout for pages, named grids and the preferences. Evidence
in objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.12 % ->
98.14 % (+2,418 values: page PointSize and LineAki 875 each, page
FontStyle 44, named grids +624 including 32 more elements, 47 wrong
values fixed), documents >= 99 % 182 -> 184; all pairs 96.26 % ->
96.28 %. Extras unchanged (8,968), no new failures or warnings, schema
failures 0 on pairs.

diff_outputs.py: 663 outputs differ, in the grids of pages, master
pages, named grids and the two grid preferences.
2026-10-08 17:08:10 +00:00
aiongg a958e55d82 feat: write PrimaryTextFrame of master spreads
Read master spread chunk 0x140A (u32 story) and write PrimaryTextFrame
as the last MasterSpread attribute from DOM 8: n without a story,
otherwise the spread's text frame of that story that has no previous
frame. Evidence in objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.11 % ->
98.12 % (MasterSpread PrimaryTextFrame 0 -> 1,025 of 1,025), documents
>= 99 % 179 -> 182; all pairs 96.25 % -> 96.26 %, 1,521 of 1,521
values. Trustworthy extras unchanged (8,968); over all pairs +9, one
attribute on each of 9 master spreads that the stale IDMLs lack. No new
failures or warnings, schema failures 0 on pairs.

diff_outputs.py: 3,620 outputs differ, only in MasterSpreads/*.
2026-10-08 16:43:09 +00:00
aiongg 3a8718d9db fix: accept any second byte in searched in-object strings
The byte after the string tag is a script code in some strings, not
always 0. Read a layer name at offset 19 of chunk 0x304 when the tag is
there, accept any second byte in find_string and in the style GUID
pattern. Evidence in objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.10 % ->
98.11 % (+912 values): Layer Name 188 wrong -> 0, StyleUniqueId +479
paragraph and +245 character styles, 4 more styles whose IDML GUID
differs from the stored one (a known kind). All pairs 96.24 % ->
96.25 %. Extras unchanged (8,968), no new failures or warnings, schema
failures 0 on pairs.

diff_outputs.py: 383 outputs differ: 455 layer names that were empty
now have their name (346 files), and 1,538 styles gain StyleUniqueId.
No other change.
2026-10-08 16:27:10 +00:00
aiongg c43a16815b feat: write custom mojikumi tables
Read class 0x4203 (name in chunk 0x100B, settings in chunk 0x420A) and
write each as a MojikumiTable with BasedOnMojikumiSet and its
OverrideMojikumiAkiList, together with the built-in mojikumi tables in
UID order. Mojikumi references to these tables become
MojikumiTable/<name> objects. Evidence in objects.md: 185 of 185 tables
and 62,439 of 62,439 entries over all pairs.

compare.py --exclude own/, trustworthy pairs: coverage 98.09 % ->
98.10 % (+1,193 values: 97 tables, 576 paragraph ranges, 105 paragraph
styles, 94 cell ranges, 19 story ranges, 11 text defaults); all pairs
96.23 % -> 96.24 %. No wrong values, extras unchanged (8,968), no new
failures or warnings, schema failures 0 on pairs.

diff_outputs.py: 132 outputs differ, all files with custom mojikumi
tables (designmap.xml, and the styles and stories that refer to them).
2026-10-08 16:09:58 +00:00
aiongg 53fff7650f feat: write ruby, kenten and warichu attributes
Map 14 more text attribute IDs (ruby alignment, spacing, overhang,
position, offset, scaling, auto align, tate-chu-yoko digits, X scales,
font styles; warichu on/off, lines, size, line spacing, alignment), add
KinsokuHangType code 1 and KentenKind code 5, and skip the ruby strand
(run kind 0x420D), a copy that IDML does not use. Evidence in
attributes.md and objects.md.

compare.py --exclude own/, trustworthy pairs: coverage 98.07 % ->
98.09 % (+3,312 values), documents >= 99 % 176 -> 179; all pairs
96.21 % -> 96.23 %. No wrong values among the new ones, extras
unchanged (8,968), no new failures, schema failures 0 on pairs.

diff_outputs.py: 4,433 outputs differ. In 4,083 only the order of
attributes changes: root styles and text defaults now take these values
from the INDD instead of the observed values. The other 350 gain the
attributes on ranges and styles.
2026-10-08 15:50:08 +00:00
aiongg 2541186464 docs: correct the kinds of LAB colours in the corpus 2026-10-08 15:06:27 +00:00
aiongg 236ab10dea docs: add the LAB and HSB spaces to the colour value chunk 2026-10-08 15:06:13 +00:00
aiongg a0da69e463 feat: write outer and inner glow, isolate blending and more blend modes
Add the transparency attribute IDs of the outer glow (applied, blend
mode, opacity, colour, spread, size), the inner glow (applied, blend
mode, size), isolate blending and the fill opacity, and every blend
mode code as its position in the schema's enumeration (codes 2, 4, 5,
7, 14 and 15 are seen besides 0, 1, 3 and 9).

compare.py --exclude own/:
- trustworthy 98.06% -> 98.07% (+1,055 values: OuterGlowSetting of
  text frames 108 of 108, of rectangles 56 of 56; BlendMode of
  rectangles 271 -> 337 of 337)
- all pairs 96.21% (+1,247)
- extra values unchanged (8,968; all pairs 277,399)
2026-10-08 15:05:23 +00:00
aiongg b83a11c923 fix: number bullets in hexadecimal
IDML writes the index in the Self of ABullet in hexadecimal
(dABullet9, dABulleta); the converter wrote it in decimal from the
tenth bullet on.

compare.py --exclude own/: trustworthy 98.06% (+25 values, ABullet
3,365 of 3,365); extra values 8,993 -> 8,968.
2026-10-08 14:57:59 +00:00
aiongg 58ccd9970e feat: write the gradient that the page item defaults name
Chunk 0x6E06 of the page item defaults object names an object of class
0x5533, a gradient and a colour. IDML writes that gradient in every
document even when nothing refers to it. The converter now treats the
swatches of the chunk as named by the page item defaults, as it does
for the entries of the two tables around the attribute list.

compare.py --exclude own/:
- trustworthy 98.05% -> 98.06% (+413 values: Gradient 756 -> 783 of
  783 elements, with their stops)
- all pairs 96.20% (+815)
- extra values unchanged (8,993; all pairs 277,424)
2026-10-08 14:53:44 +00:00
aiongg 1844a83671 fix: leave out spread guides outside the spread's pages
IDML leaves out a guide owned by the spread when it lies outside the
bounding box of the spread's pages (84 of 85 such guides in the
trustworthy pairs measured before; all spread guides inside and all
page guides are written). The one exception, on a master spread, is
lost.

compare.py --exclude own/:
- trustworthy 98.05% (-12 values: the exception guide)
- extra values 10,001 -> 8,993 (no extra Guide left in trustworthy
  pairs); all pairs 279,404 -> 277,424 (-48 values)
2026-10-08 14:46:42 +00:00
aiongg dccfc4a5ce feat: convert placed InDesign pages
Read class 0x6607 (a page of another InDesign document placed in a
frame) as a placed graphic and write it as ImportedPage: PageNumber
(chunk 0x2505 u32 + 1), the attributes of placed graphics,
GraphicBounds, the text wrap and the link. ImportedPageCrop, the XMP
packet and the PDF-style children are not decoded and left out.

compare.py --exclude own/:
- trustworthy 97.91% -> 97.92% (+1,475 values; ImportedPage 38 of
  38 with transform, bounds and page number, and their links)
- all pairs 96.02% -> 96.03%; 9 more links resolved to another file
  at export (45 values leave the counts)
- extra values unchanged
- compare.py --all with schemas: 0 conversion and 0 schema failures
  on pairs; outputs without a reference: the same 11 endnote-markup
  files
2026-10-08 14:24:50 +00:00
aiongg 1842f3568d feat: convert text on a path
Chunk 0xB30A of a shape or frame names its text path object (class
0xB320) and holds the flip, the start and end brackets and three codes.
The text path's multi-column frame holds a column of class 0xB318 that
gives the story and the thread, as for text frames. The converter
writes TextPath right after the item's Properties.

compare.py --exclude own/:
- trustworthy 97.90% -> 97.91% (+396 values; TextPath 36 of 36)
- all pairs 96.02% (+462; 42 of 42 with an INDD object)
- extra values unchanged in trustworthy pairs; all pairs +153: text
  paths in 2 stale pairs whose IDML does not have them
2026-10-08 14:09:49 +00:00
aiongg 83a6a7137a feat: convert EPS text
Read class 0x660B (text kept from a placed EPS or PDF graphic) as a
page item and write it as EPSText: ItemTransform, PathBoundingBox
(chunk 0x154), EPSTextData (chunk 0x6611 in big-endian order without
two tail fields, base64), EPSTextAttributeBounds (chunk 0x6612) and
the text wrap. element_values.py collects the EPSText values every
element has.

compare.py --exclude own/:
- trustworthy 97.72% -> 97.90% (+22,108 values; EPSText 633 of 633
  elements, with transform, bounds, text data and text wrap all equal)
- all pairs 95.89% -> 96.02%
- extra values unchanged in trustworthy pairs (26,256); all pairs
  304,533 -> 305,985: 1 stale pair whose IDML lacks its EPS text
- not yet reproduced: EPSText StrokeType (634), OverprintFill (33),
  StrokeDashAndGap (7)
2026-10-08 14:02:35 +00:00
aiongg 0a01b3c6d4 fix: write numbers as IDML does at every length
num() rounded ties to even only at 17 significant digits. IDML takes
the decimal nearest to the exact value at the shortest length, with
ties to even, at any length, and writes numbers below 1e-4 with an
exponent (1e-05). The rule gives the IDML text for all but 67 of the
1,090,937 distinct numeric texts of the reference IDMLs (those 67 are
text values).

diff_outputs.py: 2,672 outputs differ, no change in failures or
warnings.

compare.py --exclude own/:
- trustworthy 97.72% (+77 values): PDF GraphicBounds 849 -> 913 of
  913, EPS 323 -> 329, SVG 140 -> 146
- all pairs +99 values: PDF, EPS and SVG GraphicBounds all equal
- extra values unchanged
2026-10-08 13:51:34 +00:00
aiongg d2ad1e611a fix: read font families that refer to another family
Record kind 2 of chunk 0x3E05 is u8 2, u8 0, the u32 UID of another
font family and a u16 count of font entries. The converter read it as
a family record and left the fonts out with a warning ("string tag 5
at 3, expected 2" and similar), in 14 Japanese pairs and 5 other files.

IDML writes a family with a count of 0 as a copy of the family it
refers to, with FontType="Unknown", Version="" and TypekitID="$ID/"
(15 of 15 pairs). The converter now does the same. For a record with
entries (4 families in 2 files, no IDML) it keeps the name and leaves
the fonts out with a warning.

compare.py --exclude own/:
- trustworthy 97.72% (+234 values: 16 fonts, FontFamily Name 15,
  AppliedFont of styles and text 11); all pairs 95.89% (+234)
- extra values unchanged (26,256; all pairs 304,533)
2026-10-08 13:42:42 +00:00
aiongg e792768818 fix: read the composite font of InDesign 3.0 files
In InDesign 3.0 files chunk 0xCB02 starts with four zero bytes before
the flagged name (9 of 9 distinct 3.0 files, both byte orders). The
converter left the composite font out with a warning ("string tag 0
at 1, expected 2"); it now reads the name after the four bytes when it
does not parse at 0. The 3.0 files convert without that warning.

No pair is from 3.0: compare.py --exclude own/ is unchanged
(trustworthy 97.72%, all pairs 95.89%).
2026-10-08 13:42:42 +00:00
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