SynopsisPangoLayout; PangoLayoutIter; PangoLayout* pango_layout_new (PangoContext *context); PangoLayout* pango_layout_copy (PangoLayout *src); PangoContext* pango_layout_get_context (PangoLayout *layout); void pango_layout_context_changed (PangoLayout *layout); void pango_layout_set_text (PangoLayout *layout, const char *text, int length); const char* pango_layout_get_text (PangoLayout *layout); void pango_layout_set_markup (PangoLayout *layout, const char *markup, int length); void pango_layout_set_markup_with_accel (PangoLayout *layout, const char *markup, int length, gunichar accel_marker, gunichar *accel_char); void pango_layout_set_attributes (PangoLayout *layout, PangoAttrList *attrs); PangoAttrList* pango_layout_get_attributes (PangoLayout *layout); void pango_layout_set_font_description (PangoLayout *layout, const PangoFontDescription *desc); const PangoFontDescription* pango_layout_get_font_description (PangoLayout *layout); void pango_layout_set_width (PangoLayout *layout, int width); int pango_layout_get_width (PangoLayout *layout); void pango_layout_set_height (PangoLayout *layout, int height); int pango_layout_get_height (PangoLayout *layout); void pango_layout_set_wrap (PangoLayout *layout, PangoWrapMode wrap); PangoWrapMode pango_layout_get_wrap (PangoLayout *layout); gboolean pango_layout_is_wrapped (PangoLayout *layout); enum PangoWrapMode; #define PANGO_TYPE_WRAP_MODE void pango_layout_set_ellipsize (PangoLayout *layout, PangoEllipsizeMode ellipsize); PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout); gboolean pango_layout_is_ellipsized (PangoLayout *layout); enum PangoEllipsizeMode; #define PANGO_TYPE_ELLIPSIZE_MODE void pango_layout_set_indent (PangoLayout *layout, int indent); int pango_layout_get_indent (PangoLayout *layout); int pango_layout_get_spacing (PangoLayout *layout); void pango_layout_set_spacing (PangoLayout *layout, int spacing); void pango_layout_set_justify (PangoLayout *layout, gboolean justify); gboolean pango_layout_get_justify (PangoLayout *layout); void pango_layout_set_auto_dir (PangoLayout *layout, gboolean auto_dir); gboolean pango_layout_get_auto_dir (PangoLayout *layout); void pango_layout_set_alignment (PangoLayout *layout, PangoAlignment alignment); PangoAlignment pango_layout_get_alignment (PangoLayout *layout); void pango_layout_set_tabs (PangoLayout *layout, PangoTabArray *tabs); PangoTabArray* pango_layout_get_tabs (PangoLayout *layout); void pango_layout_set_single_paragraph_mode (PangoLayout *layout, gboolean setting); gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout); enum PangoAlignment; #define PANGO_TYPE_ALIGNMENT int pango_layout_get_unknown_glyphs_count (PangoLayout *layout); void pango_layout_get_log_attrs (PangoLayout *layout, PangoLogAttr **attrs, gint *n_attrs); void pango_layout_index_to_pos (PangoLayout *layout, int index_, PangoRectangle *pos); void pango_layout_index_to_line_x (PangoLayout *layout, int index_, gboolean trailing, int *line, int *x_pos); gboolean pango_layout_xy_to_index (PangoLayout *layout, int x, int y, int *index_, int *trailing); void pango_layout_get_cursor_pos (PangoLayout *layout, int index_, PangoRectangle *strong_pos, PangoRectangle *weak_pos); void pango_layout_move_cursor_visually (PangoLayout *layout, gboolean strong, int old_index, int old_trailing, int direction, int *new_index, int *new_trailing); void pango_layout_get_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_get_pixel_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_get_size (PangoLayout *layout, int *width, int *height); void pango_layout_get_pixel_size (PangoLayout *layout, int *width, int *height); int pango_layout_get_baseline (PangoLayout *layout); int pango_layout_get_line_count (PangoLayout *layout); PangoLayoutLine* pango_layout_get_line (PangoLayout *layout, int line); PangoLayoutLine* pango_layout_get_line_readonly (PangoLayout *layout, int line); GSList* pango_layout_get_lines (PangoLayout *layout); GSList* pango_layout_get_lines_readonly (PangoLayout *layout); PangoLayoutIter* pango_layout_get_iter (PangoLayout *layout); PangoLayoutIter* pango_layout_iter_copy (PangoLayoutIter *iter); void pango_layout_iter_free (PangoLayoutIter *iter); gboolean pango_layout_iter_next_run (PangoLayoutIter *iter); gboolean pango_layout_iter_next_char (PangoLayoutIter *iter); gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter); gboolean pango_layout_iter_next_line (PangoLayoutIter *iter); gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter); int pango_layout_iter_get_index (PangoLayoutIter *iter); int pango_layout_iter_get_baseline (PangoLayoutIter *iter); PangoLayoutRun* pango_layout_iter_get_run (PangoLayoutIter *iter); PangoLayoutRun* pango_layout_iter_get_run_readonly (PangoLayoutIter *iter); PangoLayoutLine* pango_layout_iter_get_line (PangoLayoutIter *iter); PangoLayoutLine* pango_layout_iter_get_line_readonly (PangoLayoutIter *iter); PangoLayout* pango_layout_iter_get_layout (PangoLayoutIter *iter); void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, PangoRectangle *logical_rect); void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, int *y0_, int *y1_); void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); PangoLayoutLine; typedef PangoLayoutRun; PangoLayoutLine* pango_layout_line_ref (PangoLayoutLine *line); void pango_layout_line_unref (PangoLayoutLine *line); void pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, PangoRectangle *ink_rect, PangoRectangle *logical_rect); void pango_layout_line_index_to_x (PangoLayoutLine *line, int index_, gboolean trailing, int *x_pos); gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, int x_pos, int *index_, int *trailing); void pango_layout_line_get_x_ranges (PangoLayoutLine *line, int start_index, int end_index, int **ranges, int *n_ranges); DescriptionWhile complete access to the layout capabilities of Pango is provided using the detailed interfaces for itemization and shaping, using that functionality directly involves writing a fairly large amount of code. The objects and functions in this section provide a high-level driver for formatting entire paragraphs of text at once. DetailsPangoLayouttypedef struct _PangoLayout PangoLayout; The PangoLayout structure represents an entire paragraph of text. It is initialized with a PangoContext, UTF-8 string and set of attributes for that string. Once that is done, the set of formatted lines can be extracted from the object, the layout can be rendered, and conversion between logical character positions within the layout's text, and the physical position of the resulting glyphs can be made. There are also a number of parameters to adjust the formatting of a PangoLayout, which are illustrated in Figure 1, “Adjustable parameters for a PangoLayout”. It is possible, as well, to ignore the 2-D setup, and simply treat the results of a PangoLayout as a list of lines. The PangoLayout structure is opaque, and has no user-visible fields. PangoLayoutItertypedef struct _PangoLayoutIter PangoLayoutIter; A PangoLayoutIter structure can be used to iterate over the visual extents of a PangoLayout. The PangoLayoutIter structure is opaque, and has no user-visible fields. pango_layout_new ()PangoLayout* pango_layout_new (PangoContext *context); Create a new PangoLayout object with attributes initialized to default values for a particular PangoContext.
pango_layout_copy ()PangoLayout* pango_layout_copy (PangoLayout *src);
Does a deep copy-by-value of the
pango_layout_get_context ()PangoContext* pango_layout_get_context (PangoLayout *layout); Retrieves the PangoContext used for this layout.
pango_layout_context_changed ()void pango_layout_context_changed (PangoLayout *layout); Forces recomputation of any state in the PangoLayout that might depend on the layout's context. This function should be called if you make changes to the context subsequent to creating the layout.
pango_layout_set_text ()void pango_layout_set_text (PangoLayout *layout, const char *text, int length); Sets the text of the layout.
Note that if you have used
pango_layout_get_text ()const char* pango_layout_get_text (PangoLayout *layout); Gets the text in the layout. The returned text should not be freed or modified.
pango_layout_set_markup ()void pango_layout_set_markup (PangoLayout *layout, const char *markup, int length);
Same as
pango_layout_set_markup_with_accel ()void pango_layout_set_markup_with_accel (PangoLayout *layout, const char *markup, int length, gunichar accel_marker, gunichar *accel_char); Sets the layout text and attribute list from marked-up text (see markup format). Replaces the current text and attribute list.
If
pango_layout_set_attributes ()void pango_layout_set_attributes (PangoLayout *layout, PangoAttrList *attrs);
Sets the text attributes for a layout object.
References
pango_layout_get_attributes ()PangoAttrList* pango_layout_get_attributes (PangoLayout *layout); Gets the attribute list for the layout, if any.
pango_layout_set_font_description ()void pango_layout_set_font_description (PangoLayout *layout, const PangoFontDescription *desc); Sets the default font description for the layout. If no font description is set on the layout, the font description from the layout's context is used.
pango_layout_get_font_description ()const PangoFontDescription* pango_layout_get_font_description (PangoLayout *layout); Gets the font description for the layout, if any.
Since 1.8 pango_layout_set_width ()void pango_layout_set_width (PangoLayout *layout, int width); Sets the width to which the lines of the PangoLayout should wrap or ellipsized. The default value is -1: no width set.
pango_layout_get_width ()int pango_layout_get_width (PangoLayout *layout); Gets the width to which the lines of the PangoLayout should wrap.
pango_layout_set_height ()void pango_layout_set_height (PangoLayout *layout, int height);
Sets the height to which the PangoLayout should be ellipsized at. There
are two different behaviors, based on whether
If
If
Height setting only has effect if a positive width is set on
Since 1.20 pango_layout_get_height ()int pango_layout_get_height (PangoLayout *layout);
Gets the height of layout used for ellipsization. See
Since 1.20 pango_layout_set_wrap ()void pango_layout_set_wrap (PangoLayout *layout, PangoWrapMode wrap);
Sets the wrap mode; the wrap mode only has effect if a width
is set on the layout with
pango_layout_get_wrap ()PangoWrapMode pango_layout_get_wrap (PangoLayout *layout); Gets the wrap mode for the layout.
Use
pango_layout_is_wrapped ()gboolean pango_layout_is_wrapped (PangoLayout *layout); Queries whether the layout had to wrap any paragraphs.
This returns
Since 1.16 enum PangoWrapModetypedef enum { PANGO_WRAP_WORD, PANGO_WRAP_CHAR, PANGO_WRAP_WORD_CHAR } PangoWrapMode; A PangoWrapMode describes how to wrap the lines of a PangoLayout to the desired width. PANGO_TYPE_WRAP_MODE#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type()) The GObject type for PangoWrapMode. pango_layout_set_ellipsize ()void pango_layout_set_ellipsize (PangoLayout *layout, PangoEllipsizeMode ellipsize);
Sets the type of ellipsization being performed for
If the layout contains characters such as newlines that
force it to be layed out in multiple paragraphs, then whether
each paragraph is ellipsized separately or the entire layout
is ellipsized as a whole depends on the set height of the layout.
See
Since 1.6 pango_layout_get_ellipsize ()PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout);
Gets the type of ellipsization being performed for
Since 1.6 pango_layout_is_ellipsized ()gboolean pango_layout_is_ellipsized (PangoLayout *layout); Queries whether the layout had to ellipsize any paragraphs.
This returns
Since 1.16 enum PangoEllipsizeModetypedef enum { PANGO_ELLIPSIZE_NONE, PANGO_ELLIPSIZE_START, PANGO_ELLIPSIZE_MIDDLE, PANGO_ELLIPSIZE_END } PangoEllipsizeMode; The PangoEllipsizeMode type describes what sort of (if any) ellipsization should be applied to a line of text. In the ellipsization process characters are removed from the text in order to make it fit to a given width and replaced with an ellipsis.
PANGO_TYPE_ELLIPSIZE_MODE#define PANGO_TYPE_ELLIPSIZE_MODE (pango_ellipsize_mode_get_type()) The GObject type for PangoEllipsizeMode. pango_layout_set_indent ()void pango_layout_set_indent (PangoLayout *layout, int indent);
Sets the width in Pango units to indent each paragraph. A negative value
of
The indent setting is ignored if layout alignment is set to
pango_layout_get_indent ()int pango_layout_get_indent (PangoLayout *layout); Gets the paragraph indent width in Pango units. A negative value indicates a hanging indentation.
pango_layout_get_spacing ()int pango_layout_get_spacing (PangoLayout *layout); Gets the amount of spacing between the lines of the layout.
pango_layout_set_spacing ()void pango_layout_set_spacing (PangoLayout *layout, int spacing); Sets the amount of spacing in Pango unit between the lines of the layout.
pango_layout_set_justify ()void pango_layout_set_justify (PangoLayout *layout, gboolean justify); Sets whether each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification may be done in more complex ways, like extending the characters. Note that this setting is not implemented and so is ignored in Pango older than 1.18.
pango_layout_get_justify ()gboolean pango_layout_get_justify (PangoLayout *layout); Gets whether each complete line should be stretched to fill the entire width of the layout.
pango_layout_set_auto_dir ()void pango_layout_set_auto_dir (PangoLayout *layout, gboolean auto_dir);
Sets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout;
when this flag is on (the default), then paragraphs in
When
When the auto-computed direction of a paragraph differs from the
base direction of the context, the interpretation of
Since 1.4 pango_layout_get_auto_dir ()gboolean pango_layout_get_auto_dir (PangoLayout *layout);
Gets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout.
See
Since 1.4 pango_layout_set_alignment ()void pango_layout_set_alignment (PangoLayout *layout, PangoAlignment alignment); Sets the alignment for the layout: how partial lines are positioned within the horizontal space available.
pango_layout_get_alignment ()PangoAlignment pango_layout_get_alignment (PangoLayout *layout); Gets the alignment for the layout: how partial lines are positioned within the horizontal space available.
pango_layout_set_tabs ()void pango_layout_set_tabs (PangoLayout *layout, PangoTabArray *tabs);
Sets the tabs to use for
pango_layout_get_tabs ()PangoTabArray* pango_layout_get_tabs (PangoLayout *layout);
Gets the current PangoTabArray used by this layout. If no
PangoTabArray has been set, then the default tabs are in use
and
pango_layout_set_single_paragraph_mode ()void pango_layout_set_single_paragraph_mode (PangoLayout *layout, gboolean setting);
If
pango_layout_get_single_paragraph_mode ()gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout);
Obtains the value set by
enum PangoAlignmenttypedef enum { PANGO_ALIGN_LEFT, PANGO_ALIGN_CENTER, PANGO_ALIGN_RIGHT } PangoAlignment;
A PangoAlignment describes how to align the lines of a PangoLayout within the
available space. If the PangoLayout is set to justify
using PANGO_TYPE_ALIGNMENT#define PANGO_TYPE_ALIGNMENT (pango_alignment_get_type()) The GObject type for PangoAlignment. pango_layout_get_unknown_glyphs_count ()int pango_layout_get_unknown_glyphs_count (PangoLayout *layout);
Counts the number unknown glyphs in
This function can be used to determine if there are any fonts
available to render all characters in a certain string, or when
used in combination with
Since 1.16 pango_layout_get_log_attrs ()void pango_layout_get_log_attrs (PangoLayout *layout, PangoLogAttr **attrs, gint *n_attrs);
Retrieves an array of logical attributes for each character in
the
pango_layout_index_to_pos ()void pango_layout_index_to_pos (PangoLayout *layout, int index_, PangoRectangle *pos);
Converts from an index within a PangoLayout to the onscreen position
corresponding to the grapheme at that index, which is represented
as rectangle. Note that
pango_layout_index_to_line_x ()void pango_layout_index_to_line_x (PangoLayout *layout, int index_, gboolean trailing, int *line, int *x_pos);
Converts from byte
pango_layout_xy_to_index ()gboolean pango_layout_xy_to_index (PangoLayout *layout, int x, int y, int *index_, int *trailing);
Converts from X and Y position within a layout to the byte
index to the character at that logical position. If the
Y position is not inside the layout, the closest position is chosen
(the position will be clamped inside the layout). If the
X position is not within the layout, then the start or the
end of the line is chosen as described for
pango_layout_get_cursor_pos ()void pango_layout_get_cursor_pos (PangoLayout *layout, int index_, PangoRectangle *strong_pos, PangoRectangle *weak_pos); Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted.
pango_layout_move_cursor_visually ()void pango_layout_move_cursor_visually (PangoLayout *layout, gboolean strong, int old_index, int old_trailing, int direction, int *new_index, int *new_trailing);
Computes a new cursor position from an old position and
a count of positions to move visually. If In the presence of bidirectional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.
Motion here is in cursor positions, not in characters, so a
single call to
pango_layout_get_extents ()void pango_layout_get_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of The extents are given in layout coordinates and in Pango units; layout coordinates begin at the top left corner of the layout.
pango_layout_get_pixel_extents ()void pango_layout_get_pixel_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of
pango_layout_get_size ()void pango_layout_get_size (PangoLayout *layout, int *width, int *height);
Determines the logical width and height of a PangoLayout
in Pango units (device units scaled by
pango_layout_get_pixel_size ()void pango_layout_get_pixel_size (PangoLayout *layout, int *width, int *height);
Determines the logical width and height of a PangoLayout
in device units. (
pango_layout_get_baseline ()int pango_layout_get_baseline (PangoLayout *layout);
Gets the Y position of baseline of the first line in
Since 1.22 pango_layout_get_line_count ()int pango_layout_get_line_count (PangoLayout *layout);
Retrieves the count of lines for the
pango_layout_get_line ()PangoLayoutLine* pango_layout_get_line (PangoLayout *layout, int line); Retrieves a particular line from a PangoLayout.
Use the faster
pango_layout_get_line_readonly ()PangoLayoutLine* pango_layout_get_line_readonly (PangoLayout *layout, int line); Retrieves a particular line from a PangoLayout.
This is a faster alternative to
Since 1.16 pango_layout_get_lines ()GSList* pango_layout_get_lines (PangoLayout *layout);
Returns the lines of the
Use the faster
pango_layout_get_lines_readonly ()GSList* pango_layout_get_lines_readonly (PangoLayout *layout);
Returns the lines of the
This is a faster alternative to
Since 1.16 pango_layout_get_iter ()PangoLayoutIter* pango_layout_get_iter (PangoLayout *layout); Returns an iterator to iterate over the visual extents of the layout.
pango_layout_iter_copy ()PangoLayoutIter* pango_layout_iter_copy (PangoLayoutIter *iter); Copies a PangLayoutIter.
Since 1.20 pango_layout_iter_free ()void pango_layout_iter_free (PangoLayoutIter *iter); Frees an iterator that's no longer in use.
pango_layout_iter_next_run ()gboolean pango_layout_iter_next_run (PangoLayoutIter *iter);
Moves
pango_layout_iter_next_char ()gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
Moves
pango_layout_iter_next_cluster ()gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter);
Moves
pango_layout_iter_next_line ()gboolean pango_layout_iter_next_line (PangoLayoutIter *iter);
Moves
pango_layout_iter_at_last_line ()gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter);
Determines whether
pango_layout_iter_get_index ()int pango_layout_iter_get_index (PangoLayoutIter *iter);
Gets the current byte index. Note that iterating forward by char
moves in visual order, not logical order, so indexes may not be
sequential. Also, the index may be equal to the length of the text
in the layout, if on the
pango_layout_iter_get_baseline ()int pango_layout_iter_get_baseline (PangoLayoutIter *iter); Gets the Y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).
pango_layout_iter_get_run ()PangoLayoutRun* pango_layout_iter_get_run (PangoLayoutIter *iter);
Gets the current run. When iterating by run, at the end of each
line, there's a position with a
Use the faster
pango_layout_iter_get_run_readonly ()PangoLayoutRun* pango_layout_iter_get_run_readonly (PangoLayoutIter *iter);
Gets the current run. When iterating by run, at the end of each
line, there's a position with a
This is a faster alternative to
Since 1.16 pango_layout_iter_get_line ()PangoLayoutLine* pango_layout_iter_get_line (PangoLayoutIter *iter); Gets the current line.
Use the faster
pango_layout_iter_get_line_readonly ()PangoLayoutLine* pango_layout_iter_get_line_readonly (PangoLayoutIter *iter); Gets the current line for read-only access.
This is a faster alternative to
Since 1.16 pango_layout_iter_get_layout ()PangoLayout* pango_layout_iter_get_layout (PangoLayoutIter *iter); Gets the layout associated with a PangoLayoutIter.
Since 1.20 pango_layout_iter_get_char_extents ()void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, PangoRectangle *logical_rect); Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout). Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.
pango_layout_iter_get_cluster_extents ()void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).
pango_layout_iter_get_run_extents ()void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect); Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).
pango_layout_iter_get_line_yrange ()void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, int *y0_, int *y1_);
Divides the vertical space in the PangoLayout being iterated over
between the lines in the layout, and returns the space belonging to
the current line. A line's range includes the line's logical
extents, plus half of the spacing above and below the line, if
pango_layout_iter_get_line_extents ()void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Obtains the extents of the current line.
pango_layout_iter_get_layout_extents ()void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Obtains the extents of the PangoLayout being iterated
over.
PangoLayoutLinetypedef struct { PangoLayout *layout; gint start_index; /* start of line as byte index into layout->text */ gint length; /* length of line in bytes */ GSList *runs; guint is_paragraph_start : 1; /* TRUE if this is the first line of the paragraph */ guint resolved_dir : 3; /* Resolved PangoDirection of line */ } PangoLayoutLine;
The PangoLayoutLine structure represents one of the lines resulting
from laying out a paragraph via PangoLayout. PangoLayoutLine
structures are obtained by calling Routines for rendering PangoLayout objects are provided in code specific to each rendering system.
PangoLayoutRuntypedef PangoGlyphItem PangoLayoutRun; The PangoLayoutRun structure represents a single run within a PangoLayoutLine; it is simply an alternate name for PangoGlyphItem. See the PangoGlyphItem docs for details on the fields. pango_layout_line_ref ()PangoLayoutLine* pango_layout_line_ref (PangoLayoutLine *line); Increase the reference count of a PangoLayoutLine by one.
Since 1.10 pango_layout_line_unref ()void pango_layout_line_unref (PangoLayoutLine *line); Decrease the reference count of a PangoLayoutLine by one. If the result is zero, the line and all associated memory will be freed.
pango_layout_line_get_extents ()void pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of a layout line. See
pango_layout_line_get_pixel_extents ()void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of
pango_layout_line_index_to_x ()void pango_layout_line_index_to_x (PangoLayoutLine *line, int index_, gboolean trailing, int *x_pos); Converts an index within a line to a X position.
pango_layout_line_x_to_index ()gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, int x_pos, int *index_, int *trailing);
Converts from x offset to the byte index of the corresponding
character within the text of the layout. If
pango_layout_line_get_x_ranges ()void pango_layout_line_get_x_ranges (PangoLayoutLine *line, int start_index, int end_index, int **ranges, int *n_ranges); Gets a list of visual ranges corresponding to a given logical range. This list is not necessarily minimal - there may be consecutive ranges which are adjacent. The ranges will be sorted from left to right. The ranges are with respect to the left edge of the entire layout, not with respect to the line.
|