Forum Documentation

How to show japanese text in pdf

adkumar
In our older prince paid version (Prince 6.0 rev 8 beta 1) we had below tffs/fonts in /usr/lib/prince/fonts and the same’s installation in /usr/lib/prince/style/fonts.css:

arialuni.ttf frutiger minynb__.ttf unisb___.ttf
deftone.ttf goodfisb.ttf minyni__.ttf unisi___.ttf
efflbi__.ttf goodfisc.ttf minyn___.ttf unispace.ttf
efflb___.ttf goodfish.ttf opens___.ttf webcore
effli___.ttf goodfisi.ttf osaka.unicode.ttf
efflores.ttf minynbi_.ttf unisbi__.ttf


and we are using osaka.unicode and frutiger fonts in our code and its working fine in older version.


In our other server we tried to use latest free Prince version (Prince 15.3) and there we donot see osaka.unicode Unicode / frutiger in /usr/lib/prince/fonts and only 1 font in the folder prince-fallback.ttf
Because of this in the pdf generation logs its showing ex:
font scan: frutiger lv roman, 0 matches
and its falling back to some default font , also the Japanese fonts are showing ex ? ⯑⯑⯑⯑⯑⯑⯑ in the pdf generated

I checked by doing fc-list ,the linux shows some default fonts like dejavu etc not osaka.unicode.ttf etc which will load the japanese fonts, also I observe in that existing older prince installation file prince-6.0r8-linux.tgz , these fonts are already in the tgz file in this path : lib/prince/fonts, so it should have came with old prince installation , in the new prince tar file in the same folder we have only that fallback font
mikeday
Prince has not shipped with its own font files for a long time (besides the default fallback font, which just contains a single glyph).

However, Prince can use the default system fonts automatically via Fontconfig; which Linux distribution are you running on and which Prince package have you installed?
adkumar
we are using Ubuntu 18.04.6 LTS and installed Prince 15.3 via deb file
mikeday
If you see a system font such as DejaVu Sans visible in fc-list, it should also work with Prince as well when you specify this font-family.

Do you know which Japanese fonts are installed on the system? By default Prince will try to use Kochi Mincho, IPAMincho, TakaoMincho, and Noto Serif CJK JP.