Draft:Slug Library
| Slug Library | |
|---|---|
| Developer | Terathon Software |
| Initial release | June 7, 2017 |
| Stable release | 7.4
/ May 14, 2025 |
| Written in | C++ |
| Platform | Microsoft Windows, macOS, Linux, PlayStation 4, PlayStation 5, Xbox One Xbox Series X/S, iOS, Android |
| License | Proprietary |
| Website | sluglibrary |
The Slug Library is a middleware library developed by Terathon Software for dynamic GPU-based rendering of high-quality, resolution-independent text and vector graphics. It is primarily used in 3D applications, such as video games, virtual environments, and graphical user interfaces, to handle font rendering and text layout. The library employs a novel mathematical algorithm to render antialiased glyphs and shapes directly from Bézier curve outlines, without relying on precomputed textures or signed distance fields.[1]
History
The Slug Library was created by Eric Lengyel, founder of Terathon Software, with the core idea originating in 2016. The name "Slug" derives from typography terminology, referring to a line of text cast as a single piece of molten lead in traditional printing presses, reflecting the library's focus on text layout and rendering. Initially designed for text rendering, it later expanded to support arbitrary vector graphics.
The underlying technology was detailed in Lengyel's 2017 paper, "GPU-Centered Font Rendering Directly from Glyph Outlines," published in the Journal of Computer Graphics Techniques.[2] The paper presents a novel shader-based approach for robustly calculating winding numbers at arbitrary points inside a glyph, which enables efficient and artifact-free GPU rendering. The work was also included in the program at the ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games (I3D) in 2018.[3] The algorithm described in these publications is currently patented.[4]
By 2022, the library had been licensed to numerous major companies across multiple software industries, and it has become a standard technology in the computer games industry. It is widely considered to be the state-of-the-art solution for text rendering in game engines.
Slug has also been integrated into the Unreal Engine.[5]
Features
The Slug Library provides a range of features for text and graphics rendering:
- GPU Rendering: Renders shapes directly on the GPU from quadratic Bézier curves, producing antialiased results without artifacts under magnification or minification.
- Text Layout: Handles Unicode strings (UTF-8 encoded), including kerning, ligatures, diacritical marks, character composition, and OpenType features like stylistic alternates and small caps.
- Emoji: Supports full-color emoji rendering with resolution independence, including skin tone modifiers and ZWJ sequences.
- Vector Graphics: Extends beyond text to render arbitrary fills and strokes.
- Platform Support: Directly supports multiple graphics APIs (Vulkan, Direct3D, OpenGL, Metal) and operating systems (Windows, macOS, Linux, PlayStation, Xbox).
- Tools: Includes tools for converting TrueType (.ttf) and OpenType (.otf) fonts as well as SVG files to the Slug format.
The library is distributed as a static C++ library with full source code included.
Notable Licensees
- 2K Games
- Activision
- Adobe Inc.
- Blizzard Entertainment[6]
- Derivative Inc.[7]
- Fatshark
- Firaxis Games
- Hexagon AB
- id Software[8]
- Insomniac Games
- Invideo
- Marmoset Toolbag
- Notch
- Quantic Dream
- That Game Company
- Treyarch
- Ubisoft
- Warner Bros. Games
- Wonderland Engine[9]
- WSC Sports
- Zeiss
- ZeniMax Online Studios
References
- ^ "Slug Library".
- ^ Lengyel, Eric (June 14, 2017). "GPU-Centered Font Rendering Directly from Glyph Outlines". Journal of Computer Graphics Techniques (JCGT). 6 (2): 31–47.
- ^ "JCGT papers to be presented at I3D, extended I3D papers to be published in JCGT".
- ^ US patent 10373352, Eric Lengyel, "Method for rendering resolution-independent shapes directly from outline control points", issued 2019-08-06, assigned to Terathon Software LLC
- ^ "Rendering scalable vector text in Unreal Engine".
- ^ "Dragonflight Alpha - Slug Library, Diablo IV Quarterly Update - August 2022".
- ^ "Slug Library".
- ^ "LinkedIn post".
- ^ "Text Rendering".