I'm using itext for creating PDF file with Unicode encoding.
My workstation is Windows Vista, so I create fonts using this construction:

--------------------------
BaseFont arialUnicode =
BaseFont.createFont("C:\\Windows\\Fonts\\arialuni.ttf", BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
--------------------------

Then i moved to linux and therefore expirienced exception - can't find font

I searched API and docs and found FontFactory.registerDirectories()
After invocation of this method I'm printing out all registered fonts using
code (all next code snippets run under Windows Vista):

--------------------------
Set fonts = FontFactory.getRegisteredFonts();
for (Object font : fonts) {
    System.out.println(font);
}
--------------------------

that prints a lot of font names, and also "arialunicodems" and "arial
unicode ms".

I then tried both of them to pass into BaseFont.createFont() using code:

--------------------------
BaseFont arialUnicode = BaseFont.createFont("arialunicodems",
BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
--------------------------

, but that code throws an exception:

--------------------------
Exception in thread "main" com.lowagie.text.DocumentException: Font
'arialunicodems' with 'Identity-H' is not recognized
--------------------------

Once generated on Linux, PDF file should open (and unicode text should not
be broken) on other Windows machines.
What am I doing wrong and how can I make the program to work on both Windows
and Linux? (suppose I can copy ARIALUNI.TTF on Linux)
-- 
View this message in context: 
http://www.nabble.com/%22Arial-Unicode-MS%22-and-FontFactory.registerDirectories%28%29-tp16677449p16677449.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to