I wrote a C# application for Linux that is compiled by mono (gmcs
) and uses the WinForms 2.0 library render a user interface. My application looks fine on my computer, but one of my customers is a using a computer (a Fedora/OLPC) with a large font size, and the auto scaling did not totally work for him (text got bigger while user control sizes stayed the same).
If I could increase my font size and reproduce the problem on my Ubuntu computer, I'm sure I could fix the problem (by setting the right AutoScaleMode and AutoScaleDimensions for all of my controls). But when I try to increase my system font size in the System -> Preferences -> Appearance dialog, my font size settings do not seem to have any effect on the Winforms-rendered UI.
So, how does Mono WinForms determine the system font size? How can I make it choose a bigger size on my computer?
I am using Ubuntu 9.10 and Mono winforms 2.4.2.3+dfsg-2.
In case it matters, my application was ported from Visual Studio so the fonts on the control are set in .Designer.cs files like so:
label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
(Hans Passant gave the correct answer to this question, but his answer is no longer here, so I will answer my own question.)
The font size used by Mono Winforms is determined by the Resolution (DPI) setting in Ubuntu, which can be accessed by going to System -> Preferences -> Appearance -> Fonts -> Details.