pub struct TextSystem(/* private fields */);Expand description
The fonts every window measures and draws text with.
There is one per process, and cloning it gives another handle to the
same fonts. The platform passes it to
Window::layout, the renderer rasterizes
glyphs with its font_system, and the root Cx
gets it as a service for Cx::measure_text and Cx::add_font.
Implementations§
Source§impl TextSystem
impl TextSystem
Sourcepub fn new() -> TextSystem
pub fn new() -> TextSystem
An empty font database. Nothing is loaded until text is laid out.
Sourcepub fn font_system(&self) -> RefMut<'_, FontSystem>
pub fn font_system(&self) -> RefMut<'_, FontSystem>
cosmic-text’s font system, for rasterizing glyphs. Release it before laying a window out.
Trait Implementations§
Source§impl Clone for TextSystem
impl Clone for TextSystem
Auto Trait Implementations§
impl !RefUnwindSafe for TextSystem
impl !Send for TextSystem
impl !Sync for TextSystem
impl !UnwindSafe for TextSystem
impl Forget for TextSystem
impl Freeze for TextSystem
impl Move 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