Abhishek Vaidya wrote:
> Hi,
> 
>     I am using cold fusion for web capture (converting websites to PDF).
> It uses Ice Browser to capture the web page as a java.awt panel which is
> converted to PDF using itext. Our product is supported on windows and
> unixes. On windows the code is working fine and displaying the Japanese
> characters for websites (I tried http://www.google.co.jp
> <http://www.google.co.jp/> ). Earlier I was facing problem on windows
> about Japanese fonts not appearing in the PDF created using itext.
> Then I figured out that the font Arial Unicode MS (true type) is requited
> under c:\windows\fonts (or other Unicode fonts would even do. They were
> somehow missing on my machine). When I added this font everything is
working
> fine. But when I run the same code on linux red hat the Japanese characters
> are not appearing. The itext.jar contains a class FontFactory which has a
> method registerDirectories() which registers a few directories containing
> fonts with itext for windows and unixes.
> 
>  
> 
> 1)I added the Arial Unicode MS (true type) (from windows) to a couple of
> directories which are used in this method (like
/usr/X11R6/lib/X11/fonts/TTF
> and /usr/X11R6/lib/X11/fonts/truetype) but itext did not pick up the
fonts.

I don't know which version of the code you are running, but the current
CVS code of registerDirectories() looks like this

    /** Register fonts in some probable directories. It usually works in
Windows,
     * Linux and Solaris.
     * @return the number of fonts registered
     */
    public int registerDirectories() {
        int count = 0;
        count += registerDirectory("c:/windows/fonts");
        count += registerDirectory("c:/winnt/fonts");
        count += registerDirectory("d:/windows/fonts");
        count += registerDirectory("d:/winnt/fonts");
        count += registerDirectory("/usr/X/lib/X11/fonts/TrueType");
        count += registerDirectory("/usr/openwin/lib/X11/fonts/TrueType");
        count += registerDirectory("/usr/share/fonts/default/TrueType");
        count += registerDirectory("/usr/X11R6/lib/X11/fonts/ttf");
        count += registerDirectory("/Library/Fonts");
        count += registerDirectory("/System/Library/Fonts");
        return count;
    }


Note that /usr/X/lib/X11/fonts/TrueType will generally require a link
from /usr/X11R6 to /usr/X. In my experience, the link, when it is
present, is from /usr/X11R6 to /usr/X11, but I don't know what Solaris,
for example, does. These directories won't work for me (SuSE 10.2), but
you can always use

    /** Register all the fonts in a directory.
     * @param dir the directory
     * @return the number of fonts registered
     */
    public int registerDirectory(String dir)

Have you tried it?


Peter
-- 
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to