Glyphic

Font loading · measuring · rasterizing

Give every glyph a place.

Load BDF bitmap fonts and TrueType outlines, measure UTF-8 text, and draw into Tessel images.

gem install glyphic

Font specimenbaseline / cap height

From font data to a measured line.

Keep text layout and drawing close to the Ruby graphics code that uses it.

01

Load font formats

Read BDF bitmap fonts or rasterize TrueType outlines.

02

Measure text

Wrap UTF-8 strings and lay out text boxes.

03

Resolve missing glyphs

Configure fallbacks and use the built-in example font.

A small first step

Start with one example.

Install the gem, then follow the project guide for platform requirements and the full API.

Read the installation guide ↗

require "glyphic"
require "tessel"

font = Glyphic.default
image = Tessel::Image.new(320, 112, fill: "#101827")
font.draw(image, 12, 12, "Glyphic", color: "#fbbf24")
image.write("type.png")