TypeStyle

Struct TypeStyle 

Source
pub struct TypeStyle {
Show 28 fields pub font_family: Option<String>, pub font_post_script_name: Option<String>, pub font_style: Option<String>, pub italic: Option<bool>, pub font_weight: Option<f64>, pub font_size: Option<f64>, pub text_case: Option<TextCase>, pub text_align_horizontal: Option<TextAlignHorizontal>, pub text_align_vertical: Option<TextAlignVertical>, pub letter_spacing: Option<f64>, pub fills: Option<Vec<Paint>>, pub hyperlink: Option<Box<Hyperlink>>, pub opentype_flags: Option<HashMap<String, f64>>, pub semantic_weight: Option<SemanticWeight>, pub semantic_italic: Option<SemanticItalic>, pub paragraph_spacing: Option<f64>, pub paragraph_indent: Option<f64>, pub list_spacing: Option<f64>, pub text_decoration: Option<TextDecoration>, pub text_auto_resize: Option<TextAutoResize>, pub text_truncation: Option<TextTruncation>, pub max_lines: Option<f64>, pub line_height_px: Option<f64>, pub line_height_percent: Option<f64>, pub line_height_percent_font_size: Option<f64>, pub line_height_unit: Option<LineHeightUnit>, pub is_override_over_text_style: Option<bool>, pub bound_variables: Option<Box<TypeStyleAllOfBoundVariables>>,
}

Fields§

§font_family: Option<String>

Font family of text (standard name).

§font_post_script_name: Option<String>

PostScript font name.

§font_style: Option<String>

Describes visual weight or emphasis, such as Bold or Italic.

§italic: Option<bool>

Whether or not text is italicized.

§font_weight: Option<f64>

Numeric font weight.

§font_size: Option<f64>

Font size in px.

§text_case: Option<TextCase>

Text casing applied to the node, default is the original casing.

§text_align_horizontal: Option<TextAlignHorizontal>

Horizontal text alignment as string enum.

§text_align_vertical: Option<TextAlignVertical>

Vertical text alignment as string enum.

§letter_spacing: Option<f64>

Space between characters in px.

§fills: Option<Vec<Paint>>

An array of fill paints applied to the characters.

§hyperlink: Option<Box<Hyperlink>>

Link to a URL or frame.

§opentype_flags: Option<HashMap<String, f64>>

A map of OpenType feature flags to 1 or 0, 1 if it is enabled and 0 if it is disabled. Note that some flags aren’t reflected here. For example, SMCP (small caps) is still represented by the textCase field.

§semantic_weight: Option<SemanticWeight>

Indicates how the font weight was overridden when there is a text style override.

§semantic_italic: Option<SemanticItalic>

Indicates how the font style was overridden when there is a text style override.

§paragraph_spacing: Option<f64>

Space between paragraphs in px, 0 if not present.

§paragraph_indent: Option<f64>

Paragraph indentation in px, 0 if not present.

§list_spacing: Option<f64>

Space between list items in px, 0 if not present.

§text_decoration: Option<TextDecoration>

Text decoration applied to the node, default is none.

§text_auto_resize: Option<TextAutoResize>

Dimensions along which text will auto resize, default is that the text does not auto-resize. TRUNCATE means that the text will be shortened and trailing text will be replaced with "…" if the text contents is larger than the bounds. TRUNCATE as a return value is deprecated and will be removed in a future version. Read from textTruncation instead.

§text_truncation: Option<TextTruncation>

Whether this text node will truncate with an ellipsis when the text contents is larger than the text node.

§max_lines: Option<f64>

When textTruncation: \"ENDING\" is set, maxLines determines how many lines a text node can grow to before it truncates.

§line_height_px: Option<f64>

Line height in px.

§line_height_percent: Option<f64>

Line height as a percentage of normal line height. This is deprecated; in a future version of the API only lineHeightPx and lineHeightPercentFontSize will be returned.

§line_height_percent_font_size: Option<f64>

Line height as a percentage of the font size. Only returned when lineHeightPercent (deprecated) is not 100.

§line_height_unit: Option<LineHeightUnit>

The unit of the line height value specified by the user.

§is_override_over_text_style: Option<bool>

Whether or not this style has overrides over a text style. The possible fields to override are semanticWeight, semanticItalic, hyperlink, and textDecoration. If this is true, then those fields are overrides if present.

§bound_variables: Option<Box<TypeStyleAllOfBoundVariables>>

Implementations§

Trait Implementations§

Source§

impl Clone for TypeStyle

Source§

fn clone(&self) -> TypeStyle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TypeStyle

Source§

fn default() -> TypeStyle

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TypeStyle

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TypeStyle

Source§

fn eq(&self, other: &TypeStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TypeStyle

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TypeStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,