pub struct WeightedFontFamily {
pub font_family: Option<String>,
pub weight: Option<i32>,
}Expand description
Represents a font family and weight of text.
This type is not used in any activity, and only used as part of another schema.
Fields§
§font_family: Option<String>The font family of the text. The font family can be any font from the Font menu in Docs or from [Google Fonts] (https://fonts.google.com/). If the font name is unrecognized, the text is rendered in Arial.
weight: Option<i32>The weight of the font. This field can have any value that’s a multiple of 100 between 100 and 900, inclusive. This range corresponds to the numerical values described in the CSS 2.1 Specification, section 15.6, with non-numerical values disallowed. The default value is 400 (“normal”). The font weight makes up just one component of the rendered font weight. A combination of the weight and the text style’s resolved bold value determine the rendered weight, after accounting for inheritance: * If the text is bold and the weight is less than 400, the rendered weight is 400. * If the text is bold and the weight is greater than or equal to 400 but is less than 700, the rendered weight is 700. * If the weight is greater than or equal to 700, the rendered weight is equal to the weight. * If the text is not bold, the rendered weight is equal to the weight.
Trait Implementations§
Source§impl Clone for WeightedFontFamily
impl Clone for WeightedFontFamily
Source§fn clone(&self) -> WeightedFontFamily
fn clone(&self) -> WeightedFontFamily
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WeightedFontFamily
impl Debug for WeightedFontFamily
Source§impl Default for WeightedFontFamily
impl Default for WeightedFontFamily
Source§fn default() -> WeightedFontFamily
fn default() -> WeightedFontFamily
Source§impl<'de> Deserialize<'de> for WeightedFontFamily
impl<'de> Deserialize<'de> for WeightedFontFamily
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for WeightedFontFamily
impl Serialize for WeightedFontFamily
impl Part for WeightedFontFamily
Auto Trait Implementations§
impl Freeze for WeightedFontFamily
impl RefUnwindSafe for WeightedFontFamily
impl Send for WeightedFontFamily
impl Sync for WeightedFontFamily
impl Unpin for WeightedFontFamily
impl UnwindSafe for WeightedFontFamily
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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