Struct zng_ext_font::GenericFonts
source · pub struct GenericFonts {}
Expand description
Generic fonts configuration for the app.
This type can be accessed from the FONTS
service.
§Defaults
By default the serif
, sans_serif
, monospace
, cursive
and fantasy
are set to their own generic name,
this delegates the resolution to the operating system.
The default fallback
font is “Segoe UI Symbol” for Windows, “Standard Symbols PS” for Linux and “sans-serif” for others.
See also FontNames::system_ui
for the default font selection for UIs.
Implementations§
source§impl GenericFonts
impl GenericFonts
sourcepub fn serif(&self, lang: &Lang) -> FontName
pub fn serif(&self, lang: &Lang) -> FontName
Gets the fallback serif font for the given language.
Returns a font name for the best lang
match.
Note that the returned name can still be the generic "serif"
, this delegates the resolution to the operating system.
sourcepub fn set_serif<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_serif<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the fallback serif font for the given language.
The change applied for the next update.
Use lang!(und)
to set name used when no language matches.
sourcepub fn sans_serif(&self, lang: &Lang) -> FontName
pub fn sans_serif(&self, lang: &Lang) -> FontName
Gets the fallback sans-serif font for the given language.
Returns a font name for the best lang
match.
Note that the returned name can still be the generic "sans-serif"
, this delegates the resolution to the operating system.
sourcepub fn set_sans_serif<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_sans_serif<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the fallback sans-serif font for the given language.
The change applied for the next update.
Use lang!(und)
to set name used when no language matches.
sourcepub fn monospace(&self, lang: &Lang) -> FontName
pub fn monospace(&self, lang: &Lang) -> FontName
Gets the fallback monospace font for the given language.
Returns a font name for the best lang
match.
Note that the returned name can still be the generic "monospace"
, this delegates the resolution to the operating system.
sourcepub fn set_monospace<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_monospace<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the fallback monospace font for the given language.
The change applied for the next update.
Use lang!(und)
to set name used when no language matches.
sourcepub fn cursive(&self, lang: &Lang) -> FontName
pub fn cursive(&self, lang: &Lang) -> FontName
Gets the fallback cursive font for the given language.
Returns a font name for the best lang
match.
Note that the returned name can still be the generic "cursive"
, this delegates the resolution to the operating system.
sourcepub fn set_cursive<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_cursive<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the fallback cursive font for the given language.
The change applied for the next update.
Use lang!(und)
to set name used when no language matches.
sourcepub fn fantasy(&self, lang: &Lang) -> FontName
pub fn fantasy(&self, lang: &Lang) -> FontName
Gets the fallback fantasy font for the given language.
Returns a font name for the best lang
match.
Note that the returned name can still be the generic "fantasy"
, this delegates the resolution to the operating system.
sourcepub fn set_fantasy<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_fantasy<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the fallback fantasy font for the given language.
The change applied for the next update.
Use lang!(und)
to set name used when no language matches.
sourcepub fn fallback(&self, lang: &Lang) -> FontName
pub fn fallback(&self, lang: &Lang) -> FontName
Gets the ultimate fallback font used when none of the other fonts support a glyph.
Returns a font name.
sourcepub fn set_fallback<F: Into<FontName>>(&self, lang: Lang, font_name: F)
pub fn set_fallback<F: Into<FontName>>(&self, lang: Lang, font_name: F)
Sets the ultimate fallback font used when none of other fonts support a glyph.
The change applies for the next update.
Use lang!(und)
to set name used when no language matches.
Auto Trait Implementations§
impl Freeze for GenericFonts
impl RefUnwindSafe for GenericFonts
impl Send for GenericFonts
impl Sync for GenericFonts
impl Unpin for GenericFonts
impl UnwindSafe for GenericFonts
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more