Example usage for com.itextpdf.text.pdf BaseFont createFont

List of usage examples for com.itextpdf.text.pdf BaseFont createFont

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf BaseFont createFont.

Prototype

public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte ttfAfm[],
        byte pfb[]) throws DocumentException, IOException 

Source Link

Document

Creates a new font.

Usage

From source file:jdbreport.model.io.pdf.itext5.ReportFontMapper.java

License:Apache License

public BaseFont awtToPdf(String fontName) {
    try {//from w w  w .java2s .c  o  m
        BaseFontParameters p = getBaseFontParameters(fontName);
        if (p != null) {
            return BaseFont.createFont(p.fontName, BaseFont.IDENTITY_H, p.embedded, p.cached, p.ttfAfm, p.pfb);
        }
    } catch (DocumentException | IOException e) {
        throw new ExceptionConverter(e);
    }
    return null;
}