Board index » delphi » Windows XP Fonts

Windows XP Fonts


2004-01-22 08:15:02 PM
delphi120
On Windows XP, the default form font is "MS Shell Dlg 2" (Tahoma), and not
"MS Shell Dlg 2" (MS Sans Serif), like in Win98.
Because of this, we get ugly (or non-standard) forms in XP, because Delphi
forms always use MS Sans Serif.
Is there a way to workaround it? Or do I have to check the win version and
change the font in runtime for every form I create?
Thanks in advance,
Rodrigo
 
 

Re:Windows XP Fonts

"Rodrigo.net" <XXXX@XXXXX.COM>writes:
Quote
On Windows XP, the default form font is "MS Shell Dlg 2" (Tahoma), and not
"MS Shell Dlg 2" (MS Sans Serif), like in Win98.
Because of this, we get ugly (or non-standard) forms in XP, because Delphi
forms always use MS Sans Serif.
"Ugly" is a relative term<g>. If you think your forms look ugly on XP,
try running them on W2K or earlier with "Large Fonts" in effect. Since
Sans Serif is not a scalable font, the results can be "interesting" to
say the least.
Quote
Is there a way to workaround it? Or do I have to check the win version and
change the font in runtime for every form I create?
Unless you were to change the system wide setting (which would be
"rude"<g>), your form will have to ask for something explicitly. You
might consider changing everything to Tahoma - then you won't have to
worry about the platform.
Good luck.
Kurt
 

Re:Windows XP Fonts

Quote
"Ugly" is a relative term<g>. If you think your forms look ugly on XP,
try running them on W2K or earlier with "Large Fonts" in effect. Since
Sans Serif is not a scalable font, the results can be "interesting" to
say the least.
Ok, maybe not "ugly", but at least "non-standard".
Quote
Unless you were to change the system wide setting (which would be
"rude"<g>), your form will have to ask for something explicitly. You
might consider changing everything to Tahoma - then you won't have to
worry about the platform.
If I change everything to Tahoma, then I will get a non-standard font in
Win98. it is not what I want.
 

Re:Windows XP Fonts

In article <XXXX@XXXXX.COM>, Rodrigo.net writes:
Quote
If I change everything to Tahoma, then I will get a non-standard font in
Win98. it is not what I want.
You can ask for the font to use at run-time.
Procedure GetMessageFont( afont: TFont );
var
ncMetrics: TNonClientMetrics;
begin
assert(assigned(afont));
ncMetrics.cbSize := sizeof(TNonClientMetrics);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(TNonClientMetrics),
@ncMetrics, 0);
afont.Handle := CreateFontIndirect(ncMetrics.lfMessageFont);
end;
The TNonClientMetrics structure also contains information on other fonts
used in the non-client area:information:
lfCaptionFont Font used in regular captions
lfSmCaptionFont Font used in small captions
lfMenuFont Font used in menus
lfStatusFont Font used in status bars
lfMessageFont Font used in message boxes
Peter Below (TeamB)
Use the newsgroup archives :
www.mers.com/searchsite.html
www.tamaracka.com/search.htm
groups.google.com
www.prolix.be