Struct manganis::FontAssetBuilder
source · pub struct FontAssetBuilder;
Expand description
A builder for a font asset. This must be used in the mg!
macro.
Note: This will do nothing outside of the
mg!
macro
Implementations§
source§impl FontAssetBuilder
impl FontAssetBuilder
sourcepub const fn families<const N: usize>(self, families: [&'static str; N]) -> Self
pub const fn families<const N: usize>(self, families: [&'static str; N]) -> Self
Sets the font family of the font
Note: This will do nothing outside of the
mg!
macro
const _: &str = manganis::mg!(font().families(["Roboto"]));
sourcepub const fn weights<const N: usize>(self, weights: [u32; N]) -> Self
pub const fn weights<const N: usize>(self, weights: [u32; N]) -> Self
Sets the font weight of the font
Note: This will do nothing outside of the
mg!
macro
const _: &str = manganis::mg!(font().families(["Roboto"]).weights([200]));
sourcepub const fn text(self, text: &'static str) -> Self
pub const fn text(self, text: &'static str) -> Self
Sets the subset of text that the font needs to support. The font will only include the characters in the text which can make the font file size significantly smaller
Note: This will do nothing outside of the
mg!
macro
const _: &str = manganis::mg!(font().families(["Roboto"]).weights([200]).text("Hello, world!"));
sourcepub const fn display(self, display: &'static str) -> Self
pub const fn display(self, display: &'static str) -> Self
Sets the display of the font. The display control what happens when the font is unavailable
Note: This will do nothing outside of the
mg!
macro
const _: &str = manganis::mg!(font().families(["Roboto"]).weights([200]).text("Hello, world!").display("swap"));
Trait Implementations§
impl ForMgMacro for FontAssetBuilder
Auto Trait Implementations§
impl Freeze for FontAssetBuilder
impl RefUnwindSafe for FontAssetBuilder
impl Send for FontAssetBuilder
impl Sync for FontAssetBuilder
impl Unpin for FontAssetBuilder
impl UnwindSafe for FontAssetBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.