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

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

public class NullFont
extends java.lang.Object
implements Font, java.io.Serializable

This class implements a dummy font which does not contain any characters.

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

Field Summary
protected static long serialVersionUID
          The field serialVersionUID contains the version number for serialization.
 
Constructor Summary
NullFont()
          Creates 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.
 long getEfCode(UnicodeChar uc)
          Getter for the ef code.
 FixedDimen getEm()
          Returns the size of 1em.
 FixedDimen getEx()
          Returns the size of 1ex.
 FixedDimen getFontDimen(java.lang.String name)
          Returns the size of the parameter with the name 'name'.
 FontKey getFontKey()
          Returns the key for the font.
 java.lang.String getFontName()
          Returns the name of the font.
 FixedGlue getHeight(UnicodeChar uc)
          Returns the height of the char.
 UnicodeChar getHyphenChar()
          Returns the hyphen char.
 FixedDimen getItalicCorrection(UnicodeChar uc)
          Returns the italic correction of the char.
 FixedDimen getKerning(UnicodeChar uc1, UnicodeChar uc2)
          Returns the kerning between two chars.
 UnicodeChar getLigature(UnicodeChar uc1, UnicodeChar uc2)
          Returns the ligature for two chars.
 FixedCount getScaleFactor()
          Returns the scale factor of the font.
 UnicodeChar getSkewChar()
          Returns the skew character.
 FixedGlue getSpace()
          Returns the size of the 'space'.
 FixedGlue getWidth(UnicodeChar uc)
          Returns the width of the character.
 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 name, Dimen value)
          Set the new value for the font parameter.
 void setHyphenChar(UnicodeChar uc)
          Set the hyphen char.
 void setSkewChar(UnicodeChar uc)
          Set the skew char.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

NullFont

public NullFont()
Creates a new object.

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
Returns:
the actual FontKey for this font.
See Also:
Font.getActualFontKey()

getActualSize

public FixedDimen getActualSize()
Returns the actual size.

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

getCheckSum

public int getCheckSum()
Returns the check sum.

Specified by:
getCheckSum in interface Font
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
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
Returns:
the design size
See Also:
Font.getDesignSize()

getEfCode

public long getEfCode(UnicodeChar uc)
Getter for the ef code.

Specified by:
getEfCode in interface Font
Parameters:
uc - the character
Returns:
the ef code
See Also:
Font.getEfCode( org.extex.core.UnicodeChar)

getEm

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

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

getEx

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

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

getFontDimen

public FixedDimen getFontDimen(java.lang.String name)
Returns the size of the parameter with the name 'name'.

Specified by:
getFontDimen in interface Font
Parameters:
name - the name of the parameter
Returns:
the size of the parameter with the name 'name'
See Also:
Font.getFontDimen( java.lang.String)

getFontKey

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

Specified by:
getFontKey in interface Font
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
Returns:
Returns the name of the font.
See Also:
Font.getFontName()

getHeight

public FixedGlue getHeight(UnicodeChar uc)
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( org.extex.core.UnicodeChar)

getHyphenChar

public UnicodeChar getHyphenChar()
Returns the hyphen char.

Specified by:
getHyphenChar in interface Font
Returns:
the hyphen char
See Also:
Font.getHyphenChar()

getItalicCorrection

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

Specified by:
getItalicCorrection in interface Font
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 chars.

Specified by:
getKerning in interface Font
Parameters:
uc1 - the first char
uc2 - the second char
Returns:
the kerning between two chars
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 chars.

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

getScaleFactor

public FixedCount getScaleFactor()
Returns the scale factor of the font.

Specified by:
getScaleFactor in interface Font
Returns:
the scale factor of the font
See Also:
Font.getScaleFactor()

getSkewChar

public UnicodeChar getSkewChar()
Returns the skew character.

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

getSpace

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

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

getWidth

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

Specified by:
getWidth in interface Font
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
Parameters:
uc - the character
Returns:
true iff the glyph is present
See Also:
Font.hasGlyph( org.extex.core.UnicodeChar)

setEfCode

public void setEfCode(UnicodeChar uc,
                      long code)
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( org.extex.core.UnicodeChar, long)

setFontDimen

public void setFontDimen(java.lang.String name,
                         Dimen value)
Set the new value for the font parameter.

Specified by:
setFontDimen in interface Font
Parameters:
name - the name of the parameter
value - the value to set
See Also:
Font.setFontDimen( java.lang.String, org.extex.core.dimen.Dimen)

setHyphenChar

public void setHyphenChar(UnicodeChar uc)
Set the hyphen char.

Specified by:
setHyphenChar in interface Font
Parameters:
uc - the hyphen char
See Also:
Font.setHyphenChar( org.extex.core.UnicodeChar)

setSkewChar

public void setSkewChar(UnicodeChar uc)
Set the skew char.

Specified by:
setSkewChar in interface Font
Parameters:
uc - the skew char
See Also:
Font.setSkewChar( org.extex.core.UnicodeChar)