Understanding Fonts in DataFlex
Overview
DataFlex allows your applications to properly use fonts in Windows. This includes using the default Windows system typeface and font size, as well as ways to customize font sizes. These capabilities have the following advantages:
- Your application will use the same fonts as the rest of Windows, creating consistency across applications.
- Your application will use the same fonts throughout your application, creating consistency within your application (e.g., the DataFlex controls and Codejock COM controls will use the same font).
- If your application is deployed on multiple Windows versions, it will use the font that is appropriate for each version.
- If your users change the DPI setting on their computers, your application will scale to the new setting.
These simple guidelines should get you started:
- Make sure that you are using the Windows system font by setting
[pbUseWindowsFont](../VdfClassRef/WebAndWindows/cApplication-Property-pbUseWindowsFont.md)to true in your[cApplication](../VdfClassRef/WebAndWindows/cApplication.md)object. - Start by doing nothing. If you do not have any code that sets font properties, your application will now use fonts properly and look correct on any supported Windows platform.
- If you want to change the font for one or more controls, set the controls'
[Typeface](../VdfClassRef/Windows/DfBaseWindow-Property-Typeface.md),[FontPointHeight](../VdfClassRef/Windows/DfBaseWindow-Property-FontPointHeight.md),[FontWeight](../VdfClassRef/Windows/DfBaseWindow-Property-FontWeight.md),[FontUnderline](../VdfClassRef/Windows/DfBaseWindow-Property-FontUnderline.md), and[FontItalics](../VdfClassRef/Windows/DfBaseWindow-Property-FontItalics.md)properties. - Do not set font properties in containers. Do not use the
FontSizeorPhysical_FontSizeproperties.
A secondary goal is to not just explain what to do, but to explain why it works. In the next section, we are providing detailed information about fonts and DataFlex. Some of this information may appear complicated, but once understood, you should be able to work with fonts in a much more predictable fashion. Once this is understood, we feel that you will be able to take advantage of the more detailed recommendations for using fonts section and the section about migrating your existing applications.
Of Special Note
If you developed applications in revisions of DataFlex prior to 17.0, please be sure to read the following: