-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Full Unicode support for TextBlock #3438
Conversation
In addition, it would be nice to get some class-level doc comments for the public classes in |
606001a
to
93b94a5
Compare
_caretTimer = new DispatcherTimer(); | ||
_caretTimer.Interval = TimeSpan.FromMilliseconds(500); | ||
_text = string.Empty; | ||
_caretTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly related to this PR: We already have an issue for spawning dedicated timers for handling undo in TextBox
and this makes me wonder if we also really need a dedicated timer to just blink the caret. Makes it fairly expensive to construct these controls. @grokys
I wonder if we couldn't use animations for this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the same but didn't want to touch anything that isn't needed to get this finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, lets get this in first and then we can think about optimizing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New implementation will have a dedicated control for displaying a caret. The shape of the caret depends on the current font etc. So it makes sense to separate this logic.
src/Avalonia.Visuals/Media/TextFormatting/Unicode/BinaryReaderExtensions.cs
Outdated
Show resolved
Hide resolved
I can't guarantee that there will be no breaking changes in the feature. Because the current version of the TextFormatter can only deal with text and not with Controls. So at some point in the future, the API surface will change. |
Just realized that I have to implement https://unicode.org/reports/tr29/ before this can be merged. Shouldn't be too complicated. |
d6828b8
to
5372855
Compare
4d843fc
to
b946ccc
Compare
bd1b5c7
to
caa06e6
Compare
Making this WIP again because I want to introduce a text source first to avoid future breaking changes. |
This is now ready for inlines support |
121a93b
to
4806240
Compare
8385087
to
de93e8e
Compare
Fix some xml comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I can't say I'm really qualified to give this the review it deserves, but what I do understand of it looks excellent.
@Gillibald i don't seem to be able to update this branch to master, could you make sure the upstream repo has write access? |
Somehow the right wasn't granted. Have changed that. |
What does the pull request do?
This PR introduces multiple things
TextFormatter
The TextFormatter will be responsible for doing all the heavy lifting for all the text processing that is needed to build up a text layout. It functions as a service to implement your own layouts and it makes it possible to implement text editors etc.
TextBlock
The TextBlock control currently uses a FormattedText implementation that doesn't work well with advanced Unicode scenarios. This PR replaces FormattedText with the TextLayout class that is able to deal with all kinds of Unicode texts and produces expected results.
What is the current behavior?
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Fixes
#2548
#3522
#1817
Checklist