Learn R Programming

RGtk2 (version 2.20.31)

pango-Layout-Objects: Layout Objects

Description

High-level layout driver objects

Arguments

Methods and Functions

pangoLayoutNew(context) pangoLayoutCopy(object) pangoLayoutGetContext(object) pangoLayoutContextChanged(object) pangoLayoutSetText(object, text, length = -1) pangoLayoutGetText(object) pangoLayoutSetMarkup(object, markup, length = -1) pangoLayoutSetMarkupWithAccel(object, markup, accel.marker) pangoLayoutSetAttributes(object, attrs) pangoLayoutGetAttributes(object) pangoLayoutSetFontDescription(object, desc = NULL) pangoLayoutGetFontDescription(object) pangoLayoutSetWidth(object, width) pangoLayoutGetWidth(object) pangoLayoutSetHeight(object, height) pangoLayoutGetHeight(object) pangoLayoutSetWrap(object, wrap) pangoLayoutGetWrap(object) pangoLayoutIsWrapped(object) pangoLayoutSetEllipsize(object, ellipsize) pangoLayoutGetEllipsize(object) pangoLayoutIsEllipsized(object) pangoLayoutSetIndent(object, indent) pangoLayoutGetIndent(object) pangoLayoutGetSpacing(object) pangoLayoutSetSpacing(object, spacing) pangoLayoutSetJustify(object, justify) pangoLayoutGetJustify(object) pangoLayoutSetAutoDir(object, auto.dir) pangoLayoutGetAutoDir(object) pangoLayoutSetAlignment(object, alignment) pangoLayoutGetAlignment(object) pangoLayoutSetTabs(object, tabs = NULL) pangoLayoutGetTabs(object) pangoLayoutSetSingleParagraphMode(object, setting) pangoLayoutGetSingleParagraphMode(object) pangoLayoutGetUnknownGlyphsCount(object) pangoLayoutGetLogAttrs(object) pangoLayoutIndexToPos(object, index, pos) pangoLayoutIndexToLineX(object, index., trailing) pangoLayoutXyToIndex(object, x, y) pangoLayoutGetCursorPos(object, index) pangoLayoutMoveCursorVisually(object, strong, old.index, old.trailing, direction) pangoLayoutGetExtents(object) pangoLayoutGetPixelExtents(object) pangoLayoutGetSize(object) pangoLayoutGetPixelSize(object) pangoLayoutGetBaseline(object) pangoLayoutGetLineCount(object) pangoLayoutGetLine(object, line) pangoLayoutGetLineReadonly(object, line) pangoLayoutGetLines(object) pangoLayoutGetLinesReadonly(object) pangoLayoutGetIter(object) pangoLayoutIterNextRun(object) pangoLayoutIterNextChar(object) pangoLayoutIterNextCluster(object) pangoLayoutIterNextLine(object) pangoLayoutIterAtLastLine(object) pangoLayoutIterGetIndex(object) pangoLayoutIterGetBaseline(object) pangoLayoutIterGetRun(object) pangoLayoutIterGetRunReadonly(object) pangoLayoutIterGetLine(object) pangoLayoutIterGetLineReadonly(object) pangoLayoutIterGetLayout(iter) pangoLayoutIterGetCharExtents(object) pangoLayoutIterGetClusterExtents(object) pangoLayoutIterGetRunExtents(object) pangoLayoutIterGetLineYrange(object) pangoLayoutIterGetLineExtents(object) pangoLayoutIterGetLayoutExtents(object) pangoLayoutLineGetExtents(object) pangoLayoutLineGetPixelExtents(object) pangoLayoutLineIndexToX(object, index, trailing) pangoLayoutLineXToIndex(object, x.pos) pangoLayoutLineGetXRanges(object, start.index, end.index) pangoLayout(context)

Hierarchy

GObject
   +----PangoLayout

Detailed Description

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.

Structures

PangoLayout
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. The PangoLayout structure is opaque, and has no user-visible fields.
PangoLayoutIter
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.
PangoLayoutLine
The PangoLayoutLine structure represents one of the lines resulting from laying out a paragraph via PangoLayout. PangoLayoutLine structures are obtained by calling pangoLayoutGetLine 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.
layout
[PangoLayout] the parent layout for this line
startIndex
[integer] the start of the line as byte index into layout->text
length
[integer] the length of the line in bytes
runs
[list] a list containing the runs of the line in visual order
isParagraphStart
[numeric] TRUE if this is the first line of the paragraph
resolvedDir
[numeric] the resolved PangoDirection of the line

Convenient Construction

pangoLayout is the equivalent of pangoLayoutNew.

Enums and Flags

PangoWrapMode
A PangoWrapMode describes how to wrap the lines of a PangoLayout to the desired width.
word
wrap lines at word boundaries.
char
wrap lines at character boundaries.
PangoEllipsizeMode
The PangoEllipsizeMode type describes what sort of (if any) ellipsization should be applied to a line of text. In the ellipsization process characters are removed from the text in order to make it fit to a given width and replaced with an ellipsis.
none
No ellipsization
start
Omit characters at the start of the text
middle
Omit characters in the middle of the text
end
Omit characters at the end of the text
PangoAlignment
A PangoAlignment describes how to align the lines of a PangoLayout within the available space. If the PangoLayout is set to justify using pangoLayoutSetJustify, this only has effect for partial lines.
left
Put all available space on the right
center
Center the line within the available space
right
Put all available space on the left

References

http://library.gnome.org/devel//pango/pango-Layout-Objects.html