de.dante.extex.interpreter.type.font
Class FontImpl

java.lang.Object
  extended byde.dante.extex.font.type.other.NullFont
      extended byde.dante.extex.interpreter.type.font.FontImpl
All Implemented Interfaces:
Font, Fount, java.io.Serializable
Direct Known Subclasses:
VirtualFontImpl

public class FontImpl
extends NullFont

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: 1.13 $
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(InternalFount fount)
          Create 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.
 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.
 InternalFount getFount()
          Getter for the fount.
 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.
 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 k)
          Return the font-property
 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.
protected  java.lang.Object readResolve()
          Magic method for deserialization.
 void setFount(InternalFount fount)
          Setter for the fount.
 java.lang.String toString()
           
 
Methods inherited from class de.dante.extex.font.type.other.NullFont
getEfcode, getHyphenChar, getSkewChar, isVirtualFont, setEfcode, setFontDimen, setHyphenChar, setSkewChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(InternalFount fount)
Create a new Object

Parameters:
fount - the fount
Method Detail

getActualSize

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

Specified by:
getActualSize in interface Fount
Overrides:
getActualSize in class NullFont
See Also:
Fount.getActualSize()

getBoundingBox

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

Specified by:
getBoundingBox in interface Fount
Overrides:
getBoundingBox in class NullFont
See Also:
Fount.getBoundingBox()

getCheckSum

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

Specified by:
getCheckSum in interface Fount
Overrides:
getCheckSum in class NullFont
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
Overrides:
getDepth in class NullFont
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
Overrides:
getDesignSize in class NullFont
See Also:
Fount.getDesignSize()

getEm

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

Specified by:
getEm in interface Fount
Overrides:
getEm in class NullFont
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
Overrides:
getEx in class NullFont
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
Overrides:
getFontByteArray in class NullFont
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
Overrides:
getFontDimen in class NullFont
See Also:
Fount.getFontDimen(java.lang.String)

getFontKey

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

Specified by:
getFontKey in interface Fount
Overrides:
getFontKey in class NullFont
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
Overrides:
getFontName in class NullFont
See Also:
Fount.getFontName()

getFount

public InternalFount getFount()
Getter for the fount.

Returns:
the fount.

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
Overrides:
getGlyph in class NullFont
See Also:
Font.getGlyph( de.dante.util.UnicodeChar)

getHeight

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

Specified by:
getHeight in interface Font
Overrides:
getHeight in class NullFont
See Also:
Font.getHeight( de.dante.util.UnicodeChar)

getItalicCorrection

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

Specified by:
getItalicCorrection in interface Font
Overrides:
getItalicCorrection in class NullFont
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
Overrides:
getKerning in class NullFont
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
Overrides:
getLetterSpacing in class NullFont
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
Overrides:
getLigature in class NullFont
See Also:
Font.getLigature( de.dante.util.UnicodeChar, de.dante.util.UnicodeChar)

getProperty

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

Specified by:
getProperty in interface Fount
Overrides:
getProperty in class NullFont
See Also:
Fount.getProperty(java.lang.String)

getSpace

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

Specified by:
getSpace in interface Fount
Overrides:
getSpace in class NullFont
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
Overrides:
getWidth in class NullFont
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
Overrides:
hasGlyph in class NullFont
See Also:
Font.hasGlyph( de.dante.util.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

setFount

public void setFount(InternalFount fount)
Setter for the fount.

Parameters:
fount - the fount to set

toString

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