Package org.apache.fontbox.util.autodetect

Examples of org.apache.fontbox.util.autodetect.FontFileFinder


        {
            LOG.trace("Will search the local system for fonts");
        }

        int count = 0;
        FontFileFinder fontFileFinder = new FontFileFinder();
        List<URI> fonts = fontFileFinder.find();
        for (URI font : fonts)
        {
            count++;
            File fontFile = new File(font);
            try
View Full Code Here


     */
    private static void loadFonts()
    {
        try
        {
            FontFileFinder fontfinder = new FontFileFinder();
            List<URI> fonts = fontfinder.find();
            for (URI font : fonts)
            {
                try
                {
                    // the URL may contain some escaped characters like spaces
                    // use the URI to decode such escape sequences
                    String fontfilename = new File(font).getPath();
                    if (fontfilename.toLowerCase().endsWith(".ttf"))
                    {
                        analyzeTTF(fontfilename);
                    }
                    else
                    {
                        LOG.debug("Unsupported font format for external font: " + fontfilename);
                    }
                }
                catch (IOException exception)
                {
                    LOG.debug("Can't read external font: " + font.getPath(), exception);
                }
            }
            addFontMapping(fontfinder.getCommonTTFMapping(), fontMappingTTF);
            createFontmapping();
        }
        catch (IOException exception)
        {
            LOG.error("An error occured when collecting external fonts.", exception);
View Full Code Here

TOP

Related Classes of org.apache.fontbox.util.autodetect.FontFileFinder

Copyright © 2018 www.massapicom. 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.