summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-11-28 10:11:33 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-11-28 10:11:33 +0000
commitc7ee26b144377a076180a2a61801c083e268b1a8 (patch)
treefbf2a0473d940c4eeb7076a5293bb3b38e97d097
parentf4cf7bc6f5dd297a3e21939e01349224e6938616 (diff)
downloadredmine-c7ee26b144377a076180a2a61801c083e268b1a8.tar.gz
redmine-c7ee26b144377a076180a2a61801c083e268b1a8.zip
add configuration of RMagcik font for CJK (Chinese, Japanese and Korean) (#4787)
Contributed by Jun NAITOH. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10890 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--config/configuration.yml.example22
-rw-r--r--lib/redmine/helpers/gantt.rb1
2 files changed, 23 insertions, 0 deletions
diff --git a/config/configuration.yml.example b/config/configuration.yml.example
index 6624ddc91..16d14b5c6 100644
--- a/config/configuration.yml.example
+++ b/config/configuration.yml.example
@@ -166,6 +166,28 @@ default:
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
#imagemagick_convert_command:
+ # Configuration of RMagcik font.
+ #
+ # Redmine uses RMagcik in order to export gantt png.
+ # You don't need this setting if you don't install RMagcik.
+ #
+ # In CJK (Chinese, Japanese and Korean),
+ # in order to show CJK characters correctly,
+ # you need to set this configuration.
+ #
+ # Because there is no standard font across platforms in non CJK,
+ # you need to set a font installed in your server.
+ #
+ # This setting is not necessary in non CJK.
+ #
+ # Examples for Japanese:
+ # Windows:
+ # rmagick_font_path: C:\windows\fonts\msgothic.ttc
+ # Linux:
+ # rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
+ #
+ rmagick_font_path:
+
# specific configuration options for production environment
# that overrides the default ones
production:
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index ebc9610f0..c71eec1c8 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -400,6 +400,7 @@ module Redmine
imgl = Magick::ImageList.new
imgl.new_image(subject_width + g_width + 1, height)
gc = Magick::Draw.new
+ gc.font = Redmine::Configuration['rmagick_font_path'] || ""
# Subjects
gc.stroke('transparent')
subjects(:image => gc, :top => (headers_height + 20), :indent => 4, :format => :image)