pub struct TextAnchor { /* private fields */ }Expand description
A point of the complete measured block, independent of its line alignment.
Implementations§
Source§impl TextAnchor
impl TextAnchor
Sourcepub fn fractions(horizontal: f64, vertical: f64) -> Result<TextAnchor, Error>
pub fn fractions(horizontal: f64, vertical: f64) -> Result<TextAnchor, Error>
Arbitrary finite justification in a top-down block frame; no 0..1 clamp.
Sourcepub fn first_baseline(horizontal: f64) -> Result<TextAnchor, Error>
pub fn first_baseline(horizontal: f64) -> Result<TextAnchor, Error>
Attach to the actual first baseline at the chosen horizontal fraction.
Sourcepub fn center_baseline(horizontal: f64) -> Result<TextAnchor, Error>
pub fn center_baseline(horizontal: f64) -> Result<TextAnchor, Error>
Attach to the midpoint of the first and last measured baselines.
Sourcepub const fn get_horizontal(&self) -> f64
pub const fn get_horizontal(&self) -> f64
Authored horizontal fraction, without a 0..1 clamp.
Sourcepub const fn get_vertical_fraction(&self) -> Option<f64>
pub const fn get_vertical_fraction(&self) -> Option<f64>
Authored vertical fraction, absent for either baseline choice.
Sourcepub const fn is_first_baseline(&self) -> bool
pub const fn is_first_baseline(&self) -> bool
Whether the vertical choice is the first baseline rather than its center.
Source§impl TextAnchor
impl TextAnchor
Sourcepub const fn top_left() -> TextAnchor
pub const fn top_left() -> TextAnchor
Attach the block’s top_left point.
Sourcepub const fn top_center() -> TextAnchor
pub const fn top_center() -> TextAnchor
Attach the block’s top_center point.
Sourcepub const fn top_right() -> TextAnchor
pub const fn top_right() -> TextAnchor
Attach the block’s top_right point.
Sourcepub const fn center_left() -> TextAnchor
pub const fn center_left() -> TextAnchor
Attach the block’s center_left point.
Sourcepub const fn center() -> TextAnchor
pub const fn center() -> TextAnchor
Attach the block’s center point.
Sourcepub const fn center_right() -> TextAnchor
pub const fn center_right() -> TextAnchor
Attach the block’s center_right point.
Sourcepub const fn bottom_left() -> TextAnchor
pub const fn bottom_left() -> TextAnchor
Attach the block’s bottom_left point.
Sourcepub const fn bottom_center() -> TextAnchor
pub const fn bottom_center() -> TextAnchor
Attach the block’s bottom_center point.
Sourcepub const fn bottom_right() -> TextAnchor
pub const fn bottom_right() -> TextAnchor
Attach the block’s bottom_right point.
Trait Implementations§
Source§impl Clone for TextAnchor
impl Clone for TextAnchor
Source§fn clone(&self) -> TextAnchor
fn clone(&self) -> TextAnchor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TextAnchor
Source§impl Debug for TextAnchor
impl Debug for TextAnchor
impl Eq for TextAnchor
Source§impl PartialEq for TextAnchor
impl PartialEq for TextAnchor
impl StructuralPartialEq for TextAnchor
Auto Trait Implementations§
impl Forget for TextAnchor
impl Freeze for TextAnchor
impl Move for TextAnchor
impl RefUnwindSafe for TextAnchor
impl Send for TextAnchor
impl Sync for TextAnchor
impl Unpin for TextAnchor
impl UnsafeUnpin for TextAnchor
impl UnwindSafe for TextAnchor
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.