TextEditor: Single line based formatting of text #559
-
|
Hello, when I change the formatting of the TextEditor, e.g. FontFamily, FontSize, FontWeight etc. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
What is the use-case? (Note that AvaloniaEdit is a source code editor, not a rich text editor.) The Example: Let's say you want to make all source code comments in the text italic. To achieve this, you can:
|
Beta Was this translation helpful? Give feedback.
What is the use-case? (Note that AvaloniaEdit is a source code editor, not a rich text editor.)
The
AvaloniaEdit.Democontains an exampleUnderlineAndStrikeThroughTransformer, which applies underline and strikethrough format. SeeAvaloniaEdit/src/AvaloniaEdit.Demo/MainWindow.xaml.cs
Line 348 in 7fa5d88
Example: Let's say you want to make all source code comments in the text italic.
To achieve this, you can:
MyCommentTransformerderived fromDocumentColorizingTransformer.ColorizeLine. Check if the text line contains a comment (like"// ...") and then callCh…