Problem/Motivation

Unifont fonts are not nice for japanese PDF generation.

Proposed resolution

I'd like to recommend alternative fonts for PDF file generation.
Takao Fonts( https://launchpad.net/takao-fonts ) are free open source fonts that are used in Ubuntu japanese distribution.
Those fonts are clear and the installation is easy because those have Debian package.

Package name is "fonts-takao", please try one of the following:
apt-get install fonts-takao
yum install fonts-takao

I like proportional font "TakaoPGothic" because it is more readable, but any font is OK.

Attach:
unifont.png: PDF screen capture using unifont.
TakaoPGothic.png: PDF screen capture using TakaoPGothic.

Remaining tasks

We have to modify the PDF generation program and pdf xsl file.

Comments

kabetani created an issue. See original summary.

jhodgdon’s picture

Great! I was wondering which font would be good for Japanese. I used Unifont because at least, though ugly, it had all the characters -- we needed a font that has both Japanese and Latin characters... It looks like that Takao font is a good one. See also #2887136-10: Font problems building PDF files for some languages.

Anyway, I will test it out and update the scripts. Thanks!

Tomotsugu Kaneko’s picture

I'd recommend [adobe-fonts/source-han-sans: Source Han Sans | 思源黑体 | 思源黑體 | 源ノ角ゴシック | 본고딕](https://github.com/adobe-fonts/source-han-sans)

kabetani’s picture

"Source Han Sans" is good because it covers Chinene,Korean,Japanese language, but it only has OpenType fonts.
In case of using that font, we have to convert that to a TrueType font.

Please see https://www.drupal.org/node/2887064#comment-12138393 .

jhodgdon’s picture

We were conversing with the developer of the PDF processor we are using on another issue (in the Apache project), and he said OpenType fonts should work. So, I will test out this font. It's possible that the other OpenType font I was trying to use had some other problem.

And we may be switching to a different method for making PDFs anyway, due to problems with Farsi (a right-to-left language).

I will probably not have time to test this out for a week or two, sorry! But I will get to it as soon as I can. Thanks for the input!

kabetani’s picture

Thank you for the information!

Japanese translation has just started and there is almost no committed work.
So please test it slowly when you have time.

jhodgdon’s picture

StatusFileSize
new6.2 MB

I don't think there is an Ubuntu package for the mentioned Adobe font, and as you said it is OpenType, which (in spite of what I said in an earlier comment) I am not convinced is working with our PDF generator. I am still having better luck with TrueType fonts.

So, I found an Ubuntu font package that covers CJK that seems to work OK for Japanese and Chinese -- it is called BabelStone Han. Here is the output. Can you take a look and see what you think? For the moment, I will commit this change to the User Guide repository, as it is definitely better than Unifont. If it is still not great for Japanese, I can install and switch to the Takao font for Japanese only (which I think doesn't cover Chinese). Please let me know what you think about this PDF.

jhodgdon’s picture

Status: Active » Needs review

  • jhodgdon committed 9660ebe on 8.x-3.x
    Issue #2895328 by kabetani, jhodgdon, Tomotsugu Kaneko: Better CJK fonts...
kabetani’s picture

StatusFileSize
new26.32 KB
new14.58 KB

Thank you for trying new font!

BabelStone Han is much better than Unifont.
But it is less beautiful because the baseline is not properly aligned. Please see the attached picture.

Sorry for troubling you, could you use Takao font for Japanese translation?

Best regards.

jhodgdon’s picture

StatusFileSize
new6.22 MB

Sure! Fewer fonts is easier to maintain, but if the Takao font is superior, that is OK. I've modified the scripts to use the Takao Proportional Gothic font... see what you think. I'll commit the changes...

  • jhodgdon committed fd40e96 on 8.x-3.x
    Issue #2895328 by kabetani, jhodgdon, Tomotsugu Kaneko: Alternative...
kabetani’s picture

Status: Needs review » Fixed

Great! It's perfect!

Thank you very much for your kind support.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.