---
id: "packages/active-charts/all-exports/export-fonts"
title: "Export fonts"
description: "ChartExportFontFace, ChartExportFontFamily, ChartExportFonts, ChartExportFontSource: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/export-fonts"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:export-fonts"
---

# Export fonts

Exported by `@workspace/active-charts`. Generated from the package source; part of [the index of every export](/packages/active-charts/all-exports).

## Types

**ChartExportFontFace**

```ts
interface ChartExportFontFace {
  source: ChartExportFontSource;
  weight?: number;
  style?: 'normal' | 'italic';
}
```

One font file of a family.

**ChartExportFontFamily**

```ts
interface ChartExportFontFamily {
  family: string;
  faces: readonly ChartExportFontFace[];
}
```

A host font family, under the host's own name.

**ChartExportFonts**

```ts
interface ChartExportFonts {
  families: readonly ChartExportFontFamily[];
  embedInSvg?: boolean;
}
```

The fonts of a visual export: the primary family first, then the fallback
families in the order the host wants them tried. One set serves every
visual format:

- **PDF** draws each text element in the first family that covers all of
it and refuses text none covers.
- **SVG** names the families, in order, before the live chart's own font
stack, and embeds their faces only with `embedInSvg`.
- **PNG** embeds every face of every family and rasterises with the same
family order, so the browser falls back per glyph across the host's
families before any system font.

The chart is never laid out again in these fonts: it keeps the geometry of
the live font, so a family with other metrics can shift or clip text. Put
the live family first for the closest result.

**ChartExportFontSource**

```ts
type ChartExportFontSource =
  ArrayBuffer | Uint8Array | (() => Promise<ArrayBuffer | Uint8Array>);
```

The bytes of one font file, or a loader the package calls once, before the
export's capture moment, when an export needs the face. The host's loader
owns the network, its timeout, retries and credentials; the package never
takes a URL.
