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 |
Show / Hide Inherited methods, properties and signals |
Properties | Defined By | |
---|---|---|
alignment : Number
read only
|
Pango.Layout | |
attrs : Pango.AttrList
read only
|
Pango.Layout | |
auto_dir : Number
read only
|
Pango.Layout | |
context : Pango.Context
read only
|
Pango.Layout | |
copy_begin : Number
read only
|
Pango.Layout | |
copy_end : Number
read only
|
Pango.Layout | |
ellipsize : Number
read only
|
Pango.Layout | |
font_desc : Pango.FontDescription
read only
|
Pango.Layout | |
height : Number
read only
|
Pango.Layout | |
indent : Number
read only
|
Pango.Layout | |
ink_rect : Pango.Rectangle
read only
|
Pango.Layout | |
ink_rect_cached : Number
read only
|
Pango.Layout | |
is_ellipsized : Number
read only
|
Pango.Layout | |
is_wrapped : Number
read only
|
Pango.Layout | |
justify : Number
read only
|
Pango.Layout | |
length : Number
read only
|
Pango.Layout | |
line_count : Number
read only
|
Pango.Layout | |
lines : Array
read only
|
Pango.Layout | |
log_attrs : Pango.LogAttr
read only
|
Pango.Layout | |
logical_rect : Pango.Rectangle
read only
|
Pango.Layout | |
logical_rect_cached : Number
read only
|
Pango.Layout | |
n_chars : Number
read only
|
Pango.Layout | |
parent_instance : GObject.Object
read only
|
Pango.Layout | |
single_paragraph : Number
read only
|
Pango.Layout | |
spacing : Number
read only
|
Pango.Layout | |
tab_width : Number
read only
|
Pango.Layout | |
tabs : Pango.TabArray
read only
|
Pango.Layout | |
text : String
read only
|
Pango.Layout | |
unknown_glyphs_count : Number
read only
|
Pango.Layout | |
width : Number
read only
|
Pango.Layout | |
wrap : Number
read only
|
Pango.Layout |
Method / Constructor | Defined By | |
---|---|---|
new Pango.Layout
(Object properties)
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 | |
copy
()
:
Pango.Layout
Does a deep copy-by-value of the src layout.
Does a deep copy-by-value of the src layout. The attribute list, tab array, and text from the original layout are all copied by value. count of one, which should be freed with g_object_unref().
|
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
()
:
Boolean
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
()
:
Number
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. 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 | |
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
()
:
Number
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
()
:
Number
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
()
:
Boolean
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
(Number 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
()
:
Number
Retrieves the count of lines for the layout.
Retrieves the count of lines for the layout.
|
Pango.Layout | |
get_line_readonly
(Number 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 | |
Retrieves an array of logical attributes for each character in the layout.
Retrieves an array of logical attributes for each character in the layout.
|
Pango.Layout | |
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
()
:
Boolean
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
()
:
Number
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
()
:
Number
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
()
:
Number
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.
|
Pango.Layout | |
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
|
Pango.Layout | |
is_ellipsized
()
:
Boolean
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
()
:
Boolean
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
(Boolean strong, Number old_index, Number old_trailing, Number direction)
:
Object
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
(Boolean 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 ayout that begin with strong right-to-left characters (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 ayout that begin with strong right-to-left characters (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
(Number 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
|
Pango.Layout | |
set_indent
(Number indent)
:
none
|
Pango.Layout | |
set_justify
(Boolean 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 | |
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
(Boolean 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
(Number 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
(Number 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.
|
Gdk
Method |
Render a PangoLayout onto a GDK drawable If the layout's PangoContext has a transformation matrix set, then bounding box (in device space) of the transformed layout.
|
Gdk
Method |
Gdk.draw_layout_with_colors
(Drawable drawable, GC gc, Number x, Number y, Layout layout, Color foreground, Color background)
:
none
Render a PangoLayout onto a GdkDrawable, overriding the layout's normal colors with foreground and/or background.
|
Gdk
Method |
Gdk.pango_layout_get_clip_region
(Layout layout, Number x_origin, Number y_origin, Object out_values, Number n_ranges)
:
Gdk.Region
Obtains a clip region which contains the areas where the given ranges of text would be drawn.
|
Gtk
Method |
Gtk.draw_layout
(Style style, Window window, StateType state_type, Boolean use_text, Number x, Number y, Layout layout)
:
none
Draws a layout on window using the given parameters.
|
Gtk
Method |
Gtk.paint_layout
(Style style, Window window, StateType state_type, Boolean use_text, Rectangle area, Widget widget, String detail, Number x, Number y, Layout layout)
:
none
Draws a layout on window using the given parameters.
|
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.LayoutIter
Method |
get_layout
()
:
Pango.Layout
Gets the layout associated with a PangoLayoutIter.
|
Pango.Renderer
Method |
Draws layout with the specified PangoRenderer.
|
Pango.Renderer
Method |
get_layout
()
:
Pango.Layout
Gets the layout currently being rendered using renderer.
|
PangoCairo
Method |
Creates a layout object set up to match the current transformation and target surface of the Cairo context.
|
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 |
|
PangoX
Method |
PangoX.render_layout
(Display display, Drawable drawable, GC gc, Layout layout, Number x, Number y)
:
none
|
PangoXft
Method |
Render a PangoLayout onto a XftDraw
|