Example usage for com.lowagie.text FontFactoryImp getRegisteredFamilies

List of usage examples for com.lowagie.text FontFactoryImp getRegisteredFamilies

Introduction

In this page you can find the example usage for com.lowagie.text FontFactoryImp getRegisteredFamilies.

Prototype


public Set getRegisteredFamilies() 

Source Link

Document

Gets a set of registered fontnames.

Usage

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());//from  w w w.  java2  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());
}