TextLayout is a graphic object that represents
styled text.
Instances of this class provide support for drawing, cursor navigation, hit testing, text wrapping, alignment, tab expansion line breaking, etc. These are aspects required for rendering internationalized text.
Application code must explicitly invoke the TextLayout#dispose()
method to release the operating system resources managed by each instance
when those instances are no longer required.
| Modifier and Type | Class and Description |
|---|---|
| private static class | TextLayout.
Adapts necessary Pango APIs to enforce fixed line metrics (when set) |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv long | |
| pack-priv long | |
| pack-priv int | |
| pack-priv Font | |
| pack-priv int | |
| pack-priv int[] | |
| pack-priv long | |
| pack-priv static final char | |
| pack-priv TextLayout. | |
| pack-priv static final char | |
| pack-priv int[] | |
| pack-priv char[] | |
| pack-priv long | |
| pack-priv TextLayout. | |
| pack-priv int | |
| pack-priv int[] | |
| pack-priv String | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv static final char | |
| pack-priv static final char |
| Access | Constructor and Description |
|---|---|
| public | TextLayout(Device
the device on which to allocate the text layout device)Constructs a new instance of this class on the given device. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | |
| pack-priv void | |
| pack-priv int[] | |
| pack-priv void | |
| pack-priv void | |
| public void | |
| public void | draw(GC
the GC to draw gc, int the x coordinate of the top left corner of the rectangular area where the text is to be drawn x, int the y coordinate of the top left corner of the rectangular area where the text is to be drawn y, int the offset where the selections starts, or -1 indicating no selection selectionStart, int the offset where the selections ends, or -1 indicating no selection selectionEnd, Color selection foreground, or NULL to use the system default color selectionForeground, Color selection background, or NULL to use the system default color selectionBackground)Draws the receiver's text using the specified GC at the specified point. |
| public void | draw(GC
the GC to draw gc, int the x coordinate of the top left corner of the rectangular area where the text is to be drawn x, int the y coordinate of the top left corner of the rectangular area where the text is to be drawn y, int the offset where the selections starts, or -1 indicating no selection selectionStart, int the offset where the selections ends, or -1 indicating no selection selectionEnd, Color selection foreground, or NULL to use the system default color selectionForeground, Color selection background, or NULL to use the system default color selectionBackground, int drawing options flags)Draws the receiver's text using the specified GC at the specified point. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground)
|
| pack-priv void | drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground, int flags)
|
| pack-priv void | drawWithCairo(GC gc, int x, int y, int start, int end, boolean fullSelection, GdkRGBA fg, GdkRGBA bg)
|
| pack-priv void | |
| public int | Returns: the alignment used to positioned text horizontallyReturns the receiver's horizontal text alignment, which will be one
of |
| public int | |
| public Rectangle | |
| public Rectangle | Returns: the bounds of the character rangethe start offset start, int the end offset end)Returns the bounds for the specified range of characters. |
| pack-priv Rectangle | |
| pack-priv Rectangle | |
| public int | |
| public Font | Returns: the receiver's fontReturns the default font currently being used by the receiver to draw and measure text. |
| public int | |
| pack-priv int | |
| public boolean | |
| public int | Returns: the embedding levelthe character offset offset)Returns the embedding level for the specified character offset. |
| public Rectangle | Returns: the line boundsthe line index lineIndex)Returns the bounds of the line for the specified line index. |
| pack-priv Rectangle | |
| private Rectangle | |
| public int | |
| public int | Returns: the line indexthe character offset offset)Returns the index of the line that contains the specified character offset. |
| public FontMetrics | Returns: the font metricsthe line index lineIndex)Returns the font metrics for the specified line index. |
| public int[] | |
| public Point | Returns: the location of the character offsetthe character offset offset, boolean the trailing flag trailing)Returns the location for the specified character offset. |
| pack-priv Point | |
| public int | Returns: the next offsetthe start offset offset, int the movement type movement)Returns the next offset for the specified offset and movement type. |
| public int | |
| public int | Returns: the character offsetthe x coordinate of the point x, int the y coordinate of the point y, int[] the trailing buffer trailing)Returns the character offset for the specified point. |
| pack-priv int | |
| pack-priv int | |
| public int | |
| public int | Returns: the previous offsetthe start offset offset, int the movement type movement)Returns the previous offset for the specified offset and movement type. |
| public int[] | Returns: the ranges, an array of offsets representing the start and end of each text style.Gets the ranges of text that are associated with a |
| private int | |
| public int[] | |
| public char[] | |
| pack-priv String | |
| public int | |
| pack-priv int | |
| public TextStyle | Returns: the style ornull if not setthe text offset offset)Gets the style of the receiver at the specified character offset. |
| public TextStyle[] | |
| public int[] | |
| pack-priv int[] | |
| public String | Returns: the receiver's textGets the receiver's text, which will be an empty string if it has never been set. |
| public int | |
| public int | |
| public int | |
| pack-priv int | |
| public int | |
| pack-priv int | |
| pack-priv static final boolean | |
| public boolean | Returns: true when the text layout is disposed and false otherwiseImplements abstract org. true if the text layout has been disposed,
and false otherwise.
|
| pack-priv static final boolean | |
| public void | |
| public void | |
| public void | setDefaultTabWidth(int
in number of characters tabLength)Sets Default Tab Width in terms if number of space characters. |
| public void | |
| public void | |
| public void | |
| public void | |
| pack-priv void | |
| public void | |
| public void | setOrientation(int
new orientation style orientation)Sets the orientation of the receiver, which must be one
of |
| public void | setSegments(int[]
the text segments offset segments)Sets the offsets of the receiver's text segments. |
| public void | setSegmentsChars(char[]
the segments characters segmentsChars)Sets the characters to be used in the segments boundaries. |
| public void | |
| pack-priv void | |
| public void | |
| public void | |
| pack-priv void | |
| public void | |
| public void | setTextDirection(int
the new text direction textDirection)Sets the text direction of the receiver, which must be one
of |
| public void | setVerticalIndent(int
the new vertical indent verticalIndent)Sets the vertical indent of the receiver. |
| public void | setWidth(int
the new width width)Sets the line width of the receiver, which determines how text should be wrapped and aligned. |
| pack-priv void | |
| pack-priv void | |
| public void | |
| pack-priv void | |
| public String | Returns: a string representation of the receiverOverrides java. |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |