Wrong charset with creating PDF report?!

We are using Piwik for several Japanese websites, hosted at our server.
If we create a PDF report all Japanese character are strange character (mojibake) and not readable, anymore.
If we create HTML report, there is no issue. All Japanese character will be displayed, correct

Any idea, how to fix it?

Thanks in advance

Maik

Thanks for the report. I asked the Japanese team to comment here. Otherwise, can you try to revert the patch: http://dev.piwik.org/trac/changeset/6701

Ie. change back from kozgopromedium to msungstdlight at line 92, does it work then?

Hello Matt,
thank you for your reply.
Cause of the patch, I noticed, if I use Japanese at the admin account and then download the repord PDF file, I can see most of the Japanese character, now. Only at the graphs, all Japanese character are still wrong.

I am running Piwik 1.8.4 and there the patch is already installed. At in Pdf.php at line ~90,
I already had the $reportFont = ‘kozgopromedium’;

Maybe there is a patch for that, too?

Maik

Hello. I am Takeshi Ueda of Japanese team.
Please let me ask you a few questions.

What version of Piwik are you using?
You mean every letter mojibake in the report?
Is the mojibake character in only the graph in the report?
Does the file “kozgopromedium.php” exist in /piwik/libs/tcpdf/fonts folder?

Could you send your generated PDF if you do not mind?

Takeshi Ueda

Tokyo, Japan

Hello Takeshi-san,

What version of Piwik are you using?

We are using Piwik 1.8.4

You mean every letter mojibake in the report?

Every Kanji, Hiragana, Katakana was mojibake. But after we changed the Piwik language from English to Japanese, the font issue for Japanese text at the report was solved. Now, only the graphs has all Japanese displayed as mojibake.

Is the mojibake character in only the graph in the report?

Now only at the graph report, yes.

Does the file “kozgopromedium.php” exist in /piwik/libs/tcpdf/fonts folder?

Yes, this file exist at our installation.

Could you send your generated PDF if you do not mind?

Sorry, I am not allowed to send your a report file. But I can send you screenshots of some files, if that helps?

Maik Heinelt

Nagoya

Thank you for your quick reply.
I understood all.
And I confirmed the same phenomenon by my local environment.
I think this is a bug of version 1.8.4.
I would create ticket about it after this.

Thanks,

Takeshi Ueda
Tokyo, Japan

Hello, Maik,

I found a solution to this problem.
Please open a file “/piwik/plugins/ImageGraph/API.php” and edit line 86 below.

const UNICODE_FONT = 'unifont.ttf';

Please rewrite the following.

const UNICODE_FONT = 'VL-Gothic-Regular.ttf';

That is all.

Thanks,

Takeshi Ueda

Ticket is tracked at: Japanese character are strange character (mojibake) at the graph in a PDF report · Issue #3434 · matomo-org/matomo · GitHub