# `Macaw.Layers.Text.Measurer`
[🔗](https://github.com/dcoai/macaw_layers/blob/v0.6.0/lib/macaw/layers/text/measurer.ex#L1)

A resolved measurer (spec/05 §3.1, #62): the measurer and the font its texts are set in,
judged once by `Macaw.Layers.Text.measurer/1`, so that `Macaw.Layers.Text.width/3` and
`Macaw.Layers.Text.lines/4` on it cost the measurer's own work and a constant.

    iex> {:ok, measurer} = Macaw.Layers.Text.measurer(font: "sans-serif")
    iex> Macaw.Layers.Text.width(measurer, "Wednesday", 11)
    {:ok, 59.4}

It is opaque: build one only through `Macaw.Layers.Text.measurer/1`, which is what makes
its measurer a measurer and its font a string. A struct written by hand is not judged.

# `t`

```elixir
@type t() :: %Macaw.Layers.Text.Measurer{font: String.t(), metrics: module()}
```

A measurer and a font, judged once.

---

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