Skip to content

Fixed several issues - #83

Merged
toptensoftware merged 9 commits into
toptensoftware:mainfrom
dbriard:fix-mistakes
Aug 21, 2023
Merged

Fixed several issues#83
toptensoftware merged 9 commits into
toptensoftware:mainfrom
dbriard:fix-mistakes

Conversation

@dbriard

Copy link
Copy Markdown
Contributor
  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 [Bug] Subscript and Superscript not working when using on part of the text only #81 and [Bug] LetterSpacing not working when using on part of the text only #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.

  1. 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?

@toptensoftware
toptensoftware merged commit a54796a into toptensoftware:mainAug 21, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dbriard@toptensoftware