Layout Objects Highlevel layout driver objects While 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 structure provide a high-level driver for formatting entire paragraphs of text at once. The #PangoLayout structure represents and 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 . It is possible, as well, to ignore the 2-D setup, and simply treat the results of a #PangoLayout as a list of lines.
Adjustable parameters for a PangoLayout
The #PangoLayout structure is opaque, and has no user-visible fields. 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. @context: @Returns: @src: @Returns: @layout: @Returns: @layout: @layout: @text: @length: @layout: @Returns: @layout: @markup: @length: @layout: @markup: @length: @accel_marker: @accel_char: @layout: @attrs: @layout: @Returns: @layout: @desc: @layout: @width: @layout: @Returns: @layout: @wrap: @layout: @Returns: describes how to wrap the lines of a #PangoLayout to the desired width. @PANGO_WRAP_WORD: wrap lines at word boundaries. @PANGO_WRAP_CHAR: wrap lines at character boundaries. @PANGO_WRAP_WORD_CHAR: wrap lines at word boundaries, but fall back to character boundaries if there is not enought space for a full word. The GObject type for #PangoWrapMode. @layout: @indent: @layout: @Returns: @layout: @Returns: @layout: @spacing: @layout: @justify: @layout: @Returns: @layout: @alignment: @layout: @Returns: @layout: @tabs: @layout: @Returns: @layout: @setting: @layout: @Returns: describes how to align the lines of a #PangoLayout within the available space. If the #PangoLayout is set to justify using pango_layout_set_justify(), then this only has an effect for partial lines. @PANGO_ALIGN_LEFT: Put all available space on the right @PANGO_ALIGN_CENTER: Center the line within the available space @PANGO_ALIGN_RIGHT: Put all available space on the left The GObject type for #PangoAlignment. @layout: @attrs: @n_attrs: @layout: @x: @y: @index_: @trailing: @Returns: @layout: @index_: @pos: @layout: @index_: @strong_pos: @weak_pos: @layout: @strong: @old_index: @old_trailing: @direction: @new_index: @new_trailing: @layout: @ink_rect: @logical_rect: @layout: @ink_rect: @logical_rect: @layout: @width: @height: @layout: @width: @height: @layout: @Returns: @layout: @line: @Returns: @layout: @Returns: @layout: @Returns: @iter: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @logical_rect: @iter: @ink_rect: @logical_rect: @iter: @ink_rect: @logical_rect: @iter: @y0_: @y1_: @iter: @ink_rect: @logical_rect: @iter: @ink_rect: @logical_rect: The #PangoLayoutLine structure represents one of the lines resulting from laying out a paragraph via #PangoLayout. #PangoLayoutLine structures are obtained by calling pango_layout_get_line() and are only valid until the text, attributes, or settings of the parent #PangoLayout are modified. Routines for rendering PangoLayout objects are provided in code specific to each rendering system. @layout: the parent layout for this line. @start_index: @length: the length of the line in bytes. @runs: a list containing the runs of the line in visual order. The #PangoLayoutRun structure represents a single run within a #PangoLayoutLine; it is simply an alternate name for #PangoGlyphItem, present for backwards compatibility. See the #PangoGlyphItem docs for details on the fields. @line: @line: @line: @ink_rect: @logical_rect: @layout_line: @ink_rect: @logical_rect: @line: @index_: @trailing: @x_pos: @line: @x_pos: @index_: @trailing: @Returns: @line: @start_index: @end_index: @ranges: @n_ranges: