By Rupert
ColdFusion Fonts
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.

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…

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..

| Print article | This entry was posted by rupert on October 8, 2008 at 8:36 pm, and is filed under Uncategorized. Follow any responses to this post through RSS 2.0. You can skip to the end and leave a response. Pinging is currently not allowed. |