Examples of parseTTF()


Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

                        InputStream fontStream = ResourceLoader.loadResource( fontResource );
                        if( fontStream == null )
                        {
                            throw new IOException( "Error missing font resource '" + externalFonts.get(baseFont) + "'" );
                        }
                        retval = ttfParser.parseTTF( fontStream );
                        loadedExternalFonts.put( baseFont, retval );
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

            {
                PDStream ff2Stream = fd.getFontFile2();
                if (ff2Stream != null)
                {
                    TTFParser ttfParser = new TTFParser(true);
                    trueTypeFont = ttfParser.parseTTF(ff2Stream.createInputStream());
                }
            }
            if (trueTypeFont == null)
            {
                // check if there is a font mapping for an external font file
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

     * @throws IOException if something went wrong
     */
    private static void analyzeTTF(String ttfFilename) throws IOException
    {
        TTFParser ttfParser = new TTFParser(false,true);
        TrueTypeFont ttfFont = ttfParser.parseTTF(ttfFilename);
        if (ttfFont != null)
        {
            NamingTable namingTable = ttfFont.getNaming();
            if (namingTable != null && namingTable.getPSName() != null)
            {
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

            InputStream fontStream = ResourceLoader.loadResource(ttffontname);
            if (fontStream == null)
            {
                throw new IOException("Can't load external font: " + ttffontname);
            }
            ttfFont = ttfParser.parseTTF(fontStream);
        }
        return ttfFont;
    }
}
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

            throws IOException, SAXException, TikaException {
        TrueTypeFont font;
        TTFParser parser = new TTFParser();
        TikaInputStream tis = TikaInputStream.cast(stream);
        if (tis != null && tis.hasFile()) {
            font = parser.parseTTF(tis.getFile());
        } else {
            font = parser.parseTTF(stream);
        }

        metadata.set(Metadata.CONTENT_TYPE, TYPE.toString());
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

        TTFParser parser = new TTFParser();
        TikaInputStream tis = TikaInputStream.cast(stream);
        if (tis != null && tis.hasFile()) {
            font = parser.parseTTF(tis.getFile());
        } else {
            font = parser.parseTTF(stream);
        }

        metadata.set(Metadata.CONTENT_TYPE, TYPE.toString());
        metadata.set(DublinCore.DATE, font.getHeader().getCreated().getTime());
        metadata.set(
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

    {
        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( ttfData );
            NamingTable naming = ttf.getNaming();
            List records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = (NameRecord)records.get( i );
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

                    InputStream fontStream = ResourceLoader.loadResource( fontResource );
                    if( fontStream == null )
                    {
                        throw new IOException( "Error missing font resource '" + externalFonts.get(baseFont) + "'" );
                    }
                    retval = ttfParser.parseTTF( fontStream );
                    loadedExternalFonts.put( baseFont, retval );
                }
            }
        }
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

        retval.setEncoding( new WinAnsiEncoding() );
        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( file );
            NamingTable naming = ttf.getNaming();
            List records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = (NameRecord)records.get( i );
View Full Code Here

Examples of org.apache.fontbox.ttf.TTFParser.parseTTF()

                    InputStream fontStream = ResourceLoader.loadResource( fontResource );
                    if( fontStream == null )
                    {
                        throw new IOException( "Error missing font resource '" + externalFonts.get(baseFont) + "'" );
                    }
                    retval = ttfParser.parseTTF( fontStream );
                    loadedExternalFonts.put( baseFont, retval );
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.