Will FontFactory.contains() or FontFactory.isRegistered() tell me if I can
get an IDENTITY_H font for that font?

Or should I call getFont() with the code page first and if it returns a
TrueTypeFont then try to get an IDENTITY_H font?

Thanks - dave


-----Original Message-----
From: David Thielen [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 12, 2004 10:52 AM
To: 'Paulo Soares'
Cc: 'itext'
Subject: RE: [iText-questions] FontFactory.getFont("Times", ...) needs
codepage

The italic part didn't surprise me - just that the getFont(... IDENTITY_H
...) didn't work.

Is there a fast way to determine if for a font name I can get an IDENTITY_H
font? What's hurting me is that it is a lot of processing time for it to
throw the exception on the getFont() call when it can't map it.

Also, can't it map Times to Times New Roman to get a TTF font in this case?

Thanks - dave


-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 12, 2004 10:27 AM
To: David Thielen; itext
Subject: Re: [iText-questions] FontFactory.getFont("Times", ...) needs
codepage


----- 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