Method Cairo.Context()->show_text_glyphs()


Method show_text_glyphs

void show_text_glyphs(string text, array(Glyph|array(int|float)) glyphs, array(TextCluster) clusters, int cluster_flags)

Description

This operation has rendering effects similar to show_glyphs() but, if the target surface supports it, uses the provided text and cluster mapping to embed the text for the glyphs shown in the output. If the target does not support the extended attributes, this function acts like the basic show_glyphs() as if it had been passed glyphs.

The mapping between text and glyphs is provided by an array of clusters. Each cluster covers a number of text bytes and glyphs, and neighboring clusters cover neighboring areas of text and glyphs. The clusters should collectively cover text and glyphs in entirety.

The first cluster always covers bytes from the beginning of text. If cluster_flags do not have the flag TEXT_CLUSTER_FLAG_BACKWARD set, the first cluster also covers the beginning of glyphs, otherwise it covers the end of the glyphs array and following clusters move backward.

See TextCluster for constraints on valid clusters.

Parameter text

a string of text

Parameter glyphs

array of glyphs to show

Parameter clusters

array of cluster mapping information

Parameter cluster_flags

cluster mapping flags