8 Commits
Author SHA1 Message Date
aiongg 0a27d17fce feat: write the transparency of object styles 2026-10-11 04:36:33 +00:00
aiongg a299387eb0 feat: decode page item, preference and resource values
Page items:
- drop shadow KnockedOut (0x1EB6F), true where neither item nor style
  stores it
- text wrap: the u32 at 40 of 0x3703 is the master page flag and the
  wrap side (two u16, as the big-endian pair shows)
- groups get the fill, stroke and corner values all their children have
- dashes (0x5A35: list and corner code) on items whose stroke type in
  effect is Dashed
- BeforeGroupingLayerPosition (0x324) from 21.4; export SizeType
  (0x1E22B); no generated alt text attributes on groups
- anchored settings on items inside anchored items
- IgnoreWrap false without the chunk, MinimumFirstBaselineOffset 0 by
  the baseline category, InsetSpacing before DOM 11 by the general
  category; EPS contents from 0x8C23
- custom striped and dashed stroke styles (classes 0xB016, 0x5A43) and
  StrokeType code 0x5A42

Preferences: column direction (0x555, else the story orientation),
optical margin size by the text size unit, highlight flags false without
their chunk, grid and gutter defaults and print marks by the edition
code, watermark font by the assignment name, EPUB ViewDocumentAfterExport
for DOM 8 and 9, HTMLFXLExportPreference from DOM 10.1, MathML document
values from DOM 20, index header type by variant name, three more
built-in kinsoku and mojikumi tables.

Resources and text: the saving edition from the XMP black name (tints
of black, unknown users, endnote and index titles, endnote marker), TOC
style entries, PageNumberType (0x1B09), CustomGlyph (0x1B5E), alignment
codes of 0x4266, 0x1B3E and 0xB676, spot colour alias and DOM 8 section
pagination (observed values), text variable settings and result texts,
object styles' AppliedParagraphStyle without a chunk and flex spacing,
stories of frames anchored in the XML backing story.

Fixes: flattener resolutions of 0x10833 were swapped; colour group Self
follows the DOM version.

compare.py, trustworthy pairs: value coverage 98.96 % -> 99.48 %
(+150,288 values), documents >= 99 % 914 -> 1,021, story text 37,129 ->
37,147 of 37,150 (0 missing), extras 92,838 -> 92,883 (+788 from the
KnockedOut and group-corner exceptions, -744 from fixed extras). No pair
loses values against f21267f. diff_outputs.py: 5,743 of 5,765 outputs
differ, no failure or warning differs.
2026-10-10 18:34:10 +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 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 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 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 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 ccda8898e9 feat: convert page item transparency: opacity, blend mode and effects 2026-10-06 23:55:15 +00:00