org.mt4j.components.visibleComponents.font
Class VectorFont

java.lang.Object
  extended by org.mt4j.components.visibleComponents.font.VectorFont
All Implemented Interfaces:
IFont

public class VectorFont
extends java.lang.Object

    
implements IFont

    

A vector font.

Author:
Christopher Ruff

Constructor Summary
VectorFont(VectorFontCharacter[] characters, int defaultHorizontalAdvX, java.lang.String fontFamily, int fontMaxAscent, int fontMaxDescent, int unitsPerEm, int originalFontSize, MTColor fillColor, MTColor strokeColor)
          The Constructor.
 
Method Summary
 IFontCharacter[] getCharacters()
          Gets the characters.
 int getDefaultHorizontalAdvX()
          Gets the default horizontal adv x.
 MTColor getFillColor()
          Gets the fill color.
 int getFontAbsoluteHeight()
          Gets the font absolute height.
 IFontCharacter getFontCharacterByName(java.lang.String characterName)
          Gets the font character by name.
 IFontCharacter getFontCharacterByUnicode(java.lang.String unicode)
          Gets the font character by unicode.
 java.lang.String getFontFamily()
          Gets the font family.
 java.lang.String getFontFileName()
          Gets the font file name.
 java.lang.String getFontId()
          Gets the font id.
 int getFontMaxAscent()
          Gets the font max ascent.
 int getFontMaxDescent()
          Gets the font max descent.
 int getOriginalFontSize()
          Gets the original font size.
 MTColor getStrokeColor()
          Gets the stroke color.
 int getUnitsPerEM()
          Gets the units per em.
 void setCharacters(VectorFontCharacter[] characters)
          Sets the characters.
 void setFontFamily(java.lang.String fontFamily)
          Sets the font family.
 void setFontFileName(java.lang.String fontFileName)
          Sets the font file name.
 void setFontId(java.lang.String fontId)
          Sets the font id.
 void setFontMaxAscent(int fontMaxAscent)
          Sets the font max ascent.
 void setFontMaxDescent(int fontMaxDescent)
          Sets the font max descent.
 void setUnitsPerEM(int unitsPerEM)
          Sets the units per em.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorFont

public VectorFont(VectorFontCharacter[] characters,
                  int defaultHorizontalAdvX,
                  java.lang.String fontFamily,
                  int fontMaxAscent,
                  int fontMaxDescent,
                  int unitsPerEm,
                  int originalFontSize,
                  MTColor fillColor,
                  MTColor strokeColor)
The Constructor.

Parameters:
characters - the characters
defaultHorizontalAdvX - the default horizontal adv x
fontFamily - the font family
fontMaxAscent - the font max ascent
fontMaxDescent - the font max descent
unitsPerEm - the units per em
originalFontSize - the original font size
fillColor - the fill color
strokeColor - the stroke color
Method Detail

getFontCharacterByName

public IFontCharacter getFontCharacterByName(java.lang.String characterName)
Description copied from interface: IFont
Gets the font character by name.

Specified by:
getFontCharacterByName in interface IFont
Parameters:
characterName - the character name
Returns:
the font character by name

getFontCharacterByUnicode

public IFontCharacter getFontCharacterByUnicode(java.lang.String unicode)
Description copied from interface: IFont
Gets the font character by unicode.

Specified by:
getFontCharacterByUnicode in interface IFont
Parameters:
unicode - the unicode
Returns:
the font character by unicode

getCharacters

public IFontCharacter[] getCharacters()
Description copied from interface: IFont
Gets the characters.

Specified by:
getCharacters in interface IFont
Returns:
the characters

setCharacters

public void setCharacters(VectorFontCharacter[] characters)
Sets the characters.

Parameters:
characters - the new characters

getDefaultHorizontalAdvX

public int getDefaultHorizontalAdvX()
Description copied from interface: IFont
Gets the default horizontal adv x.

Specified by:
getDefaultHorizontalAdvX in interface IFont
Returns:
the default horizontal adv x

getFontFamily

public java.lang.String getFontFamily()
Description copied from interface: IFont
Gets the font family.

Specified by:
getFontFamily in interface IFont
Returns:
the font family

setFontFamily

public void setFontFamily(java.lang.String fontFamily)
Sets the font family.

Parameters:
fontFamily - the new font family

getFontMaxAscent

public int getFontMaxAscent()
Description copied from interface: IFont
Gets the font max ascent.

Specified by:
getFontMaxAscent in interface IFont
Returns:
the font max ascent

getFontMaxDescent

public int getFontMaxDescent()
Description copied from interface: IFont
Gets the font max descent.
NOTE: this often is a negative value

Specified by:
getFontMaxDescent in interface IFont
Returns:
the font max descent

setFontMaxAscent

public void setFontMaxAscent(int fontMaxAscent)
Sets the font max ascent.

Parameters:
fontMaxAscent - the new font max ascent

setFontMaxDescent

public void setFontMaxDescent(int fontMaxDescent)
Sets the font max descent.

Parameters:
fontMaxDescent - the new font max descent

getFontAbsoluteHeight

public int getFontAbsoluteHeight()
Description copied from interface: IFont
Gets the font absolute height.

Specified by:
getFontAbsoluteHeight in interface IFont
Returns:
the font absolute height

getUnitsPerEM

public int getUnitsPerEM()
Description copied from interface: IFont
Gets the units per em.

Specified by:
getUnitsPerEM in interface IFont
Returns:
the units per em

setUnitsPerEM

public void setUnitsPerEM(int unitsPerEM)
Sets the units per em.

Parameters:
unitsPerEM - the new units per em

getFontId

public java.lang.String getFontId()
Gets the font id.

Returns:
the font id

setFontId

public void setFontId(java.lang.String fontId)
Sets the font id.

Parameters:
fontId - the new font id

getFontFileName

public java.lang.String getFontFileName()
Description copied from interface: IFont
Gets the font file name.

Specified by:
getFontFileName in interface IFont
Returns:
the font file name

setFontFileName

public void setFontFileName(java.lang.String fontFileName)
Sets the font file name.

Parameters:
fontFileName - the new font file name

getOriginalFontSize

public int getOriginalFontSize()
Description copied from interface: IFont
Gets the original font size.

Specified by:
getOriginalFontSize in interface IFont
Returns:
the original font size

getFillColor

public MTColor getFillColor()
Description copied from interface: IFont
Gets the fill color.

Specified by:
getFillColor in interface IFont
Returns:
the fill color

getStrokeColor

public MTColor getStrokeColor()
Description copied from interface: IFont
Gets the stroke color.

Specified by:
getStrokeColor in interface IFont
Returns:
the stroke color