#[non_exhaustive]pub struct TextShapingArgs {Show 20 fields
pub letter_spacing: Px,
pub word_spacing: Px,
pub line_height: Px,
pub line_spacing: Px,
pub paragraph_spacing: Px,
pub paragraph_indent: (Px, bool),
pub lang: Lang,
pub direction: LayoutDirection,
pub ignore_ligatures: bool,
pub disable_kerning: bool,
pub tab_x_advance: Px,
pub inline_constraints: Option<InlineConstraintsMeasure>,
pub font_features: RFontFeatures,
pub max_width: Px,
pub paragraph_break: ParagraphBreak,
pub line_break: LineBreak,
pub word_break: WordBreak,
pub hyphens: Hyphens,
pub hyphen_char: Txt,
pub obscuring_char: Option<char>,
}Expand description
Extra configuration for shape_text.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.letter_spacing: PxExtra spacing to add after each character.
word_spacing: PxExtra spacing to add after each space (U+0020 SPACE).
line_height: PxHeight of each line.
Default can be computed using FontMetrics::line_height.
line_spacing: PxExtra spacing added in between lines.
paragraph_spacing: PxReplacement space between paragraphs.
paragraph_indent: (Px, bool)Extra spacing in paragraph lines start.
The bool indicates if spacing is inverted (hang), applied to all paragraph lines except the first.
lang: LangPrimary language of the text.
direction: LayoutDirectionText flow direction.
ignore_ligatures: boolDon’t use font ligatures.
disable_kerning: boolDon’t use font letter spacing.
tab_x_advance: PxWidth of the TAB character.
inline_constraints: Option<InlineConstraintsMeasure>Inline constraints for initial text shaping and wrap.
font_features: RFontFeaturesFinalized font features.
max_width: PxMaximum line width.
Is Px::MAX when text wrap is disabled.
paragraph_break: ParagraphBreakDefinition of paragraphs.
line_break: LineBreakLine break config for Chinese, Japanese, or Korean text.
word_break: WordBreakWorld break config.
This value is only considered if it is impossible to fit the word to a line.
hyphens: HyphensHyphen breaks config.
hyphen_char: TxtCharacter rendered when text is hyphenated by break.
obscuring_char: Option<char>Obscure the text with the replacement char.
Trait Implementations§
Source§impl Clone for TextShapingArgs
impl Clone for TextShapingArgs
Source§fn clone(&self) -> TextShapingArgs
fn clone(&self) -> TextShapingArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextShapingArgs
impl Debug for TextShapingArgs
Auto Trait Implementations§
impl Freeze for TextShapingArgs
impl RefUnwindSafe for TextShapingArgs
impl Send for TextShapingArgs
impl Sync for TextShapingArgs
impl Unpin for TextShapingArgs
impl UnwindSafe for TextShapingArgs
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more