----- Original Message ----- 
From: "David Thielen" <[EMAIL PROTECTED]>
To: "itext" <[EMAIL PROTECTED]>
Sent: Sunday, September 12, 2004 17:01
Subject: [iText-questions] FontFactory.getFont("Times", ...) needs codepage


> Hi;
>
>
>
> This code throws an exception:
>
> Font font = FontFactory.getFont("Times", BaseFont.IDENTITY_H, true, 24.0,
> 2);
>

Built-in fonts can't have Identity-H. That only works for TTF or OTF.

>
>
> This code gives me a font that is "Times-Italic":
>
> Font font = FontFactory.getFont("Times", "Cp1252", true, 24.0, 2);
>

Isn't that a surprise... If you had bothered to see the javadocs for
getFont(String fontname, String encoding, boolean embedded, float size, int
style)

you'd noticed that the last parameter is the style and that the number 2 is,
surprise, Font.ITALIC. You can't throw numbers and expect nothing to happen.

Best Regards,
Paulo Soares



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to