0

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:

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.

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?

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.

1 Answer 1

1

Setting fMergeNeutralItems in the SCRIPT_CONTROL struct fixes this issue. See the SWT bugzilla bug for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.