Rephrased question:
When I draw on bitmaps from a unit test from within Visual Studio, the zoom factor I have on my desktop is taken into account, but when I run from the console it is not.
What can I do to make texts rendered using Graphics.DrawString behave consistently regardless of my desktop settings?
I have some NUnit tests that create bitmaps using GDI+ and compares them to pre-saved images to make sure that the correct image is generated.
My problem is that texts (rendered with Graphics.DrawString) are different when I run the tests from within Visual Studio, compared to what is generated when I run then tests in my command line build script (using the NUnit 3.2 test runner).
Note: it is not some minor one-pixel-off or text wrapping issue. The font size of the texts rendered while running from the console is waaay smaller.
Does anybody know why the font size would be different one the same machine depending on the execution environment? And equally important: what can I do about it?