pub struct TextShapingArgs {Show 17 fields
pub letter_spacing: Px,
pub word_spacing: Px,
pub line_height: Px,
pub line_spacing: Px,
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 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§
§letter_spacing: Px
Extra spacing to add after each character.
word_spacing: Px
Extra spacing to add after each space (U+0020 SPACE).
line_height: Px
Height of each line.
Default can be computed using FontMetrics::line_height
.
line_spacing: Px
Extra spacing added in between lines.
lang: Lang
Primary language of the text.
direction: LayoutDirection
Text flow direction.
ignore_ligatures: bool
Don’t use font ligatures.
disable_kerning: bool
Don’t use font letter spacing.
tab_x_advance: Px
Width of the TAB character.
inline_constraints: Option<InlineConstraintsMeasure>
Inline constraints for initial text shaping and wrap.
font_features: RFontFeatures
Finalized font features.
max_width: Px
Maximum line width.
Is Px::MAX
when text wrap is disabled.
line_break: LineBreak
Line break config for Chinese, Japanese, or Korean text.
word_break: WordBreak
World break config.
This value is only considered if it is impossible to fit the word to a line.
hyphens: Hyphens
Hyphen breaks config.
hyphen_char: Txt
Character 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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