Struct CharacterProperty

Source
pub struct CharacterProperty<'a> {
Show 39 fields pub style_id: Option<CharacterStyleId<'a>>, pub fonts: Option<Fonts>, pub bold: Option<Bold>, pub bold_complex: Option<BoldComplex>, pub italics: Option<Italics>, pub italics_complex: Option<ItalicsComplex>, pub caps: Option<Caps>, pub small_caps: Option<SmallCaps>, pub strike: Option<Strike>, pub dstrike: Option<Dstrike>, pub outline: Option<Outline>, pub shadow: Option<Shadow>, pub emboss: Option<Emboss>, pub imprint: Option<Imprint>, pub no_proof: Option<NoProof>, pub snap_to_grid: Option<SnapToGrid>, pub vanish: Option<Vanish>, pub web_hidden: Option<WebHidden>, pub color: Option<Color<'a>>, pub spacing: Option<TextSpacing>, pub scale: Option<Scale>, pub kern: Option<Kern>, pub position: Option<Position>, pub size: Option<Size>, pub size_complex: Option<SizeComplex>, pub highlight: Option<Highlight>, pub underline: Option<Underline<'a>>, pub effect: Option<Effect>, pub border: Option<TextBorder<'a>>, pub shading: Option<Shading<'a>>, pub fit_text: Option<FitText>, pub vertical_align: Option<VertAlign>, pub rtl: Option<RightToLeftText>, pub complex_script: Option<ComplexScript>, pub emphasis: Option<Emphasis>, pub lang: Option<Lang<'a>>, pub east_asian_layout: Option<EastAsianLayout>, pub spec_vanish: Option<SpecVanish>, pub o_math: Option<OMath>,
}
Expand description

Character Property

use docx_rust::formatting::{CharacterProperty, UnderlineStyle, HighlightType};

let prop = CharacterProperty::default()
    .style_id("foo")
    .color("00ff00")
    .color(0xff0000)
    .color((0x00, 0x00, 0xff))
    .size(42isize)
    .bold(true)
    .italics(false)
    .strike(true)
    .dstrike(false)
    .outline(true)
    .highlight(HighlightType::Yellow)
    .underline("00ff00")
    .underline(("ff0000", UnderlineStyle::Dash));

Fields§

§style_id: Option<CharacterStyleId<'a>>

Specifies the style ID of the character style.

§fonts: Option<Fonts>

Specifies the font.

§bold: Option<Bold>

Specifies that the text of the text run is to be bold.

§bold_complex: Option<BoldComplex>§italics: Option<Italics>

Specifies that the text of the text run is to be italics.

§italics_complex: Option<ItalicsComplex>

Complex Script Italics

§caps: Option<Caps>

Display All Characters As Capital Letters

§small_caps: Option<SmallCaps>

Small Caps

§strike: Option<Strike>

Specifies that the contents are to be displayed with a horizontal line through the center of the line.

§dstrike: Option<Dstrike>

Specifies that the contents are to be displayed with two horizontal lines through each character.

§outline: Option<Outline>

Specifies that the content should be displayed as if it had an outline.

§shadow: Option<Shadow>

Shadow

§emboss: Option<Emboss>

Embossing

§imprint: Option<Imprint>

Imprinting

§no_proof: Option<NoProof>

Do Not Check Spelling or Grammar

§snap_to_grid: Option<SnapToGrid>

Use Document Grid Settings For Inter-Character Spacing

§vanish: Option<Vanish>

Hidden Text

§web_hidden: Option<WebHidden>

Web Hidden Text

§color: Option<Color<'a>>

Specifies the color to be used to display text.

§spacing: Option<TextSpacing>

Character Spacing Adjustment

§scale: Option<Scale>

Expanded/Compressed Text

§kern: Option<Kern>

Font Kerning

§position: Option<Position>

Vertically Raised or Lowered Text

§size: Option<Size>

Specifies the font size in half points.

§size_complex: Option<SizeComplex>

Complex Script Font Size

§highlight: Option<Highlight>

Text Highlighting

§underline: Option<Underline<'a>>

Specifies that the content should be displayed with an underline

§effect: Option<Effect>

Animated Text Effect

§border: Option<TextBorder<'a>>

Text Border

§shading: Option<Shading<'a>>

Run Shading

§fit_text: Option<FitText>

Manual Run Width

§vertical_align: Option<VertAlign>

Subscript/Superscript Text

§rtl: Option<RightToLeftText>

Right To Left Text

§complex_script: Option<ComplexScript>

Use Complex Script Formatting on Run

§emphasis: Option<Emphasis>

Emphasis Mark

§lang: Option<Lang<'a>>

Specifies the language to be used.

§east_asian_layout: Option<EastAsianLayout>

East Asian Typography Settings

§spec_vanish: Option<SpecVanish>

Paragraph Mark Is Always Hidden

§o_math: Option<OMath>

Office Open XML Math

Implementations§

Source§

impl<'a> CharacterProperty<'a>

Source

pub fn style_id<T: Into<CharacterStyleId<'a>>>(self, value: T) -> Self

Source

pub fn color<T: Into<Color<'a>>>(self, value: T) -> Self

Source

pub fn highlight<T: Into<Highlight>>(self, value: T) -> Self

Source

pub fn bold<T: Into<Bold>>(self, value: T) -> Self

Source

pub fn dstrike<T: Into<Dstrike>>(self, value: T) -> Self

Source

pub fn italics<T: Into<Italics>>(self, value: T) -> Self

Source

pub fn outline<T: Into<Outline>>(self, value: T) -> Self

Source

pub fn strike<T: Into<Strike>>(self, value: T) -> Self

Source

pub fn size<T: Into<Size>>(self, value: T) -> Self

Source

pub fn underline<T: Into<Underline<'a>>>(self, value: T) -> Self

Source

pub fn fonts<T: Into<Fonts>>(self, value: T) -> Self

Trait Implementations§

Source§

impl<'a> Clone for CharacterProperty<'a>

Source§

fn clone(&self) -> CharacterProperty<'a>

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<'a> Debug for CharacterProperty<'a>

Source§

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

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

impl<'a> Default for CharacterProperty<'a>

Source§

fn default() -> CharacterProperty<'a>

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

impl<'__input: 'a, 'a> XmlRead<'__input> for CharacterProperty<'a>

Source§

fn from_reader(reader: &mut XmlReader<'__input>) -> XmlResult<Self>

Source§

fn from_str(text: &'a str) -> Result<Self, XmlError>

Source§

impl<'a> XmlWrite for CharacterProperty<'a>

Source§

fn to_writer<W: Write>(&self, writer: &mut XmlWriter<W>) -> XmlResult<()>

Source§

fn to_string(&self) -> Result<String, XmlError>

Auto Trait Implementations§

§

impl<'a> Freeze for CharacterProperty<'a>

§

impl<'a> RefUnwindSafe for CharacterProperty<'a>

§

impl<'a> Send for CharacterProperty<'a>

§

impl<'a> Sync for CharacterProperty<'a>

§

impl<'a> Unpin for CharacterProperty<'a>

§

impl<'a> UnwindSafe for CharacterProperty<'a>

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

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> XmlReadOwned for T
where T: for<'s> XmlRead<'s>,