Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-01

Changing default font size for all controls

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth
to Krzysztof
Krzysztof wrote 5 lines
Hi, By default controls has font size and height = 0, so size depend on OS configuration. Can I change global size or height to custom value for my application?

By default all controls also have ParentFont = True set. This means that they use the font settings of the topmost parent control which normally is the form. So changing the font settings of the form should be sufficient. It will not work though if you set other properties of a child control's font (e.g. bold, italic, color, etc.) directly as then ParentFont will be set to False and thus the control will not inherit the font size from it's parent control.

Regards,
Sven

Reply by email

zeljko
to Krzysztof: By default controls has font size and height = 0, so size depend on OS configuration. Can…
Krzysztof wrote 5 lines
Hi, By default controls has font size and height = 0, so size depend on OS configuration. Can I change global size or height to custom value for my application?

With qtlcl you have qtconfig utility where you can set default fonts for application (and that's probably thing you want). Sven said that we have ParentFont property which is ok, but I think that we can (maybe) add DefaultFont property to TApplication (which is default by default with size 0), so when that font is changed, all controls should take TApplication.DefaultFont as default font (if control font is default and no matter if ParentFont is true or false).

z.

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 14 lines
On Saturday 19 of January 2013 22:39:40 Krzysztof wrote: > Hi, > > By default controls has font size and height = 0, so size depend on OS > configuration. Can I change global size or height to custom value for my > application? With qtlcl you have qtconfig utility where you can set default fonts for application (and that's probably thing you want). Sven said that we have ParentFont property which is ok, but I think that we can (maybe) add DefaultFont property to TApplication (which is default by default with size 0), so when that font is changed, all controls should take TApplication.DefaultFont as default font (if control font is default and no matter if ParentFont is true or false).

I think that is good except for the 'no matter if ParentFont is true or false' If you set parentfont to 'False', it means you want it to be the font specified in the font property ?

Michael.

Reply by email

zeljko
to Michael Van Canneyt: I think that is good except for the 'no matter if ParentFont is true or false' If you set…
Michael Van Canneyt wrote 19 lines
On Sun, 20 Jan 2013, zeljko wrote: > On Saturday 19 of January 2013 22:39:40 Krzysztof wrote: >> Hi, >> >> By default controls has font size and height = 0, so size depend on OS >> configuration. Can I change global size or height to custom value for my >> application? > > With qtlcl you have qtconfig utility where you can set default fonts for > application (and that's probably thing you want). Sven said that we have > ParentFont property which is ok, but I think that we can (maybe) add > DefaultFont property to TApplication (which is default by default with > size 0), so when that font is changed, all controls should take > TApplication.DefaultFont as default font (if control font is default and > no matter if ParentFont is true or false). I think that is good except for the 'no matter if ParentFont is true or false' If you set parentfont to 'False', it means you want it to be the font specified in the font property ?

Maybe ... , but maybe also another application property which will say look or don't look for ParentFont. Why ? Because parent control eg. TPanel have ParentFont=False, but uses CourierNew font and 12 Size. On TPanel is TBitBtn which says ParentFont=False, but uses pure default font. So in your case both will have fonts as it is.
In my case TBitBtn will take application.DefaultFont, but TPanel won't because it's font is different than "default".

z.

Reply by email