-
Notifications
You must be signed in to change notification settings - Fork 567
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
New text integration #1182
Merged
Merged
New text integration #1182
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raphlinus
approved these changes
Sep 7, 2020
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.
This looks good. Most of what I found was comment issues. Looking forward to see it all land!
cmyr
force-pushed
the
new-text-integration
branch
3 times, most recently
from
September 8, 2020 19:35
15b92e1
to
ec8cf37
Compare
cmyr
force-pushed
the
new-text-integration
branch
from
September 8, 2020 21:08
ec8cf37
to
7eff8aa
Compare
cmyr
force-pushed
the
new-text-integration
branch
from
September 8, 2020 22:23
7eff8aa
to
08c08c8
Compare
This introduces a new type, TextLayout, that is intended to be a component used by widgets that wish to display text, and which exposes the functionality of the Piet text API. This commit is a checkpoint; it adds only a small amount of new functionality, and largely tries to keep things working as they do currently.
cmyr
force-pushed
the
new-text-integration
branch
from
September 8, 2020 22:32
08c08c8
to
bb5e6ef
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a first pass at bringing the new piet stuff into druid.
Mostly this involves a new
TextLayout
type in druid, that is intended to be used as a component of other widgets that display text. This is intended to handle the bookkeeping around invalidating and recomputing layouts, resolving attributes from the environment, and retaining other layout attributes.This first patch is intended mostly to get us to parity with the existing code; it doesn't expose things like wrap width or alignment, yet.
retaining the text
I chose not to have this object own a copy of the text, because that is already retained in the piet layout, and also already exists in whatever form it was passed to the widget in. This is annoying! It would be much nicer if you could pass in the initial text at construction time.This may change if we settle on some data type(s) for strings that are clone friendly, which I think we should do but which is out of scope for now.This now retains the text, which is shared between this object and piet as an
Arc<str>
.