org.foray.font.format.ttf
Class TTFTableGSUB

java.lang.Object
  extended by org.foray.font.format.ttf.AbstractOTFLayoutTable
      extended by org.foray.font.format.ttf.TTFTableGSUB

public class TTFTableGSUB
extends AbstractOTFLayoutTable

An OpenType "GSUB" (Glyphs Substitution Data) table. This table is an Advanced Typographic Table.


Field Summary
protected static byte BYTE_BYTES
          The size, in bytes of the data type "BYTE", that is, 1.
protected static byte CHAR_BYTES
          The size, in bytes of the data type "CHAR", that is, 1.
protected static byte F2DOT14_BYTES
          The size, in bytes of the data type "F2DOT14", that is, 2.
protected static byte FIXED_BYTES
          The size, in bytes of the data type "FIXED", that is, 4.
protected static byte FWORD_BYTES
          The size, in bytes of the data type "FWORD", that is, 2.
protected static byte LONG_BYTES
          The size, in bytes of the data type "LONG", that is, 4.
protected static byte LONG_DATE_TIME_BYTES
          The size, in bytes of the data type "International Date", that is, 8.
protected static byte OFFSET_BYTES
          The size, in bytes of the data type "Offset", that is, 2.
protected static byte SHORT_BYTES
          The size, in bytes of the data type "SHORT", that is, 2.
protected static byte UFWORD_BYTES
          The size, in bytes of the data type "UFWORD", that is, 2.
protected static byte ULONG_BYTES
          The size, in bytes of the data type "ULONG", that is, 4.
protected static byte USHORT_BYTES
          The size, in bytes of the data type "USHORT", that is, 2.
 
Constructor Summary
TTFTableGSUB(TTFOffsetTableRecord offsetRecord, Map<String,OTFScript> scriptMap, Map<String,OTFFeature> featureMap)
          Constructor.
 
Method Summary
 List<OTFLookupGSUB> getLookupList()
          Returns the lookup list.
 String getTableTag()
          Return the 4-character name of this table, for example, "post" or "glyf".
 void makeSubstitutions(IntArrayBuilder glyphIndexes, org.axsl.font.FontOptions options, org.axsl.common.i18n.Orthography orthography)
          Looks through the possible substitution in this font, and for those that the client wants, converts the glyph indexes for those substitutions.
static TTFTableGSUB parse(TTFOffsetTableRecord offsetRecord, RandomAccessInput raInput)
          Parse the table from the table content.
protected static List<OTFLookupGSUB> parseLookupList(RandomAccessInput raInput, int offset)
          Parses the lookup list.
 
Methods inherited from class org.foray.font.format.ttf.AbstractOTFLayoutTable
getFeature, getScript, parseFeatureList, parseFeatureVariations, parseScriptList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_BYTES

protected static final byte BYTE_BYTES
The size, in bytes of the data type "BYTE", that is, 1.

See Also:
Constant Field Values

CHAR_BYTES

protected static final byte CHAR_BYTES
The size, in bytes of the data type "CHAR", that is, 1.

See Also:
Constant Field Values

USHORT_BYTES

protected static final byte USHORT_BYTES
The size, in bytes of the data type "USHORT", that is, 2.

See Also:
Constant Field Values

SHORT_BYTES

protected static final byte SHORT_BYTES
The size, in bytes of the data type "SHORT", that is, 2.

See Also:
Constant Field Values

ULONG_BYTES

protected static final byte ULONG_BYTES
The size, in bytes of the data type "ULONG", that is, 4.

See Also:
Constant Field Values

LONG_BYTES

protected static final byte LONG_BYTES
The size, in bytes of the data type "LONG", that is, 4.

See Also:
Constant Field Values

FIXED_BYTES

protected static final byte FIXED_BYTES
The size, in bytes of the data type "FIXED", that is, 4.

See Also:
Constant Field Values

FWORD_BYTES

protected static final byte FWORD_BYTES
The size, in bytes of the data type "FWORD", that is, 2.

See Also:
Constant Field Values

UFWORD_BYTES

protected static final byte UFWORD_BYTES
The size, in bytes of the data type "UFWORD", that is, 2.

See Also:
Constant Field Values

F2DOT14_BYTES

protected static final byte F2DOT14_BYTES
The size, in bytes of the data type "F2DOT14", that is, 2.

See Also:
Constant Field Values

LONG_DATE_TIME_BYTES

protected static final byte LONG_DATE_TIME_BYTES
The size, in bytes of the data type "International Date", that is, 8.

See Also:
Constant Field Values

OFFSET_BYTES

protected static final byte OFFSET_BYTES
The size, in bytes of the data type "Offset", that is, 2.

See Also:
Constant Field Values
Constructor Detail

TTFTableGSUB

public TTFTableGSUB(TTFOffsetTableRecord offsetRecord,
                    Map<String,OTFScript> scriptMap,
                    Map<String,OTFFeature> featureMap)
Constructor.

Parameters:
offsetRecord - The parent table directory entry.
scriptMap - The scripts for this table.
featureMap - The features for this table.
Method Detail

parse

public static TTFTableGSUB parse(TTFOffsetTableRecord offsetRecord,
                                 RandomAccessInput raInput)
                          throws IOException
Parse the table from the table content.

Parameters:
offsetRecord - The parent offset table record.
raInput - The input which is being parsed.
Returns:
The parsed instance.
Throws:
IOException - For I/O Error.

parseLookupList

protected static List<OTFLookupGSUB> parseLookupList(RandomAccessInput raInput,
                                                     int offset)
                                              throws IOException
Parses the lookup list.

Parameters:
raInput - The input from which the lookup list is being parsed.
offset - The offset in raInput for the start of the lookup list.
Returns:
The parsed lookup list.
Throws:
IOException - For I/O errors during parsing.

getTableTag

public String getTableTag()
Return the 4-character name of this table, for example, "post" or "glyf".

Returns:
The name of this table.

getLookupList

public List<OTFLookupGSUB> getLookupList()
Returns the lookup list.

Returns:
The lookup list.

makeSubstitutions

public void makeSubstitutions(IntArrayBuilder glyphIndexes,
                              org.axsl.font.FontOptions options,
                              org.axsl.common.i18n.Orthography orthography)
Looks through the possible substitution in this font, and for those that the client wants, converts the glyph indexes for those substitutions.

Parameters:
glyphIndexes - The glyph indexes for which substitutions are being considered.
options - The font options, such as ligatures and small-caps that should be used when computing the glyphs for this word.
orthography - The orthography that should be used when applying subsitutions.


Copyright © 2017. All rights reserved.