Vote #73778
完了CJK(Chinese/Japanese/Korean) characters are not shown in PDF on non CJK locales
0%
説明
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.
journals
--------------------------------------------------------------------------------
Because embedded FreeSans font does not have glyph.
See #61#note-92.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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":http://en.wikipedia.org/wiki/Han_unification.
I think that fix of this problem requires a PDF font setting function.
h3. Font Setting Plan (Example)
# Add PDF export options dialog. (like issues CSV export options dialog.)
# Add PDF font panel for personal account setting.
# Add PDF font panel for Administration settings.
# Add default PDF font setting in configuration.yml.
--------------------------------------------------------------------------------
I think it is better in configuration.yml because of #4787 consistency.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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...
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
h3. 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.
h3. 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.
--------------------------------------------------------------------------------
I think Plan A. is better because #8312 supported to switch using font by changing "general_pdf_encoding" at locale yml.
--------------------------------------------------------------------------------
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. :)
h3. 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))|
--------------------------------------------------------------------------------
attachment:general_pdf_fontname_r13446.patch is committed in trunk r13458 and 2.6-stable r13460, thanks.
--------------------------------------------------------------------------------
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.
>
> h3. 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.
>
> h3. 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" ?
--------------------------------------------------------------------------------
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":http://en.wikipedia.org/wiki/Han_unification .
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
related_issues
relates,Closed,10681,Export to Persian PDF problem
relates,Closed,13575,Graphic characters not exported
relates,Closed,17570,use rbpdf gem instead of bundled rfpdf
relates,Closed,4787,Gannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ?
duplicates,Closed,14701,PDF Export Encoding
duplicates,Closed,1249,在生成PDF文件时,中文出现乱码
duplicates,Closed,19282,Export unicode error.