pub trait TextShaper {
// Required method
fn shape(
&self,
text: &str,
script: Script,
direction: RunDirection,
features: &FontFeatures,
) -> ShapedRun;
}Expand description
Abstract text shaping backend.
Implementations convert a Unicode text string into positioned glyphs according to the rules of the specified script, direction, and font features.
The trait is object-safe to allow dynamic dispatch between backends (e.g., terminal noop vs. web rustybuzz).
Required Methods§
Sourcefn shape(
&self,
text: &str,
script: Script,
direction: RunDirection,
features: &FontFeatures,
) -> ShapedRun
fn shape( &self, text: &str, script: Script, direction: RunDirection, features: &FontFeatures, ) -> ShapedRun
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".