プロジェクト

全般

プロフィール

Vote #73778

完了

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

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
81
issue_org_id:
13781
author_id:
65309
assigned_to_id:
0
comments:
24
status_id:
5
tracker_id:
1
plus1:
1
affected_version:
closed_on:
affected_version_id:
66
ステータス-->[Closed]

説明

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.

Admin Redmine さんが3年以上前に更新

  • カテゴリPDF export_39 にセット
  • 対象バージョン2.6.0_81 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0