Forum How do I...?

Chinese problem

Anonymous
Can Prince convert Chinese? I try to do but only get "??". The XML document is UTF-8 and I try to set other font, but it does not work....
mikeday
Hi hower,

Prince 5.0 supports arbitrary UNICODE characters and should correctly handle Chinese characters if a font for Chinese characters has been selected. If you are seeing many ??? in the output it indicates that Prince cannot find the Chinese characters that you are using in any of the fonts that you have selected.

If you are on Windows, try using the "MingLiU" font, like this:
body { font-family: MingLiU }

If you are on Linux, try using the "AR PL KaitiM Big5" font or one of the other Chinese fonts from the Arphic fonts packages.

In both cases, you might need to check to ensure that the appropriate fonts are really installed.

(I'm afraid that I don't know what is a good Chinese font on MacOS X, but some quick exploration with the Font Panel should answer that question).

Best regards,

Michael
Anonymous
Not work. Get ??????? again. :(
I try to set font url but still not work.

I am on windows XP and my test file is http://ihower.idv.tw/prince.html
mikeday
That is strange, perhaps the font has a different name on your system.

Would you be able to take a look in the \Windows\Fonts folder and see whether you have the MingLiU font installed, or if there is some other Chinese font installed?

Perhaps it would also help to try choosing a font from within a program like Microsoft Word and seeing which Chinese fonts are available there.

I assume that you do have some Chinese fonts installed on your computer, and that you can view Chinese HTML files in your web browser with all the correct characters. If that is the case, then it should just be a matter of finding which is the correct font name to use.

Ideally we could try to autodetect appropriate Chinese fonts in a future release of Prince, so that it will avoid printing ??? by default, even if no font is specified.

Thanks for your patience, I'm sure that we can solve this issue! :)
mikeday
By the way, it might also be worth trying the "MS Song" and "MS Hei" font families, as described in this handy page:

http://www.yellowbridge.com/language/fonts.html

Cheers,

Michael
Anonymous
Yes, I hava mingliu font in my \Windows\Fonts,
and of course i can see in my web browser.

By the way,we use Traditional Chinese (Taiwan).
Thank you for your help.
mikeday
It seems that Prince is having trouble loading the MingLiU font on Windows XP for some reason, and giving a rather uninformative error message: "unknown file format".

This could be due to the fact that the MingLiU font is in a TrueType Collection (.ttc file) rather than just a straight TrueType font (.ttf file).

Anyway, since Prince seems to have no trouble with the same font on Linux, it must be some aspect of the Windows font subsystem that we are not handling correctly.

I shall investigate the issue and attempt to resolve it for the next release of Prince. In the meantime the only workaround I can suggest would be to try using a different font and see if that helps.

Sorry for the inconvenience. :cry:
Ben
I had a similar problem, and could not find the right font set (even though in the Word document I was using, it said that the font type was Hei). I tried all sorts of font sets. Currently, I just jampak the unicode into the document like such:

lang
{
font-family:"Arial Unicode MS";
}

Makes your pdf rather large, but it worked for me (as a temporary fix). Then anywhere I use a font-set that isn't latin-based, I just use a <lang> tag.
Anonymous
I can work with the font "Arial Unicode MS"
This font is from Microsoft Office http://support.microsoft.com/kb/q287247/
So,maybe the key point is file format (ttc?ttf?).

Besides, my font name (!= file name) in my windows is Chinese, not mingliu ( file name is mingliu.ttc ) . maybe prince can not load properly.
Anonymous
mikeday wrote:
It seems that Prince is having trouble loading the MingLiU font on Windows XP for some reason, and giving a rather uninformative error message: "unknown file format".

This could be due to the fact that the MingLiU font is in a TrueType Collection (.ttc file) rather than just a straight TrueType font (.ttf file).


Either that or Prince has a trouble with non-ASCII font name. If your default locale on Windows XP is Traditional Chinese, TC fonts are presented to applications as Chinese names (if they have TC names). The same is true of Simplified Chinese, Japanese and Korean.

I had the same problem with Korean fonts wrapped in a truetype collection with the default locale set to Korean. I specified both Korean and English names for Korean fonts.

However, it seems like the problem lies in Prince' handling of TTC because you apparently had the problem even on Windows XP with the default locale set to English. You may try to disassemble the TTC in question into TTFs and see what happens.

Anyway, good to know that it works on Linux. I thought it would work better on Windows and only tried on Linux, but now that I know the opposite is the case, I'll try it on Linux.
MilchFlasche
Anonymous wrote:
Either that or Prince has a trouble with non-ASCII font name. If your default locale on Windows XP is Traditional Chinese, TC fonts are presented to applications as Chinese names (if they have TC names). The same is true of Simplified Chinese, Japanese and Korean.

I had the same problem with Korean fonts wrapped in a truetype collection with the default locale set to Korean. I specified both Korean and English names for Korean fonts.

However, it seems like the problem lies in Prince' handling of TTC because you apparently had the problem even on Windows XP with the default locale set to English. You may try to disassemble the TTC in question into TTFs and see what happens.

Anyway, good to know that it works on Linux. I thought it would work better on Windows and only tried on Linux, but now that I know the opposite is the case, I'll try it on Linux.
Hope these two problems can be fixed eventually:)
mikeday
We're working on it! :D

The problem only affects Prince when running on Windows and using TTC fonts; the same fonts work fine on Linux, and using TTF fonts also works fine on all platforms.
mikeday
It took a while but we got there eventually: the new beta version of Prince 7.0 supports TrueType Collection fonts properly on all platforms.