TextCharacters
struct · ferroui-base · v0.5.0
struct TextCharacters
A text run that holds text characters.
Members
from_str
fn from_str(text: &str, text_run_properties: Rc<dyn TextRunProperties>) -> Self
Constructs a run for text content from a string.
Panics when the font rendering em size of the properties is not positive.
new
fn new(text: ReadOnlyMemory<u16>, text_run_properties: Rc<dyn TextRunProperties>) -> Self
Constructs a run for text content from a memory region.
Panics when the font rendering em size of the properties is not positive.
run_properties
fn run_properties(self: &Self) -> &Rc<dyn TextRunProperties>
The run's properties (never absent for text characters).
get_shapeable_characters
fn get_shapeable_characters(self: &Self, text: ReadOnlyMemory<u16>, bidi_level: i8, font_manager: &FontManager, previous_properties: &mut Option<Rc<dyn TextRunProperties>>, results: &mut Vec<Rc<dyn TextRun>>)
Gets a list of UnshapedTextRun.
try_get_shapeable_length
fn try_get_shapeable_length(text: &[u16], glyph_typeface: &GlyphTypeface, default_glyph_typeface: Option<&GlyphTypeface>, default_can_shape_script: bool, require_full_cluster: bool) -> Option<usize>
Tries to get a shapeable length that is supported by the specified typeface.
text— the characters to shape.glyph_typeface— the typeface that is used to find matching characters.default_glyph_typeface— the default typeface, orNonewhen there is none to return to (the probe for the default typeface itself).default_can_shape_script— whether the default typeface can shape this run's script. Whenfalseit only reclaims spacing whitespace, which needs no shaping.require_full_cluster— whentrue, a grapheme cluster only counts as supported when the typeface has a glyph for every scalar it contains (base plus combining marks); whenfalse, only the base scalar is tested.
Returns the shapeable length, or None when it is zero.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherTextRun
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.