所以要實現在圖片置入中文的話,第一要有 Unicode 編碼的中文字型,第二要把 big5 中文字轉成 unicode 編碼。
我在兩個網站下載到 unicode 編碼的中文字型
http://www.info.gov.hk/digital2
http://www.study-area.org/apt
真是太感謝他們了!
有了中文字型之後,接下來就是字型編碼的轉換了!
perl 有提供一個工具 piconv 可以用來轉換 big5 to unicode 這實在是太棒了!萬事俱備了!
底下的範例,就是一個會產生含有中文字的圖檔! convert 還有很多驚人的功能,有興趣的人可以多加研究!
convert -pointsize 72 -fill white -font fireflysung.ttf -size 500x200 xc:black -draw "text +20+100 '`piconv -f big5 -t utf8 -s '中國'`'" chinese.jpg
http://www.imagemagick.org/ ImageMagick 官網
http://www.imagemagick.org
written by 東海大野狼

2 意見:
你好,可否請問一下要怎麼指定字型?
Thanks you!!
my mail: yita.wu@gmail.com
thanks for providing this useful infomation!
張貼意見