org.apache.fontbox.afm

Class FontMetric

public class FontMetric extends Object

This is the outermost AFM type. This can be created by the afmparser with a valid AFM document.

Version: $Revision: 1.3 $

Author: Ben Litchfield (ben@benlitchfield.com)

Constructor Summary
FontMetric()
Constructor.
Method Summary
voidaddCharMetric(CharMetric metric)
This will add another character metric.
voidaddComment(String comment)
This will add a new comment.
voidaddComposite(Composite composite)
This will add a single composite part to the picture.
voidaddKernPair(KernPair kernPair)
This will add a kern pair.
voidaddKernPair0(KernPair kernPair)
This will add a kern pair.
voidaddKernPair1(KernPair kernPair)
This will add a kern pair.
voidaddTrackKern(TrackKern kern)
This will add another track kern.
floatgetAFMVersion()
This will get the version of the AFM document.
floatgetAscender()
Getter for property ascender.
floatgetAverageCharacterWidth()
This will get the average width of a character.
floatgetCapHeight()
Getter for property capHeight.
floatgetCharacterHeight(String name)
This will get the width of a character.
intgetCharacters()
Getter for property characters.
StringgetCharacterSet()
Getter for property characterSet.
floatgetCharacterWidth(String name)
This will get the width of a character.
List<CharMetric>getCharMetrics()
Getter for property charMetrics.
float[]getCharWidth()
Getter for property charWidth.
List<String>getComments()
This will get all comments.
List<Composite>getComposites()
Getter for property composites.
floatgetDescender()
Getter for property descender.
StringgetEncodingScheme()
Getter for property encodingScheme.
intgetEscChar()
Getter for property escChar.
StringgetFamilyName()
Getter for property familyName.
BoundingBoxgetFontBBox()
Getter for property fontBBox.
StringgetFontName()
Getter for property fontName.
StringgetFontVersion()
Getter for property fontVersion.
StringgetFullName()
Getter for property fullName.
floatgetItalicAngle()
Getter for property italicAngle.
List<KernPair>getKernPairs()
Getter for property kernPairs.
List<KernPair>getKernPairs0()
Getter for property kernPairs0.
List<KernPair>getKernPairs1()
Getter for property kernPairs1.
intgetMappingScheme()
Getter for property mappingScheme.
intgetMetricSets()
This will get the metricSets attribute.
StringgetNotice()
Getter for property notice.
floatgetStandardHorizontalWidth()
Getter for property standardHorizontalWidth.
floatgetStandardVerticalWidth()
Getter for property standardVerticalWidth.
List<TrackKern>getTrackKern()
Getter for property trackKern.
floatgetUnderlinePosition()
Getter for property underlinePosition.
floatgetUnderlineThickness()
Getter for property underlineThickness.
float[]getVVector()
Getter for property vVector.
StringgetWeight()
Getter for property weight.
floatgetXHeight()
Getter for property xHeight.
booleanisBaseFont()
Getter for property isBaseFont.
booleanisFixedPitch()
Getter for property isFixedPitch.
booleanisFixedV()
Getter for property isFixedV.
voidsetAFMVersion(float afmVersionValue)
This will set the version of the AFM document.
voidsetAscender(float ascenderValue)
Setter for property ascender.
voidsetCapHeight(float capHeightValue)
Setter for property capHeight.
voidsetCharacters(int charactersValue)
Setter for property characters.
voidsetCharacterSet(String characterSetValue)
Setter for property characterSet.
voidsetCharMetrics(List<CharMetric> charMetricsValue)
Setter for property charMetrics.
voidsetCharWidth(float[] charWidthValue)
Setter for property charWidth.
voidsetComposites(List<Composite> compositesList)
Setter for property composites.
voidsetDescender(float descenderValue)
Setter for property descender.
voidsetEncodingScheme(String encodingSchemeValue)
Setter for property encodingScheme.
voidsetEscChar(int escCharValue)
Setter for property escChar.
voidsetFamilyName(String familyNameValue)
Setter for property familyName.
voidsetFixedPitch(boolean isFixedPitchValue)
Setter for property isFixedPitch.
voidsetFontBBox(BoundingBox bBox)
Setter for property fontBBox.
voidsetFontName(String name)
Setter for property fontName.
voidsetFontVersion(String fontVersionValue)
Setter for property fontVersion.
voidsetFullName(String fullNameValue)
Setter for property fullName.
voidsetIsBaseFont(boolean isBaseFontValue)
Setter for property isBaseFont.
voidsetIsFixedV(boolean isFixedVValue)
Setter for property isFixedV.
voidsetItalicAngle(float italicAngleValue)
Setter for property italicAngle.
voidsetKernPairs(List<KernPair> kernPairsList)
Setter for property kernPairs.
voidsetKernPairs0(List<KernPair> kernPairs0List)
Setter for property kernPairs0.
voidsetKernPairs1(List<KernPair> kernPairs1List)
Setter for property kernPairs1.
voidsetMappingScheme(int mappingSchemeValue)
Setter for property mappingScheme.
voidsetMetricSets(int metricSetsValue)
This will set the metricSets attribute.
voidsetNotice(String noticeValue)
Setter for property notice.
voidsetStandardHorizontalWidth(float standardHorizontalWidthValue)
Setter for property standardHorizontalWidth.
voidsetStandardVerticalWidth(float standardVerticalWidthValue)
Setter for property standardVerticalWidth.
voidsetTrackKern(List<TrackKern> trackKernValue)
Setter for property trackKern.
voidsetUnderlinePosition(float underlinePositionValue)
Setter for property underlinePosition.
voidsetUnderlineThickness(float underlineThicknessValue)
Setter for property underlineThickness.
voidsetVVector(float[] vVectorValue)
Setter for property vVector.
voidsetWeight(String weightValue)
Setter for property weight.
voidsetXHeight(float xHeightValue)
Setter for property xHeight.

Constructor Detail

FontMetric

public FontMetric()
Constructor.

Method Detail

addCharMetric

public void addCharMetric(CharMetric metric)
This will add another character metric.

Parameters: metric The character metric to add.

addComment

public void addComment(String comment)
This will add a new comment.

Parameters: comment The comment to add to this metric.

addComposite

public void addComposite(Composite composite)
This will add a single composite part to the picture.

Parameters: composite The composite info to add.

addKernPair

public void addKernPair(KernPair kernPair)
This will add a kern pair.

Parameters: kernPair The kern pair to add.

addKernPair0

public void addKernPair0(KernPair kernPair)
This will add a kern pair.

Parameters: kernPair The kern pair to add.

addKernPair1

public void addKernPair1(KernPair kernPair)
This will add a kern pair.

Parameters: kernPair The kern pair to add.

addTrackKern

public void addTrackKern(TrackKern kern)
This will add another track kern.

Parameters: kern The track kerning data.

getAFMVersion

public float getAFMVersion()
This will get the version of the AFM document.

Returns: The version of the document.

getAscender

public float getAscender()
Getter for property ascender.

Returns: Value of property ascender.

getAverageCharacterWidth

public float getAverageCharacterWidth()
This will get the average width of a character.

Returns: The width of the character.

Throws: IOException If this AFM file does not handle the character.

getCapHeight

public float getCapHeight()
Getter for property capHeight.

Returns: Value of property capHeight.

getCharacterHeight

public float getCharacterHeight(String name)
This will get the width of a character.

Parameters: name The character to get the width for.

Returns: The width of the character.

Throws: IOException If this AFM file does not handle the character.

getCharacters

public int getCharacters()
Getter for property characters.

Returns: Value of property characters.

getCharacterSet

public String getCharacterSet()
Getter for property characterSet.

Returns: Value of property characterSet.

getCharacterWidth

public float getCharacterWidth(String name)
This will get the width of a character.

Parameters: name The character to get the width for.

Returns: The width of the character.

Throws: IOException If this AFM file does not handle the character.

getCharMetrics

public List<CharMetric> getCharMetrics()
Getter for property charMetrics.

Returns: Value of property charMetrics.

getCharWidth

public float[] getCharWidth()
Getter for property charWidth.

Returns: Value of property charWidth.

getComments

public List<String> getComments()
This will get all comments.

Returns: The list of all comments.

getComposites

public List<Composite> getComposites()
Getter for property composites.

Returns: Value of property composites.

getDescender

public float getDescender()
Getter for property descender.

Returns: Value of property descender.

getEncodingScheme

public String getEncodingScheme()
Getter for property encodingScheme.

Returns: Value of property encodingScheme.

getEscChar

public int getEscChar()
Getter for property escChar.

Returns: Value of property escChar.

getFamilyName

public String getFamilyName()
Getter for property familyName.

Returns: Value of property familyName.

getFontBBox

public BoundingBox getFontBBox()
Getter for property fontBBox.

Returns: Value of property fontBBox.

getFontName

public String getFontName()
Getter for property fontName.

Returns: Value of property fontName.

getFontVersion

public String getFontVersion()
Getter for property fontVersion.

Returns: Value of property fontVersion.

getFullName

public String getFullName()
Getter for property fullName.

Returns: Value of property fullName.

getItalicAngle

public float getItalicAngle()
Getter for property italicAngle.

Returns: Value of property italicAngle.

getKernPairs

public List<KernPair> getKernPairs()
Getter for property kernPairs.

Returns: Value of property kernPairs.

getKernPairs0

public List<KernPair> getKernPairs0()
Getter for property kernPairs0.

Returns: Value of property kernPairs0.

getKernPairs1

public List<KernPair> getKernPairs1()
Getter for property kernPairs1.

Returns: Value of property kernPairs1.

getMappingScheme

public int getMappingScheme()
Getter for property mappingScheme.

Returns: Value of property mappingScheme.

getMetricSets

public int getMetricSets()
This will get the metricSets attribute.

Returns: The value of the metric sets.

getNotice

public String getNotice()
Getter for property notice.

Returns: Value of property notice.

getStandardHorizontalWidth

public float getStandardHorizontalWidth()
Getter for property standardHorizontalWidth.

Returns: Value of property standardHorizontalWidth.

getStandardVerticalWidth

public float getStandardVerticalWidth()
Getter for property standardVerticalWidth.

Returns: Value of property standardVerticalWidth.

getTrackKern

public List<TrackKern> getTrackKern()
Getter for property trackKern.

Returns: Value of property trackKern.

getUnderlinePosition

public float getUnderlinePosition()
Getter for property underlinePosition.

Returns: Value of property underlinePosition.

getUnderlineThickness

public float getUnderlineThickness()
Getter for property underlineThickness.

Returns: Value of property underlineThickness.

getVVector

public float[] getVVector()
Getter for property vVector.

Returns: Value of property vVector.

getWeight

public String getWeight()
Getter for property weight.

Returns: Value of property weight.

getXHeight

public float getXHeight()
Getter for property xHeight.

Returns: Value of property xHeight.

isBaseFont

public boolean isBaseFont()
Getter for property isBaseFont.

Returns: Value of property isBaseFont.

isFixedPitch

public boolean isFixedPitch()
Getter for property isFixedPitch.

Returns: Value of property isFixedPitch.

isFixedV

public boolean isFixedV()
Getter for property isFixedV.

Returns: Value of property isFixedV.

setAFMVersion

public void setAFMVersion(float afmVersionValue)
This will set the version of the AFM document.

Parameters: afmVersionValue The version of the document.

setAscender

public void setAscender(float ascenderValue)
Setter for property ascender.

Parameters: ascenderValue New value of property ascender.

setCapHeight

public void setCapHeight(float capHeightValue)
Setter for property capHeight.

Parameters: capHeightValue New value of property capHeight.

setCharacters

public void setCharacters(int charactersValue)
Setter for property characters.

Parameters: charactersValue New value of property characters.

setCharacterSet

public void setCharacterSet(String characterSetValue)
Setter for property characterSet.

Parameters: characterSetValue New value of property characterSet.

setCharMetrics

public void setCharMetrics(List<CharMetric> charMetricsValue)
Setter for property charMetrics.

Parameters: charMetricsValue New value of property charMetrics.

setCharWidth

public void setCharWidth(float[] charWidthValue)
Setter for property charWidth.

Parameters: charWidthValue New value of property charWidth.

setComposites

public void setComposites(List<Composite> compositesList)
Setter for property composites.

Parameters: compositesList New value of property composites.

setDescender

public void setDescender(float descenderValue)
Setter for property descender.

Parameters: descenderValue New value of property descender.

setEncodingScheme

public void setEncodingScheme(String encodingSchemeValue)
Setter for property encodingScheme.

Parameters: encodingSchemeValue New value of property encodingScheme.

setEscChar

public void setEscChar(int escCharValue)
Setter for property escChar.

Parameters: escCharValue New value of property escChar.

setFamilyName

public void setFamilyName(String familyNameValue)
Setter for property familyName.

Parameters: familyNameValue New value of property familyName.

setFixedPitch

public void setFixedPitch(boolean isFixedPitchValue)
Setter for property isFixedPitch.

Parameters: isFixedPitchValue New value of property isFixedPitch.

setFontBBox

public void setFontBBox(BoundingBox bBox)
Setter for property fontBBox.

Parameters: bBox New value of property fontBBox.

setFontName

public void setFontName(String name)
Setter for property fontName.

Parameters: name New value of property fontName.

setFontVersion

public void setFontVersion(String fontVersionValue)
Setter for property fontVersion.

Parameters: fontVersionValue New value of property fontVersion.

setFullName

public void setFullName(String fullNameValue)
Setter for property fullName.

Parameters: fullNameValue New value of property fullName.

setIsBaseFont

public void setIsBaseFont(boolean isBaseFontValue)
Setter for property isBaseFont.

Parameters: isBaseFontValue New value of property isBaseFont.

setIsFixedV

public void setIsFixedV(boolean isFixedVValue)
Setter for property isFixedV.

Parameters: isFixedVValue New value of property isFixedV.

setItalicAngle

public void setItalicAngle(float italicAngleValue)
Setter for property italicAngle.

Parameters: italicAngleValue New value of property italicAngle.

setKernPairs

public void setKernPairs(List<KernPair> kernPairsList)
Setter for property kernPairs.

Parameters: kernPairsList New value of property kernPairs.

setKernPairs0

public void setKernPairs0(List<KernPair> kernPairs0List)
Setter for property kernPairs0.

Parameters: kernPairs0List New value of property kernPairs0.

setKernPairs1

public void setKernPairs1(List<KernPair> kernPairs1List)
Setter for property kernPairs1.

Parameters: kernPairs1List New value of property kernPairs1.

setMappingScheme

public void setMappingScheme(int mappingSchemeValue)
Setter for property mappingScheme.

Parameters: mappingSchemeValue New value of property mappingScheme.

setMetricSets

public void setMetricSets(int metricSetsValue)
This will set the metricSets attribute. This value must be 0,1, or 2.

Parameters: metricSetsValue The new metric sets attribute.

setNotice

public void setNotice(String noticeValue)
Setter for property notice.

Parameters: noticeValue New value of property notice.

setStandardHorizontalWidth

public void setStandardHorizontalWidth(float standardHorizontalWidthValue)
Setter for property standardHorizontalWidth.

Parameters: standardHorizontalWidthValue New value of property standardHorizontalWidth.

setStandardVerticalWidth

public void setStandardVerticalWidth(float standardVerticalWidthValue)
Setter for property standardVerticalWidth.

Parameters: standardVerticalWidthValue New value of property standardVerticalWidth.

setTrackKern

public void setTrackKern(List<TrackKern> trackKernValue)
Setter for property trackKern.

Parameters: trackKernValue New value of property trackKern.

setUnderlinePosition

public void setUnderlinePosition(float underlinePositionValue)
Setter for property underlinePosition.

Parameters: underlinePositionValue New value of property underlinePosition.

setUnderlineThickness

public void setUnderlineThickness(float underlineThicknessValue)
Setter for property underlineThickness.

Parameters: underlineThicknessValue New value of property underlineThickness.

setVVector

public void setVVector(float[] vVectorValue)
Setter for property vVector.

Parameters: vVectorValue New value of property vVector.

setWeight

public void setWeight(String weightValue)
Setter for property weight.

Parameters: weightValue New value of property weight.

setXHeight

public void setXHeight(float xHeightValue)
Setter for property xHeight.

Parameters: xHeightValue New value of property xHeight.

Copyright © 2008-2011 Apache Software Foundation. All Rights Reserved.