Skip to content

@shbernal/ts-pptx


@shbernal/ts-pptx / index / Coord

Type Alias: Coord

Coord = number | `${number}%` | `${number}in` | `${number}pt` | `${number}px` | `${number}emu`

Defined in: src/types/core.ts:27

Coordinate value. A bare number is always inches — there is no magnitude-based unit guessing. For other units use an explicit string suffix:

  • number → inches (e.g. 10.25)
  • "<n>%" → percentage of the slide axis (e.g. "75%")
  • "<n>in" → inches (e.g. "10.25in")
  • "<n>pt" → points (e.g. "72pt" = 1 inch)
  • "<n>px" → CSS reference pixels at 96 px/inch (e.g. "96px" = 1 inch), for authoring against a known web/source canvas size
  • "<n>emu" → raw EMU, the escape hatch for exact OOXML units (e.g. "914400emu" = 1 inch)

Examples

ts
10.25 // inches
ts
'75%' // percentage of slide size
ts
'72pt' // points
ts
'960px' // pixels at 96 DPI = 10 inches
ts
'914400emu' // raw EMU