Analytic rasterization
Grayscale and RGB/BGR LCD coverage with gamma, darkening, and subpixel positioning.
Read TrueType, OpenType, and TTC files, extract their outlines, and render antialiased grayscale, LCD, or color glyph bitmaps— without native extensions.
gem install alhena
Alhena keeps the path from raw font bytes to immutable bitmap coverage inside one dependency-free Ruby library.
Grayscale and RGB/BGR LCD coverage with gamma, darkening, and subpixel positioning.
Inspect axes and render persistent instances across fvar, gvar, avar, HVAR, and VVAR data.
Render COLR/CPAL layers and embedded sbix or CBDT/CBLC bitmap strikes.
Lazy table parsing, checked reads, immutable output, and entry- or byte-bounded LRU caching.
The API exposes the useful result without hiding outlines, metrics, or raw table data.
require "alhena"
font = Alhena::Font.open("NotoSans-Regular.ttf")
glyph = font.glyph_id("A")
bitmap = font.rasterize(glyph, size: 24)
puts bitmap.to_ascii
Supported paths are documented precisely. Unsupported structures fail with typed errors.
Shaping, hinting, kerning, and system font discovery stay outside Alhena’s scope. Pair it with the specialist tool your application needs.
Median local measurements on Ruby 4.0 with YJIT on arm64-darwin24.
gem install alhena