ralfstuckert/pdfbox-layout

BaseFont is not extensible

Opened this issue · 0 comments

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.