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"
_________________________________________________________________
View photos of singles in your area Click Here
http://clk.atdmt.com/NMN/go/150855801/direct/01/------------------------------------------------------------------------------
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/