Package org.apache.fontbox.ttf
Class HeaderTable
- java.lang.Object
-
- org.apache.fontbox.ttf.TTFTable
-
- org.apache.fontbox.ttf.HeaderTable
-
public class HeaderTable extends TTFTable
This 'head'-table is a required table in a TrueType font.
-
-
Field Summary
Fields Modifier and Type Field Description private longcheckSumAdjustmentprivate java.util.Calendarcreatedprivate intflagsprivate shortfontDirectionHintprivate floatfontRevisionprivate shortglyphDataFormatprivate shortindexToLocFormatprivate intlowestRecPPEMstatic intMAC_STYLE_BOLDBold macStyle flag.static intMAC_STYLE_ITALICItalic macStyle flag.private intmacStyleprivate longmagicNumberprivate java.util.Calendarmodifiedstatic java.lang.StringTAGTag to identify this table.private intunitsPerEmprivate floatversionprivate shortxMaxprivate shortxMinprivate shortyMaxprivate shortyMin-
Fields inherited from class org.apache.fontbox.ttf.TTFTable
initialized
-
-
Constructor Summary
Constructors Constructor Description HeaderTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCheckSumAdjustment()java.util.CalendargetCreated()intgetFlags()shortgetFontDirectionHint()floatgetFontRevision()shortgetGlyphDataFormat()shortgetIndexToLocFormat()intgetLowestRecPPEM()intgetMacStyle()longgetMagicNumber()java.util.CalendargetModified()intgetUnitsPerEm()floatgetVersion()shortgetXMax()shortgetXMin()shortgetYMax()shortgetYMin()(package private) voidread(TrueTypeFont ttf, TTFDataStream data)This will read the required data from the stream.(package private) voidreadHeaders(TrueTypeFont ttf, TTFDataStream data, FontHeaders outHeaders)This will read required headers from the stream into outHeaders.voidsetCheckSumAdjustment(long checkSumAdjustmentValue)voidsetCreated(java.util.Calendar createdValue)voidsetFlags(int flagsValue)voidsetFontDirectionHint(short fontDirectionHintValue)voidsetFontRevision(float fontRevisionValue)voidsetGlyphDataFormat(short glyphDataFormatValue)voidsetIndexToLocFormat(short indexToLocFormatValue)voidsetLowestRecPPEM(int lowestRecPPEMValue)voidsetMacStyle(int macStyleValue)voidsetMagicNumber(long magicNumberValue)voidsetModified(java.util.Calendar modifiedValue)voidsetUnitsPerEm(int unitsPerEmValue)voidsetVersion(float versionValue)voidsetXMax(short maxValue)voidsetXMin(short minValue)voidsetYMax(short maxValue)voidsetYMin(short minValue)-
Methods inherited from class org.apache.fontbox.ttf.TTFTable
getCheckSum, getInitialized, getLength, getOffset, getTag, setCheckSum, setLength, setOffset, setTag
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
Tag to identify this table.- See Also:
- Constant Field Values
-
MAC_STYLE_BOLD
public static final int MAC_STYLE_BOLD
Bold macStyle flag.- See Also:
- Constant Field Values
-
MAC_STYLE_ITALIC
public static final int MAC_STYLE_ITALIC
Italic macStyle flag.- See Also:
- Constant Field Values
-
version
private float version
-
fontRevision
private float fontRevision
-
checkSumAdjustment
private long checkSumAdjustment
-
magicNumber
private long magicNumber
-
flags
private int flags
-
unitsPerEm
private int unitsPerEm
-
created
private java.util.Calendar created
-
modified
private java.util.Calendar modified
-
xMin
private short xMin
-
yMin
private short yMin
-
xMax
private short xMax
-
yMax
private short yMax
-
macStyle
private int macStyle
-
lowestRecPPEM
private int lowestRecPPEM
-
fontDirectionHint
private short fontDirectionHint
-
indexToLocFormat
private short indexToLocFormat
-
glyphDataFormat
private short glyphDataFormat
-
-
Method Detail
-
readHeaders
void readHeaders(TrueTypeFont ttf, TTFDataStream data, FontHeaders outHeaders) throws java.io.IOException
This will read required headers from the stream into outHeaders.- Overrides:
readHeadersin classTTFTable- Parameters:
ttf- The font that is being read.data- The stream to read the data from.outHeaders- The class to write the data to.- Throws:
java.io.IOException- If there is an error reading the data.
-
read
void read(TrueTypeFont ttf, TTFDataStream data) throws java.io.IOException
This will read the required data from the stream.
-
getCheckSumAdjustment
public long getCheckSumAdjustment()
- Returns:
- Returns the checkSumAdjustment.
-
setCheckSumAdjustment
public void setCheckSumAdjustment(long checkSumAdjustmentValue)
- Parameters:
checkSumAdjustmentValue- The checkSumAdjustment to set.
-
getCreated
public java.util.Calendar getCreated()
- Returns:
- Returns the created.
-
setCreated
public void setCreated(java.util.Calendar createdValue)
- Parameters:
createdValue- The created to set.
-
getFlags
public int getFlags()
- Returns:
- Returns the flags.
-
setFlags
public void setFlags(int flagsValue)
- Parameters:
flagsValue- The flags to set.
-
getFontDirectionHint
public short getFontDirectionHint()
- Returns:
- Returns the fontDirectionHint.
-
setFontDirectionHint
public void setFontDirectionHint(short fontDirectionHintValue)
- Parameters:
fontDirectionHintValue- The fontDirectionHint to set.
-
getFontRevision
public float getFontRevision()
- Returns:
- Returns the fontRevision.
-
setFontRevision
public void setFontRevision(float fontRevisionValue)
- Parameters:
fontRevisionValue- The fontRevision to set.
-
getGlyphDataFormat
public short getGlyphDataFormat()
- Returns:
- Returns the glyphDataFormat.
-
setGlyphDataFormat
public void setGlyphDataFormat(short glyphDataFormatValue)
- Parameters:
glyphDataFormatValue- The glyphDataFormat to set.
-
getIndexToLocFormat
public short getIndexToLocFormat()
- Returns:
- Returns the indexToLocFormat.
-
setIndexToLocFormat
public void setIndexToLocFormat(short indexToLocFormatValue)
- Parameters:
indexToLocFormatValue- The indexToLocFormat to set.
-
getLowestRecPPEM
public int getLowestRecPPEM()
- Returns:
- Returns the lowestRecPPEM.
-
setLowestRecPPEM
public void setLowestRecPPEM(int lowestRecPPEMValue)
- Parameters:
lowestRecPPEMValue- The lowestRecPPEM to set.
-
getMacStyle
public int getMacStyle()
- Returns:
- Returns the macStyle.
-
setMacStyle
public void setMacStyle(int macStyleValue)
- Parameters:
macStyleValue- The macStyle to set.
-
getMagicNumber
public long getMagicNumber()
- Returns:
- Returns the magicNumber.
-
setMagicNumber
public void setMagicNumber(long magicNumberValue)
- Parameters:
magicNumberValue- The magicNumber to set.
-
getModified
public java.util.Calendar getModified()
- Returns:
- Returns the modified.
-
setModified
public void setModified(java.util.Calendar modifiedValue)
- Parameters:
modifiedValue- The modified to set.
-
getUnitsPerEm
public int getUnitsPerEm()
- Returns:
- Returns the unitsPerEm.
-
setUnitsPerEm
public void setUnitsPerEm(int unitsPerEmValue)
- Parameters:
unitsPerEmValue- The unitsPerEm to set.
-
getVersion
public float getVersion()
- Returns:
- Returns the version.
-
setVersion
public void setVersion(float versionValue)
- Parameters:
versionValue- The version to set.
-
getXMax
public short getXMax()
- Returns:
- Returns the xMax.
-
setXMax
public void setXMax(short maxValue)
- Parameters:
maxValue- The xMax to set.
-
getXMin
public short getXMin()
- Returns:
- Returns the xMin.
-
setXMin
public void setXMin(short minValue)
- Parameters:
minValue- The xMin to set.
-
getYMax
public short getYMax()
- Returns:
- Returns the yMax.
-
setYMax
public void setYMax(short maxValue)
- Parameters:
maxValue- The yMax to set.
-
getYMin
public short getYMin()
- Returns:
- Returns the yMin.
-
setYMin
public void setYMin(short minValue)
- Parameters:
minValue- The yMin to set.
-
-