PgGlyphString

The #PangoGlyphString structure is used to store strings of glyphs with geometry and visual attribute information. The storage for the glyph information is owned by the structure which simplifies memory management.

Constructors

this
this(PangoGlyphString* pangoGlyphString, bool ownedRef)

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.

getPgGlyphStringStruct
PangoGlyphString* getPgGlyphStringStruct()

Get the main Gtk struct

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.

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

Static functions

getType
GType getType()

Variables

ownedRef
bool ownedRef;
Undocumented in source.
pangoGlyphString
PangoGlyphString* pangoGlyphString;

the main Gtk struct

Meta