net.rim.device.api.ui
Class FontMetrics

java.lang.Object
  extended by net.rim.device.api.ui.FontMetrics

public class FontMetrics
extends Object

The metrics of a font: that is, a typeface at a certain size and in a certain style.

Since:
BlackBerry API 6.0.0

Constructor Summary
FontMetrics()
          Empty constructor.
 
Method Summary
 int getAscent()
          Gets the height of standard ascenders (Latin capital letters) in pixels.
 int getAverageCharWidth()
          Gets the average width of a character in pixels, for the purpose of calculating the size of a text field.
 int getDescent()
          Gets the depth of standard descenders (usually of the Latin letters p, q, y) in pixels.
 int getHeight()
          Gets the height of the font in pixels.
 int getLeadingAbove()
          Gets the standard leading above the line in pixels.
 int getLeadingBelow()
          Gets the standard leading below the line in pixels.
 int getMaxAscent()
          Gets the maximum ascent of any character in pixels.
 int getMaxCharWidth()
          Gets the maximum width of a character in pixels.
 int getMaxDescent()
          Gets the maximum descent of any character in pixels.
 int getSpaceWidth()
          Gets the width of a word space in pixels.
 int getUnderlineOffset()
          Gets the distance of underline below baseline in pixels.
 int getUnderlineWeight()
          Gets the standard underline weight in pixels.
 void reset()
          Set all metrics to their standard values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

FontMetrics

public FontMetrics()
Empty constructor.

Since:
BlackBerry API 6.0.0


Method Detail

getHeight

public int getHeight()
Gets the height of the font in pixels.

Since:
BlackBerry API 6.0.0

getAscent

public int getAscent()
Gets the height of standard ascenders (Latin capital letters) in pixels.

Since:
BlackBerry API 6.0.0

getMaxAscent

public int getMaxAscent()
Gets the maximum ascent of any character in pixels.

Since:
BlackBerry API 6.0.0

getDescent

public int getDescent()
Gets the depth of standard descenders (usually of the Latin letters p, q, y) in pixels.

Since:
BlackBerry API 6.0.0

getMaxDescent

public int getMaxDescent()
Gets the maximum descent of any character in pixels.

Since:
BlackBerry API 6.0.0

getUnderlineOffset

public int getUnderlineOffset()
Gets the distance of underline below baseline in pixels.

Since:
BlackBerry API 6.0.0

getUnderlineWeight

public int getUnderlineWeight()
Gets the standard underline weight in pixels.

Since:
BlackBerry API 6.0.0

getLeadingAbove

public int getLeadingAbove()
Gets the standard leading above the line in pixels.

Since:
BlackBerry API 6.0.0

getLeadingBelow

public int getLeadingBelow()
Gets the standard leading below the line in pixels.

Since:
BlackBerry API 6.0.0

getSpaceWidth

public int getSpaceWidth()
Gets the width of a word space in pixels.

Since:
BlackBerry API 6.0.0

getMaxCharWidth

public int getMaxCharWidth()
Gets the maximum width of a character in pixels.

Since:
BlackBerry API 6.0.0

getAverageCharWidth

public int getAverageCharWidth()
Gets the average width of a character in pixels, for the purpose of calculating the size of a text field.

Since:
BlackBerry API 6.0.0

reset

public void reset()
Set all metrics to their standard values.

Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.