Problem appears to be solved, by doing this:

    static Font getFont(String psFont)
    {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Font[] allFonts = env.getAllFonts();
        Font retFont = null;

        for (Font basefont : allFonts)
            if (basefont.getPSName().equals(psFont))
            {
                // This is an unstyled font with a PSname that doesn't
// reflect that. So generate the four types of styles, and
                // match PSnames.

                String name = basefont.getFamily();

                Font plain = new Font(name, Font.PLAIN, 1);
                Font italic = new Font(name, Font.ITALIC, 1);
                Font bold = new Font(name, Font.BOLD, 1);
Font bolditalic = new Font(name, Font.BOLD + Font.ITALIC, 1);

                if (psFont.equals(plain.getPSName()))
                    return plain;
                else if (psFont.equals(italic.getPSName()))
                    return italic;
                else if (psFont.equals(bold.getPSName()))
                    return bold;
                else if (psFont.equals(bolditalic.getPSName()))
                    return bolditalic;
            }

System.err.println("Warning: Font with postscript name " + psFont + " not found on this system!");
        return null;
    }

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to