Skip to main content

Module font

Module font 

Source
Expand description

A font resource allows FormattedText to render text as a series of glyphs taken from a font file such as a ttf file or an otf file.

Modules§

loader
Font loader.

Structs§

Atlas
Atlas is a storage for glyphs of a particular size, each atlas could have any number of pages to store the rasterized glyphs.
Font
A font resource and the associated data required for rendering glyphs from the font.
FontBuilder
Font builder allows you to load fonts in a declarative manner.
FontGlyph
The geometric data specifying where to find a glyph on a font atlas texture for rendering text.
FontHeight
The size the text that a font is supposed to render. Each distinct size gets its own atlas page, and FontHeight allows a f32 to be hashed to look up the page.
FontStyles
Page
Page is a storage for rasterized glyphs.

Statics§

BOLD_ITALIC
Fyrox’s default build-in font for rendering bold italic text when no other font is specified.
BUILT_IN_BOLD
Fyrox’s default build-in font for rendering bold text when no other font is specified.
BUILT_IN_FONT
Fyrox’s default build-in font for rendering text when no other font is specified.
BUILT_IN_ITALIC
Fyrox’s default build-in font for rendering italic text when no other font is specified.

Functions§

wait_for_subfonts
Wait for all subfonts of this font to be completely loaded, including recursively searching through the fallback fonts, and the fallbacks of the fallbacks, to ensure that this font is fully ready to be used. In the event that any of the fonts failed to load, or a cycle is found in the fallbacks, then an error is returned.

Type Aliases§

FontResource
A resource that allows a font to be loaded.