How to always persist PixelsPerInch = 96 in DFM files even if Windows use medium font size (125%)

StackOverflow https://stackoverflow.com/questions/11097622

  •  15-06-2021
  •  | 
  •  

Question

I set my Windows 7 font size to medium (125%). When I open a form Delphi XE2 IDE, the PixelsPerInch in DFM files always set to 120 automatically. Using smaller font size in Windows (100%) makes PixelsPerInch to 96 in Delphi DFM files.

This create a problem when coding in team environment. Most team members use smaller font size (100% or 96 PPI). All DFM files store in version control repository is using 96 PPI. If I commit my DFM files that use 120 PPI to repository, all others team members will confuse about what I have changed to the DFM files. All properties related to size, width or height will be changed.

Is that possible to force Delphi IDE to save the DFM in 96 PPI when working with 120 PPI windows environment?

Was it helpful?

Solution

I have wrote a Delphi IDE open tools to tweak the the form designer in Delphi IDE. The tool attempt to let user design form in fixed scale of stored PixelPerInch in form regardless of Windows font size. It prevent the form designer to scale the form to Windows font size. The original PixelsPerInch property should maintain when saving the changes of forms.

The code has submitted to Embarcadero Code Central: 28922.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top