pub struct ShaperService(/* private fields */);Expand description
The text shaper an app runs, held as a NonSend resource (font
databases are rarely Send).
It derefs to the shaper, so TextShaper methods work directly on it.
Build one from any backend with ShaperService::from(backend), and
replace the runtime’s default by inserting your own in an app hook.
The layout engine reads it for text measurement, so a swapped backend
changes measuring and painting together.
Implementations§
Source§impl ShaperService
impl ShaperService
Sourcepub fn new<S: TextShaper + 'static>(shaper: S) -> Self
pub fn new<S: TextShaper + 'static>(shaper: S) -> Self
Wrap a shaper.
Trait Implementations§
Source§impl Default for ShaperService
impl Default for ShaperService
Source§impl Deref for ShaperService
impl Deref for ShaperService
Source§impl DerefMut for ShaperService
impl DerefMut for ShaperService
Source§impl From<Box<dyn TextShaper>> for ShaperService
impl From<Box<dyn TextShaper>> for ShaperService
Source§fn from(shaper: Box<dyn TextShaper>) -> Self
fn from(shaper: Box<dyn TextShaper>) -> Self
Converts to this type from the input type.
Source§impl<S: TextShaper + 'static> From<S> for ShaperService
impl<S: TextShaper + 'static> From<S> for ShaperService
Auto Trait Implementations§
impl Freeze for ShaperService
impl !RefUnwindSafe for ShaperService
impl !Send for ShaperService
impl !Sync for ShaperService
impl Unpin for ShaperService
impl UnsafeUnpin for ShaperService
impl !UnwindSafe for ShaperService
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
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.