PgGlyphString

pango_shape() produces a string of glyphs which can be measured or drawn to the screen. The following structures are used to store information about glyphs.

Constructors

this
this(PangoGlyphString* pangoGlyphString)

Sets our main struct and passes it to the parent class

this
this()

Create a new PangoGlyphString.

Members

Functions

copy
PgGlyphString copy()

Copy a glyph string and associated storage.

extents
void extents(PgFont font, PangoRectangle* inkRect, PangoRectangle* logicalRect)

Compute the logical and ink extents of a glyph string. See the documentation for pango_font_get_glyph_extents() for details about the interpretation of the rectangles.

extentsRange
void extentsRange(int start, int end, PgFont font, PangoRectangle* inkRect, PangoRectangle* logicalRect)

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).

free
void free()

Free a glyph string and associated storage.

getLogicalWidths
void getLogicalWidths(string text, int length, int embeddingLevel, int* logicalWidths)

Given a PangoGlyphString resulting from pango_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. See also pango_glyph_item_get_logical_widths().

getPgGlyphStringStruct
PangoGlyphString* getPgGlyphStringStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

getWidth
int getWidth()

Computes the logical width of the glyph string as can also be computed using pango_glyph_string_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. Since 1.14

indexToX
void indexToX(string text, int length, PangoAnalysis* analysis, int index, int trailing, int xPos)

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.

setSize
void setSize(int newLen)

Resize a glyph string to the given length.

xToIndex
void xToIndex(string text, int length, PangoAnalysis* analysis, int xPos, int index, 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.

Variables

pangoGlyphString
PangoGlyphString* pangoGlyphString;

the main Gtk struct

Meta