IsHyphenationEnabled 是否取决于操作系统语言? (WPF FlowDocument 和 TextBlock)
我正在使用 FlowDocument 创建固定的 XpsDocument。跳过所有细节,我在本地计算机(Windows 7 Professional、美国英语)上尝试使用 FlowDocument 和 TextBlock 进行此操作:
<FlowDocument Language="nl" IsHyphenationEnabled="True">...
在删除 Language="nl"
之前,根本不会出现连字符,然而,它随后使用英语规则并将连字符放在错误的位置。我也尝试更具体(“nl-NL”)但无济于事。
我怀疑我需要升级到 Windows 7 Ultimate 才能获得荷兰语支持,但是 FlowDocument.IsHyphenationEnabled 或 TextBlock.IsHyphenationEnabled。
任何人都可以确认或否认这种怀疑(权威链接),或者指出我提供带有荷兰语连字符字典的 FlowDocument 的替代方法吗?
另外,使用 Windows 7 Ultimate Edition 的人可以尝试一下这个(安装了荷兰语语言包)并确认它是否有效(不想升级只是为了发现这不是问题)。
顺便说一句,我的机器上安装了 Microsoft Office 2010,在 Word 中,我可以很好地使用荷兰语连字符。 (曾经以为Office使用了WPF)
I'm using a FlowDocument to create a fixed XpsDocument. Skipping all the details, I tried this with both a FlowDocument and a TextBlock on my local machine (Windows 7 Professional, US-English):
<FlowDocument Language="nl" IsHyphenationEnabled="True">...
No hyphenation occurs at all until I remove Language="nl"
, however it then uses the English rules and places hyphens at bad locations. I have also tried to be more specific ("nl-NL") but to no avail.
I suspect that I'd need to upgrade to Windows 7 Ultimate in order to get the Dutch language support, however there is no word mentioned about this in the documentation of FlowDocument.IsHyphenationEnabled or TextBlock.IsHyphenationEnabled.
Can anyone confirm or deny this suspection (authoritative link), or point me to an alternative way to provide the FlowDocument with a Dutch hyphenation dictionary?
Also, can someone with the Windows 7 Ultimate Edition try this (with the Dutch language pack installed) and confirm if it works (don't want to upgrade just to find out that this was not the problem).
As a sidenote, I have Microsoft Office 2010 on my machine and in Word I get good working hyphenation for the Dutch language. (used to think Office utilized WPF)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来我最新的大多数问题都变成了“风滚草”,但如果其他人正在研究这个,我会回答我自己的问题。
可以通过安装 .Net Framework 语言包来添加其他语言。不幸的是,仅部分支持荷兰语(异常文本被混淆为荷兰语,因此您在 Google 上搜索解决方案的机会变得很小,但不支持连字符等有用的内容)。
目前仅支持英语、法语、德语和西班牙语。
有一个 API 可以将一些行话添加到 此博客,但不支持添加全新语言。在该博客的评论中,作者谈到了这个问题。我将引用最相关的短语:
Looks like most of my latest questions all turn into 'tumbleweed', but in case anyone else is looking into this, I'll answer my own question.
Additional languages can be added by installing a .Net framework language pack. Unfortunately Dutch is only partially supported (Exception-texts are obfuscated into dutch so your chances of Binging a solution on Google become slim, but useful stuff like hyphenation is not supported).
For now only English, French, German and Spanish are supported.
There is an API to add some jargon words to those dictionaries documented in this blog, but adding a whole new language is not supported. In the comments of that blog the author touches this issue. I'll quote the most relevant phrase: