List of usage examples for com.lowagie.text FontFactory getFontImp
public static FontFactoryImp getFontImp()
From source file:com.amphisoft.epub2pdf.content.TextFactory.java
License:Open Source License
public static void main(String[] args) { FontFactoryImp fontFI = FontFactory.getFontImp(); System.out.println("\nFAMILIES"); Set<Object> famsRaw = fontFI.getRegisteredFamilies(); Set<String> fams = new TreeSet<String>(); for (Object s : famsRaw) { fams.add(s.toString());// w ww.j a v a 2 s . c om } for (String s : fams) { System.out.println(s); } System.out.println("\nFONTS"); Set<Object> fontsRaw = fontFI.getRegisteredFonts(); Set<String> fonts = new TreeSet<String>(); for (Object s : fontsRaw) { fonts.add(s.toString()); } for (String s : fonts) { System.out.println(s); } TextFactory pF = new TextFactory(); Paragraph para = pF.newParagraph(); System.out.println(para.getFont().getFamilyname()); }
From source file:org.eclipse.birt.report.engine.emitter.postscript.PostscriptWriter.java
License:Open Source License
private String getFontPath(String fontName) { try {//from w w w.j a va2s . c o m FontFactoryImp fontImpl = FontFactory.getFontImp(); Properties trueTypeFonts = (Properties) getField(FontFactoryImp.class, "trueTypeFonts", fontImpl); String fontPath = trueTypeFonts.getProperty(fontName.toLowerCase()); return fontPath; } catch (IllegalAccessException e) { log.log(Level.WARNING, "font path: " + fontName); } catch (NoSuchFieldException e) { log.log(Level.WARNING, "font path: " + fontName); } return null; }