[][src]Struct usvg::TextChunk

pub struct TextChunk {
    pub x: Option<f64>,
    pub y: Option<f64>,
    pub dx: Option<f64>,
    pub dy: Option<f64>,
    pub anchor: TextAnchor,
    pub spans: Vec<TextSpan>,
}

A text chunk.

Contains position and anchor of the next text chunk.

Doesn't represented in SVG directly. Usually, it's a first tspan or text node and any tspan that defines either x or y coordinates.

Note: usvg text chunk isn't strictly the same as an SVG one, because text chunk should be defined only by x or y coordinates. But since resvg backends doesn't have a direct access to glyphs/graphemes we have to create chunks on dx, dy and non-zero rotate to simulate this. This is incorrect, since it breaks text shaping and BIDI reordering (resvg doesn't support this one anyway).

Fields

x: Option<f64>

An optional absolute positions along the X-axis.

y: Option<f64>

An optional absolute positions along the Y-axis.

dx: Option<f64>

An optional relative positions along the X-axis.

dy: Option<f64>

An optional relative positions along the Y-axis.

anchor: TextAnchor

A text anchor/align.

spans: Vec<TextSpan>

A list of text spans.

Trait Implementations

impl Clone for TextChunk[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for TextChunk[src]

Auto Trait Implementations

impl Send for TextChunk

impl Sync for TextChunk

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]