[][src]Function harfbuzz_rs::shape

pub fn shape(
    font: &Font,
    buffer: UnicodeBuffer,
    features: &[Feature]
) -> GlyphBuffer

Shape the contents of the buffer using the provided font and activating all OpenType features given in features.

This function consumes the buffer and returns a GlyphBuffer containing the resulting glyph indices and the corresponding positioning information. Once all the information from the GlyphBuffer has been processed as necessary you can reuse the GlyphBuffer as an UnicodeBuffer (using GlyphBuffer::clear_contents) and use that to call shape again with new data.

By default some basic OpenType features are enabled according to the language and the script set in the buffer.

Arguments

  • font – a reference to the harfbuzz font used to shape the text.
  • buffer – a UnicodeBuffer that is filled with the text to be shaped and also contains metadata about the text in the form of segment properties.
  • features – a slice of additional features to activate