开发者

C# Supporting Asian Languages

开发者 https://www.devze.com 2022-12-11 22:01 出处:网络
I\'ve built a simple e-card creator web app for a client that accepts a personal greeting and draws it onto a selected card design. On my local machine, I can enter asian languages and the tex开发者_J

I've built a simple e-card creator web app for a client that accepts a personal greeting and draws it onto a selected card design. On my local machine, I can enter asian languages and the tex开发者_JAVA技巧t is drawn correctly on the image. I have the asian languages installed on my machine.

When I loaded the app to my client's server, asian languages show up as boxes. I suspect it's because their server doesn't have the asian language pack installed. But I'm wondering, is that the reason? Is there any way to accept asian languages and display it correctly without having the asian language pack installed?

Here's how I'm drawing the text onto the image

Graphics g = Graphics.FromImage(image);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawString(text,
    new Font(fontFamily, fontSize),
    brushColor,
    position,
    strFormat);
g.Dispose();

I'm using Arial font.

Is there something special I need to do?

Thanks.


Arial doesn't contain the characters you need, but if the East Asian fonts are installed, Windows can use characters from those in place of Arial. You can install the fonts, pick a new font to use, or match Arial up with a different font for Asian characters using font linking. (If you set up font linking using the instructions in that article, it'd be for all software on the machine, not just your app.)


I think you need a font that supports the Asian letters you are using. For example, my machine has the "Arial Unicode MS" font installed, which I think was installed with Microsoft Office.


You can include the fonts you need in your application. Then it doesn't matter if they aren't installed on your client's machine.

Here is one webpage I found about it: http://msdn.microsoft.com/en-us/library/ms753303.aspx

Here's another: http://dotnet-coding-helpercs.blogspot.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号