Setting TextOptions.TextFormattingMode="Display" causes cursor to be rendered incorrectly in SyntaxE

SyntaxEditor for Silverlight Forum

Posted 9 years ago by Samuel Jack - Managing Director, Seaturtle Sofware Ltd
Version: 12.2.0140
Platform: Silverlight 5

We've just discovered this bug - not sure if this is the correct place to report it?

If you set TextOptions.TextFormattingMode="Display" on the SyntaxEditor control, or any of its visual parents it causes a severe rendering bug. If you type a line  of text into the editor, you'll see that the cursor isn't rendered at the end of the line, but a few pixels back from it. The effect gets worse as the number of characters in the line increases, with the cursor getting further and further back from the end of the line.

Selection is also broken: if you try selecting from the end of the line, the selection will actually start several characters back from the end of the line.

Comments (2)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Samuel,

The problem here is that due to Silverlight not having any sort of text rendering framework, we have to resort to behind the scenes hacks involving TextBlock to achieve measuring of text.  It sounds like the TextBlocks we use aren't inheriting down the formatting mode setting since they are created internally by our text formatter, and our codebase is still Silverlight 4.  In your scenario, while the text is rendering with Display mode, it's still being measured in Ideal mode.  Thus things like caret/selection will be off.

Our codebase is Silverlight 4, so we unfortunately can't access that option since it was added in Silverlight 5.  We'll write down to revisit this issue when we move to Silverlight 5 in the future.

In the meantime, please make sure you use the Ideal formatting mode for SyntaxEditor controls.

Actipro Software Support

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Samuel,

Please see today's blog post.  In the 2013.1 version we are moving to Silverlight 5 and have updated all of SyntaxEditor to use the current TextFormattingMode setting.

Actipro Software Support

The latest build of this product (v2018.1 build 0233) was released 2 years ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.