Redmine 0.8 でガントチャートを PDF出力、PNG出力することができるが、日本語が出ていなかったのでググって対応した。
PDF の日本語対応
lang/ja.yml で指定されている PDF のエンコーディングを変更する。
- 変更前
general_csv_encoding: SJIS general_pdf_encoding: UTF-8
- 変更後
general_csv_encoding: SJIS general_pdf_encoding: SJIS
PNG の日本語対応
- Windows から msgothic.ttc を /usr/share/fonts/default/TrueType にコピー。
- Redmine の lib/redmine/helpers/gantt.rb の 89行目付近にコードを追加する。
(gc.font と gc.pointsize の行)
gc = Magick::Draw.new
gc.font = '/usr/share/fonts/default/TrueType/msgothic.ttc'
gc.pointsize = 12
参考
