Font Changes

DataFlex 17.0 contains changes that allow your applications to make better use of fonts in Windows. This includes changes that allow your application to use the default Windows system typeface and font size and it also includes new and better ways to customize font sizes.

Be sure to read...

Understanding Fonts in DataFlex

Migrating Workspaces to DataFlex 2012 - Font Changes

When using DataFlex 17.0, a couple of small interface changes will allow you to use the Windows system typeface and font size and to manipulate font sizes in a more meaningful and scalable way. In addition, you will be able to continue to run your applications in legacy mode until you are ready to make the switch.


The property FontPointHeight has been added to all font based objects. It represents the height of an object in points. Windows will set the width based on this height.

FontPointHeight sets an internal Windows LogicalFont height, which is also what FontSize and Physical_FontSize do. Therefore, these old interfaces do not change. If you don't use the new FontPointHeight property, nothing changes.

Using FontPointHeight is now the suggested mechanism for getting and setting font heights. FontSize and Physical_FontSize should be phased out.

The advantages of FontPointHeight are:



A new form property Form_FontPointHeight has been created for form objects such as Form and dbForm. It behaves the same as the FontPointHeight property except that it, like all of the form_font properties, does not change the size of the control.


The property pbUseWindowsFont determines if your application should use the Windows system font and font height or if it should continue to use the legacy font (MS Sans Serif, physical_fontsize=12). This property is defined in the desktop object and is global. It is also defined in the cApplication class, so it can be easily modeled and changed in the Studio. If your application has a cApplication object, you should set this property there.

Two other desktop functions have been created:

Get WindowsTypeface of Desktop to sVar

Get WindowsFontPointHeight of Desktop to iVar

They return the Windows system typeface and point height.

Other Sizing Improvements

We have made few changes in how dialog units are created. The new mechanism is a little more accurate, which allows for better size and location scaling when font typefaces are changed. You will see this change with both new and legacy style global font usage. It just makes things size better.


While the skin framework works well these changes, it does not work well at different DPI settings and it never did. Skinning allows you to set normal, large and extra large fonts, which is essentially doing the same thing that changing the Windows DPI does. You can't have two systems trying to change the same thing.  For this reason, Codejock provides an interface for disabling the applying of font metrics (see ComApplyOptions).  When this is disabled, the skin framework will not change the size of fonts. When pbUseWindowsFont is True, the skin framework now disables this, allowing Windows to handle the DPI settings. This means that different skins of normal, large, extra-large will now all appear the same size.

For compatibility reasons, this change is only activated when pbUseWindowsFont is True. It might have made sense to always apply this, because the normal, large, extra-large options are not very useful. They only change some of the fonts and sizes and they do it in a rather inconsistent fashion.


See Also

What's New in DataFlex 2012 - 17.0