GObject.Object
Pango.Layout
Import line: | Pango = imports.gi.Pango; |
GIR File: | Pango-1.0.gir |
C documentation: | Pango.Layout |
Class : | Layout |
Extends: | GObject.Object |
None |
Method / Constructor | Defined By | |
---|---|---|
new Pango.Layout
()
Create a new Pango.Layout
Create a new Pango.Layout
|
||
Create a new Pango.Layout
Create a new Pango.Layout
|
||
context_changed
()
:
none
Forces recomputation of any state in the PangoLayout that
might depend on the layout's context.
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 | |
get_alignment
()
:
Pango.Alignment
positioned within the horizontal space available.
positioned within the horizontal space available.
|
Pango.Layout | |
get_attributes
()
:
Pango.AttrList
Gets the attribute list for the layout, if any.
Gets the attribute list for the layout, if any.
|
Pango.Layout | |
get_auto_dir
()
:
gboolean
Gets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout.
Gets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout. See pango_layout_set_auto_dir(). is computed from the layout's contents, FALSE otherwise.
|
Pango.Layout | |
get_baseline
()
:
gint32
Gets the Y position of baseline of the first line in layout.
Gets the Y position of baseline of the first line in layout.
|
Pango.Layout | |
get_context
()
:
Pango.Context
Retrieves the PangoContext used for this layout.
Retrieves the PangoContext used for this layout.
This does not have an additional refcount added, so if you want to keep a copy of this around, you must reference it yourself.
|
Pango.Layout | |
Given an index within a layout, determines the positions that of the
strong and weak cursors if the insertion point is at that index.
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 | |
get_ellipsize
()
:
Pango.EllipsizeMode
Gets the type of ellipsization being performed for layout.
Gets the type of ellipsization being performed for layout.
See pango_layout_set_ellipsize() Use pango_layout_is_ellipsized() to query whether any paragraphs were actually ellipsized.
|
Pango.Layout | |
get_extents
()
:
Object
Computes the logical and ink extents of layout.
Computes the logical and ink extents of layout. Logical extents
are usually what you want for positioning things. Note that both extents may have non-zero x and y. You may want to use those to offset where you render the layout. Not doing that is a very typical bug that shows up as right-to-left layouts not being correctly positioned in a layout with a set width. 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_font_description
()
:
Pango.FontDescription
Gets the font description for the layout, if any.
Gets the font description for the layout, if any.
or NULL if the font description from the layout's context is inherited. This value is owned by the layout and must not be modified or freed.
|
Pango.Layout | |
get_height
()
:
gint32
Gets the height of layout used for ellipsization.
Gets the height of layout used for ellipsization. See
pango_layout_set_height() for details. number of lines if negative.
|
Pango.Layout | |
get_indent
()
:
gint32
Gets the paragraph indent width in Pango units.
Gets the paragraph indent width in Pango units. A negative value
indicates a hanging indentation.
|
Pango.Layout | |
get_iter
()
:
Pango.LayoutIter
Returns an iterator to iterate over the visual extents of the layout.
Returns an iterator to iterate over the visual extents of the layout.
pango_layout_iter_free().
|
Pango.Layout | |
get_justify
()
:
gboolean
Gets whether each complete line should be stretched to fill the entire
width of the layout.
Gets whether each complete line should be stretched to fill the entire
width of the layout.
|
Pango.Layout | |
get_line
(gint32 line)
:
Pango.LayoutLine
Retrieves a particular line from a PangoLayout.
Retrieves a particular line from a PangoLayout.
Use the faster pango_layout_get_line_readonly() if you do not plan to modify the contents of the line (glyphs, glyph widths, etc.). index is out of range. This layout line can be ref'ed and retained, but will become invalid if changes are made to the PangoLayout.
|
Pango.Layout | |
get_line_count
()
:
gint32
Retrieves the count of lines for the layout.
Retrieves the count of lines for the layout.
|
Pango.Layout | |
get_line_readonly
(gint32 line)
:
Pango.LayoutLine
Retrieves a particular line from a PangoLayout.
Retrieves a particular line from a PangoLayout.
This is a faster alternative to pango_layout_get_line(), but the user is not expected to modify the contents of the line (glyphs, glyph widths, etc.). index is out of range. This layout line can be ref'ed and retained, but will become invalid if changes are made to the PangoLayout. No changes should be made to the line.
|
Pango.Layout | |
get_lines
()
:
Array
Returns the lines of the layout as a list.
Returns the lines of the layout as a list.
Use the faster pango_layout_get_lines_readonly() if you do not plan to modify the contents of the lines (glyphs, glyph widths, etc.). the lines in the layout. This points to internal data of the PangoLayout and must be used with care. It will become invalid on any change to the layout's text or properties.
|
Pango.Layout | |
get_lines_readonly
()
:
Array
Returns the lines of the layout as a list.
Returns the lines of the layout as a list.
This is a faster alternative to pango_layout_get_lines(), but the user is not expected to modify the contents of the lines (glyphs, glyph widths, etc.). the lines in the layout. This points to internal data of the PangoLayout and must be used with care. It will become invalid on any change to the layout's text or properties. No changes should be made to the lines.
|
Pango.Layout | |
get_log_attrs
()
:
Object
|
Pango.Layout | |
get_pixel_extents
()
:
Object
Computes the logical and ink extents of layout in device units.
Computes the logical and ink extents of layout in device units.
This function just calls pango_layout_get_extents() followed by two pango_extents_to_pixels() calls, rounding ink_rect and logical_rect such that the rounded rectangles fully contain the unrounded one (that is, passes them as first argument to pango_extents_to_pixels()).
|
Pango.Layout | |
get_pixel_size
()
:
Object
Determines the logical width and height of a PangoLayout
in device units. |
Pango.Layout | |
get_single_paragraph_mode
()
:
gboolean
Obtains the value set by pango_layout_set_single_paragraph_mode().
Obtains the value set by pango_layout_set_single_paragraph_mode().
paragraph separator characters, FALSE otherwise.
|
Pango.Layout | |
get_size
()
:
Object
Determines the logical width and height of a PangoLayout
in Pango units (device units scaled by PANGO_SCALE). |
Pango.Layout | |
get_spacing
()
:
gint32
Gets the amount of spacing between the lines of the layout.
Gets the amount of spacing between the lines of the layout.
|
Pango.Layout | |
get_tabs
()
:
Pango.TabArray
Gets the current PangoTabArray used by this layout.
Gets the current PangoTabArray used by this layout. If no
PangoTabArray has been set, then the default tabs are in use and NULL is returned. Default tabs are every 8 spaces. The return value should be freed with pango_tab_array_free().
|
Pango.Layout | |
get_text
()
:
String
Gets the text in the layout.
Gets the text in the layout. The returned text should not
be freed or modified.
|
Pango.Layout | |
get_unknown_glyphs_count
()
:
gint32
Counts the number unknown glyphs in layout.
Counts the number unknown glyphs in layout. That is, zero if
glyphs for all characters in the layout text were found, or more than zero otherwise. 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 PANGO_ATTR_FALLBACK, to check if a certain font supports all the characters in the string.
|
Pango.Layout | |
get_width
()
:
gint32
Gets the width to which the lines of the PangoLayout should wrap.
Gets the width to which the lines of the PangoLayout should wrap.
|
Pango.Layout | |
get_wrap
()
:
Pango.WrapMode
Gets the wrap mode for the layout.
Gets the wrap mode for the layout.
Use pango_layout_is_wrapped() to query whether any paragraphs were actually wrapped.
|
Pango.Layout | |
Converts from byte index_ within the layout to line and X position.
Converts from byte index_ within the layout to line and X position.
(X position is measured from the left edge of the line)
|
Pango.Layout | |
index_to_pos
(gint32 index_)
:
Pango.Rectangle
Converts from an index within a PangoLayout to the onscreen position
corresponding to the grapheme at that index, which is represented as rectangle.
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 edge of the grapheme and edge of the grapheme. If the directionality of the grapheme is right-to-left, then
|
Pango.Layout | |
is_ellipsized
()
:
gboolean
Queries whether the layout had to ellipsize any paragraphs.
Queries whether the layout had to ellipsize any paragraphs.
This returns TRUE if the ellipsization mode for layout is not PANGO_ELLIPSIZE_NONE, a positive width is set on layout, and there are paragraphs exceeding that width that have to be ellipsized. otherwise.
|
Pango.Layout | |
is_wrapped
()
:
gboolean
Queries whether the layout had to wrap any paragraphs.
Queries whether the layout had to wrap any paragraphs.
This returns TRUE if a positive width is set on layout, ellipsization mode of layout is set to PANGO_ELLIPSIZE_NONE, and there are paragraphs exceeding the layout width that have to be wrapped. otherwise.
|
Pango.Layout | |
move_cursor_visually
(gboolean strong, gint32 old_index, gint32 old_trailing, gint32 direction, gint32 new_index, gint32 new_trailing)
:
gint32
Computes a new cursor position from an old position and
a count of positions to move visually.
Computes a new cursor position from an old position and
a count of positions to move visually. If direction is positive, then the new strong cursor position will be one position to the right of the old cursor position. If direction is negative, then the new strong cursor position will be one position to the left of the old cursor position. 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_move_cursor_visually() may move the cursor over multiple characters when multiple characters combine to form a single grapheme.
|
Pango.Layout | |
set_alignment
(Alignment alignment)
:
none
positioned within the horizontal space available.
positioned within the horizontal space available.
|
Pango.Layout | |
set_attributes
(AttrList attrs)
:
none
Sets the text attributes for a layout object.
Sets the text attributes for a layout object.
References attrs, so the caller can unref its reference.
|
Pango.Layout | |
set_auto_dir
(gboolean auto_dir)
:
none
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 (Arabic and Hebrew principally), will have right-to-left layout, paragraphs with letters from other scripts will have left-to-right layout.
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 (Arabic and Hebrew principally), will have right-to-left layout, paragraphs with letters from other scripts will have left-to-right layout. Paragraphs with only neutral characters get their direction from the surrounding paragraphs. When FALSE, the choice between left-to-right and right-to-left layout is done according to the base direction of the layout's PangoContext. (See pango_context_set_base_dir()). When the auto-computed direction of a paragraph differs from the base direction of the context, the interpretation of PANGO_ALIGN_LEFT and PANGO_ALIGN_RIGHT are swapped.
|
Pango.Layout | |
set_ellipsize
(EllipsizeMode ellipsize)
:
none
Sets the type of ellipsization being performed for layout.
Sets the type of ellipsization being performed for layout.
Depending on the ellipsization mode ellipsize text is removed from the start, middle, or end of text so they fit within the width and height of layout set with pango_layout_set_width() and pango_layout_set_height(). 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 pango_layout_set_height() for details.
|
Pango.Layout | |
set_font_description
(FontDescription desc)
:
none
Sets the default font description for the layout.
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 | |
set_height
(gint32 height)
:
none
Sets the height to which the PangoLayout should be ellipsized at.
Sets the height to which the PangoLayout should be ellipsized at. There
are two different behaviors, based on whether height is positive or negative. If height is positive, it will be the maximum height of the layout. Only lines would be shown that would fit, and if there is any text omitted, an ellipsis added. At least one line is included in each paragraph regardless of how small the height value is. A value of zero will render exactly one line for the entire layout. If height is negative, it will be the (negative of) maximum number of lines per paragraph. That is, the total number of lines shown may well be more than this value if the layout contains multiple paragraphs of text. The default value of -1 means that first line of each paragraph is ellipsized. This behvaior may be changed in the future to act per layout instead of per paragraph. File a bug against pango at code relies on this behavior. Height setting only has effect if a positive width is set on The behavior is undefined if a height other than -1 is set and ellipsization mode is set to PANGO_ELLIPSIZE_NONE, and may change in the future.
|
Pango.Layout | |
set_indent
(gint32 indent)
:
none
Sets the width in Pango units to indent each paragraph.
Sets the width in Pango units to indent each paragraph. A negative value
of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent. The indent setting is ignored if layout alignment is set to PANGO_ALIGN_CENTER.
|
Pango.Layout | |
set_justify
(gboolean justify)
:
none
Sets whether each complete line should be stretched to
fill the entire width of the layout.
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 | |
Same as pango_layout_set_markup_with_accel(), but
the markup text isn't scanned for accelerators. |
Pango.Layout | |
set_markup_with_accel
(String markup, gint32 length, gunichar accel_marker, gunichar accel_char)
:
none
Sets the layout text and attribute list from marked-up text (see
markup format).
Sets the layout text and attribute list from marked-up text (see
markup format). Replaces the current text and attribute list. If accel_marker is nonzero, the given character will mark the character following it as an accelerator. For example, accel_marker might be an ampersand or underscore. All characters marked as an accelerator will receive a PANGO_UNDERLINE_LOW attribute, and the first character so marked will be returned in accel_char. Two accel_marker characters following each other produce a single literal accel_marker character.
|
Pango.Layout | |
set_single_paragraph_mode
(gboolean setting)
:
none
If setting is TRUE, do not treat newlines and similar characters
as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters.
If setting is TRUE, do not treat newlines and similar characters
as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want to allow editing of newlines on a single text line.
|
Pango.Layout | |
set_spacing
(gint32 spacing)
:
none
Sets the amount of spacing in Pango unit between the lines of the
layout.
Sets the amount of spacing in Pango unit between the lines of the
layout.
|
Pango.Layout | |
set_tabs
(TabArray tabs)
:
none
Sets the tabs to use for layout, overriding the default tabs
(by default, tabs are every 8 spaces).
Sets the tabs to use for layout, overriding the default tabs
(by default, tabs are every 8 spaces). If tabs is NULL, the default tabs are reinstated. tabs is copied into the layout; you must free your copy of tabs yourself.
|
Pango.Layout | |
Sets the text of the layout.
Sets the text of the layout.
Note that if you have used pango_layout_set_markup() or pango_layout_set_markup_with_accel() on the attributes set on the layout from the markup as this function does not clear attributes.
|
Pango.Layout | |
set_width
(gint32 width)
:
none
Sets the width to which the lines of the PangoLayout should wrap or
Sets the width to which the lines of the PangoLayout should wrap or
|
Pango.Layout | |
set_wrap
(WrapMode wrap)
:
none
Sets the wrap mode; the wrap mode only has effect if a width
is set on the layout with pango_layout_set_width().
Sets the wrap mode; the wrap mode only has effect if a width
is set on the layout with pango_layout_set_width(). To turn off wrapping, set the width to -1.
|
Pango.Layout | |
Converts from X and Y position within a layout to the byte
index to the character at that logical position.
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_x_to_index(). If either the X or Y positions were not inside the layout, then the function returns FALSE; on an exact hit, it returns TRUE.
|
Pango.Layout |
None |
Class / Namespace | Method / Signal / Properties |
---|---|
Clutter.Actor
Method |
create_pango_layout
(String text)
:
Pango.Layout
Creates a new PangoLayout from the same PangoContext used
by the ClutterActor. |
Clutter.Text
Method |
get_layout
()
:
Pango.Layout
Retrieves the current PangoLayout used by a ClutterText actor.
|
Gkbd.KeyboardDrawing
Method |
render
(Context cr, Layout layout, gdouble x, gdouble y, gdouble width, gdouble height, gdouble dpi_x, gdouble dpi_y)
:
gboolean
|
Gtk
Method |
Gtk.paint_layout
(Style style, Context cr, StateType state_type, gboolean use_text, Widget widget, String detail, gint32 x, gint32 y, Layout layout)
:
none
Draws a layout on cr using the given parameters.
|
Gtk
Method |
Renders layout on the coordinates x, y
|
Gtk.Entry
Method |
get_layout
()
:
Pango.Layout
Gets the PangoLayout used to display the entry.
|
Gtk.Label
Method |
get_layout
()
:
Pango.Layout
Gets the PangoLayout used to display the label.
|
Gtk.PrintContext
Method |
create_pango_layout
()
:
Pango.Layout
Creates a new PangoLayout that is suitable for use
with the GtkPrintContext. |
Gtk.Scale
Method |
get_layout
()
:
Pango.Layout
Gets the PangoLayout used to display the scale.
|
Gtk.Widget
Method |
create_pango_layout
(String text)
:
Pango.Layout
Creates a new PangoLayout with the appropriate font map,
font description, and base direction for drawing text for this widget. |
Pango.Renderer
Method |
Draws layout with the specified PangoRenderer.
|
PangoCairo
Method |
Adds the text in a PangoLayout to the current path in the
specified cairo context. |
PangoCairo
Method |
Draws a PangoLayout in the specified cairo context.
|
PangoCairo
Method |
Updates the private PangoContext of a PangoLayout created with
pango_cairo_create_layout() to match the current transformation and target surface of a Cairo context. |
PangoFT2
Method |
|
PangoFT2
Method |
|
PangoXft
Method |
Render a PangoLayout onto a XftDraw
|