Package io.keikai.doc.io.schema.pdf
Class PDFFont
- java.lang.Object
-
- io.keikai.doc.io.schema.pdf.PDFFont
-
public class PDFFont extends java.lang.ObjectA class to handle font for PDF generation.It provides default font mapping for standard 14 fonts and additional fonts, and load custom fonts from a configuration json format file.
- Author:
- Jamson Chan
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.pdfbox.pdmodel.font.PDFontgetFont(java.lang.String fontName, char c, boolean bold, boolean italic)Returns thePDFontof the specified font name, character, bold and italic state, if the font name is not found or the character is not supported, it will keep searching the supported font in all fonts, if still not found, it will return the default font.
-
-
-
Constructor Detail
-
PDFFont
public PDFFont(org.apache.pdfbox.pdmodel.PDDocument document)
Create a newPDFFontfor the specifiedPDDocument.- Parameters:
document- thePDDocument
-
-
Method Detail
-
getFont
public org.apache.pdfbox.pdmodel.font.PDFont getFont(java.lang.String fontName, char c, boolean bold, boolean italic)Returns thePDFontof the specified font name, character, bold and italic state, if the font name is not found or the character is not supported, it will keep searching the supported font in all fonts, if still not found, it will return the default font.- Parameters:
fontName- the font namec- the characterbold- whether the font is bolditalic- whether the font is italic- Returns:
- the
PDFontof the specified font name, character, bold and italic state
-
-