# `Drafter.Widget.Digits.Bitmap`
[🔗](https://github.com/jaman/drafter/blob/main/lib/drafter/widget/digits/bitmap.ex#L1)

The glyph shapes behind the rasterised fonts in `Drafter.Widget.Digits.Font`.

Each character is one 8×16 pixel bitmap: seven columns of shape and one of
side bearing, twelve rows of shape between a row of ascender space and three
of leading. Cap height is ten rows, leaving two for the descenders on `,` and
`;`.

`Drafter.Widget.Digits.Raster` downsamples these bitmaps into the `:tall`,
`:pixel` and `:braille` fonts. See the [large text guide](large_text.md).

In the source shapes, `#` is an ink pixel and `.` is paper.

## Examples

    iex> Drafter.Widget.Digits.Bitmap.width()
    8

    iex> Drafter.Widget.Digits.Bitmap.height()
    16

    iex> Drafter.Widget.Digits.Bitmap.drawable?("Q")
    true

    iex> Drafter.Widget.Digits.Bitmap.drawable?("\u2603")
    false

    iex> Drafter.Widget.Digits.Bitmap.pixels("\u2603")
    MapSet.new([])

# `characters`

```elixir
@spec characters() :: [String.t()]
```

Every character with a bitmap, sorted.

# `drawable?`

```elixir
@spec drawable?(String.t()) :: boolean()
```

Whether a character has a bitmap in some case.

# `height`

```elixir
@spec height() :: pos_integer()
```

Pixel height of every bitmap, ascender space and leading included.

# `pixels`

```elixir
@spec pixels(String.t()) :: MapSet.t({non_neg_integer(), non_neg_integer()})
```

The lit pixels of a character as a `MapSet` of `{x, y}`, origin top left.

Returns an empty set for a character with no bitmap.

# `width`

```elixir
@spec width() :: pos_integer()
```

Pixel width of every bitmap, side bearing included.

---

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