danfickle / danfickle/openhtmltopdf

Bangla font not getting properly

Open
#884 0 comments 0 reactions 0 assignees View on GitHub
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.

1

2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.