-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add Bold and Underline to TextGrid widget #4244
Add Bold and Underline to TextGrid widget #4244
Conversation
9d2680a
to
cf930d3
Compare
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.
Looks good. A few comments inline about since notes and naming.
Would it be possible to add a test?
Also I think you might find that although the APIs are added they do not take effect on output...
You'll need to extend the code in internal/painter/font.go
I think (line 35 onwards). It will likely be necessary to pass the style in to the actual theme Font
call instead of using the helper methods which are limited to monospace vs all other styles...
I'm curious about how you got the demo working with that font cache not patched - did you find that it wasn't a problem for some reason? How was the bold monospace font looked up in that demo? |
|
Yup I appreciate that the API was designed to make this possible - but I'm pretty sure you'll get cache collisions inside the toolkit as it does not understand bold monospace. Happy to be proved wrong on this of course, but it's a concern. |
I haven't seen any, it sounds like an ideal unit test candidate, however. Is there a table test which I can add a test case to? |
The problem will be in |
When running the tests locally, I get quite a few failures. I have checked to ensure no more/other tests are failing due to this work. I can't see how |
I can't figure out how! The OpenGL driver text rendering uses the cached face to draw. it is created in |
I just realised that |
There should not be - there is an intermittent issue due to window sizing and OS not always allowing it during the test IIRC. If the CI does not see failures then it's probably OK but worth opening a bug to report that it's not all working at your end. |
Latest develop should have all the test failures resolved. |
Sorry for the delay, yeah it would be good to have this into 2.5 |
That might be tough, yesterday was feature freeze. I remain concerned that adding "TextGridTextStyle" in addition to "TextGridStyle" and "TextStyle" is confusing and the discussion about bold/bolded underline/underlined would be avoided by using the existing APIs |
I hope the last commit aligns more with your thinking? |
This seems much more consistent thanks. |
Thanks, I'll add the comments and tidy up the branch so its much more atomic :D |
Fix TextGrid tests And underline to text style Add underline support to TextGrid widget
4266b90
to
123747e
Compare
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.
Thanks so much, this is great to have in.
I guess the apps would need a bold monospace font in the theme to see the difference on that right? Perhaps we should consider with the new system font lookup to find local defaults that are more flexible? A later PR works for that. Also, I am curious - is italic being included for the TextGrid lots of extra work or would it follow the same model? Thanks again for sticking through the process here. |
The same model will work for italics. yes you have to return a different font for bold and italics in the font lookup |
Description:
Enable the text style to be passed in as part of the TextGridStyle. this will allow font options to be passed down
Checklist:
Where applicable: