pub struct GlyphBuffer { /* private fields */ }Expand description
Glyph buffer.
Can hold either text or glyphs and provides basic memory management that is used for text shaping, character to glyph mapping, glyph substitution, and glyph positioning.
Glyph buffer provides two separate buffers called ‘primary’ and ‘secondary’
that serve different purposes during processing. Primary buffer always hold
a GlyphItem array, and secondary
buffer is either used as a scratch buffer during glyph substitution or hold
glyph positions after the processing is complete and glyph positions were
calculated.
Implementations§
Source§impl GlyphBuffer
impl GlyphBuffer
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty GlyphBuffer.
Sourcepub fn from_utf8_text(text: &str) -> Self
pub fn from_utf8_text(text: &str) -> Self
Creates a new GlyphBuffer initialized with the given text.
pub fn glyph_run(&self) -> GlyphRun<'_>
pub fn glyph_item_data(&self) -> GlyphRun<'_>
pub fn size(&self) -> usize
Sourcepub fn flags(&self) -> GlyphRunFlags
pub fn flags(&self) -> GlyphRunFlags
Returns the GlyphBuffer’s GlyphRunFlags.
Sourcepub fn has_text(&self) -> bool
pub fn has_text(&self) -> bool
Returns true if this GlyphBuffer contains unicode data.
Sourcepub fn has_glyphs(&self) -> bool
pub fn has_glyphs(&self) -> bool
Returns true if this GlyphBuffer contains GlyphId data.
Sourcepub fn has_invalid_chars(&self) -> bool
pub fn has_invalid_chars(&self) -> bool
Returns true if this GlyphBuffer contains invalid characters(unicode
encoding errors).
Sourcepub fn has_undefined_chars(&self) -> bool
pub fn has_undefined_chars(&self) -> bool
Returns true if this GlyphBuffer contains undefined characters that
weren’t mapped properly to glyphs.
Sourcepub fn has_invalid_font_data(&self) -> bool
pub fn has_invalid_font_data(&self) -> bool
Returns true if one or more operations were terminated before completion because of invalid data in a font.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the content of this GlyphBuffer without releasing internal
buffers.
Sourcepub fn set_utf8_text(&mut self, text: &str)
pub fn set_utf8_text(&mut self, text: &str)
Sets text content of this GlyphBuffer.