#[repr(transparent)]pub struct CTRubyAlignment(pub u8);CTRubyAnnotation only.Expand description
These constants specify how to align the ruby annotation and the base text relative to each other when they don’t have the same length.
CoreText will determine the alignment.
The ruby text is aligned with the start edge of the base text.
The ruby text is centered within the width of the base text. If the ruby text is wider than the base text the base text is centered in the width of the ruby text.
The ruby text is aligned with the end edge of the base text.
If the width of the ruby text is less than the width of the base text, the ruby text is evenly distributed over the width of the base text, with the first letter of the ruby text aligning with the first letter of the base text and the last letter of the ruby text aligning with the last letter of the base text. If the width of the base text is less than the width of the ruby text, the base text is evenly distributed over the width of the ruby text.
If the width of the ruby text is less than the width of the base text, the ruby text is evenly distributed over the width of the base text, with a certain amount of space, usually half the inter-character width of the ruby text, before the first and after the last character. If the width of the base text is less than the width of the ruby text, the base text is similarly aligned to the width of the ruby text.
If the ruby text is not adjacent to a line edge it is aligned as with kCTRubyAlignmentAuto. If it is adjacent to a line edge the end of ruby text adjacent to the line edge is aligned to the line edge. This is only relevant if the width of the ruby text is greater than the width of the base text; otherwise alignment is as with kCTRubyAlignmentAuto.
See also Apple’s documentation
Tuple Fields§
§0: u8Implementations§
Trait Implementations§
Source§impl Clone for CTRubyAlignment
impl Clone for CTRubyAlignment
Source§fn clone(&self) -> CTRubyAlignment
fn clone(&self) -> CTRubyAlignment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CTRubyAlignment
impl Debug for CTRubyAlignment
Source§impl Encode for CTRubyAlignment
Available on crate feature objc2 only.
impl Encode for CTRubyAlignment
objc2 only.Source§impl Hash for CTRubyAlignment
impl Hash for CTRubyAlignment
Source§impl Ord for CTRubyAlignment
impl Ord for CTRubyAlignment
Source§fn cmp(&self, other: &CTRubyAlignment) -> Ordering
fn cmp(&self, other: &CTRubyAlignment) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CTRubyAlignment
impl PartialEq for CTRubyAlignment
Source§impl PartialOrd for CTRubyAlignment
impl PartialOrd for CTRubyAlignment
Source§impl RefEncode for CTRubyAlignment
Available on crate feature objc2 only.
impl RefEncode for CTRubyAlignment
objc2 only.