[DUG] Large Fonts/DPI
John Bird
johnkbird at paradise.net.nz
Wed Aug 9 12:04:03 NZST 2006
In your code below the second PixelsPerInch - is that a form property?
Eg if Screen.PixelsPerInch <> form1.PixelsPerInch then
Because I tried to use this code above to detect when a user has a non 96PPI
screen, and it didn't work. I am guessing the reason is that I let the
application create the forms on startup and when I test using this code the
form is already created and the test above then returns true (they are
equal) - but I am guessing....
John
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Laurence Bevan
Sent: Monday, 7 August 2006 9:44 a.m.
To: delphi at ns3.123.co.nz
Subject: Re: [DUG] Large Fonts/DPI
A quick way of dealing with large fonts is to change the Scaled property of
each form to False, and put this code in the FormCreate:
Assert(not Scaled, 'You should set Scaled property of Form to False!');
if Screen.PixelsPerInch <> PixelsPerInch then
ScaleBy(Screen.PixelsPerInch, PixelsPerInch);
You still have the odd funny looking control but it does a pretty good job
overall.
Cheers,
Laurence Bevan
Master Business Systems Ltd
----- Original Message -----
From: "John Bird" <johnkbird at paradise.net.nz>
To: "'NZ Borland Developers Group - Delphi List'"
<delphi at ns3.123.co.nz>
Subject: [DUG] Large Fonts/DPI
Date sent: Fri, 4 Aug 2006 19:52:29 +1200
Organization: John Bird Consulting
Send reply to: johnkbird at paradise.net.nz,
NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>
[ Double-click this line for list subscription options ]
I have come across something I have not seen before - and I do not
understand the issues involved and what I need do do, so please help!
Background:
I have some forms I resize according to users screen resolution, and also
settable options which font sizes are to be used in grids, and also default
row height. Both specified in points. Behaves nicely on most screens
-Except-
Where screen has been set to use large fonts, eg 120DPI, eg Windows 98 with
a large resolution LCD screen. The fonts I have set in the grid then become
enormous, nothing like 8 pt which is the default and unreadable. So how do
I detect the DPI setting, what does it mean for my app, and how do I adjust
the font size.....I am able to do that, but unsure what to adjust.
Any advice or web sites?
John
__________ NOD32 1.1461 (20060329) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com
More information about the Delphi
mailing list