GlyfDescript
Date: 2017-05-25

org.apache.fontbox.ttf

## Class GlyfDescript

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

- All Implemented Interfaces:
    GlyphDescription
  Direct Known Subclasses:
    GlyfCompositeDescript, GlyfSimpleDescript

      public abstract class GlyfDescript
      extends java.lang.Object
      implements GlyphDescription

  This class is based on code from Apache Batik a subproject of Apache XMLGraphics. see http://xmlgraphics.apache.org/batik/ for further details.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `ON_CURVE` if set, the point is on the curve.
    `static byte` | `REPEAT` if set, the next byte specifies the number of additional times this set of flags is to be repeated.
    `static byte` | `X_DUAL` This flag as two meanings, depending on how the x-short vector flags is set.
    `static byte` | `X_SHORT_VECTOR` if set, the x-coordinate is 1 byte long.
    `static byte` | `Y_DUAL` This flag as two meanings, depending on how the y-short vector flags is set.
    `static byte` | `Y_SHORT_VECTOR` if set, the y-coordinate is 1 byte long.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GlyfDescript(short numberOfContours, org.apache.fontbox.ttf.TTFDataStream bais)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getContourCount()` Returns the number of contours.
    `int[]` | `getInstructions()` Returns the hinting instructions.
    `protected void` | `readInstructions(org.apache.fontbox.ttf.TTFDataStream bais, int count)` Read the hinting instructions.
    `void` | `resolve()` Resolve all parts of an composite glyph.

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

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

    - ### Methods inherited from interface org.apache.fontbox.ttf.GlyphDescription

      `getEndPtOfContours, getFlags, getPointCount, getXCoordinate, getYCoordinate, isComposite`

- - ### Field Detail

    - #### ON_CURVE

          public static final byte ON_CURVE

      if set, the point is on the curve.
      See Also:
        Constant Field Values

    - #### X_SHORT_VECTOR

          public static final byte X_SHORT_VECTOR

      if set, the x-coordinate is 1 byte long.
      See Also:
        Constant Field Values

    - #### Y_SHORT_VECTOR

          public static final byte Y_SHORT_VECTOR

      if set, the y-coordinate is 1 byte long.
      See Also:
        Constant Field Values

    - #### REPEAT

          public static final byte REPEAT

      if set, the next byte specifies the number of additional times this set of flags is to be repeated.
      See Also:
        Constant Field Values

    - #### X_DUAL

          public static final byte X_DUAL

      This flag as two meanings, depending on how the x-short vector flags is set. If the x-short vector is set, this bit describes the sign of the value, with 1 equaling positive and 0 positive. If the x-short vector is not set and this bit is also not set, the current x-coordinate is a signed 16-bit delta vector.
      See Also:
        Constant Field Values

    - #### Y_DUAL

          public static final byte Y_DUAL

      This flag as two meanings, depending on how the y-short vector flags is set. If the y-short vector is set, this bit describes the sign of the value, with 1 equaling positive and 0 positive. If the y-short vector is not set and this bit is also not set, the current y-coordinate is a signed 16-bit delta vector.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GlyfDescript

          protected GlyfDescript(short numberOfContours,
                      org.apache.fontbox.ttf.TTFDataStream bais)
                          throws java.io.IOException

      Constructor.
      Parameters:
        `numberOfContours` - the number of contours
        `bais` - the stream to be read
      Throws:
        `java.io.IOException` - is thrown if something went wrong

  - ### Method Detail

    - #### resolve

          public void resolve()

      Resolve all parts of an composite glyph.
      Specified by:
        `resolve` in interface `GlyphDescription`

    - #### getContourCount

          public int getContourCount()

      Returns the number of contours.
      Specified by:
        `getContourCount` in interface `GlyphDescription`
      Returns:
        the number of contours

    - #### getInstructions

          public int[] getInstructions()

      Returns the hinting instructions.
      Returns:
        an array containing the hinting instructions.

    - #### readInstructions

          protected void readInstructions(org.apache.fontbox.ttf.TTFDataStream bais,
                              int count)
                                   throws java.io.IOException

      Read the hinting instructions.
      Parameters:
        `bais` - the stream to be read
        `count` - the number of instructions to be read
      Throws:
        `java.io.IOException` - is thrown if something went wrong