org.extex.typesetter.tc.font.impl
Class FontImpl

java.lang.Object
  extended by org.extex.typesetter.tc.font.impl.NullFont
      extended by org.extex.typesetter.tc.font.impl.FontImpl
All Implemented Interfaces:
java.io.Serializable, Font, ModifiableFont

public class FontImpl
extends NullFont
implements ModifiableFont

This class constitutes a wrapper for a font. Here all information is stored which should be saved in a format. Especially all modifiable fields have to be kept in this class.

The loadable and constant parts are delegated and should not make it into the format file. Thus it is necessary to reconstitute this contents when the format has to be provided by the loader.

Version:
$Revision: 5928 $
Author:
Michael Niedermair, Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The field serialVersionUID contains the version number for serialization.
 
Constructor Summary
FontImpl()
          Create a new Object
FontImpl(ExtexFont font)
          Create a new Object
 
Method Summary
 FontKey getActualFontKey()
          Returns the actual FontKey for this font.
 FixedDimen getActualSize()
          Returns the actual size.
 int getCheckSum()
          Returns the check sum.
 FixedGlue getDepth(UnicodeChar uc)
          Returns the depth of the char.
 FixedDimen getDesignSize()
          Returns the design size.
 FixedDimen getEm()
          Returns the size of 1em.
 FixedDimen getEx()
          Returns the size of 1ex.
 FixedDimen getFontDimen(java.lang.String k)
          Return font dimen size with a key.
 FontKey getFontKey()
          Returns the key for the font.
 java.lang.String getFontName()
          Returns the name of the font.
 ExtexFont getFount()
          Getter for the font.
 FixedGlue getHeight(UnicodeChar uc)
          Returns the height of the char.
 FixedDimen getItalicCorrection(UnicodeChar uc)
          Returns the italic correction of the char.
 FixedDimen getKerning(UnicodeChar uc1, UnicodeChar uc2)
          Returns the kerning between two characters.
 UnicodeChar getLigature(UnicodeChar uc1, UnicodeChar uc2)
          Returns the ligature for two characters.
 FixedGlue getSpace()
          Returns the size of the 'space'.
 FixedGlue getWidth(UnicodeChar uc)
          Returns the width of a character.
 boolean hasGlyph(UnicodeChar uc)
          Determine whether the glyph for a given character is present in this font.
protected  java.lang.Object readResolve()
          Magic method for deserialization.
 void setFont(ExtexFont font)
          Setter for the font.
 java.lang.String toString()
          Return the printable representation for this instance.
 
Methods inherited from class org.extex.typesetter.tc.font.impl.NullFont
getEfCode, getHyphenChar, getScaleFactor, getSkewChar, setEfCode, setFontDimen, setHyphenChar, setSkewChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.extex.typesetter.tc.font.Font
getEfCode, getHyphenChar, getScaleFactor, getSkewChar, setEfCode, setFontDimen, setHyphenChar, setSkewChar
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The field serialVersionUID contains the version number for serialization.

See Also:
Constant Field Values
Constructor Detail

FontImpl

public FontImpl()
Create a new Object


FontImpl

public FontImpl(ExtexFont font)
Create a new Object

Parameters:
font - the font
Method Detail

getActualFontKey

public FontKey getActualFontKey()
Returns the actual FontKey for this font. The font key may differ from the one requested.

Specified by:
getActualFontKey in interface Font
Overrides:
getActualFontKey in class NullFont
Returns:
the actual FontKey for this font.
See Also:
NullFont.getActualFontKey()

getActualSize

public FixedDimen getActualSize()
Returns the actual size.

Specified by:
getActualSize in interface Font
Overrides:
getActualSize in class NullFont
Returns:
the actual size
See Also:
Font.getActualSize()

getCheckSum

public int getCheckSum()
Returns the check sum.

Specified by:
getCheckSum in interface Font
Overrides:
getCheckSum in class NullFont
Returns:
the check sum
See Also:
Font.getCheckSum()

getDepth

public FixedGlue getDepth(UnicodeChar uc)
Returns the depth of the char.

Specified by:
getDepth in interface Font
Overrides:
getDepth in class NullFont
Parameters:
uc - the Unicode char
Returns:
the depth of the char
See Also:
Font.getDepth( org.extex.core.UnicodeChar)

getDesignSize

public FixedDimen getDesignSize()
Returns the design size.

Specified by:
getDesignSize in interface Font
Overrides:
getDesignSize in class NullFont
Returns:
the design size
See Also:
Font.getDesignSize()

getEm

public FixedDimen getEm()
Returns the size of 1em.

Specified by:
getEm in interface Font
Overrides:
getEm in class NullFont
Returns:
the size of 1em.
See Also:
Font.getEm()

getEx

public FixedDimen getEx()
Returns the size of 1ex.

Specified by:
getEx in interface Font
Overrides:
getEx in class NullFont
Returns:
the size of 1ex.
See Also:
Font.getEx()

getFontDimen

public FixedDimen getFontDimen(java.lang.String k)
Return font dimen size with a key.

Specified by:
getFontDimen in interface Font
Overrides:
getFontDimen in class NullFont
Parameters:
k - the key
Returns:
the value for the key
See Also:
Font.getFontDimen(java.lang.String)

getFontKey

public FontKey getFontKey()
Returns the key for the font.

Specified by:
getFontKey in interface Font
Overrides:
getFontKey in class NullFont
Returns:
the key for the font
See Also:
Font.getFontKey()

getFontName

public java.lang.String getFontName()
Returns the name of the font.

Specified by:
getFontName in interface Font
Overrides:
getFontName in class NullFont
Returns:
Returns the name of the font.
See Also:
Font.getFontName()

getFount

public ExtexFont getFount()
Getter for the font.

Returns:
the font.

getHeight

public FixedGlue getHeight(UnicodeChar uc)
Returns the height of the char.

Specified by:
getHeight in interface Font
Overrides:
getHeight in class NullFont
Parameters:
uc - the Unicode char
Returns:
the height of the char
See Also:
Font.getHeight( org.extex.core.UnicodeChar)

getItalicCorrection

public FixedDimen getItalicCorrection(UnicodeChar uc)
Returns the italic correction of the char.

Specified by:
getItalicCorrection in interface Font
Overrides:
getItalicCorrection in class NullFont
Parameters:
uc - the char
Returns:
the italic correction of the char
See Also:
Font.getItalicCorrection( org.extex.core.UnicodeChar)

getKerning

public FixedDimen getKerning(UnicodeChar uc1,
                             UnicodeChar uc2)
Returns the kerning between two characters.

Specified by:
getKerning in interface Font
Overrides:
getKerning in class NullFont
Parameters:
uc1 - the first character
uc2 - the second character
Returns:
the kerning between two characters
See Also:
Font.getKerning( org.extex.core.UnicodeChar, org.extex.core.UnicodeChar)

getLigature

public UnicodeChar getLigature(UnicodeChar uc1,
                               UnicodeChar uc2)
Returns the ligature for two characters.

Specified by:
getLigature in interface Font
Overrides:
getLigature in class NullFont
Parameters:
uc1 - the first character
uc2 - the second character
Returns:
Returns the ligature for two characters
See Also:
Font.getLigature( org.extex.core.UnicodeChar, org.extex.core.UnicodeChar)

getSpace

public FixedGlue getSpace()
Returns the size of the 'space'.

Specified by:
getSpace in interface Font
Overrides:
getSpace in class NullFont
Returns:
the size of the 'space'
See Also:
Font.getSpace()

getWidth

public FixedGlue getWidth(UnicodeChar uc)
Returns the width of a character.

Specified by:
getWidth in interface Font
Overrides:
getWidth in class NullFont
Parameters:
uc - the character
Returns:
the width of the character
See Also:
Font.getWidth( org.extex.core.UnicodeChar)

hasGlyph

public boolean hasGlyph(UnicodeChar uc)
Determine whether the glyph for a given character is present in this font.

Specified by:
hasGlyph in interface Font
Overrides:
hasGlyph in class NullFont
Parameters:
uc - the character
Returns:
true iff the glyph is present
See Also:
Font.hasGlyph( org.extex.core.UnicodeChar)

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Magic method for deserialization.

Returns:
the reconnection result
Throws:
java.io.ObjectStreamException - in case of an error

setFont

public void setFont(ExtexFont font)
Setter for the font.

Specified by:
setFont in interface ModifiableFont
Parameters:
font - the font to set
See Also:
ModifiableFont.setFont(org.extex.font.ExtexFont)

toString

public java.lang.String toString()
Return the printable representation for this instance.

Overrides:
toString in class java.lang.Object
Returns:
the printable representation for this instance
See Also:
Object.toString()