This is an occasional blog about IET's use of CA Gen for internal development as well as thoughts, tips and techniques on using CA Gen for application development. It is aimed at the CA Gen development professional, so please excuse the jargon and assumed level of knowledge about CA Gen. Reference will also be made to our products to put the development into context, so if you are not familiar with these, please visit the IET web site by clicking on the company logo.

Monday, 28 October 2013

Font Sizes and Display Resolution

When designing a GUI application in Gen, the controls are positioned using a pixel based co-ordinate system that specifies the position and size of the controls. In addition, fonts are specified using point sizes. A point is 1/72 inches, so for example 12 pt text is 1/6 inch high. In the 'normal or 100%' resolution on Windows desktop, the screen resolution is 96DPI (dots per inch), so 12 pt text is 16px (pixels) high.

If the user changes the screen resolution to say 120 DPI (125%), then the same 12pt text is now 20px high. However the remainder of the window design is still specified in pixels, and this can cause problems with the positioning of the text within the controls.

In the example below, notice the change in the window between 96 and 120DPI.

Window with system resolution set to 96 DPI

Window with system resolution set to 120 DPI

To support the change in DPI, the designer would need to ensure that text fields and literals are wide enough to accommodate all of the text and avoid wrapping. Web Browsers also allow the user to change the zoom factor for an application.

For Rapide Browser and Mobile applications, Rapide uses pixel based font heights rather than point based, with the conversion from points to pixels based on 96DPI. This means that a UI design that looks correct in 96DPI will scale correctly irrespective of the DPI setting or browser zoom level.

Rapide Desktop applications still use a point based font size to ensure that fonts are scaled if the user requires a higher DPI setting.

Labels

Disclaimer

The views and opinions expressed here represent the personal opinions of the authors and not organizations that they are related to with unless stated explicitly. Tips and techniques described may be 'work in progress' and you should take your own measures to validate that any techniques used are valid and applicable for your own requirements. This blog is not responsible for any comments left apart from our own and off-topic comments may be deleted.