Forum How do I...?

Display chinese and korean characters

MiroMichail
How can display chinese and korean characters in generated PDF? Now if i try add chinese and korean in text this characters replaced by ?? .
mikeday
You need to have Chinese and Korean fonts installed. Which operating system are you running Prince on?
MiroMichail
Debian and Mac os
mikeday
Prince will attempt to use these fonts on MacOS X:

- Chinese: LiSong Pro
- Korean: AppleMyungjo

And these fonts on Debian:

- Chinese: AR PL UMing CN or AR PL SungtiL GB
- Korean: UnBatang or Baekmuk Batang
MiroMichail
Also have a problem with:
Hindi
Gujarti
Japanese
Lao
mikeday
You need to install some fonts! :)

Although I'm not sure about Lao, that might require some special shaping behaviour we don't support yet.
MiroMichail
Can you check about Lao support? We are very need this functionality :)
MiroMichail
Also we have a problem with Urdu, some characters remove to ??
MiroMichail
Maybe you have opportunity to add users fonts?
MiroMichail
Also Traditional Chinese

注意:如果?使用繁體中文,?可以免費獲得語言援助服務。請致電

注意:如果您使用繁體中文,您可以免費獲得語言援助服務。請致電

Edited by MiroMichail

IvanNikiforov
I also have problems with the display of lao characters in pdf

source file lao.txt is just one line:
ການທົດສອບລາວ

resulting lao.pdf contains
????????????

$ prince lao.txt --debug --verbose
prince: debug: init locking for OpenSSL
prince: debug: loading license: /usr/lib/prince/license/license.dat
prince: loading document: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: type: no
prince: Loading document...
prince: debug: starting prefetch threads
prince: loading HTML5 input: lao.txt
prince: loading document: lao.txt
prince: debug: loaded resource: lao.txt
prince: debug: loaded resource: type: no
prince: debug: loaded document: lao.txt
prince: debug: sniffed doctype: XHTML
prince: Applying style sheets...
prince: loading style sheet: /usr/lib/prince/style/common.css
prince: debug: loaded resource: /usr/lib/prince/style/common.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/html.css
prince: debug: loaded resource: /usr/lib/prince/style/html.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: type: no
prince: Preparing document...
prince: debug: stopping prefetch threads
prince: Converting document...
prince: debug: pack
prince: debug: font request: serif
prince: debug: font scan: Liberation Serif
prince: debug: font scan: Liberation Serif, 4 matches
prince: page 1: warning: no font for Lao character U+0E81, fallback to '?'
prince: used font: Liberation Serif, Regular
prince: page 1: warning: no font for Lao character U+0EB2, fallback to '?'
prince: page 1: warning: no font for Lao character U+0E99, fallback to '?'
prince: page 1: warning: no font for Lao character U+0E97, fallback to '?'
prince: page 1: warning: no font for Lao character U+0EBB, fallback to '?'
prince: page 1: warning: no font for Lao character U+0E94, fallback to '?'
prince: page 1: warning: no font for Lao character U+0EAA, fallback to '?'
prince: page 1: warning: no font for Lao character U+0EAD, fallback to '?'
prince: page 1: warning: no font for Lao character U+0E9A, fallback to '?'
prince: page 1: warning: no font for Lao character U+0EA5, fallback to '?'
prince: page 1: warning: no font for Lao character U+0EA7, fallback to '?'
prince: debug: writing PDF to file: lao.pdf
prince: Finished: success

My fonts.css is

@font-face {
font-family: serif;
src: local("Liberation Serif");
/* unicode-range: U+0E80-0EFF; */
}

@font-face {
font-family: sans-serif;
src: local("Liberation Sans");
/* unicode-range: U+0E80-0EFF; */
}

Prince version 11.1 on ubuntu 14.04 64bit

Seems like "Liberation Serif, Regular" font is used. I am sure that the font contains the necessary Lao glyphs. Why i'm getting " warning: no font"? What the difference between "warning: no font" and "warning: no glyphs"? Can i fix Lao characters someway (configuration files, add fonts etc.) or Lao unicode range is just blocked?

mikeday
I don't think this font contains glyphs for Lao, you will need to install a specific Lao font.
IvanNikiforov
Thank you for the helpful advice! There is fonts-lao package for ubuntu containing a font named Phetsarath OT. I added such lines to my fonts.css

@font-face {
font-family: serif;
src: local("Phetsarath OT");
unicode-range: U+0E80-0EFF;
}

@font-face {
font-family: sans-serif;
src: local("Phetsarath OT");
unicode-range: U+0E80-0EFF;
}

And now it works!
MiroMichail
We still have a problem with some characters

prince: page 1: warning: no font for Arabic character U+06E5, fallback to '?'
prince: page 1: warning: no font for Arabic character U+0681, fallback to '?'
prince: page 1: warning: no font for Arabic character U+0685, fallback to '?'
prince: page 1: warning: no font for Arabic character U+0689, fallback to '?'
prince: page 1: warning: no font for Arabic character U+0693, fallback to '?'
prince: page 1: warning: no font for Arabic character U+069A, fallback to '?'
prince: page 1: warning: no font for Spacing Modifier Letters character U+02BB, fallback to '?'
prince: page 1: warning: no font for Arabic character U+0696, fallback to '?'
prince: page 1: warning: no font for Arabic character U+06AB, fallback to '?'
prince: page 1: warning: no font for Arabic character U+06BC, fallback to '?'
prince: page 1: warning: no font for Arabic character U+06C0, fallback to '?'
prince: page 1: warning: no font for Arabic character U+06D0, fallback to '?'
prince: page 1: warning: no font for Arabic character U+06CD, fallback to '?'

Can you answer what fonts we need to add? We already try fonts-hosny-thabit
mikeday
The Amiri font has very complete support for Arabic including some of the more esoteric characters.
shuipin1980
Font support / compatibility has been an issue for many multi-language software products. It's usually not a big problem if you are running them on a PC as MS Windows tends to got all the languages supported in its installed systems (as a Chinese<>English translator, my desktop is running a Simplified Chinese one), but Debian and Mac OS become a different story.