Buffer
Object Hierarchy:
Description:
[ CCode ( cname = "hb_buffer_t" , copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "hb_gobject_buffer_get_type ()" ) ]
[ Compact ]
[ GIR ( name = "buffer_t" ) ]
public class Buffer
The main structure holding the input text and its properties before shaping, and output glyphs and their information after shaping.
Content:
Static methods:
Methods:
- public void add (Codepoint codepoint, uint cluster)
Appends a character with the Unicode value of codepoint
to buffer, and gives it the initial cluster value of cluster.
- public void add_codepoints (Codepoint[] text, uint item_offset, int item_length)
Appends characters from text array to buffer
.
- public void add_latin1 (uint8[] text, uint item_offset, int item_length)
Similar to
add_codepoints, but allows only access to first 256 Unicode code
points that can fit in 8-bit strings.
- public void add_utf16 (uint16[] text, uint item_offset, int item_length)
- public void add_utf32 (uint32[] text, uint item_offset, int item_length)
- public void add_utf8 (uint8[] text, uint item_offset, int item_length)
- public Bool allocation_successful ()
Check if allocating memory for the buffer succeeded.
- public void append (Buffer source, uint start, uint end)
Append (part of) contents of another buffer to this buffer.
- public void clear_contents ()
Similar to reset
, but does not clear the Unicode functions and the replacement code point.
- public Bool deserialize_glyphs (char[] buf, out string end_ptr, Font? font, BufferSerializeFormat format)
Deserializes glyphs buffer from textual representation in
the format produced by serialize_glyphs.
- public Bool deserialize_unicode (char[] buf, out string end_ptr, BufferSerializeFormat format)
Deserializes Unicode buffer from textual representation
in the format produced by serialize_unicode.
- public BufferDiffFlags diff (Buffer reference, Codepoint dottedcircle_glyph, uint position_fuzz)
- public BufferClusterLevel get_cluster_level ()
Fetches the cluster level of a buffer.
- public BufferContentType get_content_type ()
Fetches the type of buffer contents.
- public Direction get_direction ()
- public BufferFlags get_flags ()
- public unowned Glyph[] get_glyph_infos ()
Returns buffer glyph information array.
- public unowned GlyphPosition[] get_glyph_positions ()
Returns buffer glyph position array.
- public Codepoint get_invisible_glyph ()
- public unowned Language get_language ()
- public uint get_length ()
Returns the number of items in the buffer.
- public Codepoint get_replacement_codepoint ()
Fetches the Codepoint
that replaces invalid entries for a given encoding when adding text to buffer.
- public Script get_script ()
Fetches the script of buffer.
- public void get_segment_properties (out unowned SegmentProperties props)
- public UnicodeFuncs get_unicode_funcs ()
Fetches the Unicode-functions structure of a buffer.
- public void guess_segment_properties ()
Sets unset buffer segment properties based on buffer Unicode contents.
- public Bool has_positions ()
Returns whether buffer has glyph position data.
- public void normalize_glyphs ()
Reorders a glyph buffer to have canonical in-cluster glyph order /
position.
- public Bool pre_allocate (uint size)
Pre allocates memory for buffer to fit at least
size number of items.
- public void reset ()
Resets the buffer to its initial status, as if it was just newly
created with create.
- public void reverse ()
Reverses buffer contents.
- public void reverse_clusters ()
Reverses buffer clusters.
- public void reverse_range (uint start, uint end)
Reverses buffer contents between start and end
.
- public uint serialize (uint start, uint end, out uint8[] buf, out uint buf_consumed, Font? font, BufferSerializeFormat format, BufferSerializeFlags flags)
Serializes buffer into a textual representation of its
content, whether Unicode codepoints or glyph identifiers and positioning information.
- public uint serialize_glyphs (uint start, uint end, out uint8[] buf, out uint buf_consumed, Font? font, BufferSerializeFormat format, BufferSerializeFlags flags)
Serializes buffer into a textual representation of its
glyph content, useful for showing the contents of the buffer, for example during debugging.
- public uint serialize_unicode (uint start, uint end, out uint8[] buf, out uint buf_consumed, BufferSerializeFormat format, BufferSerializeFlags flags)
Serializes buffer into a textual representation of its
content, when the buffer contains Unicode codepoints (i.
- public void set_cluster_level (BufferClusterLevel cluster_level)
Sets the cluster level of a buffer.
- public void set_content_type (BufferContentType content_type)
Sets the type of buffer contents.
- public void set_direction (Direction direction)
Set the text flow direction of the buffer.
- public void set_flags (BufferFlags flags)
Sets buffer flags to flags.
- public void set_invisible_glyph (Codepoint invisible)
Sets the Codepoint
that replaces invisible characters in the shaping result.
- public void set_language (Language language)
Sets the language of buffer to language.
- public Bool set_length (uint length)
Similar to
pre_allocate, but clears any new items added at the end.
- public void set_message_func (owned BufferMessageFunc func)
- public void set_replacement_codepoint (Codepoint replacement)
Sets the Codepoint
that replaces invalid entries for a given encoding when adding text to buffer.
- public void set_script (Script script)
Sets the script of buffer to script.
- public void set_segment_properties (SegmentProperties props)
- public void set_unicode_funcs (UnicodeFuncs unicode_funcs)
Sets the Unicode-functions structure of a buffer to
unicode_funcs.