Patch #3231

patch for broken character problem on png-exported gantt on 0.8 branch

Added by Yonghwan SO over 8 years ago. Updated over 6 years ago.

Status:ClosedStart date:2009-04-23
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Gantt
Target version:-

Description

  • for 0.8.3 on linux
  • related to non-ascii characters (especially hangul)

If I export gantt chart as png, all korean characters(hangul) are broken.
because there is no matching font (for rmagick).

I made simple patch to fix it, and it simply uses a font file (on extra/custom.ttf).

This method is not a kind of i18n, but IMHO, we can improve it or write something like it.

redmine-0.8.3-png-font.patch Magnifier (542 Bytes) Yonghwan SO, 2009-04-23 19:32


Related issues

Related to Redmine - Defect #4787: Gannt to PNG - CJK (Chinese, Japanese and Korean) charac... Closed 2010-02-10

History

#1 Updated by Jean-Philippe Lang over 8 years ago

And what happens when 'extra/custom.ttf' does not exist?

#2 Updated by Yonghwan SO over 8 years ago

Jean-Philippe Lang wrote:

And what happens when 'extra/custom.ttf' does not exist?

Sorry, I feel that my patch and this ticket is very "quick and dirty" style.

In my test, when the font is not exist, nothing is happen. (I guess it just ignored by rMagick. I don't know much about rMagick, so who can help us to verify it?)

PS) background of this patch is :

1) In my case, some(or most) tickets were written with Korean characters, so this is very critical issue since I use png export feature (I think it is very useful one.). not only for me, maybe for all unicode character users.

2) Can it be user configurable or not? I think a minute or more, I think this font configuration is not related to user setting, or default of system. it is depend on individual project's official language. (If the project is global :-)

3) finally, I need more consideration, but I made and use this quick and dirty one now. (and I just release it as is, for more discussions about this issue.)

Thank you for your response.

#3 Updated by Yonghwan SO over 8 years ago

I checked,

1) ImageMagick's Draw just ignores non-existing font file and fall back to default.
2) but more clearly, I modified the patch.

TODO: test with multi language environment and multiple fonts support if it can.

#4 Updated by Mischa The Evil about 7 years ago

  • Category changed from Issues to Gantt

#5 Updated by Jean-Baptiste Barth over 6 years ago

  • Status changed from New to Closed

Imho this is a server problem : if your users are korean, let's install korean fonts on the server, Rmagick should find them. Anyway I close the issue since it's 2 years old and nobody was really interested, no offense...

Also available in: Atom PDF