Serializes buffer into a textual representation of its glyph content, useful for showing the contents of the buffer, for
example during debugging.
There are currently two supported serialization formats:
A human-readable, plain text format. The serialized glyphs will look something like:
[uni0651=0@518,0+0|uni0628=0+1897]
x_offset,y_offset`. Then,A machine-readable, structured format. The serialized glyphs will look something like:
[{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0},
{"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
Each glyph is a JSON object, with the following properties: - `g`: the glyph name or glyph index if NO_GLYPH_NAMES flag is set. - `cl`: cluster if NO_CLUSTERS is not set. - `dx`,`dy`,`ax`,`ay`: x_offset, y_offset, x_advance and y_advance respectively, if NO_POSITIONS is not set. - `xb`,`yb`,`w`,`h`: x_bearing, y_bearing, width and height respectively if GLYPH_EXTENTS is set.
| start |
the first item in |
| end |
the last item in |
| buf |
output string to write serialized buffer into. |
| buf_consumed |
if not `NULL`, will be set to the number of bytes written into |
| font |
the Font used to shape this buffer, needed to read glyph names and extents. If `NULL`, an empty font will be used. |
| format |
the BufferSerializeFormat to use for formatting the output. |
| flags |
the BufferSerializeFlags that control what glyph properties to serialize. |
| buf_size |
the size of |
| buffer |
an Buffer buffer. |
|
The number of serialized items. |