> ## 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: Shapes and pictures

## `Crop`

`a:srcRect`: the share of the image cut from each side, 0..1; negative values pad.

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

| Name | Type | Description |
| - | - | - |
| `b` | `number` | |
| `l` | `number` | |
| `r` | `number` | |
| `t` | `number` | |

## `DrawingAnchor`

Import from `@reductoai/xlsx`.

```ts theme={null}
type DrawingAnchor = { editAs?: "twoCell" | "oneCell" | "absolute"; from: CellMarker; kind: "twoCell"; to: CellMarker } | { cx: number; cy: number; from: CellMarker; kind: "oneCell" } | { cx: number; cy: number; kind: "absolute"; x: number; y: number }
```

## `DrawingLink`

`a:hlinkClick` on the object's `cNvPr`: an external target, or a place in the workbook.

Import from `@reductoai/xlsx`.

| Name | Type | Description |
| - | - | - |
| `location?` | `string` | |
| `target?` | `string` | |
| `tooltip?` | `string` | |

## `DrawingObject`

Import from `@reductoai/xlsx`.

```ts theme={null}
type DrawingObject = Common & ({ chartPart?: string; kind: "chart" } | { chartPart?: string; kind: "chartEx" } | { crop?: Crop; kind: "picture"; media?: string } | { kind: "shape" } | { kind: "connector" } | { kind: "group" } | { kind: "frame"; uri: string })
```

## `ImageFlip`

Which axes a drawing's ink is mirrored across, about its bbox centre.

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

```ts theme={null}
type ImageFlip = "h" | "v" | "hv"
```

## `ImageLoader`

Fetches the bytes of the picture at an https address for `IMAGE`; a rejection shows #CONNECT!.

Import from `@reductoai/xlsx`.

```ts theme={null}
type ImageLoader = (address: string) => Promise<Uint8Array>
```

## `LayoutDrawingGrid`

`w:settings` drawing grid, shown by Word's View > Gridlines. Steps are the gap between
drawn lines (spacing times display-every); 0 draws no lines that way. Absent origin =
the page's margin corner, and the grid fills the margin box; otherwise it fills the page.

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

| Name | Type | Description |
| - | - | - |
| `origin?` | `{ x: number; y: number }` | |
| `stepX` | `number` | |
| `stepY` | `number` | |

## `LayoutImageRef`

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

| Name | Type | Description |
| - | - | - |
| `altText?` | `string` | Author's alt text (`wp:docPr/@descr`), verbatim. |
| `chartHits?` | `LayoutShapeGeom[]` | Closed chart outlines tagged with `part` for hit-testing (`chartPartAt`); never painted. |
| `clip?` | `string` | `pic:spPr` custom / non-rect preset geometry as SVG `d` in the unrotated ink box (hmm, y-down from the paint bbox). Painters clip the bitmap to it even-odd. Absent = the image fills its rectangle. |
| `drawHHmm?` | `number` | |
| `drawWHmm?` | `number` | Ink size of a ROTATED drawing, in hmm, before the rotation is applied. `wHmm`/`hHmm` then hold the slot the flow reserved (an anchor's rotated bounding box; an inline picture's extent, swapped past 45°), and painters draw the image into this size CENTRED in the bbox before rotating about that centre. Absent = the ink fills the bbox. |
| `effects?` | `{ glow?: { alpha: number; color: string; radiusHmm: number }; reflection?: { distHmm: number; endAlpha: number; size: number; startAlpha: number }; softEdgeHmm?: number }` | `pic:spPr/a:effectLst` glow, reflection and soft edges, painted against white paper as `shadow` is: a glow is stacked translucent rings behind the picture, a reflection a mirrored copy under a white fade, soft edges a white fade over each side. |
| `flip?` | `ImageFlip` | `a:xfrm@flipH`/`@flipV` (own or inherited from a group): painters mirror the ink about the bbox centre BEFORE rotating it. Absent = no mirror. |
| `hHmm` | `number` | |
| `id` | `string` | Key into `LayoutDocument.images`. Two sentinels never resolve there: `"shape"` (vector `shapes` ride on the ref) and `"rule"` (an `o:hr` slot whose stroke paints as chrome; the ref only reserves the line). |
| `layers?` | `LayoutImageRef[]` | Pictures composing one inline DrawingML group, in declared paint order. Their offsets and sizes are relative to this ref's flow slot. |
| `mime` | `"png" \| "jpeg" \| "gif" \| "tiff" \| "svg" \| "other"` | |
| `offsetXHmm?` | `number` | Offset of the painted child inside an inline drawing's flow slot. |
| `offsetYHmm?` | `number` | |
| `outline?` | `{ color: string; split?: LayoutBorderSide["split"]; widthPt: number }` | `pic:spPr/a:ln` — the picture's own frame (Word's "Picture Border"), stroked wholly outside the placed bbox as Word does. Absent = no frame. `split` is a compound line (`a:ln@cmpd`), its bands outer → inner on every side. |
| `rotDeg?` | `number` | `a:xfrm@rot` in degrees, CLOCKWISE (OOXML). Painters rotate about the placed bbox centre; absent = upright. |
| `shadow?` | `{ alpha?: number; blurPt?: number; color: string; dxHmm: number; dyHmm: number; rgb?: string }` | `pic:spPr/a:effectLst/a:outerShdw` flattened to one opaque offset copy of the bbox, painted under the picture. `dxHmm`/`dyHmm` are the shadow's displacement (dist resolved along dir); `color` is the shadow colour already composited against white for its alpha, because neither painter has an alpha channel — and no corpus shadow falls on anything but paper. The blur radius is dropped: a hard edge at the right offset is much closer to Word's ink than no shadow at all. `rgb`, `alpha` and `blurPt` keep the authored values for writers. |
| `shapeId?` | `number` | `wp:docPr/@id` of the inline drawing. Pure metadata for geometry queries (two drawings sharing one flow slot are otherwise indistinguishable); painters never read it. |
| `shapes?` | `LayoutShapeGeom[]` | Set instead of a bitmap payload when the drawing is DrawingML shape geometry. A shape has no image part, so `id` is the sentinel `"shape"` and `mime` is `"other"`: there is deliberately no `LayoutDocument.images` entry to look up, and painters must test this field BEFORE reaching for one (see `paintDrawing` in paint/scene.ts). |
| `slotHHmm?` | `number` | Height of the flow slot when the painted child is inset in it (effect extent). |
| `vectorKind?` | `"chart" \| "diagram"` | What the vector `shapes` ARE, when the parser knows: a chart plot or a SmartArt diagram. Pure metadata for sketches/tools; painters never read it. Absent = plain drawn geometry. |
| `wHmm` | `number` | Placed size in hmm (already scaled to fit the column). |

## `LayoutShapeGeom`

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

| Name | Type | Description |
| - | - | - |
| `clipD?` | `string` | Paint only inside this path (same frame as `d`, even-odd): an inner shadow's silhouette. |
| `d` | `string` | |
| `dxHmm` | `number` | |
| `dyHmm` | `number` | |
| `fill?` | `string` | CSS hex fill. Absent on a stroke-only shape (`a:noFill`, or a rule). |
| `fillOpacity?` | `number` | The solid fill's own DrawingML alpha (0..1); multiplies `opacity`. |
| `fillPaint?` | `LayoutLinearGradient` | Takes precedence over the solid fill. |
| `opacity?` | `number` | Fill/shape opacity (0..1), used by legacy VML translucent overlays. |
| `part?` | `string` | The chart element the shape draws (`chartPartAt`); painters never read it. |
| `reflection?` | `{ alpha: number; authored?: { blur: number; offset: number; size: number; transparency: number }; distHmm: number; sy: number }` | `a:effectLst/a:reflection`, approximated as a flipped translucent copy. |
| `stroke?` | `{ cap?: "round" \| "square"; color: string; dash?: "dot" \| "dash"; dashPattern?: number[]; dashPt?: number; headEnd?: LineEndType; headEndSize?: LineEndSize; join?: "round" \| "bevel"; opacity?: number; paint?: LayoutLinearGradient; tailEnd?: LineEndType; tailEndSize?: LineEndSize; widthPt: number }` | `a:ln` outline. Absent when the shape is fill-only. |

## `ShapeTextPatch`

Import from `@reductoai/xlsx/view`.

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `color?` | `string` | `#RRGGBB`. |
| `grow?` | `1 \| -1` | Increase or Decrease Font Size, each run from its own size. |
| `horizontal?` | `"Left" \| "Center" \| "Right" \| "Justify" \| "Distributed"` | |
| `italic?` | `boolean` | |
| `name?` | `string` | |
| `size?` | `number` | Points. |
| `strike?` | `boolean` | |
| `underline?` | `"None" \| "Single" \| "Double"` | |
| `vertical?` | `"Top" \| "Middle" \| "Bottom" \| "Justify" \| "Distributed"` | |

## `SrcRect`

Source-window fractions, each in \[-1, 1); see `LayoutDocument.images`.

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

| Name | Type | Description |
| - | - | - |
| `b` | `number` | |
| `l` | `number` | |
| `r` | `number` | |
| `t` | `number` | |
