Scaling Euphoria MS Windows applications to font DPI
- Posted by Andrew Katz <Akatz712 at gmail.com> May 17, 2007
- 686 views
Both Judith and Quark have complained about my Magic Designer application looking ugly. And the reason why this is, is because I designed it using my computer display at 96 DPI, and they both have theirs set at 120 DPI. So, I set mine at 120 DPI: Right click on Desktop and select Properties. Click Settings. Click Advanced. Set to Large Size (120 DPI) You will need to restart Windows. This issue is a HUGE one. I have noticed that some applications change and others do not! And some web pages change to the correct DPI and others do not. And in some cases, like Thunderbird email application, the user has the ability to adjust field lengths once they have established their DPI for fonts. With Magic Designer, I had carefully sized things using my standard 96 DPI to maximize the drawing area, for people with a 800 x 600 display. And now that I switched to 120 DPI, I can see where my application fails and where it is ugly. For example, I got Derek to write a status line library for me (he never finished it). And one of the things he does is to size the height based upon the font. lHeight = win:getTextHeight(pParent, "M") + 10 However, the widths of the subfields in my status line are too small in 120 DPI, and the information disappears at times. This is a case of an unusable application (well it really is still usable since one can click buttons, but the proper use is interfered with). The most obvious problem is that text is truncated all over the place (inside of edit fields, label fields, labels of controls, caption of buttons). I found this document online, which discusses how to write applications which scale properly for DPI fonts. They say it is simple, but from the point of view of writing in Euphoria, I do not see it as simple. Take a look at this: http://msdn2.microsoft.com/en-us/library/ms969894.aspx I was thinking of writing 2 versions of my program. One for 120 DPI and one for 96 DPI. And let the user pick which one they will run. But of course, 120 is not the only other possible DPI. Another solution would be for me to detect the DPI on start up and make all of the internal adjustments (which would be the differences between my 96 DPI original version, and my soon to be coded 120 DPI version). How would you recommend I approach this problem? Andy Katz B.S. Computer Science, 1978 Rensselaer Polytechnic Institute (RPI)