class OpenTypeFont extends TrueTypeFont
{
    private boolean isPostScript;
    
    /**
     * Constructor. Clients should use the OTFParser to create a new OpenTypeFont object.
     *
     * @param fontData The font data.
     */
    OpenTypeFont(TTFDataStream fontData)
    {
        super(fontData);
    }

    @Override
    void setVersion(float versionValue)
    {
        isPostScript = Float.floatToIntBits(versionValue) == 0x469EA8A9; // OTTO
        super.setVersion(versionValue);
    }
    
    /**
     * Get the "CFF" table for this OTF.
     *
     * @return The "CFF" table.
     * 
     * @throws IOException if the font data could not be read
     * @throws UnsupportedOperationException if the current font isn't a CFF font
     */
    public CFFTable getCFF() throws IOException
    {
        if (!isPostScript)
        {
            throw new UnsupportedOperationException("TTF fonts do not have a CFF table");
        }
        return (CFFTable) getTable(CFFTable.TAG);
    }

    @Override
    public GlyphTable getGlyph() throws IOException
    {
        if (isPostScript)
        {
            throw new UnsupportedOperationException("OTF fonts do not have a glyf table");
        }
        return super.getGlyph();
    }

    @Override
    public GeneralPath getPath(String name) throws IOException
    {
        if (isPostScript && isSupportedOTF())
        {
            int gid = nameToGID(name);
            return getCFF().getFont().getType2CharString(gid).getPath();
        }
        else
        {
            return super.getPath(name);
        }
    }

    /**
     * Returns true if this font is a PostScript outline font.
     * 
     * @return true if the font is a PostScript outline font, otherwise false
     */
    public boolean isPostScript()
    {
        return isPostScript || tables.containsKey(CFFTable.TAG) || tables.containsKey("CFF2");
    }

    /**
     * Returns true if this font is supported.
     * 
     * There are 3 kind of OpenType fonts, fonts using TrueType outlines, fonts using CFF outlines (version 1 and 2)
     * 
     * Fonts using CFF outlines version 2 aren't supported yet.
     * 
     * @return true if the font is supported
     */
    public boolean isSupportedOTF()
    {<FILL_FUNCTION_BODY>}

    /**
     * Returns true if this font uses OpenType Layout (Advanced Typographic) tables.
     * 
     * @return true if the font has any layout table, otherwise false
     */
    public boolean hasLayoutTables()
    {
        return tables.containsKey("BASE") //
                || tables.containsKey("GDEF") //
                || tables.containsKey("GPOS") //
                || tables.containsKey(GlyphSubstitutionTable.TAG) //
                || tables.containsKey(OTLTable.TAG);
    }
}

        // OTF using CFF2 based outlines aren't yet supported
        return !(isPostScript //
                && !tables.containsKey(CFFTable.TAG) //
                && tables.containsKey("CFF2") //
        );
    
<methods>public void close() throws java.io.IOException,public void disableGsubFeature(java.lang.String) ,public void enableGsubFeature(java.lang.String) ,public void enableVerticalSubstitutions() ,public int getAdvanceHeight(int) throws java.io.IOException,public int getAdvanceWidth(int) throws java.io.IOException,public org.apache.fontbox.ttf.CmapTable getCmap() throws java.io.IOException,public org.apache.fontbox.util.BoundingBox getFontBBox() throws java.io.IOException,public List<java.lang.Number> getFontMatrix() throws java.io.IOException,public org.apache.fontbox.ttf.GlyphTable getGlyph() throws java.io.IOException,public org.apache.fontbox.ttf.GlyphSubstitutionTable getGsub() throws java.io.IOException,public org.apache.fontbox.ttf.model.GsubData getGsubData() throws java.io.IOException,public org.apache.fontbox.ttf.HeaderTable getHeader() throws java.io.IOException,public org.apache.fontbox.ttf.HorizontalHeaderTable getHorizontalHeader() throws java.io.IOException,public org.apache.fontbox.ttf.HorizontalMetricsTable getHorizontalMetrics() throws java.io.IOException,public org.apache.fontbox.ttf.IndexToLocationTable getIndexToLocation() throws java.io.IOException,public org.apache.fontbox.ttf.KerningTable getKerning() throws java.io.IOException,public org.apache.fontbox.ttf.MaximumProfileTable getMaximumProfile() throws java.io.IOException,public java.lang.String getName() throws java.io.IOException,public org.apache.fontbox.ttf.NamingTable getNaming() throws java.io.IOException,public int getNumberOfGlyphs() throws java.io.IOException,public org.apache.fontbox.ttf.OS2WindowsMetricsTable getOS2Windows() throws java.io.IOException,public java.io.InputStream getOriginalData() throws java.io.IOException,public long getOriginalDataSize() ,public java.awt.geom.GeneralPath getPath(java.lang.String) throws java.io.IOException,public org.apache.fontbox.ttf.PostScriptTable getPostScript() throws java.io.IOException,public byte[] getTableBytes(org.apache.fontbox.ttf.TTFTable) throws java.io.IOException,public Map<java.lang.String,org.apache.fontbox.ttf.TTFTable> getTableMap() ,public Collection<org.apache.fontbox.ttf.TTFTable> getTables() ,public org.apache.fontbox.ttf.CmapLookup getUnicodeCmapLookup() throws java.io.IOException,public org.apache.fontbox.ttf.CmapLookup getUnicodeCmapLookup(boolean) throws java.io.IOException,public int getUnitsPerEm() throws java.io.IOException,public float getVersion() ,public org.apache.fontbox.ttf.VerticalHeaderTable getVerticalHeader() throws java.io.IOException,public org.apache.fontbox.ttf.VerticalMetricsTable getVerticalMetrics() throws java.io.IOException,public org.apache.fontbox.ttf.VerticalOriginTable getVerticalOrigin() throws java.io.IOException,public float getWidth(java.lang.String) throws java.io.IOException,public boolean hasGlyph(java.lang.String) throws java.io.IOException,public int nameToGID(java.lang.String) throws java.io.IOException,public java.lang.String toString() <variables>private static final Logger LOG,private final non-sealed org.apache.fontbox.ttf.TTFDataStream data,private final List<java.lang.String> enabledGsubFeatures,private final java.lang.Object lockPSNames,private final java.lang.Object lockReadtable,private int numberOfGlyphs,private volatile Map<java.lang.String,java.lang.Integer> postScriptNames,protected final Map<java.lang.String,org.apache.fontbox.ttf.TTFTable> tables,private int unitsPerEm,private float version