From c7ee26b144377a076180a2a61801c083e268b1a8 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 28 Nov 2012 10:11:33 +0000 Subject: [PATCH] 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 --- config/configuration.yml.example | 22 ++++++++++++++++++++++ lib/redmine/helpers/gantt.rb | 1 + 2 files changed, 23 insertions(+) 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)