@codecracker2014 thanks for this issue but what would you mean? Any particular issue? Code to reproduce it?
Current output:

Expected output:

This is due to glyph substitutions not done as per TTF file.
Below is link to typography specs:
https://docs.microsoft.com/en-us/typography/opentype/spec/gsub
Below is code for creating simple PDF using TTF font :
`
import com.lowagie.text.*;
import com.lowagie.text.pdf.PdfWriter;
import java.io.FileOutputStream;
import java.io.IOException;
/**
public static void main(String[] args) {
System.out.println("啶ㄠぎ啶膏啶む");
FontFactory.register("C:\\Windows\\Fonts\\NIRMALA.TTF");
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document,
new FileOutputStream("D:\\workspace\\TMP\\out\\HelloWorld.pdf"));
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Chunk(
"啶ㄠぎ啶膏啶む",
FontFactory.getFont("nirmala ui", "Identity-H",false,10,0,null)));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
}
}
`
Just like in iText 5, OpenPDF only has a limited support for advanced typography.
itext2 was used in more then 150 open source libraries, now these libraries can use OpenPDF. But all of them having this limitation. Itext was rewritten just add advanced typography, which is no longer compatible with other open source libraries. I'm working on improving OpenPDF to support advanced typography and got it working. I'll share pull request shortly.
Pull requested created- #329
Most helpful comment
itext2 was used in more then 150 open source libraries, now these libraries can use OpenPDF. But all of them having this limitation. Itext was rewritten just add advanced typography, which is no longer compatible with other open source libraries. I'm working on improving OpenPDF to support advanced typography and got it working. I'll share pull request shortly.