Method Cairo.ScaledFont()->text_to_glyphs()


Method text_to_glyphs

array(array(Glyph)|array(TextCluster)|int) text_to_glyphs(float|int x, float|int y, string text)

Description

Converts text to an array of glyphs, optionally with cluster mapping, that can be used to render later using ScaledFont.

For details of how clusters, and cluster_flags map UTF-8 text to the output glyphs see Context->show_text_glyphs().

The output values can be readily passed to Context->show_text_glyphs(), Context->show_glyphs(), or related functions, assuming that the exact same ScaledFont is used for the operation.

Parameter x

X position to place first glyph

Parameter y

Y position to place first glyph

Parameter text

a string of text

Returns

An array with three elements

Array
array(Glyph) 0

array of glyphs

array(TextCluster) 1

array of cluster mapping information

int 2

cluster flags corresponding to the output clusters