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
This commit is contained in:
Toshi MARUYAMA 2012-11-28 10:11:33 +00:00
parent f4cf7bc6f5
commit c7ee26b144
2 changed files with 23 additions and 0 deletions

View File

@ -166,6 +166,28 @@ default:
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails. # the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
#imagemagick_convert_command: #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 # specific configuration options for production environment
# that overrides the default ones # that overrides the default ones
production: production:

View File

@ -400,6 +400,7 @@ module Redmine
imgl = Magick::ImageList.new imgl = Magick::ImageList.new
imgl.new_image(subject_width + g_width + 1, height) imgl.new_image(subject_width + g_width + 1, height)
gc = Magick::Draw.new gc = Magick::Draw.new
gc.font = Redmine::Configuration['rmagick_font_path'] || ""
# Subjects # Subjects
gc.stroke('transparent') gc.stroke('transparent')
subjects(:image => gc, :top => (headers_height + 20), :indent => 4, :format => :image) subjects(:image => gc, :top => (headers_height + 20), :indent => 4, :format => :image)