I am using a Java SWT StyledText control to display some text on Windows. However, the performance sucks because the text I am displaying has lots of commas. Here is an example of a line of text I am trying to display:
我正在使用Java SWT StyledText控件在Windows上显示一些文本。但是,性能很糟糕,因为我显示的文本有很多逗号。这是我试图显示的一行文字的示例:
1,2,3,4,5,1,
The Java SWT code calls into the standard Windows Uniscribe ScriptItemize function to split this text into runs and gets back 12 runs! Each character is its own run! This kills the performance of the SWT drawing code to have to draw the characters one by one.
Java SWT代码调用标准Windows Uniscribe ScriptItemize函数将此文本拆分为运行并返回12次运行!每个角色都是自己的跑步!这会破坏SWT绘图代码的性能,必须逐个绘制字符。
I have raised Eclipse bug 352927 to cover this issue. Does anyone have experience with Uniscribe who could comment on how to avoid these one character runs?
我已经提出了Eclipse bug 352927来解决这个问题。有没有人有Uniscribe的经验谁可以评论如何避免这些字符运行?
The settings for the ScriptItemize method come from a SCRIPT_CONTROL struct. However, the defn of this struct used by SWT is missing the fMergeNeutralItems field. This sounds promising to me but I haven't managed to find anything clear online about whether this field would merge together the returned runs for my comma heavy text.
ScriptItemize方法的设置来自SCRIPT_CONTROL结构。但是,SWT使用的此结构的defn缺少fMergeNeutralItems字段。这听起来很有希望,但我还没有找到任何明确的在线信息,这个字段是否会将我的逗号重文本的返回运行合并在一起。
1 个解决方案
#1
0
Setting fMergeNeutralItems in the SCRIPT_CONTROL struct fixes this issue. See the SWT bugzilla bug for more details.
在SCRIPT_CONTROL结构中设置fMergeNeutralItems可以解决此问题。有关更多详细信息,请参阅SWT bugzilla错误。
#1
0
Setting fMergeNeutralItems in the SCRIPT_CONTROL struct fixes this issue. See the SWT bugzilla bug for more details.
在SCRIPT_CONTROL结构中设置fMergeNeutralItems可以解决此问题。有关更多详细信息,请参阅SWT bugzilla错误。