Fonts Tab

Top  Previous  Next

This option allows you to change the default Font in all the windows of your system. If you altered the size or color of a specific control in a window, it won't be altered (or you may specify a local override).

The Fonts window has the following options:

 

clip0136

 

The variables that contain the information about the Fonts should be global (you may copy them from the data dictionary of the example program supplied, to your program), and they should have the following characteristics:

 

GLO:FontTypeface        STRING(64) 

GLO:FontSize                BYTE

GLO:FontColor                LONG

GLO:FontStyle                LONG

 

Also, when this option is active, you should load these variables with valid contents. This load could be done with the standard Clarion Font dialog like this:

 

IF FONTDIALOG(,GLO:FontTypeface,GLO:FontSize,GLO:FontColor,GLO:FontStyle,0) THEN

   !For example, save the variables…

   PUTINI(USERNo,'GLO:FontTypeface',GLO:FontTypeface,CLIP(LONGPATH())&'\preferences.ini')

   PUTINI(USERNo,'GLO:FontSize',GLO:FontSize,CLIP(LONGPATH())&'\preferences.ini')

   PUTINI(USERNo,'GLO:FontColor',GLO:FontColor,CLIP(LONGPATH())&'\preferences.ini')

   PUTINI(USERNo,'GLO:FontStyle',GLO:FontStyle,CLIP(LONGPATH())&'\preferences.ini')

END

 

When the variables are empty, the Font won't be changed.

 

Looking at the example program supplied, you may see in the FSFormStyles window how to use the control and code templates supplied to pick a Font, and to read and save the .ini file.

The variable name drop-list will shown only the global variables that contains font as part of the name, case insensitive (for example, GLO:FontTypeface).

 

The Lock entry option allows the program to ignore your selection of Font, only for data entry fields. Clarion entry fields (so far up to version 6.3 9050) are incompatible with Fonts OpenFace, they are illegible in LCD screens. Checking this option you lock the entry type fields to the MS Sans Serif font. Text type fields don't have this problem, but they will look odd if you have entry fields with a Font and text field with other. If that's the case, you may also check Lock text also and both types of fields will be locked with the Serif font.

 

At the local level, in the Font tab you have the Don't generate code option, which allows you to suspend the Font replacement for that particular procedure. This option may come handy when you need the window to remain at a certain size or its controls to have a special presentation (like for example a report previewer, like Icetips Previewer).

 

A good example of the use of the Font replacement you can see with the Dlltutor multi-dll example application that is supplied with Clarion. In that app the windows don't even have a font assigned, so they take the system font (and look awful).

This is the Customer update window when you run the program as is:

 

clip0137

For the next window capture, not a single change was made in the window itself, it was just applied the global extension with the following settings. Before including the template in the app, the variables were copied into the dictionary from the example one.

In the "Font" Tabs, the global variables were defined as shown above.

The "All controls tranparent" was activated in the "Window" tab.

 

A button was added to the main Frame to select the Font. When the program run, a Tahoma, normal size 9 font was selected. The template was added to allfiles.app and to updates.app and recompiled. This was the immediate result:

 

clip0138

 

Note: This option Works different in Clarion 5.x than in Clarion 6.x. In 5.x versions, the window is not automatically resized when you change the font size. The example and window shown are for 6.x.