serialize_unicode


Description:

[ Version ( since = "2.7.3" ) ]
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.

e., before shaping). This is useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

text

A human-readable, plain text format. The serialized codepoints will look something like:

 <U+0651=0|U+0628=1>
- Glyphs are separated with `|` - Unicode codepoints are expressed as zero-padded four (or more) digit hexadecimal numbers preceded by `U+` - If NO_CLUSTERS is not set, the cluster will be indicated with a `=` then cluster.

json

A machine-readable, structured format. The serialized codepoints will be a list of objects with the following properties: - `u`: the Unicode codepoint as a decimal integer - `cl`: cluster if NO_CLUSTERS is not set.

For example:

[{u:1617,cl:0},{u:1576,cl:1}]

Parameters:

start

the first item in buffer to serialize.

end

the last item in buffer to serialize.

buf

output string to write serialized buffer into.

buf_consumed

if not `NULL`, will be set to the number of bytes written into buf.

format

the BufferSerializeFormat to use for formatting the output.

flags

the BufferSerializeFlags that control what glyph properties to serialize.

buf_size

the size of buf.

buffer

an Buffer buffer.

Returns:

The number of serialized items.