# `RasterExRatatui.Font.Default6x8`
[🔗](https://github.com/mcass19/raster_ex_ratatui/blob/v0.4.0/lib/raster_ex_ratatui/font/default6x8.ex#L1)

The built-in 6×8 monospace bitmap font, drawn for a 400×300 1-bit e-ink panel and readable on any panel with an integer `scale:`.

Each cell is 6×8 pixels: text glyphs are drawn 5×7 with one blank column on the right (inter-cell spacing) and one blank row at the bottom (inter-line spacing); box-drawing and block glyphs fill all 48 pixels so they join across cells.

## Coverage

Hand-drawn:

  * All of printable ASCII (`U+0020`–`U+007E`)
  * Light box drawing `─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼`, and the corners and lines of every `Block` border type: rounded `╭ ╮ ╰ ╯`, heavy `━ ┃ ┏ ┓ ┗ ┛`, double `═ ║ ╔ ╗ ╚ ╝`
  * Block elements: `█ ▀ ▄ ░ ▒ ▓`
  * Symbols: `° · • … ← ↑ → ↓ ✓ ✗ ▲ ▶ ▼ ◀ ○ ●`

Generated from their Unicode geometry by `RasterExRatatui.Font.Generated`:

  * The braille block `U+2800`–`U+28FF` (the `Canvas` widget's default marker); each dot is a solid 3×2 block, so neighbouring dots merge into lines
  * Eighth blocks `▁ ▂ ▃ ▅ ▆ ▇`, `▏ ▎ ▍ ▌ ▋ ▊ ▉`, `▐ ▔ ▕`
  * Quadrants `▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟` (`BigText`'s `:quadrant` size)

Hand-drawn glyphs win where both exist. Any other codepoint renders as a hatched box (`RasterExRatatui.Font.Generated.hatched/1`), so it is obvious in a rendering rather than silently blank.

## Examples

    iex> alias RasterExRatatui.Font.{Art, Default6x8}
    iex> Default6x8.glyph(?A) |> Art.render(Default6x8.cell_size())
    ".###..\n#...#.\n#...#.\n#####.\n#...#.\n#...#.\n#...#.\n......\n"

# `cell_size`

```elixir
@spec cell_size() :: {6, 8}
```

Cell size in pixels: `{6, 8}`.

## Examples

    iex> RasterExRatatui.Font.Default6x8.cell_size()
    {6, 8}

# `codepoints`

```elixir
@spec codepoints() :: [non_neg_integer()]
```

Every codepoint with a glyph, sorted ascending. For tests and tooling.

## Examples

    iex> ?A in RasterExRatatui.Font.Default6x8.codepoints()
    true

# `glyph`

```elixir
@spec glyph(non_neg_integer()) :: &lt;&lt;_::48&gt;&gt;
```

The 48-bit bitmap for `codepoint`, or the hatched placeholder.

## Examples

    iex> RasterExRatatui.Font.Default6x8.glyph(?\s)
    <<0::48>>

    iex> RasterExRatatui.Font.Default6x8.glyph(0x1F600) == RasterExRatatui.Font.Generated.hatched({6, 8})
    true

# `has_glyph?`

```elixir
@spec has_glyph?(non_neg_integer()) :: boolean()
```

Whether `codepoint` has a hand-drawn or generated glyph.

## Examples

    iex> RasterExRatatui.Font.Default6x8.has_glyph?(0x2588)
    true

    iex> RasterExRatatui.Font.Default6x8.has_glyph?(0x1F600)
    false

---

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