theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
110 stars 8 forks source link

Missing some unicode characters in generated PDFs #4066

Closed pbradaric closed 2 years ago

pbradaric commented 2 years ago

What happened?

Personalized PDFs are not showing unicode characters (i.e. č, ć, š, ž).

Screenshot_966 Screenshot_967

What you expected:

Letters č, ć, š, ž and special characters from other languages should be displayed.

Example:

https://www.thecrag.com/en/climbing/serbia/area/3809179194

Click on "Downloads" button, then click on "Custom PDF".

pbradaric commented 2 years ago

I've examined generated PDF and here are some findings. It looks like generated PDF is using NotoSansCJKTC Regular (and bold) font - this one https://github.com/indigofeather/fonts/blob/master/NotoSansCJKtc-Regular.ttf.

However, this font seems to be missing various European characters. The following languages have the following characters missing:

Besides these languages, I've also tested German, Spanish, Bulgarian and Russian alphabets - they all seem to be working fine.

Regular Noto Sans font (https://fonts.google.com/noto/specimen/Noto+Sans) has all of the European characters. It seems that including this font family in a comma separated list is the way to go (solution reference: https://stackoverflow.com/questions/35101439/displaying-unicode-characters-in-pdf-produced-by-apache-fop).

Thoughts?

rouletout commented 2 years ago

Same issue as https://github.com/theCrag/website/issues/3362 - closing here and linking back to 3362 as it is well described here.