vandeseer / easytable

Small table drawing library built upon Apache PDFBox
MIT License
246 stars 94 forks source link

Exception when CellText Font is Symbol Font #38

Closed ghost closed 5 years ago

ghost commented 5 years ago

I tried to set the text of CellText as uppercase sigma character. In order to do this I used the code below

CellText sigmaCell = CellText.builder()
                .text("S")
                .borderWidth(1F)
                .font(PDType1Font.SYMBOL)
                .build();

It gives the following error java.lang.IllegalArgumentException: U+2013 ('endash') is not available in this font Symbol encoding: SymbolEncoding

Thanks

vandeseer commented 5 years ago

Hi @feyzaeksen,

this is not an issue of easytable but a problem with the font. You will run into this issue as well if you only use PDFBox. I created a gist to illustrate the problem: https://gist.github.com/vandeseer/46271f3e103e336b609edca4234dd4af

Here you will run into the same issue not using easytable at all.

Also have a look here:

Hence I will close this issue.

Best, Stefan

Adriansun commented 3 years ago

Can we talk a bit more about this, please?

I have looked through your links and others issues that are similar to the font problem. I do not know what to say. Are we saying that we can only make PDFs with 'English' characters and people in Asia cannot make any PDFs at all? It does look in one link you provided that one can load some other font that might have the support for non English characters. I believe we need to work together with this problem. Kind of scary that we cannot use eg Greek characters. Any idea of what we can do?