mirror of
https://github.com/storytold/indd-utils.git
synced 2026-11-22 10:10:47 +01:00
A text frame's multi-column frame stores a matrix (chunk 0x2DE) that is the identity for horizontal text and a quarter turn for vertical text. A story whose frames all have the quarter turn is written Vertical instead of the Horizontal every sample's IDML has.
259 lines
12 KiB
Markdown
259 lines
12 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 corpus has 240 INDD files with an IDML, 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).
|
|
|
|
| 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`.
|
|
|
|
## 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"` and `AlphaChannelName="$ID/"`. The 386 PDF
|
|
and 49 EPS graphics with `ClippingPathSettings` have the same four
|
|
values. The converter writes them (`objects.md`, clipping path
|
|
settings).
|
|
|
|
## 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.
|
|
|
|
## 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`).
|
|
|
|
## Export options of page items
|
|
|
|
All 6,151 `ObjectExportOption` elements of page items (text frames,
|
|
rectangles, ovals, polygons, lines and groups) in the corpus IDML files
|
|
with DOM 12 or later have the same values, which are also the values
|
|
every object style other than `[None]` has (above). The converter writes
|
|
that element on every page item of documents from InDesign 12 on. The 2
|
|
elements in the DOM 7 file differ and that file has the element on few
|
|
items, so nothing is written for older documents.
|
|
|
|
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.
|
|
|
|
## 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.
|
|
|
|
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.
|