org.foray.font.format.ttf
Class TTFTableGLYF

java.lang.Object
  extended by org.foray.font.format.ttf.TTFTableGLYF

public class TTFTableGLYF
extends Object

A TrueType/OpenType "glyf" (Glyph Data) table. This table is used only in fonts that contain TrueType outlines.


Field Summary
protected static byte BYTE_BYTES
          The size, in bytes of the data type "BYTE", that is, 1.
static byte CF_BIT_ARG_1_AND_2_ARE_WORDS
          The bit in the composite flag indicating ARG_1_AND_2_ARE_WORDS.
static byte CF_BIT_ARGS_ARE_XY_VALUES
          The bit in the composite flag indicating ARGS_ARE_XY_VALUES.
static byte CF_BIT_MORE_COMPONENTS
          The bit in the composite flag indicating MORE_COMPONENTS.
static byte CF_BIT_ROUND_XY_TO_GRID
          The bit in the composite flag indicating ROUND_XY_TO_GRID.
static byte CF_BIT_USE_MY_METRICS
          The bit in the composite flag indicating USE_MY_METRICS.
static byte CF_BIT_WE_HAVE_A_SCALE
          The bit in the composite flag indicating WE_HAVE_A_SCALE.
static byte CF_BIT_WE_HAVE_A_TWO_BY_TWO
          The bit in the composite flag indicating WE_HAVE_A_TWO_BY_TWO.
static byte CF_BIT_WE_HAVE_AN_X_AND_Y_SCALE
          The bit in the composite flag indicating WE_HAVE_AN_X_AND_Y_SCALE.
static byte CF_BIT_WE_HAVE_INSTRUCTIONS
          The bit in the composite flag indicating WE_HAVE_INSTRUCTIONS.
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.
static byte HEADER_SIZE
          The size, in bytes, of the header portion of this table.
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
TTFTableGLYF(TTFOffsetTableRecord dirEntry)
          Constructor.
 
Method Summary
static int computeCompositeEntrySize(int compositeFlags)
          Computes the size, in bytes, of a composite entry, based on the flags for that entry.
 String getTableTag()
          Return the 4-character name of this table, for example, "post" or "glyf".
static boolean hasMoreComponents(int compositeFlags)
          Indicates, from the flags, whether there are additional composite entries.
static TTFTableGLYF parse(TTFOffsetTableRecord dirEntry, RandomAccessInput raInput, int numberOfGlyphs, TTFTableHMTX hmtx)
          Reads the "glyf" table to find the bounding boxes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_SIZE

public static final byte HEADER_SIZE
The size, in bytes, of the header portion of this table.

See Also:
Constant Field Values

CF_BIT_ARG_1_AND_2_ARE_WORDS

public static final byte CF_BIT_ARG_1_AND_2_ARE_WORDS
The bit in the composite flag indicating ARG_1_AND_2_ARE_WORDS.

See Also:
Constant Field Values

CF_BIT_ARGS_ARE_XY_VALUES

public static final byte CF_BIT_ARGS_ARE_XY_VALUES
The bit in the composite flag indicating ARGS_ARE_XY_VALUES.

See Also:
Constant Field Values

CF_BIT_ROUND_XY_TO_GRID

public static final byte CF_BIT_ROUND_XY_TO_GRID
The bit in the composite flag indicating ROUND_XY_TO_GRID.

See Also:
Constant Field Values

CF_BIT_WE_HAVE_A_SCALE

public static final byte CF_BIT_WE_HAVE_A_SCALE
The bit in the composite flag indicating WE_HAVE_A_SCALE.

See Also:
Constant Field Values

CF_BIT_MORE_COMPONENTS

public static final byte CF_BIT_MORE_COMPONENTS
The bit in the composite flag indicating MORE_COMPONENTS.

See Also:
Constant Field Values

CF_BIT_WE_HAVE_AN_X_AND_Y_SCALE

public static final byte CF_BIT_WE_HAVE_AN_X_AND_Y_SCALE
The bit in the composite flag indicating WE_HAVE_AN_X_AND_Y_SCALE.

See Also:
Constant Field Values

CF_BIT_WE_HAVE_A_TWO_BY_TWO

public static final byte CF_BIT_WE_HAVE_A_TWO_BY_TWO
The bit in the composite flag indicating WE_HAVE_A_TWO_BY_TWO.

See Also:
Constant Field Values

CF_BIT_WE_HAVE_INSTRUCTIONS

public static final byte CF_BIT_WE_HAVE_INSTRUCTIONS
The bit in the composite flag indicating WE_HAVE_INSTRUCTIONS.

See Also:
Constant Field Values

CF_BIT_USE_MY_METRICS

public static final byte CF_BIT_USE_MY_METRICS
The bit in the composite flag indicating USE_MY_METRICS.

See Also:
Constant Field Values

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

TTFTableGLYF

public TTFTableGLYF(TTFOffsetTableRecord dirEntry)
Constructor.

Parameters:
dirEntry - The parent table directory entry.
Method Detail

parse

public static TTFTableGLYF parse(TTFOffsetTableRecord dirEntry,
                                 RandomAccessInput raInput,
                                 int numberOfGlyphs,
                                 TTFTableHMTX hmtx)
                          throws IOException
Reads the "glyf" table to find the bounding boxes.

Parameters:
dirEntry - The parent table directory entry.
raInput - The input which is being parsed.
numberOfGlyphs - The number of glyphs to be parsed. This data is derived from the "maxp" table.
hmtx - The related horizontal metrics (hmtx) table.
Returns:
The parsed instance.
Throws:
IOException - For I/O Error.

getTableTag

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

Returns:
The name of this table.

computeCompositeEntrySize

public static int computeCompositeEntrySize(int compositeFlags)
Computes the size, in bytes, of a composite entry, based on the flags for that entry.

Parameters:
compositeFlags - The flags for the entry.
Returns:
The size, in bytes, of the composite entry.

hasMoreComponents

public static boolean hasMoreComponents(int compositeFlags)
Indicates, from the flags, whether there are additional composite entries.

Parameters:
compositeFlags - The flags value.
Returns:
True iff there are more composite entries.


Copyright © 2017. All rights reserved.