Jump to content
KodeZwerg

Vote for Segoe UI as Default Font opened.

Recommended Posts

52 minutes ago, KodeZwerg said:

Good day everone!

 

I did opened this https://quality.embarcadero.com/browse/RSP-33937 to have Segoe UI (Windows Vista+) as Default Font instead of Tahoma (Windows XP)

 

Stay healthy!

Did you filled a bug report also with Microsoft? Delphi uses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes\MS Shell Dlg 2 on my Windows 10 that's still Tahoma.

  • Confused 1

Share this post


Link to post

You can read what Microsoft write in this link.

Quote

Win32 or WinForms / Windows Vista or later = Use the appropriate Segoe UI font.
Quote

Extensible components or pre-Windows Vista = To target Windows XP and Windows 2000, use the 8 point MS Shell Dlg 2 pseudo font, which maps to Tahoma.
To target earlier versions of Windows, use 8 point MS Shell Dlg pseudo font, which maps to Tahoma on Windows 2000 and Windows XP, and to MS Sans Serif on Windows 95, Windows 98, Windows Millennium Edition, and Windows NT 4.0.

Using "MS Shell Dlg 2" pseudo font is to be backward compatible i guess. (Would be fatal if from now on that HKEY would lead to Segoe UI, font size would not match on old applications....)

Feel free to use the classic Windows XP way, my wish is to be more modern and not support Windows XP.

  • Like 2

Share this post


Link to post

Voted.

I've been using the following work around in the dpr file for ages:

  if (CheckWin32Version(6, 0)) then
    // Application.DefaultFont is the font used when TForm.ParentFont=True.
    // It is Tahoma by default but should be Segoe UI on Vista and later (according to MS UI guide lines).
    // See InitDefFontData() in graphics.pas
    Application.DefaultFont.Assign(Screen.MessageFont);

And I have ParentFont=True on all forms.

  • Like 2

Share this post


Link to post
55 minutes ago, Anders Melander said:

Voted.

I've been using the following work around in the dpr file for ages:


  if (CheckWin32Version(6, 0)) then
    // Application.DefaultFont is the font used when TForm.ParentFont=True.
    // It is Tahoma by default but should be Segoe UI on Vista and later (according to MS UI guide lines).
    // See InitDefFontData() in graphics.pas
    Application.DefaultFont.Assign(Screen.MessageFont);

And I have ParentFont=True on all forms.

Thank you for voting, here is my workaround way to have it scaled properly:

procedure ApplyFontAndScale(aForm: TForm);
var
  OldSize : Integer;
  Font    : TFont;
begin
  OldSize := aForm.Font.Size;
  if Screen.MessageFont.Size <> OldSize then begin
    Font := TFont.Create;
    try
      Font.Assign(Screen.MessageFont);
      Font.Size := OldSize;
      aForm.Font := Font;
    finally
      Font.Free;
    end;
    aForm.ScaleBy(Abs(Screen.MessageFont.Size), Abs(OldSize));
  end else
    aForm.Font := Screen.MessageFont;

  if aForm.BorderStyle <> bsSizeable then begin
    if aForm.Height > Screen.WorkAreaHeight then
      aForm.ScaleBy(Screen.WorkAreaHeight, aForm.Height);
    if aForm.Width > Screen.WorkAreaWidth then
      aForm.ScaleBy(Screen.WorkAreaWidth, aForm.Width);
  end;
end;

calling within OnCreate event.

Share this post


Link to post
4 hours ago, Anders Melander said:

And I have ParentFont=True on all forms

This does not work in per-Monitor DPI-aware applications.

Share this post


Link to post
3 hours ago, pyscripter said:

This does not work in per-Monitor DPI-aware applications.

Correct, it completely disables dpi scaling. 

 

Also doesn't work when using VCL Themes - seems to have zero effect. The Bitmap Style designer allows you to specify fonts for the individual elements, and I tried changing those in my themes, but again, seems to have no effect.

Share this post


Link to post

With Vcl Themes, setting the font on the form in code works (assuming parentfont is set on all the controls). That said, I'm not sure I like Sego UI any better than Tahoma - I think Tahoma has better character spacing which makes it more readable.. especially with smaller font sizes.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×