简体   繁体   中英

.net system independent font size

I have a custom windows forms .net window with several text boxes. Text boxes has always the same font size (courier new 10). There's hard coded box resizing logik which only works when the font size stays the same.

For some reason, on one machine, the font size is different. I think it depends on some custom system font settings. (windows 7 machine)

Is that possible? Can you "override" how a font is displayed? If yes, is there any way to avoid that behavior? I just always want the texboxes to have the same font size.

Thanks for any help.

Is that possible? Can you "override" how a font is displayed?

I think it is not possible. Take a look at this answer: https://stackoverflow.com/a/1944813/1758762

In Windows, under Desktop settings you have option of increasing the screen font size without changing the resolution. If you increase screen font size then the Dot per pixel changes which can measure different pixel size for same text on different machine.

This is due to fact that old people can not read smaller fonts, thats why they can increase the font size in desktop settings ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM