pub enum TextAnchor {
Start,
Middle,
End,
}Expand description
The ‘text-anchor’ property is used to align (start-, middle- or end-alignment) a string of text relative to a given point.
The ‘text-anchor’ property is applied to each individual text chunk within a given ‘text’ element. Each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the ‘x’ and ‘y’ attributes on the ‘text’ element, any ‘x’ or ‘y’ attribute values on a ‘tspan’, ‘tref’ or ‘altGlyph’ element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a ‘textPath’ element.
Variants§
Start
The rendered characters are aligned such that the start of the resulting rendered text is at the initial current text position. For an element with a ‘direction’ property value of “ltr” (typical for most European languages), the left side of the text is rendered at the initial text position. For an element with a ‘direction’ property value of “rtl” (typical for Arabic and Hebrew), the right side of the text is rendered at the initial text position. For an element with a vertical primary text direction (often typical for Asian text), the top side of the text is rendered at the initial text position.
Middle
The rendered characters are aligned such that the geometric middle of the resulting rendered text is at the initial current text position.
End
The rendered characters are aligned such that the end of the resulting rendered text is at the initial current text position. For an element with a ‘direction’ property value of “ltr” (typical for most European languages), the right side of the text is rendered at the initial text position. For an element with a ‘direction’ property value of “rtl” (typical for Arabic and Hebrew), the left side of the text is rendered at the initial text position. For an element with a vertical primary text direction (often typical for Asian text), the bottom of the text is rendered at the initial text position.
Trait Implementations§
Source§impl Clone for TextAnchor
impl Clone for TextAnchor
Source§fn clone(&self) -> TextAnchor
fn clone(&self) -> TextAnchor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextAnchor
impl Debug for TextAnchor
Source§impl<'de> Deserialize<'de> for TextAnchor
impl<'de> Deserialize<'de> for TextAnchor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Deserialize for TextAnchor
impl Deserialize for TextAnchor
type Value = TextAnchor
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer,
derserializer.