> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otter-shell.org/llms.txt
> Use this file to discover all available pages before exploring further.

# otter-render

> CPU rendering: colors, surfaces, fonts, images, CommandList, and quad_renderer.

`otter-render` is the software renderer behind Otter Shell UI. Colors, surfaces, FreeType, HarfBuzz shaping, image decode, deferred draw commands.

`otter-ui` fills a `CommandList`. You call `quad_renderer.rasterize` to paint SHM buffers.

## Quick example

```zig theme={null}
const render = @import("otter_render");

const accent = try render.parseColor("#FF5500");
var surface = render.Surface.fromPixels(&pixels, width, height);
surface.clear(render.Color.black);

const font = try render.Font.init(allocator, .{});
defer font.deinit();
font.drawText(&surface, "Hello", .{ .x = 0, .y = 20 }, 16, accent);
```

## Documentation map

<CardGroup cols={2}>
  <Card title="Colors and surfaces" icon="palette" href="/developers/libraries/otter-render/colors-and-surfaces">
    `Color`, `Surface`, HiDPI scaling, and immediate-mode drawing.
  </Card>

  <Card title="Fonts and text" icon="font" href="/developers/libraries/otter-render/fonts-and-text">
    `Font`, `TextSystem`, shaping, bidi, and fallbacks.
  </Card>

  <Card title="Images and animation" icon="image" href="/developers/libraries/otter-render/images-and-animation">
    `Image`, sprite sheets, downsampling, and `Animation`.
  </Card>

  <Card title="Command list" icon="list" href="/developers/libraries/otter-render/command-list">
    `DefaultCommandList`, scissor, damage culling, `quad_renderer`.
  </Card>
</CardGroup>

## Build flags

| Flag                                | Effect                               |
| ----------------------------------- | ------------------------------------ |
| `-Denable_text=false`               | Drop FreeType, HarfBuzz, Fontconfig  |
| `-Denable_svg=false`                | SVG loads return `error.SvgDisabled` |
| `-Denable_wide_image_formats=false` | Limit decode to PNG/JPEG             |

## Dependencies

`otter-geo`, `otter-utils`, FreeType, HarfBuzz, Fontconfig, zigimg.
