Forum How do I...?

Confused about what I need to do to support languages - fonts!

wayne.rowley
Hi there,

We are developing a system with Prince XML that needs to support multiple global languages, including Chinese (Simplified & Traditional), Japanese, Korean as well as multiple EU languages.

We are looking to build the Prince service as a Container with Docker. To facilitate that, as a development environment I have an AlmaLinux installation running Prince XML 14.3.1. When I try to produce a Chinese document I get a lot of the following errors:

prince: page 1: warning: no font for CJK character U+4E0D, fallback to U+2BD1 ⯑
prince: page 1: warning: no font for CJK character U+53EF, fallback to U+2BD1 ⯑
prince: page 1: warning: no font for CJK character U+64A4, fallback to U+2BD1 ⯑
prince: page 1: warning: no font for CJK character U+6D88, fallback to U+2BD1 ⯑
prince: page 1: warning: no font for CJK character U+9000, fallback to U+2BD1 ⯑

I need to know what additional Linux font packages need to be installed alongside Prince and what I need to do to let Prince see them. This seems to be one are where sadly the otherwise excellent Prince XML documentation is lacking. A step-by-step how-to is what is needed.

I've seen a lot of references to different fonts - many of which Yum can't find when I try to install them. Is there a definitive list?

Any help would be appreciated - this must be fairly basic to a lot of use cases.

Thanks,
Wayne
wayne.rowley
I should also add that I did install the MS Core fonts, as I don't have this issue converting the HTML on Prince in Windows, but that did not solve the problem!
jpavel
Since AlmaLinux is based on RedHat, you can install the font packages listed on this page

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.3_release_notes/internationalization

depending on your needs.

I'm running Ubuntu, and with the various Noto Sans CJK packages, I have no trouble with coverage of Chinese.

Jesse
mikeday
We have some documentation of the generic font families here, although it needs to be updated:

https://www.princexml.com/doc/styling/#generic-font-families

The Red Hat page posted above should be helpful, please let me know if there are any scripts or languages that aren't working.
vimalvimal
Hi Friends,

I am using alpine version in docker to run Prince, but I am still getting

prince: page 2: warning: no font for CJK character U+5C71, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+99AC, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+9A6C, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+6C34, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+76EE, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+9CE5, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+9E1F, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+672B, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+672C, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+4E0A, fallback to U+2BD1 ⯑
prince: page 2: warning: no font for CJK character U+5C0F, fallback to U+2BD1 ⯑

These issues, any workaround for this for alpine Linux in docker

Version used : https://www.princexml.com/download/prince-14.2-alpine3.13-x86_64.tar.gz

Any suggestion on its would be very helpful

Thanks
Vimal

mikeday
Can you install the Arphic Chinese fonts?
vimalvimal
Thank you @Mikeday, will check and let you know
vimalvimal
@Mikeday, I tried with Chinese fonts also (Noto Chinese fonts) but still this error coming, do you have any other suggestions? this is blocking our entire flow, Please help on this, Please let me know if you need any log or something
mikeday
Are the fonts showing up when you run "fc-list"? If Fontconfig is not installed or not working then it will be necessary to point Prince at the fonts manually, for example by running "prince --scanfonts /path/to/fonts/*.ttf" or similar to generate a CSS file containing @font-face rules that you can include.