-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextFormatter port #216
TextFormatter port #216
Conversation
Hey @Gillibald, I performed another test run. Some more findings:
|
How to repro:
_textEditor.Options.ShowBoxForControlCharacters = false;
_textEditor.Document = new TextDocument(
System.IO.File.ReadAllText(@"c:\path\to\the\file.bin")); |
Embedded controls are currently not properly hit tested against regular hits and trailing hits. This is something I want to write some tests for this week. |
I wonder how TabGlypRun ever worked. The run itself should reuse measurements of the replaced sequence otherwise the general text layout changes when |
Although the implementation was a mess, it was fixed in this PR and it worked fine 😂 bounding-box.mp4 |
I had an idea about long lines. What if we enforce line wrapping if we encounter a certain line length? We might get vertical virtualization that way and it is easier to edit in theory. |
Well. I'm pretty sure forcing the user to wrap long lines will end in a bunch of support requests for us 😂. We already did that in the past for the macOS editor, and some users handling minified javascript hit that issue and complained a lot (they don't care about long lines but they don't want to polish the document, wrapping long lines). Using the VSCode approach could be an option. But IMO, the best editor for handling long lines is Sublime Text. It completely virtualizes lines horizontally. Not sure how, but it does. It just displays the whole line, and you can navigate/edit/select text without any delay, supporting double-byte chars and emojis. So not sure how they do that, but it's doable. BTW the current version of AvaloniaEdit is able to do that. For long lines, it just assumes the same len for every glyph (when using a monospaced font), and it splits line runs in runs of MAX 3000 chars. Can't we do the same with the new implementation? |
…iaUI/AvaloniaEdit into feature/TextFormatterPort
Without shaping the text, we will never know how many glyphs are rendered in the final result so lazy loading portions of the long line is required aka horizontal virtualization. It is possible to do shaping on mutliple threads in the background but not sure how much we would improve performance that way. |
Avalonia's TextFormatter is still not 100% matching WPF's version so we need to slightly adjust text processing at certain points. In general this port is mostly working and I am happy that RTL support is also kinda working so we are making huge progress here. |
src/AvaloniaEdit/Rendering/VisualLineTextParagraphProperties.cs
Outdated
Show resolved
Hide resolved
Uniform button height and alignment in the header panel.
Fix ShowTabs
@mattj23 Could you test my latest changes? TextWrapping should now work with variable size lines. |
@Gillibald, for some reason I can't get the nightly build you used, I'm getting this error:
I'll give it a try on a different machine tomorrow and let you know! |
You need to use this feed: https://nuget.avaloniaui.net/repository/avalonia-all/index.json |
@Gillibald, I tested the latest commit and as best I can tell you've fixed those issues I saw with the blank line height and the variable text height. Looks great. |
50% gray with alpha of 145 looks good in both light and dark themes
@Gillibald I think I still found an issue with inline controls:
|
|
I have fixed some hit testing and rendering issues here: https://github.com/AvaloniaUI/Avalonia/pull/8094/files Will test my changes against AvaloniaEdit and will fix the remaining issues |
Hi @Gillibald, do you have any idea when this PR might be merge? |
This is only blocked by some compiler issues in the test project. Once that is sorted out we can merge. |
…iaUI/AvaloniaEdit into feature/TextFormatterPort
No description provided.