We are using iText to generate PDFs and we already had printing capability
through the Java 1.2 printer 
interfaces, so at the moment I am using iText's createGraphics to get a
Graphics2D which our application can paint to in order to create the PDF. 

Our application is fully Unicode enabled and it can contain text in multiple
fonts and with any Unicode 
characters.  I am trying to figure out what the best way to handle font
encodings so that I can always get iText to embed the right font information
into the PDF. 

Based on what I turned up in the book, mailing list archives, and the
website tutorials, right now I am creating a DefaultFontMapper and going 
through and setting the encoding member for all of the 
BaseFontParameters in the map to the special IDENTITY_H encoding.  but the
text in the PDF is stored as Unicode, making the PDF bigger than necessary

Would you suggest a better way to handle the font encoding with iText? I
wouldn't be embedding fonts as Unicode that were only used to print ANSI
characters. 


Thanks 
Dorairaj 



1T3XT info wrote:
> 
> dorairaj wrote:
>> 
>> Hi Thanks Again,
>> 
>> I did same what you said in the TextExample3 by selecting Attributed
>> string.
>> and FontMapper.awtToPdf() works greate in selecting preferred Font object
>> but the problem is change the encoding type dynamically. 
>> In my example i have both English and chinese characters. For english
>> characters i need to set encoding as WINANSI and for chinese characters i
>> need to specify the encoding as Identity-H, as WINANSI will not support
>> chinese characters it displays blank in doing so, 
> 
> Of course you need to specify the encoding as Identity-H.
> That's exactly what is shown in the examples!
> For instance:
> http://itextpdf.com/examples/index.php?page=example&id=252
> 
> DefaultFontMapper mapper = new DefaultFontMapper();
> BaseFontParameters parameters
>    = new BaseFontParameters("c:/windows/fonts/msgothic.ttc,1");
> parameters.encoding = BaseFont.IDENTITY_H;
> mapper.putName("MS PGothic", parameters );
> 
> Should I take the examples offline?
> Seems like nobody is reading them anyway...
> -- 
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
> 
> 

-- 
View this message in context: 
http://old.nabble.com/how-to-choose-unicode-support-Font-from-java.awt.Font-to-com.itextpdf.text.pdf.BaseFont-tp28092144p28137292.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to