mirror of
https://github.com/storytold/indd-utils.git
synced 2026-11-20 17:20:49 +01:00
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).
533 lines
27 KiB
Markdown
533 lines
27 KiB
Markdown
# Values written from IDML observation
|
||
|
||
Some values the converter writes do not come from the INDD file. They are
|
||
values that every IDML exported by InDesign in the corpus has, on the
|
||
root styles and in the preferences. They are
|
||
facts about InDesign's IDML output, not about the INDD format, and the
|
||
evidence is the corpus IDML files alone.
|
||
|
||
Why they are written: IDML consumers apply their own defaults to
|
||
attributes that are missing. When those defaults differ from InDesign's,
|
||
the layout differs. For example, a consumer that defaults to keeping all
|
||
lines of a paragraph together breaks pages differently from a document
|
||
whose root style says `KeepAllLinesTogether="false"`.
|
||
|
||
## Root style values
|
||
|
||
The root styles are `[No paragraph style]`, `[No character style]`, the
|
||
object style `[None]`, the cell style `[None]` and the table style
|
||
`[No table style]`. Every corpus IDML has all five.
|
||
|
||
`tools/root_values.py` reads `Resources/Styles.xml` of every corpus IDML
|
||
and collects each attribute of the root styles, each `Properties` child,
|
||
and each attribute of their child elements (for example
|
||
`TextFramePreference` in the object style). It keeps a value when:
|
||
|
||
- every IDML from some DOM version on has it, with the same value, and
|
||
- the converter does not read it from the INDD.
|
||
|
||
The kept values are in `src/idml/root_values.xml`, generated by that
|
||
tool. The converter writes them on its root styles. A value the
|
||
converter reads from the INDD takes precedence: for the paragraph and
|
||
character root styles, attributes in the text attribute table
|
||
(`attributes.md`) are left out of the file, and any attribute the INDD
|
||
supplies is written from the INDD.
|
||
|
||
The files were generated from the 240 INDD files with an IDML that the
|
||
corpus had then (`SOURCE` in the tool), which are 88 distinct IDML
|
||
files. Their DOM versions are 7 (1 file), 12 (7 files) and 15 to 20 (80
|
||
files). Values that first appear after DOM 7 are written only for
|
||
documents of that InDesign version or later (`MinimumVersion` in the
|
||
file). The corpus has grown since; the later pairs are evidence for the
|
||
values of other elements (below). Regenerating these files from all pairs
|
||
would drop some values that the larger corpus shows to vary between
|
||
documents, such as table style stroke weights.
|
||
|
||
| Root style | Values | Same in | Written for version |
|
||
|---|---|---|---|
|
||
| `[No paragraph style]` | 180 | 88 of 88 files | all |
|
||
| | 14 | 87 of 87 files with DOM 12 or later | 12 and later |
|
||
| | 30 | 80 of 80 files with DOM 15 or later | 15 and later |
|
||
| `[No character style]` | 1 | 88 of 88 | all |
|
||
| | 2 | 87 of 87 (DOM 12 or later) | 12 and later |
|
||
| | 2 | 80 of 80 (DOM 15 or later) | 15 and later |
|
||
| Object style `[None]` | 75 | 88 of 88 | all |
|
||
| | 43 | 87 of 87 (DOM 12 or later) | 12 and later |
|
||
| | 16 | 80 of 80 (DOM 15 or later) | 15 and later |
|
||
| Cell style `[None]` | 1 | 88 of 88 | all |
|
||
| Table style `[No table style]` | 105 | 88 of 88 | all |
|
||
| | 10 | 87 of 87 (DOM 12 or later) | 12 and later |
|
||
|
||
Among them are the keep settings of `[No paragraph style]`:
|
||
`KeepAllLinesTogether="false"`, `KeepFirstLines="2"`, `KeepLastLines="2"`,
|
||
`KeepWithNext="0"` and `KeepWithPrevious="false"`, in 88 of 88 files.
|
||
|
||
**Left out because they vary between files:**
|
||
|
||
- `[No paragraph style]`: `DiacriticPosition`, `KinsokuSet`, `Mojikumi`,
|
||
`StyleUniqueId`, `TreatIdeographicSpaceAsSpace`, and the eight corner
|
||
radii of paragraph borders and shading (12 or 1).
|
||
- `[No character style]`: `StyleUniqueId`.
|
||
- Object style `[None]`: `FrameFittingOption/FittingAlignment`,
|
||
`StoryPreference/StoryDirection`,
|
||
`TextFramePreference/ColumnRuleStrokeColor` and
|
||
`TextFramePreference/ColumnRuleStrokeWidth`.
|
||
|
||
**Left out because the converter reads them from the INDD:** 85
|
||
attributes of `[No paragraph style]`, listed in `attributes.md`. Some of
|
||
these are also the same in every IDML; the INDD value is written. In
|
||
every compared pair the converted root styles have all of them.
|
||
|
||
The object, cell and table root styles get only observed values: the
|
||
converter reads no attributes of these styles from the INDD yet. The cell
|
||
and table root styles are written as new elements in
|
||
`RootCellStyleGroup` and `RootTableStyleGroup`.
|
||
|
||
## Document attributes
|
||
|
||
`AccurateLABSpots="false"` is on the `Document` element of all 654
|
||
corpus pairs' IDML files. The converter writes it. The colour settings
|
||
next to it are read from the INDD (`preferences.md`).
|
||
|
||
`Name` (the package's file name) is on the `Document` element from DOM
|
||
13 only: 321 of 321 trustworthy references from DOM 13, 0 of 168 before.
|
||
|
||
## Default numbering list
|
||
|
||
The root paragraph style refers to `NumberingList/$ID/[Default]`. All 240
|
||
corpus IDML files have this element in `designmap.xml`, with the same
|
||
attributes: `Name="$ID/[Default]"`,
|
||
`ContinueNumbersAcrossStories="false"` and
|
||
`ContinueNumbersAcrossDocuments="false"`. The converter writes it after
|
||
`idPkg:Styles`, where the IDML schema puts it.
|
||
|
||
## Built-in stroke styles
|
||
|
||
All 240 corpus IDML files list the same 18 `StrokeStyle` elements in
|
||
`Resources/Graphic.xml`, in the same order, each with only `Self` and
|
||
`Name` (`StrokeStyle/$ID/Solid`, `$ID/Solid`, and so on). The converter
|
||
writes the same list, so every `StrokeType` it writes refers to an
|
||
element in the package.
|
||
|
||
## Story values
|
||
|
||
Every `Story` element in the 240 corpus IDML files (2,094 stories) has
|
||
these values, which the converter writes on every story. No INDD field
|
||
for them is identified; the story objects examined have no attributes in
|
||
their attribute list (chunk 0x23F, always empty), and no story chunk has
|
||
a value that varies with them.
|
||
|
||
| Element | Values | Same in |
|
||
|---|---|---|
|
||
| `Story` | `TrackChanges="false"`, `StoryTitle="$ID/"`, `AppliedNamedGrid="n"` | 2,094 of 2,094 |
|
||
| `Story` | `UserText="true"` | 2,090 of 2,090 with DOM 12 or later (written for version 12 and later) |
|
||
| `Story` | `IsEndnoteStory="false"` | 1,514 of 1,514 with DOM 15 or later (written for version 15 and later) |
|
||
| `StoryPreference` | `OpticalMarginAlignment="false"`, `OpticalMarginSize="12"`, `FrameType="TextFrameType"`, `StoryOrientation="Horizontal"`, `StoryDirection="LeftToRightDirection"` | 2,094 of 2,094 |
|
||
| `InCopyExportOption` | `IncludeGraphicProxies="true"`, `IncludeAllResources="false"` | 2,094 of 2,094 |
|
||
|
||
`StoryPreference` and `InCopyExportOption` are the first two children of
|
||
every story, in that order, as the IDML schema puts them. Optical margin
|
||
alignment is off in every corpus story, so the field that turns it on is
|
||
not known and a document that uses it is converted without it.
|
||
`AppliedTOCStyle` is left out: it names a TOC style in 4 stories.
|
||
|
||
`StoryOrientation` is read from the story's frames when they agree
|
||
(`objects.md`, text orientation); the observed `Horizontal` is written
|
||
only for other stories. For a sample typeset vertically, no field was
|
||
found that sets `StoryDirection` or `FrameType` apart from horizontal
|
||
samples, so these keep the observed values there too. Its object styles
|
||
store direction code 1, as horizontal samples do.
|
||
|
||
## Graphic settings without an INDD field
|
||
|
||
All 496 `Image` elements in the 240 corpus IDML files (119 files) have
|
||
`ClippingPathSettings` with `InvertPath="false"`,
|
||
`IncludeInsideEdges="false"`, `RestrictToFrame="false"` and
|
||
`AppliedPathName="$ID/"`, and `ImageIOPreference` with
|
||
`AllowAutoEmbedding="true"`. The 386 PDF and 49 EPS graphics with
|
||
`ClippingPathSettings` have the same four values. The converter writes
|
||
them (`objects.md`, clipping path settings).
|
||
|
||
Over the 5,131 graphics of the trustworthy pairs, every graphic has
|
||
`LocalDisplaySetting="Default"`; every image (3,607)
|
||
`ImageRenderingIntent="UseColorSettings"`; every PDF and EPS (1,339)
|
||
`GrayVectorPolicy="IgnoreAll"`; every SVG (146) `UseSVGAs="EmbedCode"`.
|
||
From DOM 21 every image, PDF and SVG has `FlexItemWidthMode="FlexFixed"`
|
||
and `FlexItemHeightMode="FlexFixed"` (81 of 81), and SVG graphics from
|
||
21.2 have `IsMathMLObject="false"` (4 of 4). The constant values of
|
||
graphic layers are in `objects.md` (graphic layers). The converter
|
||
writes all of these.
|
||
|
||
## Links
|
||
|
||
These `Link` values are the same in all 4,699 links of the trustworthy
|
||
pairs, and the converter writes them on every link: `AssetURL="$ID/"`,
|
||
`AssetID="$ID/"`, `LinkClassID="35906"` (0x8C42, the class of links),
|
||
`LinkClientID="257"` (the u32 at offset 4 of chunk 0x8C9B is 0x101 in
|
||
every link), `LinkObjectModified="false"`, `CanEmbed="true"`,
|
||
`CanUnembed="true"`, `CanPackage="true"`, `ImportPolicy="NoAutoImport"`
|
||
and `ExportPolicy="NoAutoExport"`. `RenditionData="Actual"` is on every
|
||
link from DOM 13 on (3,043 of 3,043) and on none before (1,656 of
|
||
1,656); the converter writes it from version 13.
|
||
|
||
## Object styles other than the root
|
||
|
||
`tools/root_values.py` also collects the object styles other than
|
||
`[None]`: 295 styles in the 88 distinct IDML files, every file having at
|
||
least one. A value is kept when every such style of every IDML from some
|
||
DOM version on has it, with the same value, and at least 10 files show
|
||
it. The kept values are in `src/idml/object_style_values.xml`. The
|
||
converter writes them on every object style other than `[None]`, and
|
||
writes the values it reads from the INDD (`objects.md`, object style
|
||
settings) in their place.
|
||
|
||
| Values | Same in | Written for version |
|
||
|---|---|---|
|
||
| 80 | 88 of 88 files | all |
|
||
| 40 | 87 of 87 files with DOM 12 or later | 12 and later |
|
||
| 14 | 80 of 80 files with DOM 15 or later | 15 and later |
|
||
| 1 | 74 of 74 files with DOM 18 or later | 18 and later |
|
||
|
||
Among them are the nine `Enable…` effect flags other than
|
||
`EnableTransparency` in the four `ObjectStyle…EffectsCategorySettings`
|
||
elements (all `true`), all of `BaselineFrameGridOption`,
|
||
`ObjectExportOption` and `TransformAttributeOption`, and
|
||
`ApplyNextParagraphStyle="false"` and `EnableParagraphStyle="false"`.
|
||
|
||
**Left out because they vary or are not in every style** (59): the
|
||
fill, stroke and corner values, most `Enable…` attributes,
|
||
`AnchoredObjectSetting` `PinPosition`, `AnchorPoint` and
|
||
`VerticalAlignment`, the frame fitting values, the story frame type,
|
||
orientation and direction, the text wrap mode and contour type, the
|
||
column, inset, footnote and column rule values of
|
||
`TextFramePreference`, and `EnableTransparency`. The converter reads
|
||
many of these from the INDD. Values that only the 2 files with DOM 20
|
||
have (18) are left out as for the preferences.
|
||
|
||
The `TextFramePreference` values that the file lists from DOM 12
|
||
(`UseFlexibleColumnWidth="false"`, `TextColumnMaxWidth="0"`,
|
||
`UseNoLineBreaksForAutoSizing="false"` and the auto-sizing values) are
|
||
on every object style from DOM 8: 607 of 607 styles of DOM 8 to 11 in
|
||
the trustworthy pairs, `[None]` included, and none of the 28 of DOM 7
|
||
(the file's source had no DOM 8 to 11 files). The converter writes them
|
||
from DOM 8; the auto-sizing values it reads from the INDD take
|
||
precedence.
|
||
|
||
`TextFramePreference` `FootnotesEnableOverrides="false"` is on every
|
||
object style, `[None]` included, from InDesign 13.1 (INDD header
|
||
version): 1,392 of 1,392 styles of the trustworthy pairs, none before.
|
||
The value file has it only from DOM 15, since it is generated per major
|
||
version; the converter writes it from 13.1.
|
||
|
||
## Composite font entries
|
||
|
||
`Locked="true"` is in all 1,440 `CompositeFontEntry` elements of the
|
||
240 corpus IDML files. No INDD field for it is identified; the converter
|
||
writes it on every entry (`fonts.md`).
|
||
|
||
## Inks
|
||
|
||
All 973 `Ink` elements of the 240 corpus IDML files have
|
||
`InkType="Normal"`, `PrintInk="true"` and `ConvertToProcess="false"`.
|
||
No INDD field for them is identified; the converter writes them on every
|
||
ink (`objects.md`).
|
||
|
||
## Values of other elements
|
||
|
||
`tools/element_values.py` collects the values of other elements the
|
||
converter writes from every distinct IDML of the corpus (683 files
|
||
exported by InDesign; one more IDML in the corpus lacks the `product` of
|
||
InDesign's `aid` processing instruction and was written by a script, so
|
||
it is left out). A value is kept for a range of DOM versions when every
|
||
element of that kind in every file of those versions has it with the
|
||
same value, and it is left out entirely when some version shows two
|
||
values or elements without it. The values may differ between versions;
|
||
each range needs 10 files. The kept values are in
|
||
`src/idml/element_values.xml`, in blocks with `MinimumVersion` and
|
||
`MaximumVersion`. The converter writes them after the values it reads
|
||
from the INDD and only where the element lacks the attribute.
|
||
|
||
Files per DOM version: 7: 9, 8: 67, 9: 8, 10: 52, 11: 48, 12: 39, 13: 79,
|
||
14: 74, 15: 66, 16: 42, 17: 17, 18: 48, 19: 70, 20: 31, 21: 33.
|
||
|
||
### Page items
|
||
|
||
| Element | Elements | Values kept |
|
||
|---|---|---|
|
||
| `TextFrame` | 32,002 | `LocalDisplaySetting="Default"`, `GradientStrokeAngle`, `GradientStrokeHiliteLength`, `GradientStrokeHiliteAngle` (`0`) from DOM 7; `FlexItemWidthMode` and `FlexItemHeightMode` (`FlexFixed`) from 21 |
|
||
| `Rectangle` | 24,314 | `LocalDisplaySetting`, `StoryTitle="$ID/"` from 7 |
|
||
| `Oval` | 3,356 | `LocalDisplaySetting`, `StoryTitle` and the gradient highlights from 8 |
|
||
| `Polygon` | 52,774 | `LocalDisplaySetting`, `StoryTitle` and the gradient highlights from 7 |
|
||
| `GraphicLine` | 4,351 | `LocalDisplaySetting`, `LockState="None"` and the gradient highlights from 7 |
|
||
| `Group` | 9,010 | `LocalDisplaySetting`, `GradientStrokeAngle` and the gradient highlights from 7 |
|
||
|
||
Each kind also has `FlexItemWidthMode` and `FlexItemHeightMode` from
|
||
DOM 21, and values that the converter reads from the INDD
|
||
(`objects.md`, page item settings), which take precedence. Values such
|
||
as `Name`, `Visible`, `Locked`, the gradient angles and the layout
|
||
constraints are not kept: they differ in some elements, and those
|
||
values come from the INDD.
|
||
|
||
### Spreads, pages and layers
|
||
|
||
| Element | Elements | Values kept |
|
||
|---|---|---|
|
||
| `Spread` | 7,281 | `PageTransitionType="None"`, `PageTransitionDirection="NotApplicable"`, `PageTransitionDuration="Medium"`, `ShowMasterItems="true"`, `FlattenerOverride="Default"` from DOM 7; `SpreadHidden="false"` from 19 |
|
||
| `FlattenerPreference` of spreads | 7,281 | `ClipComplexRegions`, `ConvertAllStrokesToOutlines`, `ConvertAllTextToOutlines` (`false`) and `RasterVectorBalance` 50 from DOM 7 |
|
||
| `MasterSpread` | 1,412 | `OverriddenPageItemProps=""` from DOM 7 |
|
||
| `Page` | 12,639 | `AppliedTrapPreset="TrapPreset/$ID/kDefaultTrapStyleName"`, `GridStartingPoint="TopOutside"` from DOM 7; `SnapshotBlendingMode="IgnoreLayoutSnapshots"`, `OptionalPage="false"` from 8 |
|
||
| `Layer` | 1,546 | `ShowGuides` and `Expendable` (`true`) from DOM 7 |
|
||
|
||
Every spread has one `FlattenerPreference`, so the converter writes the
|
||
element on every spread. The other attributes of these elements come
|
||
from the INDD (`objects.md`).
|
||
|
||
### Document settings in designmap.xml
|
||
|
||
These elements are children of `Document` without `Self`. The tool keeps
|
||
an element when every IDML from some version on has it, with the values
|
||
all of them have; the converter writes it in the order of the IDML files.
|
||
|
||
| Element | From DOM | Values kept | Left out (vary) |
|
||
|---|---|---|---|
|
||
| `ConditionalTextPreference` | 7 | both | |
|
||
| `EndnoteOption` | 13 | 9 | `EndnoteTitle`, `EndnoteSeparatorText`, the marker and text styles, `EndnoteMarkerPositioning` |
|
||
| `TextFrameFootnoteOptionsObject` | 12 | all 4 | |
|
||
| `LinkedStoryOption` | 8 | all 4 | |
|
||
| `LinkedPageItemOption` | 8 | all 7 | |
|
||
| `WatermarkPreference` | 7 | 11 | the font family, style and colour |
|
||
| `TaggedPDFPreference` | 8 | `StructureOrder` | |
|
||
| `AdjustLayoutPreference` | 14 | 4 | `EnableAdjustLayout`, `EnableAutoAdjustMargins`, `AllowFontSizeAndLeadingAdjustment` |
|
||
| `HTMLFXLExportPreference` | 11 | both | |
|
||
| `PublishExportPreference` | 11 | 11 | `ImageExportResolution`, `PublishPdf` |
|
||
|
||
`Assignment` (683 elements, one per file): `UserName="$ID/"`,
|
||
`ExportOptions="AssignedSpreads"`, `IncludeLinksWhenPackage="true"`,
|
||
`FilePath="$ID/"` and `FrameColor` `Nothing`, from DOM 7.
|
||
|
||
### Language quotes
|
||
|
||
The quotes of a language are not in its INDD object (`objects.md`,
|
||
languages). For each language name the tool keeps `SingleQuotes` and
|
||
`DoubleQuotes` when every IDML `Language` element with that name has the
|
||
same value, in at least 3 files (a `Keyed` block of the values file):
|
||
63 languages. Romanian and Japanese have two variants each and are left
|
||
out.
|
||
|
||
Pasted smooth shades are keyed the same way by `ContentsType`: every
|
||
`ConstantShade` (and every `AxialShade`) has `ContentsVersion="0"`,
|
||
`SpotColorList=""`, `ContentsEncoding="Ascii64Encoding"`,
|
||
`ColorEditable` and `ColorRemovable` `true`, `Visible="false"` and
|
||
`SwatchCreatorID="7937"`; constant shades also
|
||
`ContentsMatrix="1 0 0 1 0 0"`.
|
||
|
||
### Paragraph and character styles
|
||
|
||
The styles other than the root styles (5,505 paragraph and 2,284
|
||
character styles in the IDML files):
|
||
|
||
| Values kept | Styles | Versions |
|
||
|---|---|---|
|
||
| `PreviewColor` `Nothing` | paragraph and character | 7 on |
|
||
| `EpubAriaRole=""` | paragraph and character | 21 on |
|
||
| `IncludeClass="true"` | character | 13 on |
|
||
| `ExtendedKeyboardShortcut="0 0 0"` | character | 15 on |
|
||
| `EmitCss="true"` where written | paragraph and character | 10 on |
|
||
| `SplitDocument="false"` where written | character | 10 on |
|
||
|
||
TOC styles (707 in the IDML files) all have `RunIn="false"` and
|
||
`IncludeHidden="false"`, and `SetStoryDirection="Horizontal"` where they
|
||
have it (all but one, from DOM 7 on).
|
||
|
||
The paragraph styles' `SplitDocument` and `IncludeClass` are left out:
|
||
a few styles have other values, whose INDD field was not found. Keyboard
|
||
shortcuts are read from the INDD (`objects.md`, styles).
|
||
|
||
Table and cell styles other than the root styles (731 and 84 in the IDML
|
||
files) all have `KeyboardShortcut="0 0"` (cell styles from DOM 8, with
|
||
27 files) and `ExtendedKeyboardShortcut="0 0 0"` from DOM 15; the
|
||
converter writes them. `Imported` and `StyleUniqueId` come from the INDD
|
||
(`objects.md`, styles).
|
||
|
||
### Swatches
|
||
|
||
| Element | Values kept |
|
||
|---|---|
|
||
| `Tint` | `ColorOverride="Normal"`, `AlternateSpace="NoAlternateColor"`, `AlternateColorValue=""`, `ColorEditable`, `ColorRemovable`, `Visible` (`true`) and `SwatchCreatorID="7937"` from DOM 8 (37 tints in 26 files); `ConvertToHsb="false"` from 18 |
|
||
| `Gradient` | `SwatchCreatorID="7937"` (and the flags, which the converter reads) from DOM 7 |
|
||
| `Swatch` (`None`) | `SwatchCreatorID="7937"` from DOM 7 |
|
||
|
||
Colours have their creator and alternate colour in the INDD
|
||
(`objects.md`, colours).
|
||
|
||
### Trap presets
|
||
|
||
All 683 IDML files list the same two `TrapPreset` elements at the end of
|
||
`Resources/Styles.xml`, with the same attributes: `$ID/k[No Trap
|
||
Preset]` and `$ID/kDefaultTrapStyleName`, which every page applies. The
|
||
converter writes the list (a `List` block of the values file). A
|
||
document with trap presets of its own would have more; the corpus has
|
||
none, so their INDD objects are not decoded.
|
||
|
||
### Values written where the converter writes the attribute
|
||
|
||
Some attributes are only on some elements; IDML writes them where a
|
||
frame's value differs from its object style, or from some version on.
|
||
For these the tool keeps a value when every element that has the
|
||
attribute has the same value (`WhenWritten` blocks). The converter
|
||
writes them on every text frame of those versions:
|
||
|
||
| `TextFramePreference` values | Versions |
|
||
|---|---|
|
||
| `VerticalThreshold="0"` | 7 on |
|
||
| `UseFlexibleColumnWidth="false"` | 8 on |
|
||
| `FootnotesEnableOverrides`, `FootnotesSpanAcrossColumns` (`false`) | 13 on |
|
||
| `ColumnRuleOffset`, `ColumnRuleTopInset`, `ColumnRuleBottomInset` (`0`), `ColumnRuleInsetChainOverride="true"`, `ColumnRuleStrokeTint="100"`, `ColumnRuleStrokeType="StrokeStyle/$ID/Solid"`, `ColumnRuleOverprintOverride="false"` | 15 on |
|
||
|
||
The first version of the column rule and footnote values is also where
|
||
the converter starts writing the column rule and footnote values it
|
||
reads from the INDD (`objects.md`, text frame preferences).
|
||
|
||
### Export options of page items
|
||
|
||
`ObjectExportOption` of page items has different attributes in different
|
||
INDD versions, major and minor. Over the 92,409 page items of the
|
||
trustworthy pairs there is no exception inside a version:
|
||
|
||
| INDD version | Attributes in addition to the common set |
|
||
|---|---|
|
||
| 7 | no `ObjectExportOption` |
|
||
| 8.0–9.1 | `CustomImageConversion="false"`, `CustomImageSizeOption="SizeRelativeToPageWidth"` |
|
||
| 9.2 | also `UseOriginalImage="false"` |
|
||
| 10.0 | `EpubType="$ID/"`, `UseExistingImage="false"`, `CustomHeightType="DefaultHeight"`, `CustomHeight="$ID/"`, `CustomWidthType="DefaultWidth"`, `CustomWidth="$ID/"`, `CustomImageConversion="false"`, `UseOriginalImage="false"` |
|
||
| 10.1 on | `EpubType="$ID/"`, `SizeType="DefaultSize"`, `CustomSize="$ID/"`, `PreserveAppearanceFromLayout="PreserveAppearanceDefault"` |
|
||
| 21.0 on | also `EpubAriaRole="$ID/"` |
|
||
| 21.1 on | also `EpubAriaLabel="$ID/"`, `EpubAriaLabelSourceType="AutomaticARIALabel"` |
|
||
| 21.4 on | also `AIGeneratedAltText="false"`, `AltTextGenerationError="false"`, `AltTextCropSyncRect=""` |
|
||
|
||
The common set, on every page item from version 8 on: the alternative
|
||
text and tagging values (`AltTextSourceType`, `ActualTextSourceType`,
|
||
`CustomAltText`, `CustomActualText`, `ApplyTagType`, read from chunk
|
||
0x1E206, `objects.md`), `ImageConversionType="JPEG"`,
|
||
`ImageExportResolution="Ppi300"`, `GIFOptionsPalette="AdaptivePalette"`,
|
||
`GIFOptionsInterlaced="true"`, `JPEGOptionsQuality="High"`,
|
||
`JPEGOptionsFormat="BaselineEncoding"`, `ImageAlignment="AlignLeft"`,
|
||
`ImageSpaceBefore="0"`, `ImageSpaceAfter="0"`,
|
||
`UseImagePageBreak="false"`, `ImagePageBreak="PageBreakBefore"`,
|
||
`CustomImageAlignment="false"`, `SpaceUnit="CssPixel"`,
|
||
`CustomLayout="false"`, `CustomLayoutType="AlignmentAndSpacing"`, and
|
||
the `Properties` children `AltMetadataProperty` and
|
||
`ActualMetadataProperty` (their values also from chunk 0x1E206). These
|
||
are constant in all 93,701 elements except `ImageAlignment` (3
|
||
`AlignCenter`) and `SizeType` (3 `RelativeToTextFlow`), all in the same 3
|
||
items of one document; their INDD field is not identified.
|
||
|
||
Object styles, `[None]` included, have `ObjectExportOption` from version
|
||
9 on (all 1,882 styles of those versions), with the common set (all
|
||
values constant) and the same version-dependent attributes, except that
|
||
21.4 on adds only `AltTextCropSyncRect=""`.
|
||
|
||
The converter writes these values by the version of the INDD file. It
|
||
leaves out `CustomImageSizeOption`: the IDML schema the output is
|
||
checked against does not allow that value. The `ObjectExportOption`
|
||
blocks of `element_values.xml`, `root_values.xml` and
|
||
`object_style_values.xml` are not used, because those files are keyed
|
||
by major version only.
|
||
|
||
All 3,412 `InCopyExportOption` elements of rectangles, ovals and polygons
|
||
have `IncludeGraphicProxies="true"` and `IncludeAllResources="false"`,
|
||
and the converter writes them on those items.
|
||
|
||
## Column direction of pages
|
||
|
||
All 832 `MarginPreference` elements in the 240 corpus IDML files have
|
||
`ColumnDirection="Horizontal"`. No INDD field for it is identified, so
|
||
the converter writes that value on every `MarginPreference`
|
||
(`objects.md`).
|
||
|
||
## Font platform name
|
||
|
||
`PlatformName` is `$ID/` in all 4,464 `Font` elements of the corpus IDML
|
||
files (`fonts.md`). The converter writes that value on every font.
|
||
|
||
## Number format
|
||
|
||
IDML writes a number as the shortest decimal that reads back as the same
|
||
64-bit value, in plain notation (no exponent). When that decimal needs 17
|
||
significant digits, there can be two 17-digit candidates equally close to
|
||
the value; IDML then takes the one with the even last digit. For example
|
||
the value 150.235992431640625 is written `150.23599243164062`, not
|
||
`…063`. This is the 17-digit decimal nearest to the exact value, with
|
||
ties to even.
|
||
|
||
Evidence: all 20,524 `GraphicBounds` values of images, PDF, EPS, SVG and
|
||
WMF graphics and imported pages in the trustworthy pairs follow this
|
||
rule (compared with the text Python's `repr` gives for the same value).
|
||
The INDD values (chunk 0x1633) match 1,001 of 1,001 PDF and 338 of 338
|
||
EPS graphics with this format; Rust's shortest form differs in the last
|
||
digit for 208 of these values. The converter writes every number this
|
||
way.
|
||
|
||
## Preferences
|
||
|
||
`Resources/Preferences.xml` of every corpus IDML has the same 41
|
||
top-level elements (`TextDefault`, `TextPreference`,
|
||
`TextFramePreference`, `PageItemDefault`, `StoryPreference`,
|
||
`FootnoteOption`, `TransparencyDefaultContainerObject` and others; the
|
||
DOM 7 file lacks `EPubFixedLayoutExportPreference`). `tools/root_values.py`
|
||
collects each attribute, `Properties` child and child element attribute
|
||
of these elements with the same rule as for the root styles, and writes
|
||
the kept values to `src/idml/preference_values.xml`. The converter writes
|
||
those elements in the order the IDML files list them.
|
||
|
||
| Values | Same in | Written for version |
|
||
|---|---|---|
|
||
| 1,041 | 88 of 88 files | all |
|
||
| 66 | 87 of 87 files with DOM 12 or later | 12 and later |
|
||
| 46 | 80 of 80 files with DOM 15 or later | 15 and later |
|
||
|
||
For example `TextDefault` keeps 264 of its 317 values,
|
||
`TransparencyDefaultContainerObject` all 352 and `TextFramePreference`
|
||
32 of 34.
|
||
|
||
**Left out:**
|
||
|
||
- 230 values that vary between files, for example the page size,
|
||
margins and grid settings, 53 values of `TextDefault` (among them the
|
||
font and point size) and 12 of `TextPreference`.
|
||
- The document setup the converter reads from the INDD (`objects.md`):
|
||
`PageHeight`, `PageWidth`, `FacingPages`, `Intent`, `PageBinding` and
|
||
the four bleed offsets of `DocumentPreference`. The converter writes its own values
|
||
for these and adds the observed values for the rest of the element.
|
||
`ViewPreference` gets `RulerOrigin="SpreadOrigin"`, as before.
|
||
- 3 values that name a style other than a root style, which the package
|
||
need not contain: `AppliedTextObjectStyle` and `AppliedGridObjectStyle`
|
||
of `PageItemDefault`, `FootnoteTextStyle` of `FootnoteOption`.
|
||
- 20 values that only the 2 files with DOM 20 have. A value first seen
|
||
in a later version is kept only when at least 10 files show it.
|
||
|
||
`tools/element_values.py` also collects the preference elements from all
|
||
683 IDML files of the larger corpus (paths `Preferences/<tag>` in
|
||
`src/idml/element_values.xml`), with its rule for other elements (per
|
||
range of DOM versions, at least 10 files). The converter adds these
|
||
values where `preference_values.xml` has none. They add, for example,
|
||
the auto-sizing values of `TextFramePreference` for DOM 8 to 11 and the
|
||
values of `EPubExportPreference` and `HTMLExportPreference` that all
|
||
files from DOM 8 on have. `PageItemDefault` values that name an object
|
||
style are written only when the package has that style.
|
||
|
||
**DOM 7.** The 7 DOM 7 references of the trustworthy pairs have no
|
||
`EPubExportPreference` and no `HTMLExportPreference` (7 of 7), though
|
||
`preference_values.xml` lists them for all versions (its source had one
|
||
DOM 7 file). The converter leaves both out before DOM 8.
|
||
|
||
Some of these values are probably stored in the INDD and may differ in a
|
||
document outside the corpus; none of them is read from the INDD yet. A
|
||
sample typeset vertically shows this: two 2-byte fields of the
|
||
preferences object (chunks 0xCD14 and 0xCD1C) are 1 there and 0 in all
|
||
250 distinct little-endian public files, and the values most likely to
|
||
depend on vertical layout (`StoryPreference` `StoryOrientation`,
|
||
`DocumentPreference` and `MarginPreference` `ColumnDirection`) are
|
||
written as observed. The print PDF cannot show which preference each
|
||
field holds, so they are not mapped.
|