About us | News | Contact
iText ® Licenses Support   
You are here: Home > Forums > iText in Action — Second Edition > Part 3: Essential iText skills > Chapter 11: Choose the right font
User login
  • Request new password

ligature implementation for Indian languages / Devanagari script

Submitted by dilipvshah on Sun, 04/03/2011 - 06:19

I have a web application where I need to generate PDF files on the Linux server. I need to support a few Indian languages along with English. I started by using Arial Unicode (ARIALUNI.TTF) and test pdf generation on my the application installed on my Windows machine. iText is generating pdf files with Gujarati fonts but doesn't seem to implement any ligature.

Does iText have ligature implementation for Indian languages such as Hindi, Gujarati, Marathi, etc?

Here is the part of the PDF generation code:
============================
// open the pdf document
Document document = new Document();

// get an instance of PdfWriter and in the process link it with the output file
PdfWriter.getInstance(document, new FileOutputStream(uniqueFilePath)); // uniqueFilePath defined earlier in the program

// open the document
document.open();

// specify the font location
String fontFile = "C:/WINDOWS/Fonts/ARIALUNI.TTF";

// create base font for the specified font
BaseFont baseFont = BaseFont.createFont(fontFile, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font(baseFont, 12);

document.add(new Paragraph(text, font)); // text in unicode defined earlier in the program
===============

Thanks in advance.

Dilip

‹ Can't get Japanese characters to display in a form How can I check if a specific character is supported in a font ›
  • Login to post comments

Please read p378-379

Submitted by Bruno Lowagie on Sun, 04/03/2011 - 09:32.

I quote: Some of the translations are rendered incorrectly because iText doesn’t have support for ligatures for Indic languages. Just as we have the ArabicLigaturizer, we need an IndicLigaturizer, but so far we haven’t found anyone who could write such a class for iText.

None of the current iText developers understand Hindi or any other Indic language, so it's very difficult for them (if not impossible) to write such an IndicLigaturizer. Although plenty of developers from India are using iText, none of them has contributed working code to make the ligatures. Which is a pity, because plenty of developers from India are asking for that functionality. It's also a paradox, because if that many developers from India need that functionality, why isn't there any developer in India that can write code to support Hindi, Gujarati, Marathi, etc?

I honestly don't understand.

  • Login to post comments
Content © 2010 1T3XT BVBA