Resource parts
The Resources folder holds an IDML document's shared definitions — colors and gradients in Graphic.xml, named styles in Styles.xml, the font manifest in Fonts.xml, and document preferences in Preferences.xml.
The Resources folder holds the shared definitions — colors, styles, fonts, preferences — that the rest of an IDML document refers to by id.
In short: The Resources folder is an IDML document's shared vocabulary. A
text frame names a FillColor, a paragraph names an AppliedParagraphStyle, a run
names an AppliedFont — and the value behind each of those names is defined once,
here, so it can be reused across every spread and story. Four parts live in the
folder: Graphic.xml (colors, swatches, and gradients), Styles.xml (the named
style groups), Fonts.xml (a font manifest), and Preferences.xml (document
preferences). This page covers what each part holds and how much of it our parser
reads today.
Our parser does not discover these parts from the design map's idPkg:*
elements — it opens Resources/Graphic.xml and Resources/Styles.xml directly,
at their fixed package paths, and parses each if present. A document missing
either part still opens; the parser substitutes an empty palette or an empty
style sheet rather than failing. Fonts.xml and Preferences.xml are not opened
at all today.
Graphic.xml — colors, swatches, and gradients
The graphic resource is the document's swatch palette. The parser keys every
<Color> by its Self id (e.g. Color/Black), so a FillColor="Color/Black"
elsewhere resolves to a real color value. <Swatch> entries — the special
None / Paper / Registration cases and named wrappers — are captured
separately and can indirect to a Color one level. <Gradient> entries collect
their <GradientStop> children, each of which references a Color by id at a
Location along the ramp.
| Attribute · Color | Type / values | Support | Notes |
|---|---|---|---|
| Self | string id | Supported | The palette key, e.g. "Color/Black"; what FillColor / StrokeColor point at. |
| Name | string | Parsed, not yet rendered | Human-readable swatch name; informational. |
| Space | CMYK | RGB | LAB | Gray | Supported | Color space of ColorValue. Unrecognised values are treated as unresolved. |
| ColorValue | space-separated numbers | Supported | Channel values in Space — four for CMYK, three for RGB, one for Gray. |
| Model | Process | Spot | MixedInk | Supported | Process is the default. Spot inks preview through their CMYK alternate; MixedInk is recognised but not decomposed. |
| AlternateSpace | CMYK | RGB | LAB | Gray | Supported | Color space of a spot swatch’s fallback. Used for the CMYK preview path. |
| AlternateColorValue | space-separated numbers | Supported | Channel values in AlternateSpace; four percentages for a CMYK alternate. |
| TintValue | number 0–100 | Supported | Swatch-level tint — "this ink at N%". Folded into the CMYK channels before color management. −1 (Adobe’s unset sentinel) reads as absent. |
| AlphaPercentage / Alpha | number 0–100 (or 0–1) | Supported | Optional opacity, consumed by gradient-feather stops. Absent ⇒ opaque. |
| Attribute · Gradient | Type / values | Support | Notes |
|---|---|---|---|
| Self | string id | Supported | Gradient key, e.g. "Gradient/Sky". |
| Name | string | Parsed, not yet rendered | Human-readable name; informational. |
| Type | Linear | Radial | Supported | Ramp geometry; absent reads as Linear. Anything else is captured as Unknown. |
| GradientStop (child) | StopColor (id) + Location (0–100) | Supported | Each stop references a Color by id at a normalised position; collected in document order. |
InDesign also writes <ColorGroup> groupings into this part; the parser captures
them for round-trip, but the renderer does not branch on them.
Styles.xml — the style groups
The style sheet is where every named style lives. InDesign nests styles under
root group elements — <RootCharacterStyleGroup>, <RootParagraphStyleGroup>,
<RootObjectStyleGroup>, <RootCellStyleGroup>, and the table and TOC groups.
The parser does not require the grouping wrappers; it picks up each style element
by name wherever it appears and keys it by Self id. A story's
AppliedParagraphStyle then resolves by looking that id up in the paragraph-style
table.
Each style records the cascadable attributes the renderer consumes — font, size,
fill, tracking, paragraph geometry, and so on. A style's BasedOn field names a
parent style; the cascade is followed at resolve time and bounded so a cyclic
chain can't loop. The conventional $ID/[No paragraph style] /
$ID/[No character style] entries sit at the bottom of that chain as the
document's defaults.
| Attribute · Style group → entry | Type / values | Support | Notes |
|---|---|---|---|
| CharacterStyle | in RootCharacterStyleGroup | Supported | Font, size, fill, tracking, caps, baseline shift, underline/strikethru, and CJK ruby/kenten fields. Referenced by AppliedCharacterStyle. |
| ParagraphStyle | in RootParagraphStyleGroup | Supported | Everything a character style carries plus paragraph geometry: justification, indents, spacing, tabs, bullets/numbering, drop caps, rules/shading/borders. Referenced by AppliedParagraphStyle. |
| ObjectStyle | in RootObjectStyleGroup | Supported | Fill / stroke / corner defaults for a page item. Referenced by AppliedObjectStyle; real documents lean on this for frame fills. |
| CellStyle | in RootCellStyleGroup | Supported | Per-cell fill, vertical justification, and per-edge strokes. Referenced by AppliedCellStyle. |
| TableStyle | in RootTableStyleGroup | Supported | Region → cell-style map plus table border strokes and alternating-row fills. Referenced by AppliedTableStyle. |
| TOCStyle | TOC style + entries | Parsed, not yet rendered | Title, title style, and the ordered list of included paragraph styles. Captured; TOC resolution is a separate pass. |
| DashedStrokeStyle (+ Dotted/Striped/Wavy) | custom stroke styles | Parsed, not yet rendered | Custom stroke patterns referenced via StrokeType. The Dashed pattern is consumed; the others are captured for round-trip. |
| Condition / ConditionSet | conditional text | Parsed, not yet rendered | Visibility toggles applied to text ranges. The renderer resolves individual conditions but does not branch on sets. |
Fonts.xml — the font manifest
This part is a manifest, not a font store: <FontFamily> elements wrap <Font>
entries that name a PostScriptName, a FontStyleName, a FontType, and an
installed Status. It tells a consumer which faces the document expects. The
actual font outlines come from the host system or from the renderer's own font
set, not from this XML.
Our parser does not open Fonts.xml. Style and run elements carry the font by
name (AppliedFont="Open Sans"), and the renderer matches that name against the
fonts it has been given directly — so the manifest is informational and currently
unread. Not yet parsedResources/Fonts.xml
Preferences.xml — document preferences
Preferences.xml carries document- and application-level preference elements
(margins, grids, view and export settings, and the like). The design map points
at it like any other part, but our parser does not open it: the path is read
past, not acted on. Geometry the renderer actually needs — page bounds, frame
insets, column settings — it reads from the spreads and frames themselves, not
from this part. Not yet parsedResources/Preferences.xml
Together these four parts are the shared vocabulary. The next page covers the parts that use that vocabulary — the content parts that hold the pages and the text.
Frequently asked questions
What is stored in the Resources folder of an IDML package?
The Resources folder holds the document's shared definitions: Graphic.xml for
colors, swatches, and gradients; Styles.xml for the named paragraph, character,
object, cell, and table styles; Fonts.xml as a font manifest; and
Preferences.xml for document- and application-level preferences. The rest of the
document references these by id rather than repeating them.
Does an IDML document store its actual fonts in Fonts.xml?
No. Fonts.xml is a manifest, not a font store — it lists the faces a document
expects (PostScript name, style, type, and installed status), but the actual font
outlines come from the host system or the renderer's own font set. Our parser does
not open Fonts.xml today; styles and runs name fonts by name, and the renderer
matches that name against the fonts it has been given.
What happens if Graphic.xml or Styles.xml is missing?
The document still opens. Our parser reads Graphic.xml and Styles.xml directly
at their fixed paths and parses each if present; if either is absent, it
substitutes an empty palette or empty style sheet rather than failing, and
references that find no match simply fall back.
The design map
designmap.xml is an IDML document's root manifest — it carries document-level settings on its Document element and names every other part in the package through idPkg:* reference elements.
Content parts
The Spreads, MasterSpreads, and Stories parts hold an IDML document itself — the pages, the shapes that sit on them, and the text — each tied to the design map by a Self id derived from its file name.