[Lazarus] Changing default font size for all controls

zeljko zeljko at holobit.net
Sun Jan 20 12:54:46 CET 2013


On Sunday 20 of January 2013 11:17:42 Michael Van Canneyt wrote:
> 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.




More information about the Lazarus mailing list