NumberingRestartPolicies (0x1A41E) is three u32; the two triples seen
in the corpus are written. KeyboardDirection code 1 is
LeftToRightDirection. IDML writes AllNestedStyles only when the list
has items, on every style. The root value test checks values that the
observed root values still hold.
IDML writes a style's text attributes in ascending attribute ID order.
The IDs between known ones, with their payload types, place 79 more
attributes: ruby, kenten, tatechuyoko and warichu settings, OpenType
features, gap tints and colours, overprint flags, paragraph border
options and others. Styles and text runs write them wherever they are
stored; the root style values come from the INDD instead of the
observed values.
- BeforeGroupingLayerReference from the u32 at 0 of chunk 0x324, a
spread layer resolved to its layer.
- TableStyle CaptionPosition from DOM 21.5: attribute 0x1047D = 1 gives
BeforeTable, absent gives AfterTable.
- AIGeneratedAltText, AltTextGenerationError and AltTextCropSyncRect of
page items from chunks 0x1E262, 0x1E260 and 0x1E261.
- The Name of a nested style group is its full path joined by ':'.
An image without a link whose chunk 0x8C23 is 0 or absent keeps its
file in its preview (0x170D -> class 0x1708 -> 0x119 -> raw data
object). Images of InDesign 2.0 to 5.0 whose chunk 0x8C1B names a class
0x8C01 object keep the preview as a preview.
`read_previews` also collects the page items of graphic table cells and
the items of form field states, which the package holds as well. Over
the open corpus this adds previews for 657 graphics in cells and 385 in
states; every cell graphic without `Contents` has one. Items anchored in
cell text were already in the story anchors.
A preview chain that can't be read gives no preview instead of failing
the graphic, and with it the conversion.
The README and ARCHITECTURE.md say that every conversion looks up each
graphic's preview object; only `convert` reads the preview data.
`indd::convert` now returns `Conversion::previews`: InDesign's screen
preview (chunk 0x170D -> class 0x1708 -> chunk 0x119 -> raw data) of each
placed graphic without `Contents`, one entry per preview file with the
`Self` of every graphic that uses it. IDML has no place for a preview, so
the package is unchanged; an application can show the preview when it
cannot read a linked file. `convert_into` and `indd audit` do not read
previews.
Output: `diff_outputs.py --exclude own/` over 23 files (the fixtures and
part of the open corpus): 0 differing outputs, 0 changed warnings or
failures.
Stories and XML stories get the Ai* attributes from DOM 21.5; links the
Ai* attributes from 21.5 and SourceObjectName from 21.4; every typed
ContourOption the four contour parameters from 21.4; object styles
EpubAriaLabel and EpubAriaLabelSourceType from 21.2; designmap.xml
Html5ExportPreference from 21.1. LockPosition and AnchorSpaceAbove go on
every AnchoredObjectSetting with all ten settings, polygons included,
in place of the per-tag WhenWritten blocks.
Chunk 0x2C1A gives the clipping type (None, DetectEdges, AlphaChannel,
PhotoshopPath) and a flags byte (high-resolution image, invert and
restrict to frame). Graphics of types 1 to 3 write their chunk 0x162B
paths as ClippingPathGeometry; PhotoshopPath names come from key 0x7D
of the image properties when ASCII, AlphaChannel names from chunk
0x177C. Placed pages get the element with the values of graphics
without the chunk.
Chunk 0x808 of the preferences is the ruler origin (0 spread, 1 page,
2 spine). With PageOrigin a page guide is measured from its own page,
with SpineOrigin a vertical guide on a two-page spread from the spine.
The difference is taken after adding the spread's translation, which
gives IDML's 0 for guides on the origin.
A story without chunk 0x2EE has OpticalMarginSize 9.2125984251969 (13 Q)
when the text size unit is Q, and 12 otherwise: 33,351 of 33,351
stories of the trustworthy pairs. The preferences' size of new frames
does not give it (3 pairs differ).
Section chunk 0x4C02 stores IncludeSectionPrefix as a u16 after a u16 0.
The section Name is its prefix; pages of a section that includes the
prefix are named with it. The first section starts at its stored start
even when it continues numbering, and the page descriptor writes a
return in the marker as U+2029.
IDML starts a ParagraphStyleRange at every paragraph-style run record,
also between neighbouring records with equal formatting. Document the
rule and the paragraph length list of the records in objects.md, and
the remaining splits inside one record in unknowns.md.
An element whose start marker and last character lie in different
paragraph ranges wraps the paragraph ranges, which split after its start
marker and at its end marker; one within a paragraph range whose markers
lie in different character ranges wraps character ranges. Start markers
sit in a character range of the parent and end markers in none. Before
version 11 an element with a story as content ends its character range.
Elements are no longer left out when they span paragraphs.
A grid position's 0x10469 record names a graphic cell object (class
0x1046B, u32 at byte 70 of its first value) whose chunk 0x10466 lists
the cell's page items. Write them inside the Cell like nested items.
A plain rectangle has exactly four straight points along the axes. Other
frames take the one number from offset 0 of chunk 0x3723, whatever their
four insets, and before DOM 11 always have InsetSpacing.
Every ContourOption has ContourPathName: `$ID/`, or for an AlphaChannel
contour the first channel name of image chunk 0x177C. Frames take their
graphic's name; frames whose object style turns the text wrap category
on get a ContourOption with only the name. Object styles write `$ID/`.
A wrap path object (class 0x3702) flagged custom in chunk 0x3709 has its
0x162B paths written as TextWrapPreference/Properties/PathGeometry, before
TextWrapOffset.
Decode the 29-byte contour chunk (0x373D on placed graphics, 0x373F in
the preferences, 0x3777 on object styles): u32 contour type at 0 and
IncludeInsideEdges at 17. Graphics without the chunk take the
preferences' contour, else SameAsClipping; a frame with one graphic
takes its graphic's contour unless its object style turns the text wrap
category on; object styles without the chunk have SameAsClipping.
Over the trustworthy pairs every ContourType and IncludeInsideEdges the
converter writes equals the reference (graphics 9,535, frames 8,965,
object styles 5,556, preferences 1,251); 14 graphics get a ContourType
the reference leaves out.
kMojikumiDefaultName10 is LineEndAllOneEmEnum: the BasedOnMojikumiSet of
7 custom mojikumi tables in 7 trustworthy pairs (code 10).
kMojikumiDefaultName14 is LineEndPeriodOneEmEnum: the Mojikumi of one
paragraph range in one trustworthy pair. Codes 3, 5, 6, 9 and 11 have
no pair and stay unwritten (docs/format/unknowns.md).
compare.py --exclude own/: trustworthy values reproduced 28,699,017 ->
28,699,026 (+7 BasedOnMojikumiSet, +2 Mojikumi); coverage 99.484 % ->
99.485 %; extras 92,883 unchanged; no pair loses values.
Text attribute 0x42AE (value type 0x42DF) holds the OpenType feature of
a glyph chosen from its alternates: u16 count, then per feature four tag
bytes and a u32 number. IDML writes it as Properties/OpenTypeFeatures,
a list of [$ID/<tag>, number]. The converter writes values with one
feature and leaves out the empty lists that styles store.
Evidence (docs/format/attributes.md, alternate glyphs): 127 of 127 runs
in the trustworthy pairs, 11 tags; tag byte order checked on 7
big-endian files.
compare.py --exclude own/: trustworthy values reproduced 28,698,890 ->
28,699,017 (+127, all CSR.P.OpenTypeFeatures gaps); extras 92,883
unchanged; no pair loses values; 0 conversion failures.
Leaves out details of the column direction exceptions and the chunk size that were not measured, and updates the counts of the open items from the current comparison.
The u32 read as Level is a u16 level and a u16 that is 0 in every entry
of the pairs and 1 in some entries of files without one, where the u32
gave levels such as 65537 that the schema does not allow. Outputs of the
pairs do not change.
docs/format/unknowns.md lists what is not decoded after the next-gaps work, with the reason (no field found, never varies, no pair, not explained, not needed) and the page that describes the rest of each item.
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.
Inserted text over several text runs is written as a child of its
paragraph range, or of the story when it spans paragraph ranges, with
the ranges split at its ends, instead of one Change per character range.
A character-level hyperlink source whose whole extent is inserted text
is written inside the Change. Changes over tables, anchored items or
XML markers, and changes that do not nest with a paragraph-level
source, keep the per-range form.
compare.py, trustworthy pairs: 3,960 of the 3,962 reference Change
elements have an equal one in the output (3,969 written);
HyperlinkTextSource/Change extras fall from 220 values in 10 documents
to 0; 13 more text range starts. Only stories with tracked changes or
sources in changes differ in the output.
A text attribute list that stores an empty FontStyle is written with the
style of its AppliedFont family's Regular font, or of the family's first
font if it has no Regular one.
compare.py --exclude own/, trustworthy pairs: ParagraphStyle FontStyle
4,017 -> 4,080/4,086, CharacterStyle 1,310 -> 1,334/1,345, TextDefault
1,240 -> 1,250/1,251, text ranges 76,473 -> 76,619/76,652. No value
that matched before changes; no extra values.
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.
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.
- 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.
- 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.
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.
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.
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.
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).
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.
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.
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).