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.
- Font
Builder - Font builder allows you to load fonts in a declarative manner.
- Font
Glyph - The geometric data specifying where to find a glyph on a font atlas texture for rendering text.
- Font
Height - The size the text that a font is supposed to render.
Each distinct size gets its own atlas page, and
FontHeightallows a f32 to be hashed to look up the page. - Font
Styles - 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§
- Font
Resource - A resource that allows a font to be loaded.