- java.lang.Object
- 
- java.awt.font.LineMetrics
 
- 
 
 public abstract class LineMetrics extends Object TheLineMetricsclass allows access to the metrics needed to layout characters along a line and to layout of a set of lines. ALineMetricsobject encapsulates the measurement information associated with a run of text.Fonts can have different metrics for different ranges of characters. The getLineMetricsmethods ofFonttake some text as an argument and return aLineMetricsobject describing the metrics of the initial number of characters in that text, as returned bygetNumChars().
- 
- 
Constructor SummaryConstructors Constructor Description LineMetrics()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract floatgetAscent()Returns the ascent of the text.abstract intgetBaselineIndex()Returns the baseline index of the text.abstract float[]getBaselineOffsets()Returns the baseline offsets of the text, relative to the baseline of the text.abstract floatgetDescent()Returns the descent of the text.abstract floatgetHeight()Returns the height of the text.abstract floatgetLeading()Returns the leading of the text.abstract intgetNumChars()Returns the number of characters (charvalues) in the text whose metrics are encapsulated by thisLineMetricsobject.abstract floatgetStrikethroughOffset()Returns the position of the strike-through line relative to the baseline.abstract floatgetStrikethroughThickness()Returns the thickness of the strike-through line.abstract floatgetUnderlineOffset()Returns the position of the underline relative to the baseline.abstract floatgetUnderlineThickness()Returns the thickness of the underline.
 
- 
- 
- 
Method Detail- 
getNumCharspublic abstract int getNumChars() Returns the number of characters (charvalues) in the text whose metrics are encapsulated by thisLineMetricsobject.- Returns:
- the number of characters (charvalues) in the text with which thisLineMetricswas created.
 
 - 
getAscentpublic abstract float getAscent() Returns the ascent of the text. The ascent is the distance from the baseline to the ascender line. The ascent usually represents the the height of the capital letters of the text. Some characters can extend above the ascender line.- Returns:
- the ascent of the text.
 
 - 
getDescentpublic abstract float getDescent() Returns the descent of the text. The descent is the distance from the baseline to the descender line. The descent usually represents the distance to the bottom of lower case letters like 'p'. Some characters can extend below the descender line.- Returns:
- the descent of the text.
 
 - 
getLeadingpublic abstract float getLeading() Returns the leading of the text. The leading is the recommended distance from the bottom of the descender line to the top of the next line.- Returns:
- the leading of the text.
 
 - 
getHeightpublic abstract float getHeight() Returns the height of the text. The height is equal to the sum of the ascent, the descent and the leading.- Returns:
- the height of the text.
 
 - 
getBaselineIndexpublic abstract int getBaselineIndex() Returns the baseline index of the text. The index is one ofROMAN_BASELINE,CENTER_BASELINE,HANGING_BASELINE.- Returns:
- the baseline of the text.
 
 - 
getBaselineOffsetspublic abstract float[] getBaselineOffsets() Returns the baseline offsets of the text, relative to the baseline of the text. The offsets are indexed by baseline index. For example, if the baseline index isCENTER_BASELINEthenoffsets[HANGING_BASELINE]is usually negative,offsets[CENTER_BASELINE]is zero, andoffsets[ROMAN_BASELINE]is usually positive.- Returns:
- the baseline offsets of the text.
 
 - 
getStrikethroughOffsetpublic abstract float getStrikethroughOffset() Returns the position of the strike-through line relative to the baseline.- Returns:
- the position of the strike-through line.
 
 - 
getStrikethroughThicknesspublic abstract float getStrikethroughThickness() Returns the thickness of the strike-through line.- Returns:
- the thickness of the strike-through line.
 
 - 
getUnderlineOffsetpublic abstract float getUnderlineOffset() Returns the position of the underline relative to the baseline.- Returns:
- the position of the underline.
 
 - 
getUnderlineThicknesspublic abstract float getUnderlineThickness() Returns the thickness of the underline.- Returns:
- the thickness of the underline.
 
 
- 
 
-