如何使用C#图形绘制unicode字符串 [英] How to draw unicode string using C# graphics.DrawString

查看:146
本文介绍了如何使用C#图形绘制unicode字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用.NET框架提供的PrintDocument将高棉脚本(unicode)字符串发送到打印机.

I'm trying to send khmer script(unicode) string to printer using PrintDocument provided by the .NET framework.

不幸的是,在我看来,Graphics.DrawString()无法正确呈现高棉脚本.

Unfortunately it seems to me that the Graphics.DrawString() does not render khmer script correctly.

平台:Windows 7 Ultimate
IDE:VS 2010 Ultimate

Platform: Windows 7 Ultimate
IDE: VS 2010 Ultimate

这是示例代码:

void printDoc_PrintPage(object sender, PrintPageEventArgs e)
{
  var font = new Font("Khmer UI", 12);
  var text = "សួស្តី"; // "Hello"
  e.Graphics.DrawString(text, font, Brushes.Black, 100, 100);
}

推荐答案

感谢Albin和Beemer的积极回应.

Thanks Albin and Beemer for your active response.

在c#谷歌论坛中发表了几篇文章.已经确认GDI +中存在一个错误,该错误将某些脚本(在这种情况下为高棉")错误地显示为另一种措辞.

After a few posts in c# google group. It's been confirmed that there is a bug in GDI+ that incorrectly show certain script ("Khmer" in this case) to a different wording.

已创建一个本机win32测试应用程序来验证GDI + DrawString()的问题.

A native win32 test application was created to verify the issue with GDI+ DrawString().

一个错误报告已提交给Microsoft Connect: http://connect.microsoft .com/VisualStudio/feedback/details/620081/

A bug report has been submitted to Microsoft Connect: http://connect.microsoft.com/VisualStudio/feedback/details/620081/

这篇关于如何使用C#图形绘制unicode字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆