Package org.docx4j.fonts.fop.fonts.autodetect

Examples of org.docx4j.fonts.fop.fonts.autodetect.FontFileFinder


    // Currently we use FOP - inspired by org.apache.fop.render.PrintRendererConfigurator
    // iText also has a font discoverer (which we could use
    // instead, but don't, since in docx4j we're settled on
    // PDF output via XSL FO)   
   
        FontFileFinder fontFileFinder = new FontFileFinder();
       
        // Automagically finds a list of font files on local system
        // based on os.name
        List fontFileList = fontFileFinder.find();     
       
       
        if (regex==null) {
            for (Iterator iter = fontFileList.iterator(); iter.hasNext();) {
             
              URL fontUrl = getURL(iter.next());
               
                // parse font to ascertain font info
              addPhysicalFont( fontUrl);
            }
        } else {
          Pattern pattern = Pattern.compile(regex);
            for (Iterator iter = fontFileList.iterator(); iter.hasNext();) {
             
              URL fontUrl = getURL(iter.next());
               
             
                // parse font to ascertain font info
              if (pattern.matcher(fontUrl.toString()).matches()){
                addPhysicalFont( fontUrl);           
              } else {
//                  log.debug("Ignoring " + fontUrl.toString() );

              }
            }
        }
       

        // Add fonts from our Temporary Embedded Fonts dir
        fontFileList = fontFileFinder.find( ObfuscatedFontPart.getTemporaryEmbeddedFontsDir() );
        for (Iterator iter = fontFileList.iterator(); iter.hasNext();) {
            URL fontUrl = getURL(iter.next());
            addPhysicalFont( fontUrl);
        }
       
View Full Code Here

TOP

Related Classes of org.docx4j.fonts.fop.fonts.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.