Crate riddle_font[][src]

Riddle crate for loading font files and rendering text to riddle_image images.

Built largely on the back of rusttype and its dependencies.

Example

// Load font from TTF file
let ttf_bytes = include_bytes!("../../example_assets/Roboto-Regular.ttf");
let font = TTFont::load(&ttf_bytes[..])?;

// Render the loaded font to a Riddle image
let image = font.render_simple("Simple String", 24)?;

Modules

rusttype_ext

Traits which expose underlying rusttype crates types

Structs

ImgFont

Represents an image font, which is an Image containing glyphs, glyph information specifying which parts of the image map to which glyph, and layout information.

ImgFontBuilder

A utility to construct an ImgFont given an image and a collection of glyph data.

ImgFontGenerator

A utility for generating ImgFonts from TTFonts.

ImgFontGlyph

Details describing a glyph stored in an image font

ImgFontLayoutRule

Layout will happen relative to a (0,0) point representing the top left of the layout space.

TTFont

Represents a parsed TTF file, and facilitates simple rendering

Enums

FontError