# `NestGen2.Text`
[🔗](https://github.com/integration-technology/nest_gen2_sdk/blob/v0.6.6/lib/nest_gen2/text.ex#L1)

Text rendering from Nest's own Akkurat fonts, on the device.

The `textrender` helper (stb_truetype) rasterises text from the device's
`/nestlabs/share/fonts`, so no font data ships with the SDK (Akkurat is
commercially licensed). On the host (see `docs/host.md`) it reads a copy of
your own Nest's fonts from `~/.nest_gen2_sdk/fonts`, or the `:font_dir` config.

Options:
  * `:font` — `:bold` (default), `:regular`, or a path to a TrueType file
  * `:size` — em size in pixels, default 36
  * `:color` — text colour (hex string or `{r, g, b}`), default white
  * `:background` — colour the text is smoothed onto, default black

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `measure`

```elixir
@spec measure(String.t(), keyword()) ::
  {:ok, {pos_integer(), pos_integer()}} | {:error, term()}
```

Width and height the text would render at.

# `render`

```elixir
@spec render(String.t(), keyword()) :: {:ok, NestGen2.Image.t()} | {:error, term()}
```

Renders text to an image the exact size of the text.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
