Discussion:
DPI setting with Lazarus and Lazarus applications
Graeme Geldenhuys
2006-03-15 08:25:24 UTC
Permalink
Hi,

Does Lazarus take into account the DPI setting of the system to set
the font sizes, etc...? From my initial observation I would guess not
(see screenshot). The editor font and the Editor Window's Title is the
correct font size, but the Main Menu, Component Palette Tabs, Editor
Tabs and the Popup Window in the editor has a huge font.

eg: Mozilla Firefox and Thunderbird has an option under the Font
settings, to custom set the DPI or use the System Setting. My X
server is running at 90x90dpi (calculated from my actual display
size). Setting Thunderbird to 96dpi gives me big fonts, setting it to
System Setting, give me an accurate font size (looks better and in
proportion).

I am looking at the issue with the Compiler Options dialog regarding
clipping of text (see my previous post for a screenshot). I have the
same problem in our commercial application we are developing. Under
Windows you design a GUI interface so it looks great. Windows
normally defaults to 96dpi. Taking that same application and running
it under Linux (which the dpi could be different for every system) the
interface looks crap! Lots of clipping of labels, labels to close to
each other, button caption doesn't fit in button, etc.

So what is the best approach to fix this? Are you supposed to us the
DPI setting, or just keep playing with the controls AutoSize property
(if it has one) and Anchor properties and hope for the best.

There must be some way of getting this right. Some application
(though not to many) under Windows actual handle the systems dpi
setting correctly. You can change the dpi and the application scales
or something, and the GUI is still perfectly usable.

Any ideas on this topic?

Regards,
- Graeme -
Michael Van Canneyt
2006-03-15 08:33:37 UTC
Permalink
Post by Graeme Geldenhuys
Hi,
Does Lazarus take into account the DPI setting of the system to set
the font sizes, etc...? From my initial observation I would guess not
(see screenshot). The editor font and the Editor Window's Title is the
correct font size, but the Main Menu, Component Palette Tabs, Editor
Tabs and the Popup Window in the editor has a huge font.
eg: Mozilla Firefox and Thunderbird has an option under the Font
settings, to custom set the DPI or use the System Setting. My X
server is running at 90x90dpi (calculated from my actual display
size). Setting Thunderbird to 96dpi gives me big fonts, setting it to
System Setting, give me an accurate font size (looks better and in
proportion).
I am looking at the issue with the Compiler Options dialog regarding
clipping of text (see my previous post for a screenshot). I have the
same problem in our commercial application we are developing. Under
Windows you design a GUI interface so it looks great. Windows
normally defaults to 96dpi. Taking that same application and running
it under Linux (which the dpi could be different for every system) the
interface looks crap! Lots of clipping of labels, labels to close to
each other, button caption doesn't fit in button, etc.
So what is the best approach to fix this? Are you supposed to us the
DPI setting, or just keep playing with the controls AutoSize property
(if it has one) and Anchor properties and hope for the best.
There must be some way of getting this right. Some application
(though not to many) under Windows actual handle the systems dpi
setting correctly. You can change the dpi and the application scales
or something, and the GUI is still perfectly usable.
Any ideas on this topic?
It's a difficult topic. Delphi has a lot of issues with it,
I've never seen a delphi app which worked correctly on all
DPI settings, even after so many versions of Delphi :/

We solve this by making all labels/controls big enough so they
always have enough room to contain their caption at small/large
font size.


Michael.
Graeme Geldenhuys
2006-03-15 08:42:01 UTC
Permalink
Post by Michael Van Canneyt
It's a difficult topic. Delphi has a lot of issues with it,
I've never seen a delphi app which worked correctly on all
DPI settings, even after so many versions of Delphi :/
I have had that same experienc, though I have seem one or two Delphi
written apps that work correctly, but no idea how they did it. :-(
Post by Michael Van Canneyt
We solve this by making all labels/controls big enough so they
always have enough room to contain their caption at small/large
font size.
I just read the tuturial on the wiki regarding Anchor properties.
Very nice tutorial. Not sure it will solve all problems, but the
Border propety (to Neighbour components) should help in some sence. I
will create a few test to see...

I also found this info from the efg's Computer Labs. They did a bit
of research on this as well. I might be able to use some of what they
did.

http://www.efg2.com/Lab/Library/Kylix/FormScaling/index.htm
http://www.efg2.com/Lab/Library/Kylix/FormScaling/DPIScaledTrue/DPIScaledTrue.htm

Regards,
- Graeme -
Michael Van Canneyt
2006-03-15 08:56:46 UTC
Permalink
Post by Graeme Geldenhuys
Post by Michael Van Canneyt
It's a difficult topic. Delphi has a lot of issues with it,
I've never seen a delphi app which worked correctly on all
DPI settings, even after so many versions of Delphi :/
I have had that same experienc, though I have seem one or two Delphi
written apps that work correctly, but no idea how they did it. :-(
Post by Michael Van Canneyt
We solve this by making all labels/controls big enough so they
always have enough room to contain their caption at small/large
font size.
I just read the tuturial on the wiki regarding Anchor properties.
Very nice tutorial. Not sure it will solve all problems, but the
Border propety (to Neighbour components) should help in some sence. I
will create a few test to see...
I also found this info from the efg's Computer Labs. They did a bit
of research on this as well. I might be able to use some of what they
did.
http://www.efg2.com/Lab/Library/Kylix/FormScaling/index.htm
http://www.efg2.com/Lab/Library/Kylix/FormScaling/DPIScaledTrue/DPIScaledTrue.htm
I am aware of these results.
We always use 'Scaled=False', it gives the best results.

Michael.

Loading...