ralfstuckert / pdfbox-layout

MIT License
156 stars 74 forks source link

BaseFont is not extensible #53

Open literakl opened 6 years ago

literakl commented 6 years ago

Current implementation:

public enum BaseFont { Times(PDType1Font.TIMES_ROMAN, PDType1Font.TIMES_BOLD, PDType1Font.TIMES_ITALIC, PDType1Font.TIMES_BOLD_ITALIC);

This enum is widely used, e.g.

public void addMarkup(final String markup, final float fontSize, final BaseFont baseFont) throws IOException;

The trouble is that I have to use custom fonts. Default font does not have central european characters like žčřšúů. I loaded the font with:

PDType0Font.load(documentMock, inputStream, true);

but I cannot use it with pdfbox-layout. I propose to make it ordinary class with a public constructor.