danfickle / danfickle/openhtmltopdf
Bangla font not getting properly
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 423
- PR merge metrics
- No merged PRs in 30d
Description
First I can't add font by
builder.useFont(new File("D:\\Project\\xx\\xx\\xx\\src\\main\\resources\\fonts\\NikoshBAN.ttf"),"NikoshBAN",13, PdfRendererBuilder.FontStyle.NORMAL,false);
Getting error "java.io.ioexception: this font does not permit subsetting"
After lot of brain storming- able to add font by
File f3 = new File("D:\\Project\\xx\\xx\\xx\\src\\main\\resources\\fonts\\NikoshBAN.ttf");
InputStream fontFile1Stream3 = new FileInputStream(f3);
PDDocument PDDoc3 = new PDDocument();
PDType0Font product_title_font3 = PDType0Font.load(PDDoc3, fontFile1Stream3, false);
builder.useFont(new PDFontSupplier(product_title_font), "NikoshBAN",1, PdfRendererBuilder.FontStyle.NORMAL,false);
Now the main problem arises font not showing correctly, attached 1st picture is expected, but i got like 2nd picture
Please help ASAP. Any help is appreciated.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.