The Pango.Glyph_String.Pango_Glyph_String 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.
function Copy
(Self : access Pango_Glyph_String) return access Pango_Glyph_String
Copy a glyph string and associated storage.
the newly allocated Pango.Glyph_String.Pango_Glyph_String, which should be freed with Pango.Glyph_String.Free, or null if String was null.
procedure Extents
(Self : access Pango_Glyph_String;
Font : not null access Pango.Font.Pango_Font_Record'Class;
Ink_Rect : out Pango_Rectangle;
Logical_Rect : out Pango_Rectangle)
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. Examples of logical (red) and ink (green) rects: 

a Pango.Font.Pango_Font
rectangle used to store the extents of the glyph string as drawn or null to indicate that the result is not needed.
rectangle used to store the logical extents of the glyph string or null to indicate that the result is not needed.
procedure Extents_Range
(Self : access Pango_Glyph_String;
Start : Glib.Gint;
The_End : Glib.Gint;
Font : not null access Pango.Font.Pango_Font_Record'Class;
Ink_Rect : out Pango_Rectangle;
Logical_Rect : out Pango_Rectangle)
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).
start index
end index (the range is the set of bytes with indices such that start <= index < end)
a Pango.Font.Pango_Font
rectangle used to store the extents of the glyph string range as drawn or null to indicate that the result is not needed.
rectangle used to store the logical extents of the glyph string range or null to indicate that the result is not needed.
procedure Free (Self : access Pango_Glyph_String)
Free a glyph string and associated storage.
function From_Object_Free
(B : not null access Pango_Glyph_Geometry) return Pango_Glyph_Geometry
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Free
(B : not null access Pango_Glyph_Info) return Pango_Glyph_Info
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Free
(B : not null access Pango_Glyph_String) return Pango_Glyph_String
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Free
(B : not null access Pango_Glyph_Vis_Attr) return Pango_Glyph_Vis_Attr
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
procedure Get_Logical_Widths
(Self : access Pango_Glyph_String;
Text : UTF8_String;
Length : Glib.Gint;
Embedding_Level : Glib.Gint;
Logical_Widths : Gint_Array)
Given a Pango.Glyph_String.Pango_Glyph_String 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.
the text corresponding to the glyphs
the length of Text, in bytes
the embedding level of the string
an array whose length is the number of characters in text (equal to g_utf8_strlen (text, length) unless text has NUL bytes) to be filled in with the resulting character widths.
function Get_Type return Glib.GType
function Get_Width (Self : access Pango_Glyph_String) return Glib.Gint
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: gtk+ 1.14
the logical width of the glyph string.
procedure Index_To_X
(Self : access Pango_Glyph_String;
Text : UTF8_String;
Length : Glib.Gint;
Analysis : access Pango.Item.Pango_Analysis;
Index : Glib.Gint;
Trailing : Boolean;
X_Pos : out Glib.Gint)
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.
the text for the run
the number of bytes (not characters) in Text.
the analysis information return from pango_itemize
the byte index within Text
whether we should compute the result for the beginning (False) or end (True) of the character.
location to store result
type Pango_Glyph_Geometry is record
Width : Glib.Gint32;
X_Offset : Glib.Gint32;
Y_Offset : Glib.Gint32;
end record;
The Pango.Glyph_String.Pango_Glyph_Geometry structure contains width and positioning information for a single glyph.
type Pango_Glyph_Info is record
Glyph : Pango_Glyph;
Geometry : Pango_Glyph_Geometry;
Attr : Pango_Glyph_Vis_Attr;
end record;
The Pango.Glyph_String.Pango_Glyph_Info structure represents a single glyph together with positioning information and visual attributes. It contains the following fields.
type Pango_Glyph_Info_Array is
array (Natural range <>) of Pango_Glyph_Info;
type Pango_Glyph_String is record
Num_Glyphs : Glib.Gint := 0;
Glyphs : System.Address := System.Null_Address;
Log_Clusters : access Glib.Gint := null;
Space : Glib.Gint := 0;
end record;
The Pango.Glyph_String.Pango_Glyph_String 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.
function Pango_Glyph_String_New return access Pango_Glyph_String
Create a new Pango.Glyph_String.Pango_Glyph_String.
type Pango_Glyph_Vis_Attr is record
Is_Cluster_Start : Guint;
end record;
The PangoGlyphVisAttr is used to communicate information between the shaping phase and the rendering phase. More attributes may be added in the future.
procedure Set_Size
(Self : access Pango_Glyph_String;
New_Len : Glib.Gint)
Resize a glyph string to the given length.
the new length of the string.
procedure X_To_Index
(Self : access Pango_Glyph_String;
Text : UTF8_String;
Length : Glib.Gint;
Analysis : access Pango.Item.Pango_Analysis;
X_Pos : Glib.Gint;
Index : out Glib.Gint;
Trailing : out Glib.Gint)
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.
the text for the run
the number of bytes (not characters) in text.
the analysis information return from pango_itemize
the x offset (in Pango units)
location to store calculated byte index within Text
location to store a boolean indicating whether the user clicked on the leading or trailing edge of the character.