2

Just installed Delphi 11 (Alexandria) and starting to convert our project to it (from 10.4, we try to keep up-to-date). I was surprised to see that our pixel-perfect (and quite crowded) data entry forms with dozens of TDBEdits were out of shape.

After a short research I found that amongst other changes, "For VCL applications, the default font is now Segoe UI, 9 pt.". Our forms are designed for "Tahoma, 8 pt", the former default font. At runtime I can fix it with altering the Application.DefaultFont at the start of the application, but we just cannot do development work on the forms while the fonts are bigger than the form was designed for.

All of our forms use the ParentFont = True setting, so I would like to change the default fonts for the form designer. For older Delphi versions there was a registry setting that controlled this, as seen at https://suretalent.blogspot.com/2011/07/how-to-set-default-form-font-delphi.html

I did the changes as mentioned on the url above, with no luck. Is there a setting I could use for this?

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
gyulak
  • 21
  • 2
  • Just my two cents: Segoe UI, 9 pt looks "right" on Windows Vista+. Tahoma, 8 pt, looks "wrong". Microsoft recommends Segoe UI, 9 pt, on Vista+: https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-fonts – Andreas Rejbrand Jan 24 '22 at 15:28
  • Sure, and we would like to convert to the new font, but we just cannot use Delphi11 until this is not resolved. We have 500+ forms in the project (split between a few dozen dlls). – gyulak Jan 24 '22 at 15:40
  • 1
    AFAIK, there is no way to overcome this besides setting the forms ParentFont property to false or just remove it from the DFM. – Uwe Raabe Jan 24 '22 at 16:26

1 Answers1

0

In some unit (eg. with design-time editors):

type
  TMyFormCustomModule = class(TCustomModule)

constructor TMyFormCustomModule.Create(ARoot: TComponent; const ADesigner: IDesigner);
begin
    if Application.DefaultFont.Name = 'Segoe UI' then begin
      Application.DefaultFont.Name := ' Tahoma';
      Application.DefaultFont.Height := -11;
    end;
end;

In a design-time package register:

  RegisterCustomModule(TForm, TMyFormCustomModule);
John
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 08 '23 at 16:54