Blend2D
2D Vector Graphics Engine
Glyph buffer [C++ API].
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 holds actual text/glyph array, and secondary buffer is either used as a scratch buffer during glyph substitution or to hold glyph positions after the processing is complete and glyph positions were calculated.
Tests whether the glyph-buffer has flag
set.
Tests whether the buffer contains unicode data.
Tests whether the buffer contains glyph-id data.
Tests whether the input string contained invalid characters (unicode encoding errors).
Tests whether the input string contained undefined characters that weren't mapped properly to glyphs.
Tests whether one or more operation was terminated before completion because of invalid data in a font.
Resets the BLGlyphBuffer into its default constructed state. The content will be cleared and allocated memory released.
Clears the content of BLGlyphBuffer without releasing internal buffers.
Assigns a text content of this BLGlyphBuffer.
This is a generic function that accepts void*
data, which is specified by encoding
. The size
argument depends on encoding as well. If the encoding specifies byte string (LATIN1 or UTF8) then it's bytes, if the encoding specifies UTF16 or UTF32 then it would describe the number of uint16_t
or uint32_t
code points, respectively.
Null-terminated string can be specified by passing SIZE_MAX
as size
.
Assigns a text content of this BLGlyphBuffer from LATIN1 (ISO/IEC 8859-1) string.
Assigns a text content of this BLGlyphBuffer from UTF-8 encoded string. The size
parameter represents the length of the text
in bytes.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Assigns a text content of this BLGlyphBuffer from UTF-16 encoded string. The size
parameter represents the length of the text
in 16-bit units.
Assigns a text content of this BLGlyphBuffer from UTF-32 encoded string. The size
parameter represents the length of the text
in 32-bit units.
Assigns a text content of this BLGlyphBuffer from wchar_t
encoded string. The size
parameter represents the length of the text
in wchar_t
units.
Assigns a glyph content of this BLGlyphBuffer from either the given glyphData
.
Assigns a glyph content of this BLGlyphBuffer from an array of glyphs or from a foreign structure that contains glyphs and possibly other members that have to be skipped. The glyph size can be either 16-bit (2) or 32-bit (4). The last parameter glyphAdvance
specifies how many bytes to advance after a glyph value is read.