.net DrawString 带有零宽度字符的希伯来语字体

发布于 2024-09-28 13:20:34 字数 614 浏览 9 评论 0原文

DrawString 中是否有任何其他属性或参数可以解决此问题。 我有一种带有许多零宽度字符的希伯来字体,因此两个字符应该呈现在同一位置。

此示例在左侧显示了 .NET 问题,在右侧则显示了该问题:

http: //hebrewresources.com/html5/images/rendering_issue.png

Word 和 Visual Studio 文本框呈现方式相同,但在 SumTotal'sToolbook 中,它呈现正确。

这实际上是 15 年前的一种非常古老的 true-type 字体, 而且它甚至不是从右到左的。我可能会切换到较新的字体,但随后 我必须编写一个程序来重新映射每个字符和元音。

objGraphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
objGraphics.DrawString(text, objFont, Brushes.Black, border / 2, border / 2);

Are there any additional properties or parms in the DrawString to solve this problem.
I have a Hebrew font with many zero-width characters so that two characters should render in the same location.

This example shows the .NET problem on the left, and what is should look like on the right:

http://hebrewresources.com/html5/images/rendering_issue.png

Word and Visual Studio text boxes render the same way, but in SumTotal'sToolbook, it renders correctly.

This is actually a very old true-type font from over 15 years ago,
and it's not even right-to-left. I may switch to newer font, but then
I would have to write a program to remap every character and vowel.

objGraphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
objGraphics.DrawString(text, objFont, Brushes.Black, border / 2, border / 2);

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

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

发布评论

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

评论(1

红尘作伴 2024-10-05 13:20:34

您将不得不:

objGraphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
var stringFormat = new StringFormat(StringFormatFlags.DirectionRightToLeft);
float x = border / 2;
float y = border / 2;
objGraphics.DrawString(text, objFont, Brushes.Black, x, y, stringFormat);

如果它不起作用,您将不得不尝试其他标志:

http://msdn.microsoft.com/en-us/library/system.drawing.stringformatflags(v=VS.71).aspx

You will have to:

objGraphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
var stringFormat = new StringFormat(StringFormatFlags.DirectionRightToLeft);
float x = border / 2;
float y = border / 2;
objGraphics.DrawString(text, objFont, Brushes.Black, x, y, stringFormat);

If it doesn't work, you will have to try other flags:

http://msdn.microsoft.com/en-us/library/system.drawing.stringformatflags(v=VS.71).aspx

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