I am creating an .Net 2.0 SP2 windows Forms Application. The form fonts looks fine in my machine, when i tried in another machine, it looks bigger. (This is not because of resolution difference, fonts are bigger relatively to other icons etc.)
I tried to debug the problem and found following code returns different sizes on different 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 same value for same arguments in different machines.
For 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 this difference ? because of this my application fonts looks bigger and affect layout.
edit:
Both Machines have .Net 2.0 SP2 , but their resolution and screen sizes differ. I understand that fonts physical dimension (on physical screen) will vary with resolution and screen size. But my question is why their dimension in pixel units differ ?
Machine 2 is eeetop ET1602 with windows xp, its touch screen system, by default it came with all desktop fonts bigger, but i have reset windows theme/windows fonts to default.