Defect #4787
closedGannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ?
100%
Description
When exporting a gantt chart to png format all Japanese (hiragana,katakana and kanji) characters are replaced with ? characters.
This is using RMagick 2.12.2 and the libmagick9-dev provided with Ubuntu 9.10.
Being able to export to PNG would relieve some of the problems we are facing with the inability to export to PDF (As discussed in issue #61 )
(Also would it be useful to add an "Exporters" category? I am not sure what to file this under)
Files
Related issues
Updated by Jeffrey Jones almost 15 years ago
- % Done changed from 0 to 10
Looks like this is a font issue.
I edited /lib/redmine/helpers/gantt.rb and hacked in the following
gc = Magick::Draw.new gc.font = "/usr/share/fonts/truetype/msttcorefonts/gothic.ttf" # New Line - Explicitly declare font # Subjects
This is an ugly hard-coded hack that points to a font that I know for sure is UTF-8 Japanese character compatible and it works.
So the question now is how to make this something that can be merged into redmine itself and works on all platforms.
Maybe we could make an administration option that allows us to select the fonts we desire for our exports? (When using PDF/PNG?)
Updated by Ki Won Kim over 14 years ago
Symptoms are the same, and I was modified gantt.rb by your hacked code.
thanks a lot.
Jeffrey Jones wrote:
When exporting a gantt chart to png format all Japanese (hiragana,katakana and kanji) characters are replaced with ? characters.
This is using RMagick 2.12.2 and the libmagick9-dev provided with Ubuntu 9.10.
Being able to export to PNG would relieve some of the problems we are facing with the inability to export to PDF (As discussed in issue #61 )
(Also would it be useful to add an "Exporters" category? I am not sure what to file this under)
Updated by Toshi MARUYAMA over 13 years ago
- Subject changed from Gannt to PNG - Japanese characters appear as ? to Gannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ?
Updated by Namho Kim almost 13 years ago
- File gantt_korean.png gantt_korean.png added
That's right. For example Gannt include Korean like belows.
Updated by Namho Kim almost 13 years ago
That's right. For example Gannt include Korean like belows.
Updated by Jun NAITOH almost 13 years ago
- File png_rmagick_font_r8745.patch png_rmagick_font_r8745.patch added
- File rmagick_font.png rmagick_font.png added
This issue is font setting problem.
I wrote selectable RMagcik font patch.
This patch add RMagick font selector of Display tab in Setting.
If you want to show Japanese, so please select Japanese Font.
I tested on RMagick 2.13.1 on CentOS 6, RMagick 2.12.0 on Windows XP.
Updated by Etienne Massip almost 13 years ago
Please don't make this a new setting, just force the police font to what would fit well if possible?
Updated by Toshi MARUYAMA almost 13 years ago
- Assignee deleted (
Toshi MARUYAMA)
Updated by Toshi MARUYAMA almost 13 years ago
- File user-pref.png user-pref.png added
- File user-pref-r8745.patch user-pref-r8745.patch added
This is a patch using user preference.
Updated by Etienne Massip almost 13 years ago
I can't see why a font would be a user preference?? This should be automatic, who wants to select a specific font to export a chart? I just want to click and get my Gantt chart exported as a image as it it rendered in browser, period.
Please don't add too much complexity.
Updated by Toshi MARUYAMA almost 13 years ago
Etienne Massip wrote:
This should be automatic
There is no standard font in Japanese.
- Windows: MS Mincho, MS Gothic
- MacOS: HIRAGINO
- Linux: Nothing
Unicode has Unified problem.
http://en.wikipedia.org/wiki/CJK_Unified_Ideographs
So, CJK font cannot be defined automatically.
Updated by Toshi MARUYAMA almost 13 years ago
On Redmine 1.3, CJK PDF fonts are hard-coded.
source:tags/1.3.0/lib/redmine/export/pdf.rb#L52
Redmine 1.3 uses non embedded fonts for CJK PDF.
So, PDF reader uses alternate fonts if there is no fonts on client.
But, rmagick processes on server.
So, we cannot hard-coded and defined fonts at locale files (config/locales/ja.yml).
Updated by Etienne Massip almost 13 years ago
Can't you add a setting to embed fonts into exported file?
Updated by Toshi MARUYAMA almost 13 years ago
Etienne Massip wrote:
Can't you add a setting to embed fonts into exported file?
It is difficult that user/administrator finds fonts name on server.
On Note-12 user-pref.png, font name is "IPAGothic-Regular".
Updated by Namho Kim almost 13 years ago
- File redmine-gantt_kr.png redmine-gantt_kr.png added
Korean is OK, using the above patch.
Updated by Jun NAITOH almost 13 years ago
Toshi MARUYAMA wrote:
This is a patch using user preference.
I'm checked. I think this patch is better than my patch.
Updated by Jun NAITOH over 12 years ago
Etienne Massip wrote:
Please don't add too much complexity.
OK. I tried another approach.
This patch add a configurable path of RMagick in configuration.yml.
Updated by Go MAEDA about 12 years ago
Current PNG output is of no use in CJK. Font name must be set to address the problem but we cannot know what font is installed in a system because standard CJK font is different by operating system.
NAITOH's patch (png_rmagick_font_path_r8987.patch) seems smart approach to deal with the problem because there's no ui change.
It wishes strongly that the patch is merged to trunk to make Redmine more useful.
Updated by Toshi MARUYAMA about 12 years ago
This is a patch of note-19 png_rmagick_font_path_r8987.patch rebased to trunk r10851.
You can apply it to 2.1-stable r10848 (2.1.3).
Updated by Toshi MARUYAMA almost 12 years ago
- Status changed from New to Closed
- Assignee set to Toshi MARUYAMA
- Target version set to 2.2.0
- % Done changed from 10 to 100
- Resolution set to Fixed
Updated by Daniel Felix about 10 years ago
Etienne Massip wrote:
Please don't make this a new setting, just force the
policefont to what would fit well if possible?
Well I would agree to that point. Our users won't be able to easily determine the right font on languages they don't even know.
Updated by Toshi MARUYAMA about 10 years ago
- Related to Defect #13781: CJK(Chinese/Japanese/Korean) characters are not shown in PDF on non CJK locales added