KerningSubtable
Date: 2017-05-25

org.apache.fontbox.ttf

## Class KerningSubtable

- java.lang.Object
- - org.apache.fontbox.ttf.KerningSubtable

-     public class KerningSubtable
      extends java.lang.Object

  A 'kern' table in a true type font.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getKerning(int[] glyphs)` Obtain kerning adjustments for GLYPHS sequence, where the Nth returned adjustment is associated with the Nth glyph and the succeeding non-zero glyph in the GLYPHS sequence.
    `int` | `getKerning(int l, int r)` Obtain kerning adjustment for glyph pair {L,R}.
    `boolean` | `isHorizontalKerning()` Determine if subtable is designated for use in horizontal writing modes and contains inline progression kerning pairs (not block progression "cross stream") kerning pairs.
    `boolean` | `isHorizontalKerning(boolean cross)` Determine if subtable is designated for use in horizontal writing modes, contains kerning pairs (as opposed to minimum pairs), and, if CROSS is true, then return cross stream designator; otherwise, if CROSS is false, return true if cross stream designator is false.
    `void` | `read(org.apache.fontbox.ttf.TTFDataStream data, int version)` This will read the required data from the stream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### read

          public void read(org.apache.fontbox.ttf.TTFDataStream data,
                  int version)
                    throws java.io.IOException

      This will read the required data from the stream.
      Parameters:
        `data` - The stream to read the data from.
        `version` - The version of the table to be read
      Throws:
        `java.io.IOException` - If there is an error reading the data.

    - #### isHorizontalKerning

          public boolean isHorizontalKerning()

      Determine if subtable is designated for use in horizontal writing modes and contains inline progression kerning pairs (not block progression "cross stream") kerning pairs.
      Returns:
        true if subtable is for horizontal kerning

    - #### isHorizontalKerning

          public boolean isHorizontalKerning(boolean cross)

      Determine if subtable is designated for use in horizontal writing modes, contains kerning pairs (as opposed to minimum pairs), and, if CROSS is true, then return cross stream designator; otherwise, if CROSS is false, return true if cross stream designator is false.
      Parameters:
        `cross` - if true, then return cross stream designator in horizontal modes
      Returns:
        true if subtable is for horizontal kerning in horizontal modes

    - #### getKerning

          public int[] getKerning(int[] glyphs)

      Obtain kerning adjustments for GLYPHS sequence, where the Nth returned adjustment is associated with the Nth glyph and the succeeding non-zero glyph in the GLYPHS sequence. Kerning adjustments are returned in font design coordinates.
      Parameters:
        `glyphs` - a (possibly empty) array of glyph identifiers
      Returns:
        a (possibly empty) array of kerning adjustments

    - #### getKerning

          public int getKerning(int l,
                       int r)

      Obtain kerning adjustment for glyph pair {L,R}.
      Parameters:
        `l` - left member of glyph pair
        `r` - right member of glyph pair
      Returns:
        a (possibly zero) kerning adjustment