# slug-font-rendering

Provides reference HLSL shaders for GPU vector font rendering with the Slug algorithm. Useful for drawing glyphs at any scale without texture atlases.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1300 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/slug-font-rendering/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/slug-font-rendering

## What it does

This skill supplies reference HLSL implementations of the Slug algorithm. It calculates glyph coverage directly in fragment shaders using quadratic Bézier curves and lines, avoiding blurry textures when zooming.

The implementation includes `slug.hlsl`, `curve.hlsl`, and the band-based optimization in `band.hlsl`. It functions across rendering APIs like D3D11, D3D12, Vulkan, and Metal via translation layers.

Shaders cannot render text on their own without CPU preprocessing. You must convert TrueType or OpenType contours into curve records on the host and bind them to a GPU structured buffer.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill slug-font-rendering -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/slug-font-rendering/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/slug-font-rendering/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill slug-font-rendering -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/slug-font-rendering/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill slug-font-rendering -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/slug-font-rendering/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills slug-font-rendering
```

2. **Manually: put the files in place**
- File: `.github/skills/slug-font-rendering/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill slug-font-rendering -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/slug-font-rendering
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/slug-font-rendering/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill slug-font-rendering -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/slug-font-rendering/SKILL.md

## When to use it
- render vector glyphs on GPU without precomputed font atlases
- evaluate quadratic Bézier coverage directly inside fragment shaders
- reduce per-pixel curve intersection tests using band culling
- integrate Slug text drawing routines into D3D12 or Vulkan pipelines

## Example prompts
- Explain how to bind the curve structured buffer to `slug.hlsl` in DirectX 12
- Write a CPU contour preprocessor that outputs quadratic Bézier segments for Slug
- Show how band metadata reduces per-fragment curve evaluations in `band.hlsl`

## Similar
- [ue-materials-rendering](https://affpapa.org/en/nevibecode/skills/ue-materials-rendering.md) — skill · 1200 installs
- [font-pairing-suggester](https://affpapa.org/en/nevibecode/skills/font-pairing-suggester.md) — skill · 578 installs
- [shader-programming](https://affpapa.org/en/nevibecode/skills/shader-programming.md) — skill · 7100 installs
- [shader-graph-create-custom-node](https://affpapa.org/en/nevibecode/skills/shader-graph-create-custom-node.md) — skill · 5600 installs
- [pixijs-rendering](https://affpapa.org/en/nevibecode/skills/pixijs-rendering.md) — skill · 5600 installs
- [blender-rendering](https://affpapa.org/en/nevibecode/skills/blender-rendering.md) — skill · 1300 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 199 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
