Layout Objects High-level 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 section provide a high-level driver for formatting entire paragraphs of text at once. 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 . 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: @Returns: @layout: @text: @length: @layout: @Returns: @layout: @Returns: @layout: @markup: @length: @layout: @markup: @length: @accel_marker: @accel_char: @layout: @attrs: @layout: @Returns: @layout: @desc: @layout: @Returns: @layout: @width: @layout: @Returns: @layout: @height: @layout: @Returns: @layout: @wrap: @layout: @Returns: @layout: @Returns: A #PangoWrapMode 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 enough space for a full word. The #GObject type for #PangoWrapMode. @layout: @ellipsize: @layout: @Returns: @layout: @Returns: @PANGO_ELLIPSIZE_NONE: @PANGO_ELLIPSIZE_START: @PANGO_ELLIPSIZE_MIDDLE: @PANGO_ELLIPSIZE_END: The #GObject type for #PangoEllipsizeMode. @layout: @indent: @layout: @Returns: @layout: @Returns: @layout: @spacing: @layout: @justify: @layout: @Returns: @layout: @auto_dir: @layout: @Returns: @layout: @alignment: @layout: @Returns: @layout: @tabs: @layout: @Returns: @layout: @setting: @layout: @Returns: A #PangoAlignment 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(), this only has 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: @Returns: @layout: @attrs: @n_attrs: @layout: @n_attrs: @Returns: @layout: @index_: @pos: @layout: @index_: @trailing: @line: @x_pos: @layout: @x: @y: @index_: @trailing: @Returns: @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: @Returns: @layout: @line: @Returns: @layout: @line: @Returns: @layout: @Returns: @layout: @Returns: @layout: @Returns: @iter: @Returns: @iter: @iter: @Returns: @iter: @Returns: @iter: @Returns: @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. 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. @line: @Returns: @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: