de.dante.extex.unicodeFont.format.tex.tfm
Class TfmFont

java.lang.Object
  extended byde.dante.extex.unicodeFont.format.tex.tfm.TfmFont
All Implemented Interfaces:
ExtexFont, Font, FontInit, FontKeyConfigurable, InputStreamConfigurable, LogEnabled, PropertyConfigurable, java.io.Serializable, TexFont
Direct Known Subclasses:
TfmFontPfb

public class TfmFont
extends java.lang.Object
implements ExtexFont, TexFont, java.io.Serializable, LogEnabled, PropertyConfigurable, InputStreamConfigurable, FontKeyConfigurable, FontInit

A font from a tfm file. TODO add EE00 from Unicode

Version:
$Revision: 1.5 $
Author:
Michael Niedermair
See Also:
Serialized Form

Field Summary
static int DEFAULTUNITSPEREM
          Default units per em.
static int PERMILLE_FACTOR
          permille factor for scale factor.
 
Constructor Summary
TfmFont()
          Create a new object.
 
Method Summary
 void enableLogging(java.util.logging.Logger theLogger)
          Setter for the logger.
 FontKey getActualFontKey()
          Returns the actual FontKey for this font after a font subtition.
 Dimen getActualsize()
          Returns the actual size of the font.
 Glue getDepth(UnicodeChar uc)
          Returns the depth of the char.
 Dimen getDesignsize()
          Returns the design size of the font.
 Dimen getEm()
          Returns the size of 'M'.
 Dimen getEx()
          Returns the size of 'x'.
 Dimen getFontDimen(java.lang.String name)
          Returns the size of the parameter with the name 'name'.
 FontKey getFontKey()
          Returns the FontKey for this font.
 java.lang.String getFontName()
          Returns the name of the font.
 Glue getHeight(UnicodeChar uc)
          Returns the height of the char.
 UnicodeChar getHyphenChar()
          Returns the hyphen char.
 Dimen getItalicCorrection(UnicodeChar uc)
          Returns the italic correction of the char.
 Dimen getKerning(UnicodeChar uc1, UnicodeChar uc2)
          Returns the kerning between two chars.
 UnicodeChar getLigature(UnicodeChar uc1, UnicodeChar uc2)
          Returns the ligature for two chars.
 Count getScalefactor()
          Returns the scale factor of the font.
 UnicodeChar getSkewChar()
          Returns the skew char.
 Glue getSpace()
          Returns the size of the 'space'.
 TfmReader getTfmReader()
          Returns the tfmReader.
 Glue getWidth(UnicodeChar uc)
          Returns the width of the char.
 void init()
          Initialize the font.
protected  java.lang.Object readResolve()
          reconnect after a dump.
 void setActualsize(Dimen size)
          Set the actual size of the font.
 void setFontDimen(java.lang.String name, Dimen value)
          Set the new value for the font parameter.
 void setFontKey(FontKey theFontKey)
          Set the font key.
 void setHyphenChar(UnicodeChar uc)
          Set the hyphen char.
 void setInputStream(java.io.InputStream theIn)
          Set the input stream.
 void setProperties(java.util.Properties theProperties)
          Setter for the properties.
 void setScalefactor(Count scaleFactor)
          Set the scale factor of the font.
 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

DEFAULTUNITSPEREM

public static final int DEFAULTUNITSPEREM
Default units per em.

See Also:
Constant Field Values

PERMILLE_FACTOR

public static final int PERMILLE_FACTOR
permille factor for scale factor.

See Also:
Constant Field Values
Constructor Detail

TfmFont

public TfmFont()
Create a new object.

Method Detail

getActualsize

public Dimen getActualsize()
Description copied from interface: ExtexFont
Returns the actual size of the font.

Specified by:
getActualsize in interface ExtexFont
Returns:
Returns the actual size of the font.
See Also:
ExtexFont.getActualsize()

getDepth

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

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

getDesignsize

public Dimen getDesignsize()
Description copied from interface: ExtexFont
Returns the design size of the font.

Specified by:
getDesignsize in interface ExtexFont
Returns:
Returns the design size of the font.
See Also:
ExtexFont.getDesignsize()

getEm

public Dimen getEm()
Description copied from interface: ExtexFont
Returns the size of 'M'.

Specified by:
getEm in interface ExtexFont
Returns:
Returns the size of 'M'.
See Also:
ExtexFont.getEm()

getEx

public Dimen getEx()
Description copied from interface: ExtexFont
Returns the size of 'x'.

Specified by:
getEx in interface ExtexFont
Returns:
Returns the size of 'x'.
See Also:
ExtexFont.getEx()

getFontDimen

public Dimen getFontDimen(java.lang.String name)
Description copied from interface: ExtexFont
Returns the size of the parameter with the name 'name'.

The size are multiples of the design size!

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

setActualsize

public void setActualsize(Dimen size)
Description copied from interface: TexFont
Set the actual size of the font.

Specified by:
setActualsize in interface TexFont
Parameters:
size - The actual size.
See Also:
TexFont.setActualsize( de.dante.extex.interpreter.type.dimen.Dimen)

getFontName

public java.lang.String getFontName()
Description copied from interface: ExtexFont
Returns the name of the font.

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

getHeight

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

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

getItalicCorrection

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

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

getKerning

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

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

getLigature

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

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

getScalefactor

public Count getScalefactor()
Description copied from interface: ExtexFont
Returns the scale factor of the font.

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

setScalefactor

public void setScalefactor(Count scaleFactor)
Description copied from interface: TexFont
Set the scale factor of the font.

Specified by:
setScalefactor in interface TexFont
Parameters:
scaleFactor - The scale factor.
See Also:
TexFont.setScalefactor( de.dante.extex.interpreter.type.count.Count)

getSpace

public Glue getSpace()
Description copied from interface: ExtexFont
Returns the size of the 'space'.

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

getWidth

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

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

getFontKey

public FontKey getFontKey()
Description copied from interface: Font
Returns the FontKey for this font.

Specified by:
getFontKey in interface Font
Returns:
Returns the FontKey for this font.
See Also:
Font.getFontKey()

getActualFontKey

public FontKey getActualFontKey()
Description copied from interface: Font
Returns the actual FontKey for this font after a font subtition.

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

getHyphenChar

public UnicodeChar getHyphenChar()
Description copied from interface: TexFont
Returns the hyphen char.

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

getSkewChar

public UnicodeChar getSkewChar()
Description copied from interface: TexFont
Returns the skew char.

Specified by:
getSkewChar in interface TexFont
Returns:
Returns the skew char.
See Also:
TexFont.getSkewChar()

setFontDimen

public void setFontDimen(java.lang.String name,
                         Dimen value)
Description copied from interface: TexFont
Set the new value for the font parameter.

Specified by:
setFontDimen in interface TexFont
Parameters:
name - The name of the parameter.
value - The value to set.
See Also:
TexFont.setFontDimen( java.lang.String, de.dante.extex.interpreter.type.dimen.Dimen)

setHyphenChar

public void setHyphenChar(UnicodeChar uc)
Description copied from interface: TexFont
Set the hyphen char.

Specified by:
setHyphenChar in interface TexFont
Parameters:
uc - The Unicode char.
See Also:
TexFont.setHyphenChar( de.dante.util.UnicodeChar)

setSkewChar

public void setSkewChar(UnicodeChar uc)
Description copied from interface: TexFont
Set the skew char.

Specified by:
setSkewChar in interface TexFont
Parameters:
uc - The Unicode char.
See Also:
TexFont.setSkewChar( de.dante.util.UnicodeChar)

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
reconnect after a dump.

Returns:
an object.
Throws:
java.io.ObjectStreamException - if an error occurred.

enableLogging

public void enableLogging(java.util.logging.Logger theLogger)
Description copied from interface: LogEnabled
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
theLogger - the logger to use
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

setProperties

public void setProperties(java.util.Properties theProperties)
Description copied from interface: PropertyConfigurable
Setter for the properties.

Specified by:
setProperties in interface PropertyConfigurable
Parameters:
theProperties - the properties to use for configuration
See Also:
PropertyConfigurable.setProperties( java.util.Properties)

setInputStream

public void setInputStream(java.io.InputStream theIn)
Description copied from interface: InputStreamConfigurable
Set the input stream.

Specified by:
setInputStream in interface InputStreamConfigurable
Parameters:
theIn - The input.
See Also:
InputStreamConfigurable.setInputStream( java.io.InputStream)

setFontKey

public void setFontKey(FontKey theFontKey)
Description copied from interface: FontKeyConfigurable
Set the font key.

Specified by:
setFontKey in interface FontKeyConfigurable
Parameters:
theFontKey - The font key.
See Also:
FontKeyConfigurable.setFontKey( de.dante.extex.unicodeFont.key.FontKey)

init

public void init()
          throws FontException
Description copied from interface: FontInit
Initialize the font.

Specified by:
init in interface FontInit
Throws:
FontException
See Also:
FontInit.init()

getTfmReader

public TfmReader getTfmReader()
Returns the tfmReader.

Returns:
Returns the tfmReader.