> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: layout and fonts: Formatting and styles

## `BorderLineProps`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `color?` | `SmlColor` | |
| `style?` | `string` | |

## `CanvasFaceEntry`

What a host knows about the face a style resolves to.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `cssFamily` | `string` | Family name the face was registered under with the host's font system. |
| `loaded` | `boolean` | True when the exact face file loaded; false falls back to CSS by name. |
| `metrics` | `FaceMetrics` | |
| `synthBold?` | `true` | The registered face is the family's REGULAR one because it ships no bold: the weight has to be synthesised by stroking (see `synthBoldStrokePt`). |

## `CanvasFaces`

Host-side face resolution: IR style -> registered face, or undefined.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `entryFor()` | `(style: TextStyle) => CanvasFaceEntry \| undefined` | |

## `DxfProps`

A differential format: what a conditional format or table style lays over a cell's own.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `borders` | `Partial<Record<"left" \| "right" \| "top" \| "bottom", BorderLineProps>>` | |
| `fill?` | `SmlColor` | |
| `font` | `Partial<{ bold: boolean; color: SmlColor; italic: boolean; strike: boolean; underline: string }>` | |
| `numFmt?` | `string` | |

## `EmbeddedFaceData`

One embedded face, serializable: it travels inside the layout IR so a
renderer in another process (or a browser) embeds the same bytes the
measurer used. `id` is the face's stable identity (`embed:<doc>/<slug>`).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `data?` | `Uint8Array` | Non-enumerable fast path: the bytes when the face came from an in-process engine. |
| `dataB64` | `string` | |
| `id` | `string` | |

## `EmbeddedFontMap`

Not exported by name. You get it from the API.

```ts theme={null}
type EmbeddedFontMap = Record<string, Partial<Record<FaceKey, EmbeddedFaceData>>>
```

## `FaceKey`

Not exported by name. You get it from the API.

```ts theme={null}
type FaceKey = "regular" | "bold" | "italic" | "boldItalic"
```

## `FaceMetrics`

Per-face vertical metrics, all expressed per pt of font size (i.e. in em).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `ascent?` | `number` | Bare ascender, per pt of size; where a top-anchored metafile text puts its baseline. |
| `baselineFactor` | `number` | Distance from top of the line box down to the baseline, per pt of size. |
| `strikePos` | `number` | |
| `strikeThickness` | `number` | Strikethrough thickness, per pt of size. |
| `underlinePos` | `number` | Underline position (negative = below baseline), per pt of size. |
| `underlineThickness` | `number` | Underline thickness, per pt of size. |
| `unitsPerEm` | `number` | The face's design units per em. |

## `FaceProvider`

How face bytes reach the browser. `FaceSource.bytes()` is synchronous, so a
layout cannot fetch mid-run; `layoutDocxInBrowser` lays out once to trace
the faces it needs, calls `fetch` with those ids, and lays out again when
bytes arrived. `bytes` serves canvas `FontFace` loading and PDF embedding.

Import from `@reductoai/xlsx/view`.

| Name | Type | Description |
| - | - | - |
| `bytes()` | `(id: string) => Uint8Array<ArrayBufferLike> \| null` | Face bytes held here, or an embedded face the registry extracted. |
| `fetch()` | `(ids: string[], onProgress?: FetchProgress) => Promise<number>` | Pull the faces named by `ids` that are not held yet; returns the bytes pulled. |
| `heldIds()` | `() => string[]` | Ids whose bytes this thread holds; a worker skips these when it ships faces over. |
| `install()` | `() => Promise<void>` | Register every family on `defaultFontRegistry`; face bytes may still be absent. Memoized. |
| `seed()` | `(faces: Iterable<[string, Uint8Array<ArrayBufferLike>]>) => void` | Adopt face bytes another thread fetched, so `bytes` can serve them here. |

## `FaceTable`

A static font mirror: which families exist, which face id fills each slot,
and which file holds each face. Families register up front with empty faces;
a face's bytes arrive only when a layout trace (or `familyFaces`) asks.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `cjk?` | `string[]` | Families that are real CJK faces; replayed through `markCjkFamilies`. |
| `families` | `Record<string, Partial<Record<FaceKey, string>>>` | family (lower case) -> face key -> face id. |
| `files` | `Record<string, string>` | face id -> file, handed to `urlFor`. |
| `noSubset?` | `string[]` | Face ids a PDF embeds whole; replayed through `markNoSubsetFaces`. |

## `FillAcrossHow`

What Fill Across Worksheets writes, as Excel's `XlFillWith`.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type FillAcrossHow = "all" | "contents" | "formats"
```

## `FontDecl`

Font-table properties used to select a substitute face.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `altName?` | `string` | |
| `arabic?` | `true` | `w:charset="B2"` or the Arabic code page (1256) in `w:sig@csb0`. |
| `auto?` | `true` | |
| `caucasian?` | `true` | |
| `cjk?` | `EastAsianScript` | Script from `w:charset`, else from the `w:sig` code pages. |
| `eastAsia?` | `true` | |
| `korean?` | `true` | |
| `modern?` | `true` | `w:family="modern"`. |
| `nonAnsiCharset?` | `true` | `w:charset` names a code page other than ANSI (00), default (01) or Symbol (02). |
| `notTT?` | `true` | |
| `roman?` | `true` | |
| `scriptCharset?` | `true` | `w:charset` names a non-Western script (Cyrillic, Greek, CJK, Arabic, Thai, Vietnamese). |
| `swiss?` | `true` | |
| `symbol?` | `true` | |
| `thai?` | `true` | `w:charset="DE"` or the Thai code page (874) in `w:sig@csb0`. |

## `FontDeclMap`

Not exported by name. You get it from the API.

```ts theme={null}
type FontDeclMap = Record<string, FontDecl>
```

## `FontFallback`

One requested family that the registry could not serve as itself.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `reason` | `FontFallbackReason` | |
| `requested` | `string` | |
| `served` | `string` | |

## `FontFallbackReason`

Why a requested family was not the family that got served.

alias   a metric-compatible clone from SUBSTITUTIONS (Arial -> Liberation
Sans). Expected on the portable profile; metrics are designed to
match, so this is information, not a defect.
script  a complex-script fallback replaced the run's face. The served face
has DIFFERENT advances, so line breaks and page count move.
missing nothing matched the name at all and resolveFamily's fontTable rule
chose the face. Same metric risk as `script`.

Not exported by name. You get it from the API.

```ts theme={null}
type FontFallbackReason = "alias" | "script" | "missing"
```

## `LayoutBorderSide`

One drawn border side (pt width + CSS hex color). Absent side = no border.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `color` | `string` | |
| `dash?` | `readonly number[]` | On/off stroke pattern in multiples of `widthPt`. |
| `split?` | `{ bands: readonly { color?: string; widthPt: number }[]; leftTop?: true }` | Ink split of a composite side: consecutive sub-bands in pt, summing to `widthPt`; a band without `color` is a blank gap. Absent = one solid bar. The first band is the one further from the box centre — unless `leftTop`, when the bands run top/left → bottom/right. |
| `texture?` | `"wave" \| "doubleWave" \| "hatch"` | Hairline art filling the band instead of a bar (see `strokeTexture`). |
| `widthPt` | `number` | |

## `LayoutLinearGradient`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `end` | `{ x: number; y: number }` | |
| `kind` | `"linear" \| "radial"` | `radial`: a circle about `start` whose rim passes through `end`. |
| `start` | `{ x: number; y: number }` | Endpoints use the shape path's local hmm coordinates. |
| `stops` | `{ alpha?: number; color: string; offset: number }[]` | |

## `NormalFont`

The Normal font: `fonts[0]`, which sets the column character width.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `name?` | `string` | |
| `size` | `number` | |

## `StyleCategory`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type StyleCategory = "number" | "font" | "fill" | "border" | "alignment" | "protection"
```

## `TextFillGradient`

A run's gradient fill before layout knows its box: a DrawingML `lin` angle or circle focus.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `angleDeg?` | `number` | Degrees clockwise from +x; absent for a circle. |
| `focus?` | `{ b: number; l: number; r: number; t: number }` | `fillToRect` insets as fractions; present for a circle. |
| `stops` | `{ alpha?: number; color: string; offset: number }[]` | |

## `TextReflection`

A Word `w14:reflection`; opacities and `endPos` are fractions.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `blurPt` | `number` | |
| `distPt` | `number` | |
| `endAlpha` | `number` | |
| `endPos` | `number` | |
| `startAlpha` | `number` | |

## `TextShadow`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `alpha` | `number` | |
| `blurRadiusPt` | `number` | |
| `color` | `string` | |
| `dxHmm` | `number` | |
| `dyHmm` | `number` | |
| `growsLine?` | `boolean` | A Word `w14:shadow`: the line box makes room for it (`shadowGrowthPt`). |

## `TextStroke`

`dash`: on and off lengths in stroke widths; absent is solid. `round`: round dash caps.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `alpha?` | `number` | |
| `color` | `string` | |
| `dash?` | `number[]` | |
| `round?` | `boolean` | |
| `widthPt` | `number` | |

## `TextStyle`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `advanceGridPt?` | `number` | Each glyph's advance, in pt, snaps to this grid (PowerPoint lays out in 1/576 inch). |
| `bold` | `boolean` | |
| `border?` | `{ color: string; spacePt: number; widthPt: number }` | Single run border, painted around the run box. |
| `boxFont?` | `string` | Face whose metrics size the line when the glyph is drawn from a fallback face. |
| `charSpacingPt?` | `number` | Per-character tracking in pt (OOXML w:rPr/w:spacing = val/20). The renderer must emit it as the PDF `Tc` operator so glyphs land where we measured. |
| `checkbox?` | `{ checked: boolean; sidePt?: number }` | Legacy FORMCHECKBOX form field. The run carries the square as `shapes` and no glyph text, so a painter needs nothing beyond `drawShapes`. |
| `color` | `string` | CSS hex, e.g. "#000000". Auto/default color becomes "#000000". |
| `comments?` | `readonly string[]` | Comment ranges enclosing this run. Present only in comment-balloon mode. |
| `doubleStrike?` | `boolean` | w:dstrike — double strikethrough. Omitted when false. |
| `doubleUnderline?` | `boolean` | Double underline (Moved To text in the inline review view). Omitted when false. |
| `emboss?` | `boolean` | Legacy raised relief text; paint-only and excluded from advances/line boxes. |
| `emphasisMark?` | `"overFullStop" \| "overSesame" \| "overHyphenationPoint" \| "overComma" \| "overCircle" \| "underFullStop"` | Resolved East Asian emphasis ink; paint-only and excluded from advances/line boxes. |
| `enclosure?` | `{ innerPositionPt: number; innerSizePt: number; outerPositionPt: number; outerSizePt: number; shape: "circle" \| "square" }` | Legacy EQ overlay field rendered as a glyph inside vector enclosure ink. |
| `fillGradient?` | `TextFillGradient` | `w14:textFill` gradient relative to each run's box; layout resolves it to `fillPaint`. |
| `fillPaint?` | `LayoutLinearGradient` | Glyph gradient in page hmm; `color` stays its solid stand-in. |
| `font` | `string` | |
| `glow?` | `{ alpha: number; color: string }` | Resolved `w14:glow` halo paint. |
| `glowRadiusPt?` | `number` | `w14:glow` radius in pt. Grows the line box; see `glowGrowthPt`. |
| `highlight?` | `string \| null` | Run highlight background (OOXML w:highlight), CSS hex or null. |
| `imprint?` | `boolean` | Legacy engraved relief text; paint-only and excluded from advances/line boxes. |
| `italic` | `boolean` | |
| `kern?` | `boolean` | OOXML w:rPr/w:kern threshold met: the run was measured with the face's pair kerning, so the renderer must position glyphs by their kerned advances (`TJ`). |
| `lang?` | `string` | Proofing language (BCP 47) and do-not-check; read by spell check, never painted. |
| `ligatures?` | `LigaturePolicy` | w14:ligatures — per-run OpenType ligature policy. |
| `noProof?` | `true` | |
| `opacity?` | `number` | Paint opacity (0..1), used by translucent VML textpaths/watermarks. |
| `outline?` | `boolean` | Legacy hollow text outline; paint-only and excluded from advances/line boxes. |
| `positionPt?` | `number` | w:rPr/w:position — signed baseline shift in pt (positive = raised), applied ON TOP of `risePt` and WITHOUT the sub/superscript size shrink. Kept separate so the renderer's nominal-size anchoring stays keyed to `risePt`. |
| `reflection?` | `TextReflection` | Mirror image under the glyphs; grows the line box below (`reflectionGrowthPt`). |
| `revision?` | `"insert" \| "delete" \| "format"` | Inline tracked-change provenance; paint policy uses it for margin change bars. |
| `revisionInserted?` | `true` | A deletion of text a tracked insertion added first (`w:del` inside `w:ins`). |
| `risePt?` | `number` | Baseline shift in pt (positive = raised); sub/superscript. When set, `sizePt` is the shrunken script size and the renderer must anchor the baseline at the NOMINAL size (`scriptNominalPt`) before applying the shift. |
| `scriptNominalPt?` | `number` | Nominal size a sub/superscript anchors at, when its shrink is not 58%. |
| `shadow?` | `boolean` | Legacy Word text shadow; paint-only and excluded from advances/line boxes. |
| `sizePt` | `number` | |
| `strike?` | `boolean` | w:strike — single strikethrough. Omitted when false. |
| `textInnerShadow?` | `TextShadow` | DrawingML inner shadow, painted inside the glyphs away from the offset copy. |
| `textShadow?` | `TextShadow` | DrawingML outer shadow, painted behind the glyphs without affecting layout. |
| `textStroke?` | `TextStroke` | `w14:textOutline` with a fill: stroked over the filled glyphs, paint-only. |
| `underline` | `boolean` | |
| `widthScale?` | `number` | |

## `ThemeFaces`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `major` | `string` | |
| `minor` | `string` | |

## `WorkbookFormat`

The kind of Excel file a package is, from its workbook part's content type.

Import from `@reductoai/xlsx`.

```ts theme={null}
type WorkbookFormat = "xlsx" | "xlsm" | "xltx" | "xltm" | "xlam"
```
