> ## 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.

# Text

## `TextFrame`

`PowerPoint.TextFrame`. `columnCount` and `columnSpacing` are headless extensions (VBA TextFrame2.Column).

Import from `@reductoai/pptx/officejs`.

### TextFrame properties

| Name | Type | Description |
| - | - | - |
| `autoSizeFontScale` | `number \| null` | Extension: the text scale a shrink-to-fit frame paints at (`a:normAutofit@fontScale`); null when the frame does not shrink. |
| `autoSizeLineSpacingReduction` | `number \| null` | Extension: the line spacing a shrink-to-fit frame takes off, as a fraction (`a:normAutofit@lnSpcReduction`). |
| `autoSizeSetting` | `ShapeAutoSize` | |
| `bottomMargin` | `number` | |
| `columnCount` | `number` | Extension: number of text columns (`a:bodyPr@numCol`, 1–16). |
| `columnSpacing` | `number` | Extension: gap between text columns in points (`a:bodyPr@spcCol`). |
| `equations` | `HandleCollection<Equation>` | read-only Extension: every equation in the frame; each reads and rewrites as TeX. |
| `hasText` | `boolean` | read-only |
| `leftMargin` | `number` | |
| `links` | `LinkScope` | read-only |
| `orientation` | `TextOrientation \| null` | Extension (VBA `TextFrame.Orientation`): text direction (`a:bodyPr@vert`); null for a value VBA has no name for. |
| `rightMargin` | `number` | |
| `scope` | `LinkScope \| undefined` | read-only The part the text lives in, when the host knows it. |
| `textRange` | `TextRange` | read-only |
| `topMargin` | `number` | |
| `verticalAlignment` | `TextVerticalAlignment` | |
| `wordWrap` | `boolean` | |

### `TextFrame.deleteText()`

```ts theme={null}
deleteText(): void
```

### `TextFrame.getParentShape()`

```ts theme={null}
getParentShape(): unknown
```

## `TextRange`

`PowerPoint.TextRange`: characters \[start, start + length) of a text frame.
The frame's own range has no fixed length and always spans all its text.

Import from `@reductoai/pptx/officejs`.

### TextRange properties

| Name | Type | Description |
| - | - | - |
| `font` | `ShapeFont` | read-only |
| `paragraphFormat` | `ParagraphFormat` | read-only |
| `equations` | `HandleCollection<Equation>` | read-only Extension: the equations inside the range; each reads and rewrites as TeX. |
| `hyperlinks` | `HyperlinkScopedCollection` | read-only |
| `length` | `number` | read-only |
| `start` | `number` | read-only |
| `text` | `string` | |

### `TextRange.getParentTextFrame()`

```ts theme={null}
getParentTextFrame(): TextFrame
```

### `TextRange.getSubstring()`

```ts theme={null}
getSubstring(start: number, length?: number): TextRange
```

### `TextRange.insertDateTime()`

```ts theme={null}
insertDateTime(format: DateTimeFormat, insertAsField?: boolean): TextRange
```

VBA `TextRange.InsertDateTime`: the range becomes today's date, as a field that updates or as text.

### `TextRange.insertMath()`

```ts theme={null}
insertMath(tex: string, options?: InsertMathOptions): TextRange
```

Extension: writes TeX as a native equation (`a14:m` Office Math) in place of the range and returns
the equation's one-character range. A display equation (`$$…$$`, `\[…\]` or `{ display: true }`)
takes a paragraph of its own. Same as Word's `insertMath`.

### `TextRange.insertSlideNumber()`

```ts theme={null}
insertSlideNumber(): TextRange
```

VBA `TextRange.InsertSlideNumber`: the range becomes a slide number field; returns the field's range.

### `TextRange.overwrite()`

```ts theme={null}
overwrite(text: string): void
```

Extension: rewrites the range character for character, as Change Case does; each run keeps its format.

### `TextRange.setHyperlink()`

```ts theme={null}
setHyperlink(options?: HyperlinkAddOptions): Hyperlink
```

Links the range's text; any link already on it is replaced.

## `ShapeFont`

`PowerPoint.ShapeFont` over a text range. A getter reports the range's direct
formatting: null when the runs disagree or inherit the property.

Import from `@reductoai/pptx/officejs`.

### ShapeFont properties

| Name | Type | Description |
| - | - | - |
| `allCaps` | `boolean \| null` | |
| `bold` | `boolean \| null` | |
| `brightness` | `number \| null` | Extension (VBA `Font2.Fill.ForeColor.Brightness`): -1 (black) to 1 (white) over the text colour. |
| `color` | `string \| null` | |
| `doubleStrikethrough` | `boolean \| null` | |
| `gradientAngle` | `number` | Extension (VBA `Font2.Fill.GradientAngle`): clockwise degrees, 0 = left to right. |
| `gradientStops` | `GradientStops` | read-only Extension (VBA `Font2.Fill.GradientStops`); every run of the range keeps the same stops. |
| `highlightColor` | `string \| null` | Extension (VBA `Font2.Highlight`): the run highlight, `a:highlight`, as `#RRGGBB`; null for none or mixed. |
| `italic` | `boolean \| null` | |
| `kerning` | `number \| null` | Extension (VBA `Font2.Kerning`): the smallest size in points that kerns, `a:rPr@kern`; 0 turns kerning off. |
| `name` | `string \| null` | |
| `nameComplexScript` | `string \| null` | Extension (VBA `Font2.NameComplexScript`): the complex script typeface, `a:cs@typeface`. |
| `nameFarEast` | `string \| null` | Extension (VBA `Font2.NameFarEast`): the East Asian typeface, `a:ea@typeface`. |
| `nameSymbol` | `string \| null` | Extension (`a:sym@typeface`): the typeface for symbol-font characters (U+F000–U+F0FF). |
| `shadow` | `ShadowFormat` | read-only Extension (VBA `Font2.Shadow`): the text's outer shadow. |
| `size` | `number \| null` | |
| `smallCaps` | `boolean \| null` | |
| `spacing` | `number \| null` | Extension (VBA `Font2.Spacing`): character spacing in points, `a:rPr@spc`. |
| `strikethrough` | `boolean \| null` | |
| `subscript` | `boolean \| null` | |
| `superscript` | `boolean \| null` | |
| `themeColor` | `ShapeThemeColor \| null` | Extension (VBA `Font2.Fill.ForeColor.ObjectThemeColor`): the text's theme colour; null for RGB or mixed. |
| `underline` | `ShapeFontUnderlineStyle \| null` | |

### `ShapeFont.clearFormatting()`

```ts theme={null}
clearFormatting(): void
```

Extension (Clear All Formatting): drops every run property but language, proofing marks and links.

### `ShapeFont.setGradientFill()`

```ts theme={null}
setGradientFill(options?: { type?: GradientFillType }): void
```

Extension (VBA `Font2.Fill.TwoColorGradient`): two stops from the text colour to its shade.

## `ParagraphFormat`

`PowerPoint.ParagraphFormat` over the paragraphs a text range touches. The
spacing and indent members are headless extensions named after VBA's
ParagraphFormat2; Office.js has no spelling for them yet.

Import from `@reductoai/pptx/officejs`.

### ParagraphFormat properties

| Name | Type | Description |
| - | - | - |
| `bulletFormat` | `BulletFormat` | read-only |
| `tabStops` | `TabStops` | read-only Extension (VBA `ParagraphFormat2.TabStops`). |
| `baselineAlignment` | `BaselineAlignment \| null` | Extension (VBA `ParagraphFormat2.BaselineAlignment`): how runs of mixed size line up (`a:pPr@fontAlgn`). |
| `defaultTabSize` | `number \| null` | Extension: the spacing of default tab stops in points (`a:pPr@defTabSz`). |
| `firstLineIndent` | `number \| null` | Extension: first-line offset from the left indent in points, negative for a hanging indent (`a:pPr@indent`). |
| `horizontalAlignment` | `ParagraphHorizontalAlignment \| null` | |
| `indentLevel` | `number` | Zero-based outline level (`a:pPr@lvl`, 0–8). |
| `leftIndent` | `number \| null` | Extension: left indent of the text in points (`a:pPr@marL`). |
| `lineSpacing` | `number \| null` | Extension: line spacing as a multiple of single (`a:lnSpc/a:spcPct`). |
| `lineSpacingPoints` | `number \| null` | Extension: exact line pitch in points (`a:lnSpc/a:spcPts`). |
| `rightIndent` | `number \| null` | Extension (VBA `ParagraphFormat2.RightIndent`): right indent of the text in points (`a:pPr@marR`). |
| `spaceAfter` | `number \| null` | Extension: space after the paragraph in points (`a:spcAft/a:spcPts`). |
| `spaceBefore` | `number \| null` | Extension: space before the paragraph in points (`a:spcBef/a:spcPts`). |

## `BulletFormat`

`PowerPoint.BulletFormat`; `character` is a headless extension (`a:buChar@char`).

Import from `@reductoai/pptx/officejs`.

### BulletFormat properties

| Name | Type | Description |
| - | - | - |
| `font` | `BulletFont` | read-only Extension (VBA `BulletFormat.Font`). |
| `character` | `string \| null` | |
| `relativeSize` | `number \| null` | Extension (VBA `BulletFormat.RelativeSize`): bullet size over text size. |
| `style` | `BulletStyle \| null` | |
| `type` | `BulletType \| null` | |
| `useTextColor` | `boolean \| null` | Extension (VBA `BulletFormat.UseTextColor`): true when the bullet states it takes the text colour, false when it states its own. Setting false drops `a:buClrTx`, so an inherited colour applies. |
| `useTextFont` | `boolean \| null` | Extension (VBA `BulletFormat.UseTextFont`): as `useTextColor`, for `a:buFontTx`. |
| `useTextSize` | `boolean \| null` | Extension (`a:buSzTx`): as `useTextColor`, for the bullet size. |
| `visible` | `boolean \| null` | |

### `BulletFormat.picture()`

```ts theme={null}
picture(image: ImageSource): void
```

Extension (VBA `BulletFormat.Picture`): a picture bullet.

## `TabStops`

Extension (VBA `ParagraphFormat2.TabStops`): custom tab stops, the same on every paragraph the range touches.

Import from `@reductoai/pptx/officejs`.

### TabStops properties

| Name | Type | Description |
| - | - | - |
| `count` | `number` | read-only |
| `items` | `TabStop[]` | read-only The stops when every paragraph has the same ones; empty when they differ. |

### `TabStops.add()`

```ts theme={null}
add(type: TabStopType, position: number): TabStop
```

Adds a stop at `position` points from the text box's left inset, replacing one already there.

### `TabStops.clear()`

```ts theme={null}
clear(): void
```

Removes every custom stop; the paragraphs fall back to their default tab size.

### `TabStops.getItemAt()`

```ts theme={null}
getItemAt(index: number): TabStop
```

## `Equation`

`Equation` (extension): one `a14:m` of a text frame, read and rewritten as TeX.

Import from `@reductoai/pptx/officejs`.

### Equation properties

| Name | Type | Description |
| - | - | - |
| `display` | `boolean` | read-only `m:oMathPara`: a display equation that owns its paragraph. |
| `tex` | `string` | The equation as TeX, without delimiters. |

### `Equation.delete()`

```ts theme={null}
delete(): void
```

### `Equation.getRange()`

```ts theme={null}
getRange(): TextRange
```

The object character the equation occupies in its frame's text.

### `Equation.setTex()`

```ts theme={null}
setTex(tex: string, options?: InsertMathOptions): void
```

Rewrites the equation from TeX; the display mode stays unless `options` or delimiters ask otherwise.

## `fitText()`

```ts theme={null}
function fitText(deck: PowerPointPresentation): Promise<number>
```

Stores the fitted scale on every slide shape set to `AutoSizeTextToFitShape`; returns how many shrank.

Import from `@reductoai/pptx/officejs`.
