lch*_*ann 4 c# printdocument drawstring
我正在尝试使用.NET框架提供的PrintDocument将khmer脚本(unicode)字符串发送到打印机.
不幸的是,在我看来,Graphics.DrawString()没有正确呈现高棉脚本.
平台: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);
}
Run Code Online (Sandbox Code Playgroud)
mann,
我在一个Form_Paint()处理程序上测试了你的代码,我得到了你所说的.
但是当我使用它时:
TextRenderer.DrawText(e.Graphics, text, font, new Point(100, 100), Color.Black);
Run Code Online (Sandbox Code Playgroud)
它以你想要的方式给了我文本.
试试吧printDoc_PrintPage().
