summaryrefslogtreecommitdiff
path: root/doc/hooks/installFonts.section.md
blob: 6c1c2c139313fece0a538cb33a654d8fa7436ec2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# `installFonts` {#installfonts}

This hook installs common font formats to the proper location. In its default state, the hook automatically handles ttf, ttc, otf, bdf, and psf. Given a `webfont` output, woff and woff2 formats will be installed under this output.

The automatic behavior of the hook can be disabled by setting the `dontInstallFonts` variable to true.

Additionally, it exposes the `installFont` function that can be used from your `postInstall`
hook, to install additional formats:

## `installFont` {#installfonts-installfont}

The `installFont` function takes two arguments, a file extension to move (*without* a preceding dot), and the install location.

### Example Usage {#installfonts-installfont-exampleusage}

```nix
{
  nativeBuildInputs = [ installFonts ];

  postInstall = ''
    installFont svg $out/share/fonts/svg
  '';
}
```