Function manganis::font

source ·
pub const fn font() -> FontAssetBuilder
Expand description

Create a font asset

Note: This will do nothing outside of the mg! macro

You can use the font builder to collect fonts that will be included in the final binary from google fonts

const _: &str = manganis::mg!(font().families(["Roboto"]));

You can specify weights for the fonts

const _: &str = manganis::mg!(font().families(["Roboto"]).weights([200]));

Or set the text to only include the characters you need

const _: &str = manganis::mg!(font().families(["Roboto"]).weights([200]).text("Hello, world!"));