I was trying to make a chinese text drawn in an image. That worked flawlessly on my Mac. Upon svn updating my files in production, the characters in the image became squares again.

Picture 4.png

First hunch was to change my file.encoding as from my previous post. But didn’t helped, so I changed the font from the CF code itself..

 <cfset attr = StructNew() />
 <cfset attr.size = 16 />
 <cfset attr.style = "plain" />
 <cfset attr.font = "microsoft yahei" />

I noticed that using the obvious fonts (Arial, Tahoma) didn’t worked. It always complained it can’t find the font…

Picture 5.png

I remember using msyh.ttf (Microsoft Yahei) in Mapserver for producing Chinese text. So what I did was, I copied msyh.ttf and dropped it in the coldfusion fonts directory (/opt/coldfusion8/runtime/jre/lib/fonts) then restarted coldfusion. Afterwards, I was able to see msyh.ttf from the Font Management of CFIDE Administrator. From there… I was able to display the image with Chinese Characters..

Picture 3.png