Project

General

Profile

Actions

Defect #13781

closed

CJK(Chinese/Japanese/Korean) characters are not shown in PDF on non CJK locales

Added by Toru Haraguchi over 11 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
PDF export
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When exporting tickets list view to PDF in English personal preference, most of Japanese characters are not shown.
Attached is an example.

Because when in Japanese personal preference those letters are shown, so far no preblem. But this might be annoying for bilingual (or multilingual) people who prefer English controls of Redmine, but need reading his/her responsible issues written in Japanese.


Files

error_example2.pdf (278 KB) error_example2.pdf Toru Haraguchi, 2013-04-16 12:34
general_pdf_fontname_r13446.patch (22 KB) general_pdf_fontname_r13446.patch Jun NAITOH, 2014-10-15 16:39
pdf_font_name_r13446.patch (1.51 KB) pdf_font_name_r13446.patch Jun NAITOH, 2014-10-15 16:54

Related issues

Related to Redmine - Defect #10681: Export to Persian PDF problemClosed

Actions
Related to Redmine - Defect #13575: Graphic characters not exportedClosed

Actions
Related to Redmine - Feature #17570: use rbpdf gem instead of bundled rfpdfClosedToshi MARUYAMA

Actions
Related to Redmine - Defect #4787: Gannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ?ClosedToshi MARUYAMA2010-02-10

Actions
Has duplicate Redmine - Defect #14701: PDF Export EncodingClosed

Actions
Has duplicate Redmine - Defect #1249: 在生成PDF文件时,中文出现乱码ClosedChaoqun Zou2008-05-17

Actions
Has duplicate Redmine - Feature #19282: Export unicode error.Closed

Actions
Actions #1

Updated by Toshi MARUYAMA over 11 years ago

  • Priority changed from Normal to Low
Actions #2

Updated by Toshi MARUYAMA over 11 years ago

Because embedded FreeSans font does not have glyph.
See #61#note-92.

Actions #3

Updated by Toshi MARUYAMA over 11 years ago

  • Subject changed from Japanese characters are not shown in PDF exported ticket list when in English preference to CJK(Chinese/Japanese/Korean) characters are not shown in PDF exported ticket list when in English preference
Actions #4

Updated by Toshi MARUYAMA over 11 years ago

  • Subject changed from CJK(Chinese/Japanese/Korean) characters are not shown in PDF exported ticket list when in English preference to CJK(Chinese/Japanese/Korean) characters are not shown in PDF on non CJK locales
Actions #5

Updated by Filou Centrinov over 11 years ago

Related with #10681, #13575

In this and in the related issues the problem is that the included font file does not contain the appropriate glyph.
http://sourceforge.net/projects/tcpdf/files/ provides newer fonts files. The problem is the pdf size increases enormously (#13575).

Actions #6

Updated by Toshi MARUYAMA over 11 years ago

Actions #7

Updated by Toshi MARUYAMA about 11 years ago

  • Has duplicate Defect #1249: 在生成PDF文件时,中文出现乱码 added
Actions #8

Updated by Maxime Vez about 10 years ago

+1 same annoying problem here.

Recently Adobe and Google released an open-source CJK font : http://blog.typekit.com/2014/07/15/introducing-source-han-sans/

Maybe it can help in solving this issue.

Actions #9

Updated by Toshi MARUYAMA about 10 years ago

  • Related to Feature #17570: use rbpdf gem instead of bundled rfpdf added
Actions #10

Updated by Jun NAITOH about 10 years ago

I think that this problem is unsolvable even if it uses a Han Sans font.

It is because the language of a Chinese character is indistinguishable because of Han unification.

I think that fix of this problem requires a PDF font setting function.

Font Setting Plan (Example)

  1. Add PDF export options dialog. (like issues CSV export options dialog.)
  2. Add PDF font panel for personal account setting.
  3. Add PDF font panel for Administration settings.
  4. Add default PDF font setting in configuration.yml.
Actions #11

Updated by Toshi MARUYAMA about 10 years ago

  • Priority changed from Low to Normal
  • Target version set to 2.6.0

I think it is better in configuration.yml because of #4787 consistency.

Actions #12

Updated by Daniel Felix about 10 years ago

Well a user defined setting would be better, or?

A default in the configuration won't help on a multilingual environment. Like people have issues in korean and issues posted in german for example. I think this would collide and force the german output to break.

Actions #13

Updated by Jun NAITOH about 10 years ago

Daniel Felix wrote:

A default in the configuration won't help on a multilingual environment.
Like people have issues in korean and issues posted in german for example.
I think this would collide and force the german output to break.

Oh... It is important indication.

I consider whether there is any better solution...

Actions #14

Updated by Toshi MARUYAMA about 10 years ago

  • Related to Defect #4787: Gannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ? added
Actions #15

Updated by Jun NAITOH about 10 years ago

Maxime Vez wrote:

Recently Adobe and Google released an open-source CJK font : http://blog.typekit.com/2014/07/15/introducing-source-han-sans/

Maybe it can help in solving this issue.

I tried to use Adobe and Google CJK Font(han-sans), but I couldn't convert from OTF font to TTF font.
rbpdf library can use only a TTF font.

Daniel Felix wrote:

A default in the configuration won't help on a multilingual environment.
Like people have issues in korean and issues posted in german for example.
I think this would collide and force the german output to break.

I wrote patch.

Plan A. (use config/locales/*.yml) : I recommend.

  • general_pdf_fontname_r13446.patch
    locale general_pdf_fontname: Language
    ja.yml kozminproregular Japanese
    ko.yml hysmyeongjostdmedium Korean (UHC)
    th.yml freeserif Thai
    vi.yml DejaVuSans Vietnamese
    zh-TW.yml msungstdlight Traditional Chinese (BIG5)
    zh.yml stsongstdlight Simplified Chinese (GB18030)
    other yml freesans
    etc.. Helvetica

This plan was considered in order to support multilingual environment.

If you use English locale (en.yml) and you want to Japanese characters, so please set to "general_pdf_fontname: kozminproregular" on en.yml.

Plan B. (use configuration.yml) : I don't recommend.

  • pdf_font_name_r13446.patch

Configuration of PDF font for non CJKV (and Thai) locale.

I think that this plan has the big influence in multilingual environment.

Actions #16

Updated by Toshi MARUYAMA about 10 years ago

I think Plan A. is better because #8312 supported to switch using font by changing "general_pdf_encoding" at locale yml.

Actions #17

Updated by Jun NAITOH about 10 years ago

Toshi MARUYAMA wrote:

I think Plan A. is better because #8312 supported to switch using font by changing "general_pdf_encoding" at locale yml.

me, too. :)

Plan A : fontname table updated. (add Font type)

locale general_pdf_fontname: (Font type) Language
ja.yml kozminproregular (Non embedded Font (CID Font)) Japanese
ko.yml hysmyeongjostdmedium (Non embedded Font (CID Font)) Korean (UHC)
th.yml freeserif (embedded Font) Thai
vi.yml DejaVuSans (embedded Font) Vietnamese
zh-TW.yml msungstdlight (Non embedded Font (CID Font)) Traditional Chinese (BIG5)
zh.yml stsongstdlight (Non embedded Font (CID Font)) Simplified Chinese (GB18030)
other yml freesans (embedded Font)
etc.. courier, helvetica, times, symbol, zapfdingbats (Non embedded Font(Core Font))
Actions #18

Updated by Toshi MARUYAMA about 10 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

general_pdf_fontname_r13446.patch is committed in trunk r13458 and 2.6-stable r13460, thanks.

Actions #19

Updated by gank gu almost 10 years ago

Jun NAITOH wrote:

Maxime Vez wrote:

Recently Adobe and Google released an open-source CJK font : http://blog.typekit.com/2014/07/15/introducing-source-han-sans/

Maybe it can help in solving this issue.

I tried to use Adobe and Google CJK Font(han-sans), but I couldn't convert from OTF font to TTF font.
rbpdf library can use only a TTF font.

Daniel Felix wrote:

A default in the configuration won't help on a multilingual environment.
Like people have issues in korean and issues posted in german for example.
I think this would collide and force the german output to break.

I wrote patch.

Plan A. (use config/locales/*.yml) : I recommend.

  • general_pdf_fontname_r13446.patch
    locale general_pdf_fontname: Language
    ja.yml kozminproregular Japanese
    ko.yml hysmyeongjostdmedium Korean (UHC)
    th.yml freeserif Thai
    vi.yml DejaVuSans Vietnamese
    zh-TW.yml msungstdlight Traditional Chinese (BIG5)
    zh.yml stsongstdlight Simplified Chinese (GB18030)
    other yml freesans
    etc.. Helvetica

This plan was considered in order to support multilingual environment.

If you use English locale (en.yml) and you want to Japanese characters, so please set to "general_pdf_fontname: kozminproregular" on en.yml.

Plan B. (use configuration.yml) : I don't recommend.

  • pdf_font_name_r13446.patch

Configuration of PDF font for non CJKV (and Thai) locale.

I think that this plan has the big influence in multilingual environment.

If I'm using english and I want both Traditional Chinese (BIG5) and Simplified Chinese (GB18030), what can I do ? can I specify two font name in "general_pdf_fontname" ?

Actions #20

Updated by Toshi MARUYAMA almost 10 years ago

gank gu wrote:

If I'm using english and I want both Traditional Chinese (BIG5) and Simplified Chinese (GB18030), what can I do ? can I specify two font name in "general_pdf_fontname" ?

You cannot because of Han unification .

Actions #21

Updated by Toshi MARUYAMA over 9 years ago

Actions #22

Updated by Toshi MARUYAMA over 9 years ago

Actions #23

Updated by Toshi MARUYAMA over 9 years ago

Actions #24

Updated by nikunj begda about 5 years ago

Hello i found solution for this issue:

1. you need to create mysql database with utf8 parameter.
2. go to /redmine/app/models/user.rb and replace this line and comment the default one
#validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\Å\/
validates_format_of :login, :with => /[a-zA-ZąćęłńóśźżĄĆĘÅŃÓŚŹŻ]{5,15}(?:\+[a-zA-ZąćęłńóśźżĄĆĘÅŃÓŚŹŻ]{5,15}){0,2}/

or add your language characters before end '/ ' and save the file

now you can login with all the characters.

Actions

Also available in: Atom PDF