.Net Inconsistent font output

I am creating a Windows Forms application for .NET 2.0 SP2. Form fonts look great on my machine, when I tried to use another machine, it looks bigger. (This is not due to the difference in resolution, the fonts are larger relative to other icons, etc.)

I tried to debug the problem and found that the following code returns different sizes on another machine.

//inside a windows form
private void checkfont()
{
    var g = this.CreateGraphics();
    MessageBox.Show(g.MeasureString("Hello World", this.Font) + "," + this.Font);
}

I expect graphics.measurestring () to return the same value for the same arguments on different machines.

For the font "Verdana 8.25"

  • On machine 1, "Hello World" measures 69.0px, 14.7px
  • On machine 2, "Hello World" measures 86.3px, 18.4px

Why is this a difference? because of this, my application fonts look bigger and affect the layout.

alt textalt text

change

.Net 2.0 SP2, . , ( ) . , ?

2 eeetop ET1602 xp, , , reset windows/ windows .

+3
2

"Verdana 8.25", 8.25 , "", - , DPI .

Windows . , Dot , .

, , . , , . , .

+4

, DPI " "?


. - " ".

+1

Source: https://habr.com/ru/post/1726317/


All Articles