1) I also fixed a few mistakes I've seen in the code, a null test on the wrong variable, and missing halo test in IStyleExtensions.
2) I fixed text shapping issue (see https://github.com/toptensoftware/RichTextKit/issues/81 and https://github.com/toptensoftware/RichTextKit/issues/80)
3) I improved MeasureOverhang, it now also compute top and bottom when Style.LineHeight is less than 1.
4) I added MeasureOverhang in TextDocument.
5) I added two new methods to TextDocument for Extracting StyledText and Replacing text with StyledText. See below:
public StyledText Extract(TextRange range)
public void ReplaceText(ITextDocumentView view, TextRange range, StyledText styledText, EditSemantics semantics)
The first one allow to extract a range of the document as StyledText, the paragraph separators are replaced by new lines
The second one is an additional ReplaceText that take a styledText directly in input, the new lines are replaced by paragraph separator.
I need those two methods in order to build a RichTextBox control, to apply a style to a range of text. Basically to update a range of rich text, I call extract to retrieve a styled text of the selection, then I modify the styles in this StyledText (or a copy of it), and finally I call ReplaceText to update the document.
6) Last things, I wasn't able to compile the project as nullable was no available in c# 7.3 to I updated to c# 8 as advised by the compiler, please tell me if that is ok for you?
1) I also fixed a few mistakes I've seen in the code, a null test on the wrong variable, and missing halo test in IStyleExtensions. 2) I fixed text shapping issue (see https://github.com/toptensoftware/RichTextKit/issues/81 and https://github.com/toptensoftware/RichTextKit/issues/80) 3) I improved MeasureOverhang, it now also compute top and bottom when Style.LineHeight is less than 1. 4) I added MeasureOverhang in TextDocument. 5) I added two new methods to TextDocument for Extracting StyledText and Replacing text with StyledText. See below:
The first one allow to extract a range of the document as StyledText, the paragraph separators are replaced by new lines The second one is an additional ReplaceText that take a styledText directly in input, the new lines are replaced by paragraph separator.
I need those two methods in order to build a RichTextBox control, to apply a style to a range of text. Basically to update a range of rich text, I call extract to retrieve a styled text of the selection, then I modify the styles in this StyledText (or a copy of it), and finally I call ReplaceText to update the document.
6) Last things, I wasn't able to compile the project as nullable was no available in c# 7.3 to I updated to c# 8 as advised by the compiler, please tell me if that is ok for you?