de.dante.extex.typesetter.listMaker.math
Class MathFont

java.lang.Object
  extended byde.dante.extex.typesetter.listMaker.math.MathFont
All Implemented Interfaces:
Font, Fount

public class MathFont
extends java.lang.Object
implements Font

This class encapsulates a font and provides access to the font dimens with convenience methods.

Version:
$Revision: 1.8 $
Author:
Gerd Neugebauer
See Also:
"TTP [700]"

Constructor Summary
MathFont(Font font)
          Creates a new object.
 
Method Summary
 FixedDimen getActualSize()
          Returns the actual size.
 BoundingBox getBoundingBox()
          Returns the BoundingBox.
 int getCheckSum()
          Returns the check sum.
 FixedGlue getDepth(UnicodeChar uc)
          Returns the depth of the char.
 FixedDimen getDesignSize()
          Returns the design size.
 long getEfcode(UnicodeChar uc)
          Getter for the ef code.
 FixedDimen getEm()
          Return the em size of the font.
 FixedDimen getEx()
          Return the ex size of the font.
 FontByteArray getFontByteArray()
          Returns the byte array for the external file e.g.
 FixedDimen getFontDimen(java.lang.String key)
          Return font dimen size with a key.
 FountKey getFontKey()
          Returns the key for the font.
 java.lang.String getFontName()
          Return the font name.
 Glyph getGlyph(UnicodeChar c)
          Return the Glyph of a UnicodeChar, or null, if the character is not defined.
 FixedGlue getHeight(UnicodeChar uc)
          Returns the height of the char.
 UnicodeChar getHyphenChar()
          Return the hyphenation character.
 FixedDimen getItalicCorrection(UnicodeChar uc)
          Returns the italic correction of the char.
 FixedDimen getKerning(UnicodeChar uc1, UnicodeChar uc2)
          Returns the kerning between two chars.
 FixedGlue getLetterSpacing()
          Return the letter spacing
 UnicodeChar getLigature(UnicodeChar uc1, UnicodeChar uc2)
          Returns the ligature for two chars.
 java.lang.String getProperty(java.lang.String key)
          Return the font-property
 UnicodeChar getSkewChar()
          Return the skew character
 FixedGlue getSpace()
          Return the width of space character.
 FixedGlue getWidth(UnicodeChar uc)
          Returns the width of the char.
 boolean hasGlyph(UnicodeChar uc)
          Determine whether the glyph for a given character is present in this font.
 void setEfcode(UnicodeChar uc, long code)
          Setter for the ef code.
 void setFontDimen(java.lang.String key, Dimen value)
          Setter for the font dimen register.
 void setHyphenChar(UnicodeChar hyphen)
          Set the char for hyphenation.
 void setSkewChar(UnicodeChar skew)
          Set the skew character.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathFont

public MathFont(Font font)
Creates a new object.

Parameters:
font - the font encapsulated
Method Detail

getActualSize

public FixedDimen getActualSize()
Description copied from interface: Fount
Returns the actual size.

Specified by:
getActualSize in interface Fount
Returns:
Returns the actual size.
See Also:
Fount.getActualSize()

getBoundingBox

public BoundingBox getBoundingBox()
Description copied from interface: Fount
Returns the BoundingBox.

Specified by:
getBoundingBox in interface Fount
Returns:
the BoundingBox, or null, if it does not exists
See Also:
Fount.getBoundingBox()

getCheckSum

public int getCheckSum()
Description copied from interface: Fount
Returns the check sum.

Specified by:
getCheckSum in interface Fount
Returns:
the check sum
See Also:
Fount.getCheckSum()

getDepth

public FixedGlue getDepth(UnicodeChar uc)
Description copied from interface: Font
Returns the depth of the char.

Specified by:
getDepth in interface Font
Parameters:
uc - the Unicode char
Returns:
the depth of the char
See Also:
Font.getDepth( de.dante.util.UnicodeChar)

getDesignSize

public FixedDimen getDesignSize()
Description copied from interface: Fount
Returns the design size.

Specified by:
getDesignSize in interface Fount
Returns:
the design size.
See Also:
Fount.getDesignSize()

getEfcode

public long getEfcode(UnicodeChar uc)
Description copied from interface: Font
Getter for the ef code.

Specified by:
getEfcode in interface Font
Parameters:
uc - the character
Returns:
the ef code
See Also:
de.dante.extex.interpreter.type.font.Font#getEfcode()

getEm

public FixedDimen getEm()
Description copied from interface: Fount
Return the em size of the font.

Specified by:
getEm in interface Fount
Returns:
em-size
See Also:
Fount.getEm()

getEx

public FixedDimen getEx()
Description copied from interface: Fount
Return the ex size of the font.

Specified by:
getEx in interface Fount
Returns:
ex-size
See Also:
Fount.getEx()

getFontByteArray

public FontByteArray getFontByteArray()
Description copied from interface: Fount
Returns the byte array for the external file e.g. cmr12.pfb.

Specified by:
getFontByteArray in interface Fount
Returns:
Returns the byte array for the external file e.g. cmr12.pfb
See Also:
Fount.getFontByteArray()

getFontDimen

public FixedDimen getFontDimen(java.lang.String key)
Description copied from interface: Fount
Return font dimen size with a key.

Specified by:
getFontDimen in interface Fount
Parameters:
key - the key
Returns:
the value for the key
See Also:
Fount.getFontDimen(String)

getFontKey

public FountKey getFontKey()
Description copied from interface: Fount
Returns the key for the font.

Specified by:
getFontKey in interface Fount
Returns:
Returns the key for the font.
See Also:
Fount.getFontKey()

getFontName

public java.lang.String getFontName()
Description copied from interface: Fount
Return the font name.

Specified by:
getFontName in interface Fount
Returns:
the font name
See Also:
Fount.getFontName()

getGlyph

public Glyph getGlyph(UnicodeChar c)
Description copied from interface: Font
Return the Glyph of a UnicodeChar, or null, if the character is not defined.

Specified by:
getGlyph in interface Font
Parameters:
c - the Unicode char
Returns:
the glyph
See Also:
Font.getGlyph(UnicodeChar)

getHeight

public FixedGlue getHeight(UnicodeChar uc)
Description copied from interface: Font
Returns the height of the char.

Specified by:
getHeight in interface Font
Parameters:
uc - the Unicode char
Returns:
the height of the char
See Also:
Font.getHeight( de.dante.util.UnicodeChar)

getHyphenChar

public UnicodeChar getHyphenChar()
Description copied from interface: Font
Return the hyphenation character.

Specified by:
getHyphenChar in interface Font
Returns:
the hyphenation character
See Also:
Font.getHyphenChar()

getItalicCorrection

public FixedDimen getItalicCorrection(UnicodeChar uc)
Description copied from interface: Font
Returns the italic correction of the char.

Specified by:
getItalicCorrection in interface Font
Parameters:
uc - the Unicode char
Returns:
Returns the italic correction of the char
See Also:
Font.getItalicCorrection( de.dante.util.UnicodeChar)

getKerning

public FixedDimen getKerning(UnicodeChar uc1,
                             UnicodeChar uc2)
Description copied from interface: Font
Returns the kerning between two chars.

Specified by:
getKerning in interface Font
Parameters:
uc1 - the Unicode char (first one)
uc2 - the Unicode char (second one)
Returns:
the kerning between two chars
See Also:
Font.getKerning( de.dante.util.UnicodeChar, de.dante.util.UnicodeChar)

getLetterSpacing

public FixedGlue getLetterSpacing()
Description copied from interface: Fount
Return the letter spacing

Specified by:
getLetterSpacing in interface Fount
Returns:
the letter spacing
See Also:
Fount.getLetterSpacing()

getLigature

public UnicodeChar getLigature(UnicodeChar uc1,
                               UnicodeChar uc2)
Description copied from interface: Font
Returns the ligature for two chars.

Specified by:
getLigature in interface Font
Parameters:
uc1 - the Unicode char (first one)
uc2 - the Unicode char (second one)
Returns:
Returns the ligature for two chars
See Also:
Font.getLigature( de.dante.util.UnicodeChar, de.dante.util.UnicodeChar)

getProperty

public java.lang.String getProperty(java.lang.String key)
Description copied from interface: Fount
Return the font-property

Specified by:
getProperty in interface Fount
Parameters:
key - the key
Returns:
the value for the key
See Also:
Fount.getProperty(String)

getSkewChar

public UnicodeChar getSkewChar()
Description copied from interface: Font
Return the skew character

Specified by:
getSkewChar in interface Font
Returns:
the skew character
See Also:
Font.getSkewChar()

getSpace

public FixedGlue getSpace()
Description copied from interface: Fount
Return the width of space character.

Specified by:
getSpace in interface Fount
Returns:
the width of the space character
See Also:
Fount.getSpace()

getWidth

public FixedGlue getWidth(UnicodeChar uc)
Description copied from interface: Font
Returns the width of the char.

Specified by:
getWidth in interface Font
Parameters:
uc - the Unicode char
Returns:
the width of the char
See Also:
Font.getWidth( de.dante.util.UnicodeChar)

hasGlyph

public boolean hasGlyph(UnicodeChar uc)
Description copied from interface: Font
Determine whether the glyph for a given character is present in this font.

Specified by:
hasGlyph in interface Font
Parameters:
uc - the character
Returns:
true iff the glyph is present
See Also:
Font.hasGlyph(de.dante.util.UnicodeChar)

setEfcode

public void setEfcode(UnicodeChar uc,
                      long code)
Description copied from interface: Font
Setter for the ef code. The ef code influences the stretchability of characters. It has a positive value. 1000 means "normal" stretchability.

Specified by:
setEfcode in interface Font
Parameters:
uc - the character
code - the associated code
See Also:
Font.setEfcode( de.dante.util.UnicodeChar, long)

setFontDimen

public void setFontDimen(java.lang.String key,
                         Dimen value)
Description copied from interface: Font
Setter for the font dimen register.

Specified by:
setFontDimen in interface Font
Parameters:
key - the key
value - the value for the key
See Also:
Font.setFontDimen(String, Dimen)

setHyphenChar

public void setHyphenChar(UnicodeChar hyphen)
Description copied from interface: Font
Set the char for hyphenation.

Specified by:
setHyphenChar in interface Font
Parameters:
hyphen - the char to set
See Also:
Font.setHyphenChar(UnicodeChar)

setSkewChar

public void setSkewChar(UnicodeChar skew)
Description copied from interface: Font
Set the skew character.

Specified by:
setSkewChar in interface Font
Parameters:
skew - the new skew character
See Also:
Font.setSkewChar(UnicodeChar)

toString

public java.lang.String toString()
See Also:
Object.toString()