Top Description Fields Constructors Methods
org.apache.fontbox.ttf

public Class HorizontalMetricsTable

extends TTFTable
Class Inheritance
Imports
java.io.IOException

This 'hmtx'-table is a required table in a TrueType font.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private int[]
private short[]
private short[]
private int
public static final String
TAG

A tag that identifies this table type.

Inherited from org.apache.fontbox.ttf.TTFTable:
initialized

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the advance width of the given GID
getAdvanceWidth
(int
GID
gid
)

Returns the advance width for the given GID.

public int

Returns:

the left side bearing of the given GID
getLeftSideBearing
(int
GID
gid
)

Returns the left side bearing for the given GID.

pack-priv void
read(TrueTypeFont
The font that is being read.
ttf
,
TTFDataStream
The stream to read the data from.
data
)

Overrides org.apache.fontbox.ttf.TTFTable.read.

This will read the required data from the stream.

Inherited from org.apache.fontbox.ttf.TTFTable:
getCheckSumgetInitializedgetLengthgetOffsetgetTagreadHeaderssetCheckSumsetLengthsetOffsetsetTag

Field Detail

advanceWidthback to summary
private int[] advanceWidth
leftSideBearingback to summary
private short[] leftSideBearing
nonHorizontalLeftSideBearingback to summary
private short[] nonHorizontalLeftSideBearing
numHMetricsback to summary
private int numHMetrics
TAGback to summary
public static final String TAG

A tag that identifies this table type.

Constructor Detail

HorizontalMetricsTableback to summary
pack-priv HorizontalMetricsTable()

Method Detail

getAdvanceWidthback to summary
public int getAdvanceWidth(int gid)

Returns the advance width for the given GID.

Parameters
gid:int

GID

Returns:int

the advance width of the given GID

getLeftSideBearingback to summary
public int getLeftSideBearing(int gid)

Returns the left side bearing for the given GID.

Parameters
gid:int

GID

Returns:int

the left side bearing of the given GID

readback to summary
pack-priv void read(TrueTypeFont ttf, TTFDataStream data) throws IOException

Overrides org.apache.fontbox.ttf.TTFTable.read.

This will read the required data from the stream.

Parameters
ttf:TrueTypeFont

The font that is being read.

data:TTFDataStream

The stream to read the data from.

Annotations
@Override
Exceptions
IOException:
If there is an error reading the data.