Forum Bugs

Unable to display Japanese characters


We are running prince_8.1-4_ubuntu12.04_amd64.deb on Ubuntu 12.10 (with ttf-mscorefonts-installer package installed) with default fonts.css, but are unable to produce PDFs with Japanese fonts.

For example, HTML-input with
<span style="font-family: sans-serif;">公祐</span>

produces errors:
prince: warning: no glyphs for character U+516C, fallback to '?'
prince: warning: no glyphs for character U+7950, fallback to '?'

Any tips? Thanks!
You will need to install some Japanese fonts, as the Microsoft Core Fonts don't actually support Japanese. For example, the ttf-kochi-mincho and ttf-kochi-gothic packages. Due to an oversight it seems that we have not added these to the default font families, so you will need to add these rules to your style sheet, or directly to /usr/lib/prince/style/fonts.css:
@font-face {
    font-family: sans-serif;
    src: local("Kochi Gothic")

@font-face {
    font-family: serif;
    src: local("Kochi Mincho")

You will notice that the current fonts.css has rules providing default fonts for various scripts, including Chinese, but we seem to have missed the Japanese fonts; we will correct this in the next release of Prince.
Prince 9 is now available, and we have updated the default fonts.css with rules for Japanese fonts.