Struct google_docs1::api::TextStyle

source ·
pub struct TextStyle {
    pub background_color: Option<OptionalColor>,
    pub baseline_offset: Option<String>,
    pub bold: Option<bool>,
    pub font_size: Option<Dimension>,
    pub foreground_color: Option<OptionalColor>,
    pub italic: Option<bool>,
    pub link: Option<Link>,
    pub small_caps: Option<bool>,
    pub strikethrough: Option<bool>,
    pub underline: Option<bool>,
    pub weighted_font_family: Option<WeightedFontFamily>,
}
Expand description

Represents the styling that can be applied to text. Inherited text styles are represented as unset fields in this message. A text style’s parent depends on where the text style is defined: * The TextStyle of text in a Paragraph inherits from the paragraph’s corresponding named style type. * The TextStyle on a named style inherits from the normal text named style. * The TextStyle of the normal text named style inherits from the default text style in the Docs editor. * The TextStyle on a Paragraph element that’s contained in a table may inherit its text style from the table style. If the text style does not inherit from a parent, unsetting fields will revert the style to a value matching the defaults in the Docs editor.

This type is not used in any activity, and only used as part of another schema.

Fields§

§background_color: Option<OptionalColor>

The background color of the text. If set, the color is either an RGB color or transparent, depending on the color field.

§baseline_offset: Option<String>

The text’s vertical offset from its normal position. Text with SUPERSCRIPT or SUBSCRIPT baseline offsets is automatically rendered in a smaller font size, computed based on the font_size field. Changes in this field don’t affect the font_size.

§bold: Option<bool>

Whether or not the text is rendered as bold.

§font_size: Option<Dimension>

The size of the text’s font.

§foreground_color: Option<OptionalColor>

The foreground color of the text. If set, the color is either an RGB color or transparent, depending on the color field.

§italic: Option<bool>

Whether or not the text is italicized.

§link: Option<Link>

The hyperlink destination of the text. If unset, there’s no link. Links are not inherited from parent text. Changing the link in an update request causes some other changes to the text style of the range: * When setting a link, the text foreground color will be updated to the default link color and the text will be underlined. If these fields are modified in the same request, those values will be used instead of the link defaults. * Setting a link on a text range that overlaps with an existing link will also update the existing link to point to the new URL. * Links are not settable on newline characters. As a result, setting a link on a text range that crosses a paragraph boundary, such as "ABC\n123", will separate the newline character(s) into their own text runs. The link will be applied separately to the runs before and after the newline. * Removing a link will update the text style of the range to match the style of the preceding text (or the default text styles if the preceding text is another link) unless different styles are being set in the same request.

§small_caps: Option<bool>

Whether or not the text is in small capital letters.

§strikethrough: Option<bool>

Whether or not the text is struck through.

§underline: Option<bool>

Whether or not the text is underlined.

§weighted_font_family: Option<WeightedFontFamily>

The font family and rendered weight of the text. If an update request specifies values for both weighted_font_family and bold, the weighted_font_family is applied first, then bold. If weighted_font_family#weight is not set, it defaults to 400. If weighted_font_family is set, then weighted_font_family#font_family must also be set with a non-empty value. Otherwise, a 400 bad request error is returned.

Trait Implementations§

source§

impl Clone for TextStyle

source§

fn clone(&self) -> TextStyle

Returns a copy 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 TextStyle

source§

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

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

impl Default for TextStyle

source§

fn default() -> TextStyle

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

impl<'de> Deserialize<'de> for TextStyle

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 Serialize for TextStyle

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 Part for TextStyle

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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>,