Most Delphi applications are using MS Sans Serif 8 as their default font, meanwhile Windows XP system font is Tahoma 8.25 and Windows Vista system font is Segoe UI.
Below code makes Delphi applications support Windows system font:
procedure TForm1.FormCreate(Sender: TObject); var NonClientMetrics: TNonClientMetrics; begin NonClientMetrics.cbSize := SizeOf(NonClientMetrics); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0); Font.Handle := CreateFontIndirect(NonClientMetrics.lfMessageFont); if Scaled then begin Font.Height := NonClientMetrics.lfMessageFont.lfHeight; end; end;
Comments
more accurate and working in
more accurate and working in Delphi 2010, version of above code is:
courtesy of http://stackoverflow.com/questions/401075/delphi-handling-users-font-preference/448574#448574
Screen.IconFont But "Icon
Screen.IconFont
But "Icon font" can be changed by user...
Post new comment