/** * Automagically finds a list of font files on local system. * * @return List<URI> of font files */ public List<URI> find() { if (fontDirFinder == null) { fontDirFinder = determineDirFinder(); } List<File> fontDirs = fontDirFinder.find(); List<URI> results = new java.util.ArrayList<>(); for (File dir : fontDirs) { walk(dir, results); } return results; }
private FontDirFinder determineDirFinder() { final String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { return new WindowsFontDirFinder(); } else if (osName.startsWith("Mac")) { return new MacFontDirFinder(); } else if (osName.startsWith("OS/400")) { return new OS400FontDirFinder(); } else { return new UnixFontDirFinder(); } }
/** * Searches a given directory for font files. * * @param dir directory to search * @return list<URI> of font files */ public List<URI> find(String dir) { List<URI> results = new java.util.ArrayList<>(); File directory = new File(dir); if (directory.isDirectory()) { walk(directory, results); } return results; }
private FontDirFinder determineDirFinder() { final String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { return new WindowsFontDirFinder(); } else { if (osName.startsWith("Mac")) { return new MacFontDirFinder(); } else { return new UnixFontDirFinder(); } } }
walk(file, results); if (checkFontfile(file))
FontFileFinder fontFileFinder = new FontFileFinder(); List<URI> fonts = fontFileFinder.find(); for (URI font : fonts)
String[] searchableDirectories = getSearchableDirectories(); if (searchableDirectories != null)
windir = getWinDir(osName);
/** * Automagically finds a list of font files on local system. * * @return List<URI> of font files */ public List<URI> find() { if (fontDirFinder == null) { fontDirFinder = determineDirFinder(); } List<File> fontDirs = fontDirFinder.find(); List<URI> results = new java.util.ArrayList<URI>(); for (File dir : fontDirs) { walk(dir, results); } return results; }
private FontDirFinder determineDirFinder() { final String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { return new WindowsFontDirFinder(); } else if (osName.startsWith("Mac")) { return new MacFontDirFinder(); } else if (osName.startsWith("OS/400")) { return new OS400FontDirFinder(); } else { return new UnixFontDirFinder(); } }
walk(file, results); if (checkFontfile(file))
FontFileFinder fontFileFinder = new FontFileFinder(); List<URI> fonts = fontFileFinder.find(); for (URI font : fonts)
/** * Searches a given directory for font files. * * @param dir directory to search * @return list<URI> of font files */ public List<URI> find(String dir) { List<URI> results = new java.util.ArrayList<URI>(); File directory = new File(dir); if (directory.isDirectory()) { walk(directory, results); } return results; }
/** * Generic method used by Mac and Unix font finders. * * @return list of natively existing font directories {@inheritDoc} */ @Override public List<File> find() { List<File> fontDirList = new java.util.ArrayList<File>(); String[] searchableDirectories = getSearchableDirectories(); if (searchableDirectories != null) { for (String searchableDirectorie : searchableDirectories) { File fontDir = new File(searchableDirectorie); try { if (fontDir.exists() && fontDir.canRead()) { fontDirList.add(fontDir); } } catch (SecurityException e) { // should continue if this fails } } } return fontDirList; }
windir = getWinDir(osName);
/** * Automagically finds a list of font files on local system. * * @return List<URI> of font files */ public List<URI> find() { if (fontDirFinder == null) { fontDirFinder = determineDirFinder(); } List<File> fontDirs = fontDirFinder.find(); List<URI> results = new java.util.ArrayList<>(); for (File dir : fontDirs) { walk(dir, results); } return results; }
walk(file, results); if (checkFontfile(file))
FontFileFinder fontFileFinder = new FontFileFinder(); List<URI> fonts = fontFileFinder.find(); for (URI font : fonts)
/** * Searches a given directory for font files. * * @param dir directory to search * @return list<URI> of font files */ public List<URI> find(String dir) { List<URI> results = new java.util.ArrayList<>(); File directory = new File(dir); if (directory.isDirectory()) { walk(directory, results); } return results; }
/** * Generic method used by Mac and Unix font finders. * * @return list of natively existing font directories {@inheritDoc} */ @Override public List<File> find() { List<File> fontDirList = new java.util.ArrayList<>(); String[] searchableDirectories = getSearchableDirectories(); if (searchableDirectories != null) { for (String searchableDirectorie : searchableDirectories) { File fontDir = new File(searchableDirectorie); try { if (fontDir.exists() && fontDir.canRead()) { fontDirList.add(fontDir); } } catch (SecurityException e) { // should continue if this fails } } } return fontDirList; }