IDML Reference / Package anatomy
Resource parts
The Resources folder holds an IDML document's shared definitions — swatches in Graphic.xml, faces in Fonts.xml, styles and preferences.
Reviewed against engine v0.71.6
The Resources folder holds the definitions the rest of the document refers to by id: swatches, fonts, styles and preferences.
In short A text frame names a FillColor, a paragraph names an
AppliedParagraphStyle, a run names an AppliedFont. The value behind each name is
defined once, in one of four resource parts: Graphic.xml (colours, tints, gradients, inks
and stroke styles), Fonts.xml (the families and faces in use), Styles.xml (every named
style) and Preferences.xml (document settings and the defaults new objects get). Every
package in the census behind the element reference carries all
four.
Graphic.xml: swatches, inks and stroke styles
| Element | What it defines |
|---|---|
Color | A colour swatch: Model (Process, Spot), Space (CMYK, RGB, LAB) and ColorValue; a spot colour adds an AlternateSpace and AlternateColorValue |
Tint | A named tint of another swatch: BaseColor names the colour, TintValue the percentage |
MixedInk | A swatch mixed from several inks |
Gradient | A linear or radial ramp of GradientStop children, each with a StopColor, a Location and a Midpoint |
Swatch | The reserved swatches: None, Paper, Registration |
Ink | A printing ink: its type, screen angle, frequency and trap order |
StrokeStyle | A built-in stroke style that strokes refer to by name |
DashedStrokeStyle, DottedStrokeStyle, … | A custom stroke pattern |
| Attribute · Color | Values | Seen in |
|---|---|---|
| ColorEditable | false | true | 100% |
| ColorOverride | Hiddenreserved | Normal | Specialblack | Specialpaper | Specialregistration | 100% |
| ColorRemovable | false | true | 100% |
| ColorValue | list (pt) | 100% |
| Model | Process | Spot | 100% |
| Name | text | 100% |
| Self | Color reference | 100% |
| Space | CMYK | RGB | LAB | Gray | 100% |
A tint is its own element. A TintValue attribute on a <Color> does not make that colour a
tint: InDesign keeps a named tint only when it is written as <Tint BaseColor="…" TintValue="…">. Swatch folders (ColorGroup) are defined in the design map, not here.
The colour model itself is covered in colour and swatches.
In Paged: colours, named tints, gradients and the reserved swatches are read and rendered. Custom stroke patterns are read from this part, a dashed style's dashes from its
DashArray. A built-inStrokeStyleelement is not read; a stroke that names one is drawn by the name.InkandMixedInkare not read. Parsed, not rendered
Fonts.xml: the faces in use
The part lists one <FontFamily> per family, with one <Font> per face the document
uses. A Font records the face's PostScriptName, its FontStyleName, its FontType
and whether it was installed when the file was saved (Status); a variable font also
records its design axes. CompositeFont entries define composite fonts for CJK text.
| Attribute · Font | Values | Seen in |
|---|---|---|
| FontFamily | enum / text | 100% |
| FontStyleName | enum / text | 100% |
| FontType | OpenTypeCFF | OpenTypeCID | OpenTypeTT | TrueType | 100% |
| Name | text | 100% |
| PostScriptName | builtin / enum / text | 100% |
| Self | Font reference | 100% |
| Status | Installed | NotAvailable | Substituted | 100% |
| FontStyleNameNative | enum / text | 89% |
The part holds no outlines, but it is not decoration. InDesign binds each font a story or
style applies (an AppliedFont with its FontStyle) through these declarations. Measured
in InDesign 20.0.1:
- a face applied in the text but not declared here is reported as not available;
- a declaration that names only the family (no instance) comes back substituted; what
binds is one
<Font>per face, named the way InDesign names it (Name="Fraunces Regular",FontStyleName="Regular").
In Paged: the importer does not open
Fonts.xml; fonts are matched by the names in the stories and styles. The exporter writes a declaration for every applied face that lacks one.
Styles.xml: named styles
Styles sit in root groups, one per kind, and may be organised further in nested
…StyleGroup folders:
| Root group | Style | Applied by |
|---|---|---|
RootCharacterStyleGroup | CharacterStyle | AppliedCharacterStyle on a character range |
RootParagraphStyleGroup | ParagraphStyle | AppliedParagraphStyle on a paragraph range |
RootObjectStyleGroup | ObjectStyle | AppliedObjectStyle on a page item |
RootTableStyleGroup | TableStyle | AppliedTableStyle on a table |
RootCellStyleGroup | CellStyle | AppliedCellStyle on a cell |
| (none: directly in the part) | TOCStyle | a generated table of contents |
A style inherits what it does not set from the style named in its BasedOn. The reserved
entries $ID/[No paragraph style] and $ID/[No character style] end the chain, and
ObjectStyle/$ID/[None] is what a page item with no object style names. The cascade is
covered in
styles.
Preferences.xml: settings and defaults
The part holds one element per preference panel. A few describe the document itself:
DocumentPreference: page size (PageWidth,PageHeight),FacingPages, binding, and the bleed and slug offsets;ChapterNumberPreference: the document's chapter number, which chapter-number text variables show;FootnoteOption,GridPreference,MarginPreference: footnote layout, baseline and document grids, and the margins new pages get.
Others are defaults InDesign applies to what is created or reflowed after opening:
TextFramePreference and TextDefault for new frames and text, TextPreference for
composition options. One was measured to change how existing text is set:
TextPreference UseOpticalSize. With it true, InDesign re-instances runs in a variable
font with an optical-size axis at their point size; with it false, they use the font's
default instance.
The rest (export, print, view and XML preferences) configure the application and do not change the pages.
In Paged: the importer reads from this part the bleed and slug offsets in
DocumentPreference,ChapterNumberPreference,FootnoteOption,GridPreferenceand the document's global light inTransparencyPreference; page sizes and facing pages come from the pages themselves. An edited bleed or slug is written back onto the existingDocumentPreference. The exporter writesTextPreference UseOpticalSizeto match how it composed variable fonts.
Frequently asked questions
What is stored in the Resources folder of an IDML package?
Four parts: Graphic.xml for swatches, inks and stroke styles; Fonts.xml for the
families and faces in use; Styles.xml for paragraph, character, object, table, cell and
TOC styles; and Preferences.xml for document settings and defaults.
Does an IDML document store its fonts in Fonts.xml?
No outlines, only declarations. But the declarations matter: InDesign binds each applied
font through them, and reports a face it cannot find declared there as missing.
How do I write a tint swatch?
As its own <Tint> element in Graphic.xml, with BaseColor naming the colour and
TintValue the percentage. A TintValue attribute on a <Color> is not a named tint.
Where are conditions and swatch folders defined?
In the design map, not in a resource part. InDesign writes Condition, ConditionSet and
ColorGroup as children of Document.
Which preferences change how an existing document looks?
Few. DocumentPreference describes the document, ChapterNumberPreference feeds chapter
numbers, and TextPreference UseOpticalSize changes which instance of a variable font is
used. Most of the part holds defaults for new objects and application settings.
The design map
designmap.xml is the root of an IDML package — document settings, the definitions that belong to the whole document, and an idPkg reference to every part.
Content parts
The Spreads, MasterSpreads and Stories parts hold the document itself — pages and the items on them, the master pages, and the text, each tied in by id.