-
Notifications
You must be signed in to change notification settings - Fork 566
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
Text integration tracking issue #1192
Labels
enhancement
adds or requests a new feature
Comments
cmyr
added a commit
that referenced
this issue
Sep 10, 2020
With this patch, the TextLayout object can now be given a width for wrapping words. This is exposed in the Label via a new LineBreaking enum, with three options. With LineBreaking::WordWrap, the TextLayout's wrap-width is set to the maximum width of the label's BoxConstraints, and lines are broken appropriately. The other two options (LineBreaking::Overflow and LineBreaking::Clip) both disable line-breaking; in the former case if text exceeds the width of the label it is painted outside of the label's bounds, and in the latter case the text is clipped to the bounds of the label. It would be nice if, in the clipping case, we could use a gradient mask or something to fade the edges of the clipped text, but I don't believe this is currently possible in piet. A simple alternative of drawing a gradient from (transparent -> label background color) doesn't work, because label's do not have an explicit background color, which I think is also correct. progress on #1192
cmyr
added a commit
that referenced
this issue
Sep 10, 2020
With this patch, the TextLayout object can now be given a width for wrapping words. This is exposed in the Label via a new LineBreaking enum, with three options. With LineBreaking::WordWrap, the TextLayout's wrap-width is set to the maximum width of the label's BoxConstraints, and lines are broken appropriately. The other two options (LineBreaking::Overflow and LineBreaking::Clip) both disable line-breaking; in the former case if text exceeds the width of the label it is painted outside of the label's bounds, and in the latter case the text is clipped to the bounds of the label. It would be nice if, in the clipping case, we could use a gradient mask or something to fade the edges of the clipped text, but I don't believe this is currently possible in piet. A simple alternative of drawing a gradient from (transparent -> label background color) doesn't work, because label's do not have an explicit background color, which I think is also correct. progress on #1192
cmyr
added a commit
that referenced
this issue
Sep 10, 2020
With this patch, the TextLayout object can now be given a width for wrapping words. This is exposed in the Label via a new LineBreaking enum, with three options. With LineBreaking::WordWrap, the TextLayout's wrap-width is set to the maximum width of the label's BoxConstraints, and lines are broken appropriately. The other two options (LineBreaking::Overflow and LineBreaking::Clip) both disable line-breaking; in the former case if text exceeds the width of the label it is painted outside of the label's bounds, and in the latter case the text is clipped to the bounds of the label. It would be nice if, in the clipping case, we could use a gradient mask or something to fade the edges of the clipped text, but I don't believe this is currently possible in piet. A simple alternative of drawing a gradient from (transparent -> label background color) doesn't work, because label's do not have an explicit background color, which I think is also correct. progress on #1192
cmyr
added a commit
that referenced
this issue
Sep 11, 2020
With this patch, the TextLayout object can now be given a width for wrapping words. This is exposed in the Label via a new LineBreaking enum, with three options. With LineBreaking::WordWrap, the TextLayout's wrap-width is set to the maximum width of the label's BoxConstraints, and lines are broken appropriately. The other two options (LineBreaking::Overflow and LineBreaking::Clip) both disable line-breaking; in the former case if text exceeds the width of the label it is painted outside of the label's bounds, and in the latter case the text is clipped to the bounds of the label. It would be nice if, in the clipping case, we could use a gradient mask or something to fade the edges of the clipped text, but I don't believe this is currently possible in piet. A simple alternative of drawing a gradient from (transparent -> label background color) doesn't work, because label's do not have an explicit background color, which I think is also correct. progress on #1192
cmyr
added a commit
that referenced
this issue
Sep 11, 2020
With this patch, the TextLayout object can now be given a width for wrapping words. This is exposed in the Label via a new LineBreaking enum, with three options. With LineBreaking::WordWrap, the TextLayout's wrap-width is set to the maximum width of the label's BoxConstraints, and lines are broken appropriately. The other two options (LineBreaking::Overflow and LineBreaking::Clip) both disable line-breaking; in the former case if text exceeds the width of the label it is painted outside of the label's bounds, and in the latter case the text is clipped to the bounds of the label. It would be nice if, in the clipping case, we could use a gradient mask or something to fade the edges of the clipped text, but I don't believe this is currently possible in piet. A simple alternative of drawing a gradient from (transparent -> label background color) doesn't work, because label's do not have an explicit background color, which I think is also correct. progress on #1192
Probably known issue, but just in case - there are a lot of In my realtime system, the time needed to render a frame dropped from 1ms to 188ms because of that :( |
Well, that's funny, I have steady 6ms-10ms if I run from the terminal, but 188ms if I run from emacs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A tracking issue, largely for my own benefit, detailing the various bits of work involved in incorporating the new piet text stuff into druid.
TextLayout
component that can be used to draw simple text. (New text integration #1182)based on xi-ropeBasic rich text #1255The text was updated successfully, but these errors were encountered: