Skip to main content

BlockConfig

Struct BlockConfig 

Source
pub struct BlockConfig {
Show 18 fields pub font_family: Option<String>, pub font_size_pt: Option<f32>, pub font_weight: Option<FontWeight>, pub font_style: Option<FontStyleVariant>, pub text_color: Option<Color>, pub background_color: Option<Color>, pub line_height: Option<f32>, pub text_align: Option<TextAlignment>, pub border: Option<BorderConfig>, pub padding: Option<Sides<f32>>, pub margin_before_pt: Option<f32>, pub margin_after_pt: Option<f32>, pub indent_pt: Option<f32>, pub letter_spacing_pt: Option<f32>, pub strikethrough: Option<bool>, pub underline: Option<bool>, pub small_caps: Option<bool>, pub fallback_fonts: Option<Vec<String>>,
}
Expand description

The workhorse style block. Applies to any flowable block: paragraph, heading, code block, blockquote, list, table cell, etc.

Fields§

§font_family: Option<String>§font_size_pt: Option<f32>§font_weight: Option<FontWeight>§font_style: Option<FontStyleVariant>§text_color: Option<Color>§background_color: Option<Color>§line_height: Option<f32>

Multiplier of font_size_pt. 1.4 means the line advance is font_size * 1.4.

§text_align: Option<TextAlignment>§border: Option<BorderConfig>§padding: Option<Sides<f32>>§margin_before_pt: Option<f32>§margin_after_pt: Option<f32>§indent_pt: Option<f32>§letter_spacing_pt: Option<f32>§strikethrough: Option<bool>§underline: Option<bool>§small_caps: Option<bool>

When true, every lowercase letter in this block’s text is rendered uppercase at ~78% font size (faux small caps). Real OpenType smcp substitution depends on the loaded font and is a follow-up.

§fallback_fonts: Option<Vec<String>>

Ordered list of fallback font names. Codepoints not covered by the primary body / code font are looked up in each fallback in turn; the first font that has a glyph wins. Only the value on the document [defaults] block is read by the renderer — the field is accepted syntactically on per-block tables but ignored.

Trait Implementations§

Source§

impl Clone for BlockConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BlockConfig

Source§

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

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

impl Default for BlockConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for BlockConfig

Source§

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

Deserialize this value from the given Serde deserializer. Read more

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.