Module java.desktop
Package java.awt.font

Interface OpenType


public interface OpenType
The OpenType interface represents OpenType and TrueType fonts. This interface makes it possible to obtain sfnt tables from the font. A particular Font object can implement this interface.

For more information on TrueType and OpenType fonts, see the OpenType specification. ( http://www.microsoft.com/typography/otspec/ ).

  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int TAG_ACNT
    Accent attachment.
    static int TAG_AVAR
    Axis variation.
    static int TAG_BASE
    Baseline data.
    static int TAG_BDAT
    Bitmap data.
    static int TAG_BLOC
    Bitmap location.
    static int TAG_BSLN
    Baseline table.
    static int TAG_CFF
    Compact font format (Type1 font).
    static int TAG_CMAP
    Character to glyph mapping.
    static int TAG_CVAR
    CVT variation.
    static int TAG_CVT
    Control value table.
    static int TAG_DSIG
    Digital signature.
    static int TAG_EBDT
    Embedded bitmap data.
    static int TAG_EBLC
    Embedded bitmap location.
    static int TAG_EBSC
    Embedded bitmap scaling.
    static int TAG_FDSC
    Font descriptors.
    static int TAG_FEAT
    Feature name.
    static int TAG_FMTX
    Font metrics.
    static int TAG_FPGM
    Font program.
    static int TAG_FVAR
    Font variation.
    static int TAG_GASP
    Grid-fitting and scan conversion procedure.
    static int TAG_GDEF
    Glyph definition.
    static int TAG_GLYF
    Glyph data.
    static int TAG_GPOS
    Glyph positioning.
    static int TAG_GSUB
    Glyph substitution.
    static int TAG_GVAR
    Glyph variation.
    static int TAG_HDMX
    Horizontal device metrics.
    static int TAG_HEAD
    Font header.
    static int TAG_HHEA
    Horizontal metrics header.
    static int TAG_HMTX
    Horizontal metrics.
    static int TAG_JSTF
    Justification.
    static int TAG_JUST
    Justification.
    static int TAG_KERN
    Kerning.
    static int TAG_LCAR
    Ligature caret.
    static int TAG_LOCA
    Index to location.
    static int TAG_LTSH
    Linear threshold.
    static int TAG_MAXP
    Maximum profile.
    static int TAG_MMFX
    Multiple master font metrics.
    static int TAG_MMSD
    Multiple master supplementary data.
    static int TAG_MORT
    Glyph metamorphosis.
    static int TAG_NAME
    Naming table.
    static int TAG_OPBD
    Optical bounds.
    static int TAG_OS2
    OS/2 and Windows specific metrics.
    static int TAG_PCLT
    PCL 5 data.
    static int TAG_POST
    PostScript Information.
    static int TAG_PREP
    CVT preprogram.
    static int TAG_PROP
    Glyph properties.
    static int TAG_TRAK
    Tracking.
    static int TAG_TYP1
    Adobe Type 1 font data.
    static int TAG_VDMX
    Vertical device metrics.
    static int TAG_VHEA
    Vertical metrics header.
    static int TAG_VMTX
    Vertical metrics.
  • Method Summary

    Modifier and Type Method Description
    byte[] getFontTable​(int sfntTag)
    Returns the table as an array of bytes for a specified tag.
    byte[] getFontTable​(int sfntTag, int offset, int count)
    Returns a subset of the table as an array of bytes for a specified tag.
    byte[] getFontTable​(String strSfntTag)
    Returns the table as an array of bytes for a specified tag.
    byte[] getFontTable​(String strSfntTag, int offset, int count)
    Returns a subset of the table as an array of bytes for a specified tag.
    int getFontTableSize​(int sfntTag)
    Returns the size of the table for a specified tag.
    int getFontTableSize​(String strSfntTag)
    Returns the size of the table for a specified tag.
    int getVersion()
    Returns the version of the OpenType font. 1.0 is represented as 0x00010000.
  • Field Details

  • Method Details

    • getVersion

      int getVersion()
      Returns the version of the OpenType font. 1.0 is represented as 0x00010000.
      Returns:
      the version of the OpenType font.
    • getFontTable

      byte[] getFontTable​(int sfntTag)
      Returns the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.
      Parameters:
      sfntTag - a four-character code as a 32-bit integer
      Returns:
      a byte array that is the table that contains the font data corresponding to the specified tag.
    • getFontTable

      byte[] getFontTable​(String strSfntTag)
      Returns the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.
      Parameters:
      strSfntTag - a four-character code as a String
      Returns:
      a byte array that is the table that contains the font data corresponding to the specified tag.
    • getFontTable

      byte[] getFontTable​(int sfntTag, int offset, int count)
      Returns a subset of the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.
      Parameters:
      sfntTag - a four-character code as a 32-bit integer
      offset - index of first byte to return from table
      count - number of bytes to return from table
      Returns:
      a subset of the table corresponding to sfntTag and containing the bytes starting at offset byte and including count bytes.
    • getFontTable

      byte[] getFontTable​(String strSfntTag, int offset, int count)
      Returns a subset of the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.
      Parameters:
      strSfntTag - a four-character code as a String
      offset - index of first byte to return from table
      count - number of bytes to return from table
      Returns:
      a subset of the table corresponding to strSfntTag and containing the bytes starting at offset byte and including count bytes.
    • getFontTableSize

      int getFontTableSize​(int sfntTag)
      Returns the size of the table for a specified tag. Tags for sfnt tables include items like cmap, name and head.
      Parameters:
      sfntTag - a four-character code as a 32-bit integer
      Returns:
      the size of the table corresponding to the specified tag.
    • getFontTableSize

      int getFontTableSize​(String strSfntTag)
      Returns the size of the table for a specified tag. Tags for sfnt tables include items like cmap, name and head.
      Parameters:
      strSfntTag - a four-character code as a String
      Returns:
      the size of the table corresponding to the specified tag.