This method will not work because FONT_TYPE_TTUNI only shows up after
setting the encoding, not before. The only safe way of doing it is to get
the codepages supported by the font and act based on them.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Vishal Jain [SMTP:[EMAIL PROTECTED]
> Sent: Friday, October 03, 2003 21:01
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] Setting
> DefaultFontMapper.BaseFontParameters.encoding
> 
> In my application, I am using multiple fonts representing symbols, Latin
> and non Latin characters. Fonts are MSMincho, Arial and Wingdings.
> 
> Thus, I need to set the encoding for some fonts to CP1252 eg Wingdings and
> the others to IDENTITY_H eg MSMincho.
> 
>                         
> 
>                 HashMap hmBaseFonts = defaultFontMapper.getMapper();
> 
>                 Iterator itr = hmBaseFonts.values().iterator();
> 
>                 Iterator itrKeys = hmBaseFonts.keySet().iterator();
> 
>       while (itr.hasNext())
> 
>         {
> 
>                       DefaultFontMapper.BaseFontParameters bf =
> (DefaultFontMapper.BaseFontParameters) itr.next();
> 
>                         String sFontName =  (String) itrKeys.next();
> 
>                         BaseFont baseF = defaultFontMapper.awtToPdf(new
> Font(sFontName, 1, 12));
> 
>                         
> 
>                         if(baseF.getFontType() != 3)
> 
>               {
> 
>                                 bf.encoding =
> com.lowagie.text.pdf.BaseFont.CP1252;
> 
>                         }
> 
>                         else
> 
>                         {
> 
>                         bf.encoding =
> com.lowagie.text.pdf.BaseFont.IDENTITY_H;
> 
>                       }
> 
>                 }
> 
> When I do this it is setting the encoding for all the fonts to CP1252,
> thus I do not see any non Latin characters in my pdf file but do see the
> Wingdings symbol.
> 
> Any feedback will be highly appreciated.
> 
> Regards,
> 
> Vishal Jain.
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to