The font is not Unicode, it's Big5.

Paulo 

> -----Original Message-----
> From: Y Fang [mailto:[email protected]] 
> Sent: Wednesday, October 14, 2009 1:24 PM
> To: [email protected]
> Subject: Re: [iText-questions] Chinese fonts, and chinese 
> fonts with chinese names
> 
> I'm trying to write PDFs with Chinese fonts. It seems to work 
> fine with default windows fonts that support Chinese, and 
> also with Chinesefonts I download off the internet... except 
> for the ones that actually have Chinese names. 
> 
> Using a simple test:
> -----------
> BaseFont baseFont = 
> BaseFont.CreateFont(@"C:\WINDOWS\Fonts\msyh.TTF", 
> BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
> Font font = new Font(baseFont, 12, Font.NORMAL);
> document.Add(new Paragraph("Hello! 你好!", font));
> -----------
> msyh.ttf is "Microsoft YaHei", a font on Vista computers by 
> default. Both the english and chinese hello shows up. 
> 
> I then downloaded the first font from this website: 
> http://www.sinosplice.com/chinese/fonts/ 
> The font name is "STXinwei" and the file is 
> C:\WINDOWS\Fonts\STXINWEI.TTF
> Once again works fine. 
> 
> I then downloaded the first font from this website: 
> http://www.chinese-tools.com/resources/free-chinese-fonts.html
> The font name is "汉鼎繁古印" and the file is C:\WINDOWS\Fonts\HDZB_5.TTF
> The program produces a blank PDF, even the english characters 
> do not show up. 
> 
> I've tried it with various downloaded fonts. It seems if the 
> font name (the one that actually shows up if you go to 
> C:\Windows\Fonts in windows explorer, or select it from the 
> font list in say...Microsoft Word program) is not in english 
> (even though the file name is in english characters)... the 
> font simply will not work. 
> 
> Is this supposed to happen? Is it a problem/limitation with 
> iTextSharp, something I'm doing wrong, or actually an issue 
> with these fonts I'm downloading?
> 
> I don't know if this is related, but I also notice the fonts 
> with chinese names have funny postscript names. 
> 
> According to "baseFont.PostscriptFontName", the postscript 
> name for HDZB_5.TTF is "By JOSSQ-DMF in BeiJing"  


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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