PluggableButtonMorph does not respect font size :(
For the Pharo Mooc we need to use large font and we end up with this visual glitch :( I tried to dive into PluggableButtonMorph and I failed to found how to make sure it computes the bound correctly. Any help is welcome. I really think that in Brick we should really be picky on such problems. Stef
2016-01-14 11:19 GMT+01:00 stepharo <stepharo@free.fr>:
For the Pharo Mooc we need to use large font and we end up with this visual glitch :( I tried to dive into PluggableButtonMorph and I failed to found how to make sure it computes the bound correctly. Any help is welcome.
I think this issue is related: 13376 <https://pharo.fogbugz.com/f/cases/13376/Wrong-TextMorph-extent-for-ButtonMor...> Wrong TextMorph extent for ButtonMorphs The problem: UITheme buttonLabelFor: creates a TextMorph with an extent computed by TextMorph>>optimalExtent (in buttonLabelForText:), which relies on its TextStyle (from the default font). After that, the TextMorphs font is changed to the buttons default font: label := self buttonLabelForText: aButton label. label enabled: aButton enabled. label font: self buttonFont. but the "label font:" does not recomputed the extent.
I really think that in Brick we should really be picky on such problems.
Stef
Thanks nicolai I changed the font right now. I will check because after we will do around 20 videos showing pharo tools. Le 14/1/16 11:33, Nicolai Hess a écrit :
2016-01-14 11:19 GMT+01:00 stepharo <stepharo@free.fr <mailto:stepharo@free.fr>>:
For the Pharo Mooc we need to use large font and we end up with this visual glitch :( I tried to dive into PluggableButtonMorph and I failed to found how to make sure it computes the bound correctly. Any help is welcome.
I think this issue is related: 13376 <https://pharo.fogbugz.com/f/cases/13376/Wrong-TextMorph-extent-for-ButtonMor...> Wrong TextMorph extent for ButtonMorphs The problem: UITheme buttonLabelFor: creates a TextMorph with an extent computed by TextMorph>>optimalExtent (in buttonLabelForText:), which relies on its TextStyle (from the default font). After that, the TextMorphs font is changed to the buttons default font:
label :=selfbuttonLabelForText:aButton label. label enabled:aButton enabled. label font:selfbuttonFont.
but the "label font:" does not recomputed the extent.
I really think that in Brick we should really be picky on such problems.
Stef
Hi,
On Jan 14, 2016, at 11:19 AM, stepharo <stepharo@free.fr> wrote:
For the Pharo Mooc we need to use large font and we end up with this visual glitch :( I tried to dive into PluggableButtonMorph and I failed to found how to make sure it computes the bound correctly. Any help is welcome. I really think that in Brick we should really be picky on such problems.
Indeed. Actually, Alex Syrel spent 2 weeks to get this âlittleâ thing of computing the bounds of a string right (I think it works well now hopefully) :). Doru
Stef
<djbhggee..png>
-- www.tudorgirba.com www.feenk.com "Problem solving should be focused on describing the problem in a way that makes the solution obvious."
Indeed. Actually, Alex Syrel spent 2 weeks to get this âlittleâ thing of computing the bounds of a string right (I think it works well now hopefully) :). excellent And we should be really picky about that. Especially since we will have a vector graphic. and I would like to avoid to have the font plaque that we have now.
Doru
Stef
<djbhggee..png> -- www.tudorgirba.com www.feenk.com
"Problem solving should be focused on describing the problem in a way that makes the solution obvious."
participants (3)
-
Nicolai Hess -
stepharo -
Tudor Girba