Struct zng::font::TextShapingArgs
source · 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: Vec<Feature>,
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: Vec<Feature>
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
source§impl Default for TextShapingArgs
impl Default for TextShapingArgs
source§fn default() -> TextShapingArgs
fn default() -> 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
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.