Module lux::font [] [src]

Text drawing and loading functionality.

WARNING

The render function and the SOURCE_CODE_PRO_REGULAR static variable is only available when lux is compiled with the freetype cargo feature enabled.

Structs

ContainedText

A context that contains information about the text that can be drawn to the screen.

Statics

SOURCE_CODE_PRO_REGULAR

Traits

TextDraw

Any struct that implements TextDraw can draw text to it.

TextLoad

Any struct that implements TextLoad can have fonts atlases added to an internal cache.

Functions

load_atlas

Load the image portion of a font atlas from a slice of bytes, and the metadata portion from a slice.

read_atlas

Load the image portion of a font atlas from one Reader, and the metadata portion from another.

render

Given a freetype face, this function generates a RenderedFont with the a DynamicImage backing it.

save_atlas

Saves an atlas to two paths. One for the image (using the specified image format), one for the font metadata.

write_atlas

Saves an atlas to two Writers. One for the image (using the specified image format), one for the font metadata.