1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 High-level layout driver objects
7 <!-- ##### SECTION Long_Description ##### -->
9 While complete access to the layout capabilities of Pango is provided
10 using the detailed interfaces for itemization and shaping, using
11 that functionality directly involves writing a fairly large amount
12 of code. The objects and functions in this section provide a
13 high-level driver for formatting entire paragraphs of text
17 <!-- ##### SECTION See_Also ##### -->
22 <!-- ##### SECTION Stability_Level ##### -->
25 <!-- ##### STRUCT PangoLayout ##### -->
27 The #PangoLayout structure represents an entire paragraph
28 of text. It is initialized with a #PangoContext, UTF-8 string
29 and set of attributes for that string. Once that is done, the
30 set of formatted lines can be extracted from the object,
31 the layout can be rendered, and conversion between logical
32 character positions within the layout's text, and the physical
33 position of the resulting glyphs can be made.
37 There are also a number of parameters to adjust the formatting
38 of a #PangoLayout, which are illustrated in <xref linkend="parameters"/>.
39 It is possible, as well, to ignore the 2-D setup, and simply
40 treat the results of a #PangoLayout as a list of lines.
43 <figure id="parameters">
44 <title>Adjustable parameters for a PangoLayout</title>
45 <graphic fileref="layout.gif" format="GIF"></graphic>
49 The #PangoLayout structure is opaque, and has no user-visible
54 <!-- ##### STRUCT PangoLayoutIter ##### -->
56 A #PangoLayoutIter structure can be used to
57 iterate over the visual extents of a #PangoLayout.
60 The #PangoLayoutIter structure is opaque, and
61 has no user-visible fields.
65 <!-- ##### FUNCTION pango_layout_new ##### -->
74 <!-- ##### FUNCTION pango_layout_copy ##### -->
83 <!-- ##### FUNCTION pango_layout_get_context ##### -->
92 <!-- ##### FUNCTION pango_layout_context_changed ##### -->
100 <!-- ##### FUNCTION pango_layout_set_text ##### -->
110 <!-- ##### FUNCTION pango_layout_get_text ##### -->
119 <!-- ##### FUNCTION pango_layout_set_markup ##### -->
129 <!-- ##### FUNCTION pango_layout_set_markup_with_accel ##### -->
141 <!-- ##### FUNCTION pango_layout_set_attributes ##### -->
150 <!-- ##### FUNCTION pango_layout_get_attributes ##### -->
159 <!-- ##### FUNCTION pango_layout_set_font_description ##### -->
168 <!-- ##### FUNCTION pango_layout_get_font_description ##### -->
177 <!-- ##### FUNCTION pango_layout_set_width ##### -->
186 <!-- ##### FUNCTION pango_layout_get_width ##### -->
195 <!-- ##### FUNCTION pango_layout_set_height ##### -->
204 <!-- ##### FUNCTION pango_layout_get_height ##### -->
213 <!-- ##### FUNCTION pango_layout_set_wrap ##### -->
222 <!-- ##### FUNCTION pango_layout_get_wrap ##### -->
231 <!-- ##### FUNCTION pango_layout_is_wrapped ##### -->
240 <!-- ##### ENUM PangoWrapMode ##### -->
242 A #PangoWrapMode describes how to wrap the lines of a #PangoLayout to the desired width.
245 @PANGO_WRAP_WORD: wrap lines at word boundaries.
246 @PANGO_WRAP_CHAR: wrap lines at character boundaries.
247 @PANGO_WRAP_WORD_CHAR: wrap lines at word boundaries, but fall back to character boundaries if there is not
248 enough space for a full word.
250 <!-- ##### MACRO PANGO_TYPE_WRAP_MODE ##### -->
252 The #GObject type for #PangoWrapMode.
257 <!-- ##### FUNCTION pango_layout_set_ellipsize ##### -->
266 <!-- ##### FUNCTION pango_layout_get_ellipsize ##### -->
275 <!-- ##### FUNCTION pango_layout_is_ellipsized ##### -->
284 <!-- ##### ENUM PangoEllipsizeMode ##### -->
289 @PANGO_ELLIPSIZE_NONE:
290 @PANGO_ELLIPSIZE_START:
291 @PANGO_ELLIPSIZE_MIDDLE:
292 @PANGO_ELLIPSIZE_END:
294 <!-- ##### MACRO PANGO_TYPE_ELLIPSIZE_MODE ##### -->
296 The #GObject type for #PangoEllipsizeMode.
301 <!-- ##### FUNCTION pango_layout_set_indent ##### -->
310 <!-- ##### FUNCTION pango_layout_get_indent ##### -->
319 <!-- ##### FUNCTION pango_layout_get_spacing ##### -->
328 <!-- ##### FUNCTION pango_layout_set_spacing ##### -->
337 <!-- ##### FUNCTION pango_layout_set_justify ##### -->
346 <!-- ##### FUNCTION pango_layout_get_justify ##### -->
355 <!-- ##### FUNCTION pango_layout_set_auto_dir ##### -->
364 <!-- ##### FUNCTION pango_layout_get_auto_dir ##### -->
373 <!-- ##### FUNCTION pango_layout_set_alignment ##### -->
382 <!-- ##### FUNCTION pango_layout_get_alignment ##### -->
391 <!-- ##### FUNCTION pango_layout_set_tabs ##### -->
400 <!-- ##### FUNCTION pango_layout_get_tabs ##### -->
409 <!-- ##### FUNCTION pango_layout_set_single_paragraph_mode ##### -->
418 <!-- ##### FUNCTION pango_layout_get_single_paragraph_mode ##### -->
427 <!-- ##### ENUM PangoAlignment ##### -->
429 A #PangoAlignment describes how to align the lines of a #PangoLayout within the
430 available space. If the #PangoLayout is set to justify
431 using pango_layout_set_justify(), this only has effect for partial lines.
434 @PANGO_ALIGN_LEFT: Put all available space on the right
435 @PANGO_ALIGN_CENTER: Center the line within the available space
436 @PANGO_ALIGN_RIGHT: Put all available space on the left
438 <!-- ##### MACRO PANGO_TYPE_ALIGNMENT ##### -->
440 The #GObject type for #PangoAlignment.
445 <!-- ##### FUNCTION pango_layout_get_unknown_glyphs_count ##### -->
454 <!-- ##### FUNCTION pango_layout_get_log_attrs ##### -->
464 <!-- ##### FUNCTION pango_layout_index_to_pos ##### -->
474 <!-- ##### FUNCTION pango_layout_index_to_line_x ##### -->
486 <!-- ##### FUNCTION pango_layout_xy_to_index ##### -->
499 <!-- ##### FUNCTION pango_layout_get_cursor_pos ##### -->
510 <!-- ##### FUNCTION pango_layout_move_cursor_visually ##### -->
524 <!-- ##### FUNCTION pango_layout_get_extents ##### -->
534 <!-- ##### FUNCTION pango_layout_get_pixel_extents ##### -->
544 <!-- ##### FUNCTION pango_layout_get_size ##### -->
554 <!-- ##### FUNCTION pango_layout_get_pixel_size ##### -->
564 <!-- ##### FUNCTION pango_layout_get_baseline ##### -->
573 <!-- ##### FUNCTION pango_layout_get_line_count ##### -->
582 <!-- ##### FUNCTION pango_layout_get_line ##### -->
592 <!-- ##### FUNCTION pango_layout_get_line_readonly ##### -->
602 <!-- ##### FUNCTION pango_layout_get_lines ##### -->
611 <!-- ##### FUNCTION pango_layout_get_lines_readonly ##### -->
620 <!-- ##### FUNCTION pango_layout_get_iter ##### -->
629 <!-- ##### FUNCTION pango_layout_iter_copy ##### -->
638 <!-- ##### FUNCTION pango_layout_iter_free ##### -->
646 <!-- ##### FUNCTION pango_layout_iter_next_run ##### -->
655 <!-- ##### FUNCTION pango_layout_iter_next_char ##### -->
664 <!-- ##### FUNCTION pango_layout_iter_next_cluster ##### -->
673 <!-- ##### FUNCTION pango_layout_iter_next_line ##### -->
682 <!-- ##### FUNCTION pango_layout_iter_at_last_line ##### -->
691 <!-- ##### FUNCTION pango_layout_iter_get_index ##### -->
700 <!-- ##### FUNCTION pango_layout_iter_get_baseline ##### -->
709 <!-- ##### FUNCTION pango_layout_iter_get_run ##### -->
718 <!-- ##### FUNCTION pango_layout_iter_get_run_readonly ##### -->
727 <!-- ##### FUNCTION pango_layout_iter_get_line ##### -->
736 <!-- ##### FUNCTION pango_layout_iter_get_line_readonly ##### -->
745 <!-- ##### FUNCTION pango_layout_iter_get_layout ##### -->
754 <!-- ##### FUNCTION pango_layout_iter_get_char_extents ##### -->
763 <!-- ##### FUNCTION pango_layout_iter_get_cluster_extents ##### -->
773 <!-- ##### FUNCTION pango_layout_iter_get_run_extents ##### -->
783 <!-- ##### FUNCTION pango_layout_iter_get_line_yrange ##### -->
793 <!-- ##### FUNCTION pango_layout_iter_get_line_extents ##### -->
803 <!-- ##### FUNCTION pango_layout_iter_get_layout_extents ##### -->
813 <!-- ##### STRUCT PangoLayoutLine ##### -->
815 The #PangoLayoutLine structure represents one of the lines resulting
816 from laying out a paragraph via #PangoLayout. #PangoLayoutLine
817 structures are obtained by calling pango_layout_get_line() and
818 are only valid until the text, attributes, or settings of the
819 parent #PangoLayout are modified.
822 Routines for rendering PangoLayout objects are provided in
823 code specific to each rendering system.
826 @layout: the parent layout for this line
827 @start_index: the start of the line as byte index into @layout->text
828 @length: the length of the line in bytes
829 @runs: a list containing the runs of the line in visual order
830 @is_paragraph_start: %TRUE if this is the first line of the paragraph
831 @resolved_dir: the resolved #PangoDirection of the line
833 <!-- ##### TYPEDEF PangoLayoutRun ##### -->
835 The #PangoLayoutRun structure represents a single run within
836 a #PangoLayoutLine; it is simply an alternate name for
838 See the #PangoGlyphItem docs for details on the fields.
842 <!-- ##### FUNCTION pango_layout_line_ref ##### -->
851 <!-- ##### FUNCTION pango_layout_line_unref ##### -->
859 <!-- ##### FUNCTION pango_layout_line_get_extents ##### -->
869 <!-- ##### FUNCTION pango_layout_line_get_pixel_extents ##### -->
879 <!-- ##### FUNCTION pango_layout_line_index_to_x ##### -->
890 <!-- ##### FUNCTION pango_layout_line_x_to_index ##### -->
902 <!-- ##### FUNCTION pango_layout_line_get_x_ranges ##### -->