@API(type=NOT_EXTENDABLE,
src=PRIVATE)
public interface FontMetrics
Modifier and Type | Method and Description |
---|---|
int |
charsWidth(char[] chars,
int off,
int len)
Returns the total advance width for showing the specified array
of characters in this
Font . |
int |
charWidth(char c)
Get the char width
|
int |
getAscent()
The font ascent is the distance from the font's baseline to the top of most
alphanumeric characters.
|
int |
getCorrectedBreakYForWrappedString(AttributedString aStr,
int wrappingWidth,
int initialBreak)
Gets the y coordinate where the given wrapped string bounds can be split
without cutting off a text line.
|
int |
getDescent()
The font descent is the distance
from the font's baseline to the bottom of most alphanumeric
characters with descenders.
|
int |
getHeight() |
int |
getLeading()
Determines the standard leading of the
Font described by this FontMetrics
object. |
Rectangle |
getWrappedStringBounds(AttributedString aStr,
int wrappingWidth)
Gets the bounds of a string that is wrapped at the wrappingWidth.
|
AttributedString[] |
limitAttributedString(AttributedString aStr,
int wrappingWidth,
int maxLineCount)
Limit the given attributed string at a maximum number of lines.
|
int |
stringWidth(java.lang.String text)
Returns the total advance width for showing the specified
String in this Font . |
int charsWidth(char[] chars, int off, int len)
Font
.chars
- the array of characters to be measuredoff
- the start offset of the characters in the arraylen
- the number of characters to be measured from the arraychar
array in the font described by
this FontMetrics
object.int getAscent()
int getDescent()
int stringWidth(java.lang.String text)
String
in this Font
.text
- The text.int getHeight()
int charWidth(char c)
c
- The charint getLeading()
Font
described by this FontMetrics
object. The standard leading, or
interline spacing, is the logical amount of space to be reserved
between the descent of one line of text and the ascent of the next
line. The height metric is calculated to include this extra space.Font
.Rectangle getWrappedStringBounds(AttributedString aStr, int wrappingWidth)
AttributedString[] limitAttributedString(AttributedString aStr, int wrappingWidth, int maxLineCount)
aStr
- The text, as an attributed string. The {TextAttribute#FONT}
and {TextAttribute#FOREGROUND} contain values that are
instances of Font
and Color
.wrappingWidth
- The maximum width of the text.maxLineCount
- The maximum number of lines.int getCorrectedBreakYForWrappedString(AttributedString aStr, int wrappingWidth, int initialBreak)
-1
is returned.aStr
- The text, as an attributed string. The {TextAttribute#FONT}
and {TextAttribute#FOREGROUND} contain values that are
instances of Font
and Color
.wrappingWidth
- The maximum width of the text.initialBreak
- The initial break Y coordinate.-1
if the initial
break is not placed inside a text line.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.