C# 支持亚洲语言

发布于 2024-08-12 04:31:05 字数 531 浏览 2 评论 0原文

我为客户构建了一个简单的电子贺卡创建器 Web 应用程序,它接受个人问候语并将其绘制到选定的卡片设计上。在我的本地计算机上,我可以输入亚洲语言,并且文本可以正确绘制在图像上。我的机器上安装了亚洲语言。

当我将应用程序加载到客户端的服务器时,亚洲语言显示为方框。我怀疑这是因为他们的服务器没有安装亚洲语言包。但我想知道,是这个原因吗?有没有办法在不安装亚洲语言包的情况下接受亚洲语言并正确显示?

将文本绘制到图像上的方法

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

以下是我使用 Arial 字体

。我需要做一些特别的事情吗?

谢谢。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

累赘 2024-08-19 04:31:05

Arial 不包含您需要的字符,但如果安装了东亚字体,Windows 可以使用这些字符来代替 Arial。您可以安装字体、选择要使用的新字体,或者使用 字体链接。 (如果您使用该文章中的说明设置字体链接,则它将适用于计算机上的所有软件,而不仅仅是您的应用程序。)

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

沒落の蓅哖 2024-08-19 04:31:05

我认为您需要一种支持您正在使用的亚洲字母的字体。例如,我的机器安装了“Arial Unicode MS”字体,我认为已安装与微软Office。

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.

孤者何惧 2024-08-19 04:31:05

您可以在应用程序中包含所需的字体。那么即使它们没有安装在您的客户端计算机上也没关系。

这是我找到的一个关于它的网页: http://msdn.microsoft.com /en-us/library/ms753303.aspx

这是另一个: http://dotnet-编码-helpercs.blogspot.com/

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文