contextChanged
public void contextChanged()
Forces recomputation of any state in the Layout that might
depend on the layout's context. This method should be called
if you make changes to the context subsequent to creating
the layout
getAlignment
public Alignment getAlignment()
Gets the alignment for the layout (how partial lines are positioned
within the horizontal space available.)
getAttributes
public AttrList getAttributes()
Gets the attribute list for the layout, if any
getContext
public Context getContext()
Retrieve the Context used for this Layout.
getHeight
public int getHeight()
Return the logical height of the Layout in Pango units.
getIndent
public int getIndent()
Gets the amount by which the first line should be shorter than the rest
of the lines.
getJustified
public boolean getJustified()
Gets whether or not each complete line should be stretched to fill the
entire width of the layout.
getLine
public LayoutLine getLine(int line)
Retrieves a particular line from a PangoLayout.
line
- the index of a line, which must be between 0 and
pango_layout_get_line_count(layout) - 1, inclusive.
- the requested PangoLayoutLine.
getLineCount
public int getLineCount()
Retrieve the count of lines for the layout
getPixelHeight
public int getPixelHeight()
Return the logical height of the Layout in device units.
getPixelWidth
public int getPixelWidth()
Return the logical width of the Layout in device units.
getSingleParagraphMode
public boolean getSingleParagraphMode()
getSpacing
public int getSpacing()
Gets the amount of spacing between the lines of the layout.
- the spacing (in thousandths of a device unit)
getStrongCursorPosition
public Rectangle getStrongCursorPosition(int index)
Given an index within a layout, determines the positions that of the
strong cursor 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.
index
-
getTabs
public TabArray getTabs()
Retrieve the tabs used for this layout.
getText
public String getText()
Gets the text in the layout.
getWeakCursorPosition
public Rectangle getWeakCursorPosition(int index)
Given an index within a layout, determines the positions that of the
weak cursor if the insertion point is at that index. The position
of each cursor is stored as a zero-width rectangle. The weak cursor
location is the location where characters of the directionality opposite
to the base direction of the layout are inserted.
index
-
getWidth
public int getWidth()
Gets the width to which the lines of the PangoLayout should be wrapped.
getWrapMode
public WrapMode getWrapMode()
Get the wrap mode for the layout.
indexToPos
public Rectangle indexToPos(int index)
Converts from an index within a Layout to the onscreen position
corresponding to the grapheme at that index, which is represented
as rectangle. Note that pos->x is always the leading edge of the
grapheme and pos->x + pos->width the trailing edge of the grapheme.
If the directionality of the grapheme is right-to-left, then
pos->width will be negative.
index
-
pango_layout_context_changed
protected static final void pango_layout_context_changed(Handle layout)
pango_layout_copy
protected static final Handle pango_layout_copy(Handle src)
pango_layout_get_alignment
protected static final int pango_layout_get_alignment(Handle layout)
pango_layout_get_attributes
protected static final Handle pango_layout_get_attributes(Handle layout)
pango_layout_get_context
protected static final Handle pango_layout_get_context(Handle layout)
pango_layout_get_cursor_pos
protected static final void pango_layout_get_cursor_pos(Handle layout,
int index,
Handle strongPos,
Handle weakPos)
pango_layout_get_extents
protected static final void pango_layout_get_extents(Handle layout,
Handle inkRect,
Handle logicalRect)
pango_layout_get_indent
protected static final int pango_layout_get_indent(Handle layout)
pango_layout_get_justify
protected static final boolean pango_layout_get_justify(Handle layout)
pango_layout_get_line
protected static final Handle pango_layout_get_line(Handle layout,
int line)
pango_layout_get_line_count
protected static final int pango_layout_get_line_count(Handle layout)
pango_layout_get_pixel_extents
protected static final void pango_layout_get_pixel_extents(Handle layout,
Handle inkRect,
Handle logicalRect)
pango_layout_get_pixel_size
protected static final void pango_layout_get_pixel_size(Handle layout,
int[] width,
int[] height)
pango_layout_get_single_paragraph_mode
protected static final boolean pango_layout_get_single_paragraph_mode(Handle layout)
pango_layout_get_size
protected static final void pango_layout_get_size(Handle layout,
int[] width,
int[] height)
pango_layout_get_spacing
protected static final int pango_layout_get_spacing(Handle layout)
pango_layout_get_tabs
protected static final Handle pango_layout_get_tabs(Handle layout)
pango_layout_get_text
protected static final String pango_layout_get_text(Handle layout)
pango_layout_get_type
protected static final int pango_layout_get_type()
pango_layout_get_width
protected static final int pango_layout_get_width(Handle layout)
pango_layout_get_wrap
protected static final int pango_layout_get_wrap(Handle layout)
pango_layout_index_to_pos
protected static final void pango_layout_index_to_pos(Handle layout,
int index,
Handle pos)
pango_layout_move_cursor_visually
protected static final void pango_layout_move_cursor_visually(Handle layout,
boolean strong,
int oldIndex,
int oldTrailing,
int direction,
int[] newIndex,
int[] newTrailing)
pango_layout_new
protected static final Handle pango_layout_new(Handle context)
pango_layout_set_alignment
protected static final void pango_layout_set_alignment(Handle layout,
int alignment)
pango_layout_set_attributes
protected static final void pango_layout_set_attributes(Handle layout,
Handle attrs)
pango_layout_set_font_description
protected static final void pango_layout_set_font_description(Handle layout,
Handle desc)
pango_layout_set_indent
protected static final void pango_layout_set_indent(Handle layout,
int indent)
pango_layout_set_justify
protected static final void pango_layout_set_justify(Handle layout,
boolean justify)
pango_layout_set_markup
protected static final void pango_layout_set_markup(Handle layout,
String markup,
int length)
pango_layout_set_markup_with_accel
protected static final void pango_layout_set_markup_with_accel(Handle layout,
String markup,
int length,
byte accelMarker,
byte accelChar)
pango_layout_set_single_paragraph_mode
protected static final void pango_layout_set_single_paragraph_mode(Handle layout,
boolean setting)
pango_layout_set_spacing
protected static final void pango_layout_set_spacing(Handle layout,
int spacing)
pango_layout_set_tabs
protected static final void pango_layout_set_tabs(Handle layout,
Handle tabs)
pango_layout_set_text
protected static final void pango_layout_set_text(Handle layout,
String text,
int length)
pango_layout_set_width
protected static final void pango_layout_set_width(Handle layout,
int width)
pango_layout_set_wrap
protected static final void pango_layout_set_wrap(Handle layout,
int wrap)
pango_layout_xy_to_index
protected static final boolean pango_layout_xy_to_index(Handle layout,
int x,
int y,
int[] index,
int[] trailing)
setAlignment
public void setAlignment(Alignment alignment)
Sets the alignment for the layout (how partial lines are positioned
within the horizontal space available.)
setAttributes
public void setAttributes(AttrList attributes)
Sets the text attributes for a layout object
setFontDescription
public void setFontDescription(FontDescription desc)
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.
setIndent
public void setIndent(int indent)
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
setJustification
public void setJustification(boolean justify)
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.
setMarkup
public void setMarkup(String markup)
setMarkup
public void setMarkup(String markup,
char accelMarker)
Sets the layout text and attribute list from marked-up text (see markup
format). Replaces the current text and attribute list.
If accelMarker 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
Underline.LOW
attribute. Two accelMarker characters
following each other produce a single literal accelMarker character.
markup
- some marked-up textaccelMarker
- : marker for accelerators in the text
setSingleParagraphMode
public void setSingleParagraphMode(boolean setting)
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.
setSpacing
public void setSpacing(int spacing)
Sets the amount of spacing between the lines of the layout.
setTabs
public void setTabs(TabArray tabs)
Sets the tabs to use for layout, overriding the default tabs (by default,
tabs are every 8 spaces).
setText
public void setText(String text)
Set the text of the layout.
setWidth
public void setWidth(int width)
Sets the width to which the lines of the PangoLayout should be wrapped.
setWrapStyle
public void setWrapStyle(WrapMode wrap)
Sets the wrap style; the wrap style only has an effect if a width is set
on the layout with
setWidth(int)
To turn off wrapping, set
the width to -1.