Agent skill · software engineering · aradotso
slug-font-rendering
Reference HLSL shader implementations for the Slug font rendering algorithm, enabling high-quality GPU-accelerated vector font and glyph rendering.
Why this skill is useful
Adds HLSL shader implementations for GPU-accelerated font rendering that are not commonly found in public resources.
What it needs
Requires git installed locally. About 7k tokens when loaded. Last updated 2026-07-09. 70 stars on the source repository.
What this skill does
Slug Font Rendering Algorithm Skill by ara.so — Daily 2026 Skills collection. Slug is a reference implementation of the Slug font rendering algorithm — a GPU-accelerated technique for rendering vector fonts and glyphs at arbitrary scales with high quality anti-aliasing. It works by encoding glyph outlines as lists of quadratic Bézier curves and line segments, then resolving coverage directly in fragment shaders without pre-rasterized textures. Paper: JCGT 2017 — Slug Algorithm Blog (updates): A Decade of Slug License: MIT — Patent dedicated to public domain. Credit required if distributed. --- What Slug Does Renders TrueType/OpenType glyphs entirely on the GPU No texture atlases or pre-rasterization needed Scales to any resolution without quality loss Anti-aliased coverage computed per-fragment using Bézier math Works with any rendering API that supports programmable shaders (D3D11/12, Vulkan, Metal via translation) --- Repository Structure --- Installation / Integration Slug is a reference implementation — you integrate the HLSL shaders into your own rendering pipeline. Step 1: Clone the Repository Step 2: Include the Shaders Copy the .hlsl files into your shader directory and include them in your pipeline: Step 3: Prepare Glyph Data on the CPU You must preprocess font outlines (TrueType/OTF) into Slug's curve buffer format: Decompose glyph contours into quadratic Bézier segments and line segments Upload curve data to a GPU buffer (structured buffer or texture buffer) Precompute per-glyph "band" metadata for the band optimization --- Core Concepts Glyph Coordinate System Glyph outlines live in font units (typically 0–2048 or 0–1000 per em) The fragment shader receives a position in glyph space via interpolated vertex attributes Coverage is computed by counting signed curve crossings in the Y direction (winding number) Curve Data Format Each curve entry in the GPU buffer stores: Band Optimization The glyph bounding box is divided into horizontal bands. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/slug-font-rendering