module

CrImage::Font

CrImage::Font provides text rendering capabilities with TrueType font support.

Features:

  • TrueType font rendering with glyph rasterization
  • Multi-line text with word wrapping
  • Text alignment (horizontal and vertical)
  • Text effects (shadows, outlines, decorations)
  • Kerning support
  • Font metrics and measurements

This module defines the Face interface for font implementations. Font face implementations are provided by other modules (e.g., FreeType).

Class methods

bounds(f : Face, s : String) : Tuple(Math::Fixed::Rectangle26_6, Math::Fixed::Int26_6)

returns the bounding box of s with f, drawn at a dot equal to the origin, as well as the advance.

Source
measure(f : Face, s : String) : Math::Fixed::Int26_6

returns how far dot would advance by drawing s with f

Source

Nested types