-
public GlyphString copy ()
Copy a glyph string and associated storage.
-
public void extents (Font font, out Rectangle ink_rect, out Rectangle logical_rect)
Compute the logical and ink extents of a glyph string. See the documentation for
get_glyph_extents for details about the interpretation of the
rectangles.
-
public void extents_range (int start, int end, Font font, out Rectangle ink_rect, out Rectangle logical_rect)
Computes the extents of a sub-portion of a glyph string. The extents are relative to the start of the
glyph string range (the origin of their coordinate system is at the start of the range, not at the start of the entire glyph string).
-
public void get_logical_widths (string text, int length, int embedding_level, int[] logical_widths)
Given a GlyphString resulting from
shape and the corresponding text, determine the screen width corresponding to each
character. When multiple characters compose a single cluster, the width of the entire cluster is divided equally among the characters.
-
public int get_width ()
Computes the logical width of the glyph string as can also be computed using
extents. However, since this only computes the width, it's much faster.
This is in fact only a convenience function that computes the sum of geometry.width for each glyph in the glyphs.
-
public void index_to_x (string text, int length, Analysis analysis, int index_, bool trailing, out int x_pos)
Converts from character position to x position. (X position is measured from the left edge of the run).
Character positions are computed by dividing up each cluster into equal portions.
-
public void set_size (int new_len)
Resize a glyph string to the given length.
-
public void x_to_index (string text, int length, Analysis analysis, int x_pos, out int index_, out int trailing)
Convert from x offset to character position. Character positions are computed by dividing up each
cluster into equal portions. In scripts where positioning within a cluster is not allowed (such as Thai), the returned value may not
be a valid cursor position; the caller must combine the result with the logical attributes for the text to compute the valid cursor
position.