![]() |
![]() |
It is initialized with a Pango::Context, 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.
Public Member Functions | |
virtual | ~Layout () |
PangoLayout* | gobj () |
Provides access to the underlying C GObject. | |
const PangoLayout* | gobj () const |
Provides access to the underlying C GObject. | |
PangoLayout* | gobj_copy () |
Glib::RefPtr<Layout> | copy () |
Does a deep copy-by-value of the src layout. | |
Glib::RefPtr<Context> | get_context () const |
Retrieves the Pango::Context used for this layout. | |
void | set_attributes (AttrList& attrs) |
Sets the text attributes for a layout object. | |
AttrList | get_attributes () const |
Gets the attribute list for the layout, if any. | |
void | set_text (const Glib::ustring& text) |
Set the text of the layout. | |
Glib::ustring | get_text () const |
Gets the text in the layout. | |
void | set_markup (const Glib::ustring& markup) |
Sets the layout text and attribute list from marked-up text (see markup format). | |
void | set_markup (const Glib::ustring& markup, gunichar accel_marker, gunichar& accel_char) |
Sets the layout text and attribute list from marked-up text (see markup format). | |
void | set_font_description (const FontDescription& desc) |
Set the default font description for the layout. | |
void | set_width (int width) |
Sets the width to which the lines of the Pango::Layout should be wrapped. | |
int | get_width () const |
Gets the width to which the lines of the Pango::Layout should be wrapped. | |
void | set_wrap (WrapMode wrap) |
Sets the wrap style; the wrap style only has an effect if a width is set on the layout with pango_layout_set_width(). | |
WrapMode | get_wrap () const |
Get the wrap mode for the layout. | |
void | set_indent (int indent) |
Sets the amount by which the first line should be shorter than the rest of the lines. | |
int | get_indent () const |
Gets the amount by which the first line should be shorter than the rest of the lines. | |
void | set_spacing (int spacing) |
Sets the amount of spacing between the lines of the layout. | |
int | get_spacing () const |
Gets the amount of spacing between the lines of the layout. | |
void | set_justify (bool justify=true) |
Sets whether or not each complete line should be stretched to fill the entire width of the layout. | |
bool | get_justify () const |
Gets whether or not each complete line should be stretched to fill the entire width of the layout. | |
void | set_alignment (Alignment alignment) |
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.). | |
Alignment | get_alignment () const |
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.). | |
void | set_tabs (TabArray& tabs) |
Sets the tabs to use for layout , overriding the default tabs (by default, tabs are every 8 spaces). | |
TabArray | get_tabs () const |
Get the current Pango::TabArray used by this layout. | |
void | set_single_paragraph_mode (bool setting=true) |
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. | |
bool | get_single_paragraph_mode () const |
Obtains the value set by pango_layout_set_single_paragraph_mode(). | |
void | context_changed () |
Forces recomputation of any state in the Pango::Layout that might depend on the layout's context. | |
Glib::ArrayHandle<LogAttr> | get_log_attrs () const |
Retrieve an array of logical attributes for each character in the layout. | |
Rectangle | index_to_pos (int index) const |
Convert from an index within the layout to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle. | |
void | get_cursor_pos (int index, Rectangle& strong_pos, Rectangle& weak_pos) const |
Given an index within a layout, determine the positions that of the strong and weak cursors if the insertion point is at that index. | |
Rectangle | get_cursor_strong_pos (int index) const |
Given an index within the layout, determine the positions that of the strong cursors if the insertion point is at that index. | |
Rectangle | get_cursor_weak_pos (int index) const |
Given an index within the layout, determine the positions that of the weak cursors if the insertion point is at that index. | |
void | move_cursor_visually (bool strong, int old_index, int old_trailing, int direction, int& new_index, int& new_trailing) const |
Computes a new cursor position from an old position and a count of positions to move visually. | |
bool | xy_to_index (int x, int y, int& index, int& trailing) const |
Convert from X and Y position within a layout to the byte index to the character at that logical position. | |
void | get_extents (Rectangle& ink_rect, Rectangle& logical_rect) const |
Compute the logical and ink extents of layout . | |
Rectangle | get_ink_extents () const |
Compute the ink extents of layout. | |
Rectangle | get_logical_extents () const |
Compute the logical extents of layout. | |
void | get_pixel_extents (Rectangle& ink_rect, Rectangle& logical_rect) const |
Compute the logical and ink extents of layout in device units. | |
Rectangle | get_pixel_ink_extents () const |
Compute the ink extents of the layout in device units. | |
Rectangle | get_pixel_logical_extents () const |
Compute the logical extents of the layout in device units. | |
void | get_size (int& width, int& height) const |
Determine the logical width and height of a Pango::Layout in Pango units. | |
void | get_pixel_size (int& width, int& height) const |
Determine the logical width and height of a Pango::Layout in device units. | |
int | get_line_count () const |
Retrieve the count of lines for the layout . | |
Glib::RefPtr<LayoutLine> | get_line (int line) const |
Retrieves a particular line from a Pango::Layout. | |
SListHandle_LayoutLine | get_lines () const |
Return the lines of the layout as a list. | |
void | get_iter (LayoutIter& iter) |
Gets an iterator to iterate over the visual extents of the layout. | |
Static Public Member Functions | |
Glib::RefPtr<Layout> | create (const Glib::RefPtr<Context>& context) |
Protected Member Functions | |
Layout (const Glib::RefPtr<Context>& context) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Pango::Layout> | wrap (PangoLayout* object, bool take_copy=false) |
|
|
|
|
|
Forces recomputation of any state in the Pango::Layout 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. |
|
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.
|
|
|
|
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.).
|
|
Gets the attribute list for the layout, if any.
|
|
Retrieves the Pango::Context used for this layout.
|
|
Given an index within a layout, determine 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.
|
|
Given an index within the layout, determine the positions that of the strong cursors if the insertion point is at that index.
|
|
Given an index within the layout, determine the positions that of the weak cursors if the insertion point is at that index.
|
|
Compute the logical and ink extents of layout . Logical extents are usually what you want for positioning things. The extents are given in layout coordinates; layout coordinates begin at the top left corner of the layout. |
|
Gets the amount by which the first line should be shorter than the rest of the lines.
|
|
Compute the ink extents of layout.
|
|
Gets an iterator to iterate over the visual extents of the layout.
|
|
Gets whether or not each complete line should be stretched to fill the entire width of the layout.
|
|
Retrieves a particular line from a Pango::Layout.
|
|
Retrieve the count of lines for the layout .
|
|
Return the lines of the layout as a list.
|
|
Retrieve an array of logical attributes for each character in the layout.
|
|
Compute the logical extents of layout.
|
|
Compute the logical and ink extents of layout in device units. See pango_layout_get_extents(); this function just calls pango_layout_get_extents() and then converts the extents to pixels using the Pango::SCALE factor. |
|
Compute the ink extents of the layout in device units.
|
|
Compute the logical extents of the layout in device units.
|
|
Determine the logical width and height of a Pango::Layout in device units. (pango_layout_get_size() returns the width and height in thousandths of a device unit.) This is simply a convenience function around pango_layout_get_extents.
|
|
Obtains the value set by pango_layout_set_single_paragraph_mode().
|
|
Determine the logical width and height of a Pango::Layout in Pango units. (device units divided by PANGO_SCALE). This is simply a convenience function around pango_layout_get_extents.
|
|
Gets the amount of spacing between the lines of the layout.
|
|
Get the current Pango::TabArray used by this layout. If no Pango::TabArray has been set, then the default tabs are in use and an invalid instance is returned. Default tabs are every 8 spaces.
|
|
Gets the text in the layout. The returned text should not be freed or modified.
|
|
Gets the width to which the lines of the Pango::Layout should be wrapped.
|
|
Get the wrap mode for the layout.
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
|
|
Convert from an index within the layout to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle. Note that x in the returned rectangle is always the leading edge of the grapheme and x + width the trailing edge of the grapheme. If the directionality of the grapheme is right-to-left, then width will be negative.
|
|
Computes a new cursor position from an old position and a count of positions to move visually. If count is positive, then the new strong cursor position will be one position to the right of the old cursor position. If count is position then the new strong cursor position will be one position to the left of the old cursor position. In the presence of bidirection 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.
|
|
Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.).
|
|
Sets the text attributes for a layout object.
|
|
Set 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.
|
|
Sets the amount by which the first line should be shorter than the rest of the lines. This may be negative, in which case the subsequent lines will be shorter than the first line. (However, in either case, the entire width of the layout will be given by the value
|
|
Sets whether or not 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 is done by extending the characters.
|
|
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, the 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.
|
|
Sets the layout text and attribute list from marked-up text (see markup format). Replaces the current text and attribute list.
|
|
If setting is Used when you want to allow editing of newlines on a single text line.
|
|
Sets the amount of spacing between the lines of the layout.
|
|
Sets the tabs to use for layout , overriding the default tabs (by default, tabs are every 8 spaces).
If tabs is
|
|
Set the text of the layout.
|
|
Sets the width to which the lines of the Pango::Layout should be wrapped.
|
|
Sets the wrap style; the wrap style only has an effect if a width is set on the layout with pango_layout_set_width(). To turn off wrapping, set the width to -1.
|
|
Convert from X and Y position within a layout to the byte index to the character at that logical position.
If the position is not inside the layout, the closest position is chosen (the x/y position will be clamped inside the layout). If a closest position is chosen, then the function returns
|
|
|