is it save to always recompute a TextMorphs extent if the font changed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

is it save to always recompute a TextMorphs extent if the font changed

Nicolai Hess
If you use different fonts as default font and button font, buttons labels may get truncated.

One solution would be to always recompute the TextMorphs extent when its
font changes, but I don't know if this is always desirable.

Otherwise, if we recompute the extent on the creation time of the button,
I am not sure if all buttonlabels have styled text.
Reply | Threaded
Open this post in threaded view
|

Re: is it save to always recompute a TextMorphs extent if the font changed

stepharo
Hi nicolai

this is a couple of weeks were I'm thinking about the way widgets use fonts.
It is orthogonal to your mail but related. Most of the system is refering to fonts via a global variable.
And to me this is wrong.
I would like to experiment with a solution similar to Settings:
    - 1    Font should be hold by an instance variables of the widgets.
            The code of the widgets should only refer to this state

    - 2 Now there is the question of the propagation when we change
    and there I would do the same as settings:
    pragma + builder

What do the community think?

Stef
   



On 23/6/14 22:00, Nicolai Hess wrote:
If you use different fonts as default font and button font, buttons labels may get truncated.

One solution would be to always recompute the TextMorphs extent when its
font changes, but I don't know if this is always desirable.

Otherwise, if we recompute the extent on the creation time of the button,
I am not sure if all buttonlabels have styled text.

Reply | Threaded
Open this post in threaded view
|

Re: is it save to always recompute a TextMorphs extent if the font changed

stepharo

On 24/6/14 08:14, stepharo wrote:
Hi nicolai

this is a couple of weeks were I'm thinking about the way widgets use fonts.
It is orthogonal to your mail but related. Most of the system is refering to fonts via a global variable.
And to me this is wrong.
I would like to experiment with a solution similar to Settings:
    - 1    Font should be hold by an instance variables of the widgets.
            The code of the widgets should only refer to this state

    - 2 Now there is the question of the propagation when we change
    and there I would do the same as settings:
    pragma + builder

What do the community think?

Stef
   



On 23/6/14 22:00, Nicolai Hess wrote:
If you use different fonts as default font and button font, buttons labels may get truncated.

One solution would be to always recompute the TextMorphs extent when its
font changes, but I don't know if this is always desirable.

Otherwise, if we recompute the extent on the creation time of the button,
I am not sure if all buttonlabels have styled text.