Skip to main content

shape

Function shape 

Source
pub fn shape(
    font: &FontInstance,
    buffer: UnicodeBuffer,
    options: ShapeOptions<'_>,
) -> GlyphBuffer
Expand description

Shapes the buffer content using provided options.

Consumes the buffer. You can then run GlyphBuffer::clear to get the UnicodeBuffer back without allocating a new one.

If a plan is provided, it is up to the caller to ensure that the shape plan matches the properties of the provided buffer, otherwise the shaping result will likely be incorrect.

ยงPanics

Will panic when debugging assertions are enabled if the buffer and plan have mismatched properties.