I'm trying to create a PDF on Android using Spire.PDF for Android via Java 4.1.0.
The problem I'm having is:
If I use
- Code: Select all
private static final PdfFontBase font = new PdfFont(PdfFontFamily.Helvetica, 10);
If I use
- Code: Select all
private static final PdfFontBase font = new PdfTrueTypeFont("Arial", 10);
Based on this SO-question/answer https://stackoverflow.com/questions/39535475/what-is-the-default-font-family-in-android I also tried
- Code: Select all
private static final PdfFontBase font = new PdfTrueTypeFont("sans-serif", 10);
- Code: Select all
private static final PdfFontBase font = new PdfTrueTypeFont("Roboto", 10);
PdfCjkStandardFonts work, but they don't look good for normal text.
So how can I display UTF-8 characters correctly?
And yes, I probably could bundle some font file with my app and embed this. But delivering fonts with your app is legally very complicated so I'd like to not do that.