pub struct TextSystem { /* private fields */ }Implementations§
Source§impl TextSystem
impl TextSystem
pub fn new() -> Self
pub fn measure_text( &self, text: impl Into<String>, style: TextStyle, font_registry: &FontRegistry, ) -> Result<TextMeasurement>
pub fn measure_document( &self, document: TextDocument, font_registry: &FontRegistry, ) -> Result<TextMeasurement>
Sourcepub fn measure_document_size(
&self,
request: TextLayoutRequest,
font_registry: &FontRegistry,
) -> Result<Size>
pub fn measure_document_size( &self, request: TextLayoutRequest, font_registry: &FontRegistry, ) -> Result<Size>
Measure advance width and natural line-box height without building SUI’s glyph, caret, selection or ink-bounds geometry. Box height does not constrain the result; box width and paragraph wrapping determine the line breaks.
Sourcepub fn measure_text_size(
&self,
text: impl Into<String>,
style: TextStyle,
font_registry: &FontRegistry,
) -> Result<Size>
pub fn measure_text_size( &self, text: impl Into<String>, style: TextStyle, font_registry: &FontRegistry, ) -> Result<Size>
Size-only measurement of unconstrained plain text. Use measure_text when ink bounds, ascent, descent or cap height are also needed.
pub fn preparation_cache_snapshot(&self) -> TextPreparationCacheSnapshot
pub fn shape_text( &self, text: impl Into<String>, box_size: Size, style: TextStyle, font_registry: &FontRegistry, ) -> Result<TextLayout>
pub fn layout_document( &self, request: TextLayoutRequest, font_registry: &FontRegistry, ) -> Result<TextLayout>
pub fn shape_text_persistent( &self, handle: Option<TextLayoutHandle>, text: impl Into<String>, box_size: Size, style: TextStyle, font_registry: &FontRegistry, ) -> Result<PersistentTextLayout>
pub fn layout_document_persistent( &self, handle: Option<TextLayoutHandle>, request: TextLayoutRequest, font_registry: &FontRegistry, ) -> Result<PersistentTextLayout>
pub fn shape_text_run( &self, run: &TextRun, font_registry: &FontRegistry, ) -> Result<TextLayout>
pub fn shape_text_run_persistent( &self, handle: Option<TextLayoutHandle>, run: &TextRun, font_registry: &FontRegistry, ) -> Result<PersistentTextLayout>
pub fn adopt_layout(&self, layout: TextLayout) -> PersistentTextLayout
pub fn touch_persistent_layout(&self, layout: &PersistentTextLayout)
pub fn text_layout_registry(&self) -> Arc<TextLayoutRegistry> ⓘ
pub fn retain_persistent_layouts(&self, handles: &HashSet<TextLayoutHandle>)
pub fn layout_cache_snapshot(&self) -> TextLayoutCacheSnapshot
Trait Implementations§
Source§impl Debug for TextSystem
impl Debug for TextSystem
Auto Trait Implementations§
impl !Freeze for TextSystem
impl !RefUnwindSafe for TextSystem
impl !UnwindSafe for TextSystem
impl Send for TextSystem
impl Sync for TextSystem
impl Unpin for TextSystem
impl UnsafeUnpin for TextSystem
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
Mutably borrows from an owned value. Read more