RTF in Syntax Editor

SyntaxEditor for WPF Forum

Posted 9 years ago by tal
Version: 15.1.0622


Is there a way to insert a text (programmatically) into the editor and present it as a rich text format (or something similar) in order to display specific text in a specific format (colors, background, font, font style…), regardless of the language being used.

Like when using a REPL (read–eval–print loop) and printing a colorful output to the screen after a line was entered in a specific language.

Currently using language transitions and a made up language we are able to do a mock up: wrapping the text with textual symbols that mark a start and end of language’s states with a specific classification for the default token key (which is the text between those visible delimiters).


Comments (1)

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

Hi Tal,

You could use a custom classification tagger to tag certain ranges that will overflow the default token-based syntax highlighting for those ranges.  Some of our adornments samples show the usage of classification taggers to do that.  However note that if you will have a lot of these ranges, don't use a collection tagger as it may affect performance with lots of entries.  It might be better to use a classification tagger design that dynamically decides how to classify the text based on examining it.  The AdornmentsHighlightWord QuickStart is a good example of that concept.

Of course what you did with using delimiters so that the lexer is what fully controls syntax highlighting is good too, and probably the most performant way to do everything.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.