Oxygen XML Editor 12.2 Author API

ro.sync.exml.view.graphics
Interface FontMetrics


public interface FontMetrics

Common font metrics


Method Summary
 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 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.
 int stringWidth(java.lang.String text)
          Returns the total advance width for showing the specified String in this Font.
 

Method Detail

charsWidth

int charsWidth(char[] chars,
               int off,
               int len)
Returns the total advance width for showing the specified array of characters in this Font.

Parameters:
chars - the array of characters to be measured
off - the start offset of the characters in the array
len - the number of characters to be measured from the array
Returns:
the advance width of the subarray of the specified char array in the font described by this FontMetrics object.

getAscent

int getAscent()
The font ascent is the distance from the font's baseline to the top of most alphanumeric characters.

Returns:
The font ascent.

getDescent

int getDescent()
The font descent is the distance from the font's baseline to the bottom of most alphanumeric characters with descenders.

Returns:
The ont descent.

stringWidth

int stringWidth(java.lang.String text)
Returns the total advance width for showing the specified String in this Font.

Parameters:
text - The text.
Returns:
The width of the text.

getHeight

int getHeight()
Returns:
The font height

charWidth

int charWidth(char c)
Get the char width

Parameters:
c - The char
Returns:
The char width

getLeading

int getLeading()
Determines the standard leading of the 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.

Returns:
the standard leading of the Font.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.