java.lang.Object
org.loboevolution.pdfview.font.ttf.Glyf
Direct Known Subclasses:
GlyfCompound, GlyfSimple

public class Glyf extends Object
A single glyph in a pdf font. May be simple or compound via subclasses
  • Constructor Details

    • Glyf

      protected Glyf()
      Creates a new instance of glyf Don't use this directly, use Glyf.getGlyf()
  • Method Details

    • getGlyf

      public static Glyf getGlyf(ByteBuffer data)
      Get a map from the given data

      This method reads the format, data and length variables of the map.

      Parameters:
      data - a ByteBuffer object.
      Returns:
      a Glyf object.
    • getData

      public ByteBuffer getData()
      Get the data in this glyf as a byte buffer. Return the basic glyf data only, since there is no specific data. This method returns the data un-flipped, so subclasses can simply append to the allocated buffer.
      Returns:
      a ByteBuffer object.
    • setData

      public void setData(ByteBuffer data)
      Set the data for this glyf. Do nothing, since a glyf with no contours has no glyf data.
      Parameters:
      data - a ByteBuffer object.
    • getLength

      public short getLength()
      Get the length of this glyf. A glyf with no data has a length of 10 (2 bytes each for 5 short values)
      Returns:
      a short.