java.awt.font
Class LineMetrics

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.font.LineMetrics

public abstract class LineMetrics
extends Object sample code for java.lang.Object definition code for java.lang.Object

The LineMetrics class allows access to the metrics needed to layout characters along a line and to layout of a set of lines. A LineMetrics object encapsulates the measurement information associated with a run of text.

Fonts can have different metrics for different ranges of characters. The getLineMetrics methods of Font sample code for java.awt.Font definition code for java.awt.Font take some text as an argument and return a LineMetrics object describing the metrics of the initial number of characters in that text, as returned by getNumChars() sample code for java.awt.font.LineMetrics.getNumChars() definition code for java.awt.font.LineMetrics.getNumChars() .


Constructor Summary
LineMetrics sample code for java.awt.font.LineMetrics.LineMetrics() definition code for java.awt.font.LineMetrics.LineMetrics() ()
           
 
Method Summary
abstract  float getAscent sample code for java.awt.font.LineMetrics.getAscent() definition code for java.awt.font.LineMetrics.getAscent() ()
          Returns the ascent of the text.
abstract  int getBaselineIndex sample code for java.awt.font.LineMetrics.getBaselineIndex() definition code for java.awt.font.LineMetrics.getBaselineIndex() ()
          Returns the baseline index of the text.
abstract  float[] getBaselineOffsets sample code for java.awt.font.LineMetrics.getBaselineOffsets() definition code for java.awt.font.LineMetrics.getBaselineOffsets() ()
          Returns the baseline offsets of the text, relative to the baseline of the text.
abstract  float getDescent sample code for java.awt.font.LineMetrics.getDescent() definition code for java.awt.font.LineMetrics.getDescent() ()
          Returns the descent of the text.
abstract  float getHeight sample code for java.awt.font.LineMetrics.getHeight() definition code for java.awt.font.LineMetrics.getHeight() ()
          Returns the height of the text.
abstract  float getLeading sample code for java.awt.font.LineMetrics.getLeading() definition code for java.awt.font.LineMetrics.getLeading() ()
          Returns the leading of the text.
abstract  int getNumChars sample code for java.awt.font.LineMetrics.getNumChars() definition code for java.awt.font.LineMetrics.getNumChars() ()
          Returns the number of characters (char values) in the text whose metrics are encapsulated by this LineMetrics object.
abstract  float getStrikethroughOffset sample code for java.awt.font.LineMetrics.getStrikethroughOffset() definition code for java.awt.font.LineMetrics.getStrikethroughOffset() ()
          Returns the position of the strike-through line relative to the baseline.
abstract  float getStrikethroughThickness sample code for java.awt.font.LineMetrics.getStrikethroughThickness() definition code for java.awt.font.LineMetrics.getStrikethroughThickness() ()
          Returns the thickness of the strike-through line.
abstract  float getUnderlineOffset sample code for java.awt.font.LineMetrics.getUnderlineOffset() definition code for java.awt.font.LineMetrics.getUnderlineOffset() ()
          Returns the position of the underline relative to the baseline.
abstract  float getUnderlineThickness sample code for java.awt.font.LineMetrics.getUnderlineThickness() definition code for java.awt.font.LineMetrics.getUnderlineThickness() ()
          Returns the thickness of the underline.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

LineMetrics sample code for java.awt.font.LineMetrics() definition code for java.awt.font.LineMetrics()

public LineMetrics()
Method Detail

getNumChars sample code for java.awt.font.LineMetrics.getNumChars() definition code for java.awt.font.LineMetrics.getNumChars()

public abstract int getNumChars()
Returns the number of characters (char values) in the text whose metrics are encapsulated by this LineMetrics object.

Returns:
the number of characters (char values) in the text with which this LineMetrics was created.

getAscent sample code for java.awt.font.LineMetrics.getAscent() definition code for java.awt.font.LineMetrics.getAscent()

public 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.

getDescent sample code for java.awt.font.LineMetrics.getDescent() definition code for java.awt.font.LineMetrics.getDescent()

public 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.

getLeading sample code for java.awt.font.LineMetrics.getLeading() definition code for java.awt.font.LineMetrics.getLeading()

public 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.

getHeight sample code for java.awt.font.LineMetrics.getHeight() definition code for java.awt.font.LineMetrics.getHeight()

public 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.

getBaselineIndex sample code for java.awt.font.LineMetrics.getBaselineIndex() definition code for java.awt.font.LineMetrics.getBaselineIndex()

public abstract int getBaselineIndex()
Returns the baseline index of the text. The index is one of ROMAN_BASELINE sample code for java.awt.Font.ROMAN_BASELINE definition code for java.awt.Font.ROMAN_BASELINE , CENTER_BASELINE sample code for java.awt.Font.CENTER_BASELINE definition code for java.awt.Font.CENTER_BASELINE , HANGING_BASELINE sample code for java.awt.Font.HANGING_BASELINE definition code for java.awt.Font.HANGING_BASELINE .

Returns:
the baseline of the text.

getBaselineOffsets sample code for java.awt.font.LineMetrics.getBaselineOffsets() definition code for java.awt.font.LineMetrics.getBaselineOffsets()

public 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 is CENTER_BASELINE then offsets[HANGING_BASELINE] is usually negative, offsets[CENTER_BASELINE] is zero, and offsets[ROMAN_BASELINE] is usually positive.

Returns:
the baseline offsets of the text.

getStrikethroughOffset sample code for java.awt.font.LineMetrics.getStrikethroughOffset() definition code for java.awt.font.LineMetrics.getStrikethroughOffset()

public abstract float getStrikethroughOffset()
Returns the position of the strike-through line relative to the baseline.

Returns:
the position of the strike-through line.

getStrikethroughThickness sample code for java.awt.font.LineMetrics.getStrikethroughThickness() definition code for java.awt.font.LineMetrics.getStrikethroughThickness()

public abstract float getStrikethroughThickness()
Returns the thickness of the strike-through line.

Returns:
the thickness of the strike-through line.

getUnderlineOffset sample code for java.awt.font.LineMetrics.getUnderlineOffset() definition code for java.awt.font.LineMetrics.getUnderlineOffset()

public abstract float getUnderlineOffset()
Returns the position of the underline relative to the baseline.

Returns:
the position of the underline.

getUnderlineThickness sample code for java.awt.font.LineMetrics.getUnderlineThickness() definition code for java.awt.font.LineMetrics.getUnderlineThickness()

public abstract float getUnderlineThickness()
Returns the thickness of the underline.

Returns:
the thickness of the underline.