Let's say you'll be using arial (any other font TT or T1 will also work).
 
BaseFont bf1 = BaseFont.createFont("c:\\windows\\fonts\\arial.ttf", BaseFont.WINANSI, true, false, null, null);
bf1.setPostscriptFontName("font1name");
// change the widths for bf1
BaseFont bf2 = BaseFont.createFont("c:\\windows\\fonts\\arial.ttf", BaseFont.WINANSI, true, false, null, null);
bf2.setPostscriptFontName("font2name");
// change the widths for bf2
 
Best Regards,
Paulo Soares


From: Hari Krishnan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 26, 2004 6:52 PM
To: Paulo Soares
Subject: RE: [iText-questions] Font display issue

Thanks for your response. I am sorry for the late response but how would I be able to embed the font and change it's name. I am using The PdfContentByte setFontandSize method to set the fontand the beginText showText and endText methods to place text on the PDF. Any examples using this would be helpful. Once again thank you for your response.
-Hari


Paulo Soares <[EMAIL PROTECTED]> wrote:
It's a different problem here. All the fonts have the same name, let's
say Helvetica, but have different widths and that scrambles the viewer
that only looks at the font name. That said, you can't have the same
default font with different widths. To do what you want to do you'll
have to embed the font and change the name.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Leonard Rosenthol
> Sent: Thursday, May 20, 2004 8:35 AM
> To: Hari Krishnan; [EMAIL PROTECTED]
> Subject: Re: [iText-questions] Font display issue
>
> At 11:09 PM 5/19/2004, Hari Krishnan wrote:
> > I am creating a translator program that creates a pdf
> from different
> > formats
> >namely afp using iText using default fonts. To better match
> parameters of
> >font
> >widths. I override the font widths of helvetica to
> correspond to the font
> >width
> >that the afp document provides for it's custom font.
>
> Don't do that!! Doing so will create a PDF that
> will NOT display
> consistantly in all PDF viewers or print on PDF-capable RIPs.
>
> As documented in the PDF reference, the /Widths
> table MUST match
> the data in the font...
>
>
> Leonard
> --------------------------------------------------------------
> -------------
> Leonard Rosenthol
>
> Chief Technical Officer
> PDF Sages, Inc. 215-938-7080 (voice)
> 215-938-0880 (fax)
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market...
> Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

Reply via email to