![]() |
|||
Version
Goldwww.capesoft.com Updated Wednesday 28 May 2008 |
|||
Introduction
Installation
JumpStart
Example
Programmer's
Guide
FAQ
Support
Purchasing
AnyFont
Distribution
Relationship
with other 3rdParty products
The Global AnyFont Extension
![]()
Global
General Tab
![]()
Global
Multi-DLL Tab
![]()
Global
Default Font Tab
![]()
Global
Save & Load Tab
The
Local AnyFont Extension
![]()
Local
General Tab
![]()
Local
Classes Tab
Class
Method Reference
Class
Properties and Global Variable Reference
![]()
Properties
![]()
Global
Variables
Version
History
License
& Copyright
![]()
| Introduction | |||
|
|
CapeSoft AnyFont extension allows you to change different
properties of your
application font at run-time. Settings can be saved using an .INI file or the
registry. |
||
Run the supplied installation file. CapeSoft AnyFont adheres to the standards layed out by by the C3PA (Clarion 3rd Party Association) for 3rd party Accessory installation:
Template (anyfont.tpl and anyfont1.tpw) - Clarion\3rdparty\template\
Source code (anyfont.clw and anyfont.inc) - Clarion\3rdparty\libsrc\
Examples - Clarion\3rdParty\Examples\AnyFont\
![]()

This jumpstart shows you how to add font resizing to your application.
You won't even have to type a single line of code.
Adding AnyFont to your Application.
To add the AnyFont template to your program, do the following:
This will add the global extension to you application. It will also add local extensions to each of your windows. No parameters need to be changed in order to get AnyFont working.
Changing your Application's Default Font
This can be done in the Global Default
Font tab.
Adding the Embedded Code
to Change the Font.
This is normally done via a menu command using the FontDialog procedure. To make your life easier, embedded
code has already been written for you.
Your application is now ready for use!
There is an example in your \Clarion\3rdParty\Examples\AnyFont\Demo directory. The example shows a simple application that allows storage of names and addresses. An example screen is shown below.
Writing Code for AnyFont
Normally, the only code you will have to add is the FontDialog embed point.
This is called "AnyFontDialog - Call FontDialog to set Font
parameters". The Jump
Start guide shows how to add this embed point.
If you want to be more adventurous and not use the font dialog, the AnyFont global variables are just what you need. To change the font parameters, follow these steps.
Setting the font manually, along with window-resizing templates
If you set the font using the AnyFont dialog box, no extra code needs to
be written. However, if you change the font size manually you will have to insert
some code if you are using a window-resizing template.
NOTE: In all the following examples, the parameters shown by (...) must be supplied as specified in this document.
Listbox Style Behaviours for Different Clarion Versions
Certain versions of Clarion do not read listbox styles correctly. These are
Clarion 5.5 up to Clarion 6.1, RC5.
I get a template Assert requiring me to modify my existing legacy templates. What must I do?
I lost my settings after upgrading AnyFont.
1. Why don't all my open windows' fonts update immediately?
2. Why don't my listbox styles update correctly?
3. When I change the font properties, why does moving and resizing of the
controls not work properly?
4. When I increase the font size so that the window is too large for the
screen, some controls disappear when I decrease the font size. How do I
fix this?
5. AnyFont doesn't remember my window's position correctly.
6. The controls on my MDI child window don't resize.
7. How do I disable AnyFont dynamically?
8. My windows
flicker a lot when I open/resize them.
9. I'm using C55 and when I change the Font color, my XP theme
gets lost on my buttons.
10. I get a template Assert requiring me to modify my existing legacy templates.
What must I do?
11. How do I restrict my users to select a
certain range of font settings?
12. My decimal fields are not correctly
justified when using a larger font.
1. Why don't all my open windows' fonts update immediately?
Answer: All windows, except the window in which the font was changed, will display their new font only when they are newly opened. To update all the windows' fonts, close the application and re-open it.
2. Why don't my listbox styles update correctly?
Answer: You are probably using Clarion 5.5 or 6.0. These versions of Clarion do not read the proplist styles correctly.
3. When I change the font properties, why does moving and resizing of the controls not work properly?
Answer: You're probably using a move-and-resize template that isn't supported yet. At the moment the resizers that AnyFont supports are the standard WindowResize template and IngaSoft's EasyResizeAndSplit v2.07. However, support for more resizers is on the way. In the meantime, there are a few ways to fix this.
4. When I increase the font size so that the window is too large for the screen, some controls disappear when I decrease the font size. How do I fix this?
When the window becomes too large for the screen, the size of the window (in Clarion units) decreases even though the actual size, in pixels, increases. Here are two ways to fix this.
5. AnyFont doesn't remember my window's position correctly.
This may be caused by other code that executes after AnyFont.SetWindow has been called, such as the INI manager or a resizer template. To find out if AnyFont is the culprit, insert the following lines after the call to SetWindow:
display()
stop('SetWindow
called')
If the window displays in the wrong place, then AnyFont is indeed causing the problem. Please call support if this the case.
6. The controls on my MDI child window don't resize.
This is probably caused by setting the font directly in the child window. The correct way of setting the font in an MDI application is to do it in the MDI menu.
7. How do I disable AnyFont dynamically?
To disable AnyFont globally, set the global variable AnyFont:Disable to true. To disable AnyFont in a single window, set the ThisAnyFont.AFdisable variable to true, or call ThisAnyFont.Disable().
8. My windows flicker a lot when I open/resize them.
Answer 1: To use the buffer attribute in a window, you can turn on prop:buffer (in the window.init method after opening the window).
0{prop:Buffer} = 1
This does adversely affect some 3rdparty tools - so this may not be an option in all situations.
Answer 2: There's a problem in one of the ABC methods. For a workaround:
DISPLAY(Toolbar:First,Toolbar:Last)
!DISPLAY(Toolbar:First,Toolbar:Last)
9. I'm using C55 and when I change the Font color, my XP theme gets lost on my buttons.
Answer: C55 does not support Font colorisation and XP theme. If you change the font color manually (in a non-AnyFont app) you will see the effect. The only solution is to upgrade to Clarion6.
10. I get a template Assert requiring me to modify my existing legacy templates. What must I do?
You need to add an extra embed point into the Standard.tpw file (which is located in your Clarionx\template directory).
Open the file in a text editor, and search for the following text:
INISaveWindow(
Immediately after this line, insert a new line with the following code (which you can copy and paste from this document):
#EMBED(%BeforeWindowClosingAfterSaveINI,'Before Closing the Window - After Saving INI')
Close your application and re-open it (you may need to re-register your Clarion templates if your IDE is not set to re-register templates on update), then recompile and run it.
11. How do I restrict my users to select a certain range of font settings?
Answer: You can quite easily reject the
settings if the font settings fall outside the parameters that you require.
You'll need to handcode before the template generated code (in the Validate User
Font Selection embed):
if ValidateFontSettings() = false !This is a
function you create to return whether the font settings are valid or not
message('Warn user he has selected the incorrect font settings')
cycle
end
ThisAnyFont.SetWindow(AnyFont:FontName,AnyFont:FontSize,AnyFont:FontColor,AnyFont:FontStyle,AnyFont:FontCharset,0)
!Template generated code
12. My decimal fields are not correctly justified when using a larger font.
Answer: You will need to Right-justify decimal settings as the RTL does not position a font adjustment decimal justification after the control is created.
I lost my settings after upgrading AnyFont.
Vista (operating under UAC) does not allow programs to write to the Local Machine section of the registry settings. In version 1.51, AnyFont now supports storing the AnyFont settings in the Current User section of the registry by default. you can revert back to using the Local Machine section of the registry (a setting in theGlobal Save & Load Tab), which will maintain your current settings, but will make your program Vista unfriendly.
![]()
| CapeSoft Support | |||
| support@capesoft.com |
|||
| Telephone | +27 21 715 4000 | ||
| Fax | +27 21 715 2535 | ||
| Snail Mail | PO Box 511, Plumstead, 7801, South Africa | ||
AnyFont is now Gold. It is on sale for $49.00.
| Buy Online | |||
Purchase CapeSoft AnyFont for $49 from: |
|||
| CapeSoft Sales | |||
| Web | www.capesoft.com | ||
| sales@capesoft.com |
|||
| Telephone | +27 21 715 4000 | ||
| Fax | +27 21 715 2535 | ||
| Snail Mail | PO Box 511, Plumstead, 7801, South Africa | ||
See the Jump Start for information on how to add the Global Extension. The global extension allows you to set the default font for your application, as well as allowing you to save your font settings in a .INI file.
Global General Tab
Global Default Font Tab
Global Multi-DLL Tab
Global Save & Load Tab
| Global General Tab | |||
![]() |
Disable All AnyFont features |
||
This allows you to control how AnyFont will behave for each window in your application.
NOTE: If the extension is in a report or source template, then AnyFont will be automatically disabled.
Local General Tab
Local Classes Tab
Local Tab (disabled)
| Local General Tab | |||
![]() |
Disable AnyFont in this Procedure
Disable Moving and Sizing of Controls Override
Individual Control Behaviour |
||
| Local Control Options Tab | |||
|
Window Control: Disable Resize Disable Font Change |
||
| Local Classes Tab | |||
|
Object: |
||
| Local Tab (disabled) | |||
|
This local extension is shown when the local template is a Report or a Source template. |
||
![]()
Most of the time your PowerToolbar will reside on the frame of your application together with your AnyFont code templates. The best solution is to partially disable AnyFont locally on the Frame. You do this by going to the AnyFont Local Extension prompts on the frame and checking the Disable AnyFont in this Procedure checkbox. You can leave the Disable Change Font dialog code and/or the Disable AnyFont Disable code checkboxes unchecked here to still use this functionality for your application.
![]()
SetWindow
SetControlFont
SetControlTypeFont
Disable
Enable
SetWindow (<string p_FontName>, long p_FontSize= -1, long p_Fontcolor= -1, long p_FontStyle= -1, long p_FontCharset= -1, byte p_NoMoveSize=0)
Sets the font of the current window.
Parameters:
p_FontName: Name of the new font required. This can either be a variable
name or a literal font name, e.g. 'Arial'.
p_FontSize: Size of the new font.
p_Fontcolor: The new font's colour.
p_FontStyle: The style of the new font (bold, italic, etc.)
p_FontCharset: The character set of the new font. The character set values are listed in the global template in the Default Font tab.
p_NoMoveSize: Set to 1 if the window controls are not to be moved or sized.
Return value: none.
Example:
If the font is to be set for the entire application, do this (AnyFont does
this automatically). Moving and sizing is enabled in this example.
Anyfont:Fontname = 'Tahoma'
Anyfont:Fontsize = 8
Anyfont:Fontcolor = color:red
Anyfont:Fontstyle = style:bold
Anyfont:FontCharset = charset:ansi
thisAnyFont.SetWindow (Anyfont:Fontname,
Anyfont:Fontsize,
Anyfont:Fontcolor, |
Anyfont:Fontstyle, Anyfont:FontCharset,
false)
The font can be set for only one window, in which case don't use the global variables in the font setting. Here is an example, with moving and sizing disabled:
thisAnyFont.SetWindow ('Tahoma', 8, color:red, style:bold, charset:ansi, true)
![]()
SetControlFont (long p_Ctrl, <string p_FontName>, long p_FontSize= -1, long p_Fontcolor= -1, long p_FontStyle= -1, long p_FontCharset= -1)
Sets the font of the selected window control. If this control is the window, then resizing also takes place.
Parameters:
p_Ctrl: Handle of the control whose font is to be changed.
p_FontName: Name of the new font required. This can either be a variable name or a literal font name, e.g. 'Arial'.
p_FontSize: Size of the new font.
p_Fontcolor: The new font's colour.
p_FontStyle: The style of the new font (bold, italic, etc.)
p_FontCharset: The character set of the new font. The character set values are listed in the global template in the Default Font tab.
Return value: none.
Example:
thisAnyFont.SetControlFont (?Listbox,
'Tahoma',
8, color:red,
style:bold, |
charset:ansi)
![]()
SetControlTypeFont (long p_CtrlType, <string p_FontName>, long p_FontSize= -1, long p_Fontcolor= -1, long p_FontStyle= -1, long p_FontCharset= -1)
Sets the font of all the window controls of the specified type. For example, use this method if you want to change all your entry fields' fonts.
Parameters:
p_CtrlType: Type of control whose font is to be changed. A list of
all control types can be found in EQUATES.CLW.
p_FontName: Name of the new font required. This can either be a variable name or a literal font name, e.g. 'Arial'.
p_FontSize: Size of the new font.
p_Fontcolor: The new font's colour.
p_FontStyle: The style of the new font (bold, italic, etc.)
p_FontCharset: The character set of the new font. The character set values are listed in the global template in the Default Font tab.
Return value: none.
Example:
thisAnyFont.SetControlTypeFont (create:button,
'MS Sans Serif',
8, color:red, |
style:bold, charset:ansi)
![]()
Allows dynamic disabling of AnyFont. Sets the AnyFont property AFDisable to true. This must be called before the call to ThisAnyFont.SetWindow().
Parameters: none.
Return value: none.
Example:
thisAnyFont.Disable()
![]()
Enables AnyFont after Disable() has been called. Sets the AnyFont property AFDisable to false. This is its default value.
Parameters: none.
Return value: none.
Example:
thisAnyFont.Enable()
OldFont
NewFont
RegistryFolder
AFdisable
The font attributes used by the program on startup. The initial values of the group are taken from the global variables.
The FontParams group is defined as follows. The elements of the group are self-explanatory.
FontParams
group
Name
string
Size
long
Color
long
Style
long
Charset
long
end
The new font attributes changed by the user.
This variable contains the folder in the registry where the AnyFont settings will be kept. The folder will be in the HKEY_LOCAL_MACHINE\Software folder.
This is the variable changed by the methods AnyFont.Disable() and AnyFont.Enable(). It is used to disable AnyFont in a single window and is normally set to false. To disable AnyFont, set this variable to true just before the initial call to ThisAnyFont.SetWindow().
AnyFont:Fontname
string(31)
AnyFont:FontSize
long(-1)
AnyFont:FontColor
long(-1)
AnyFont:FontStyle
long(-1)
AnyFont:FontCharset long(-1)
These are used to store the current application font and correspond to the variables in the FontParams group. They can be set before the AnyFont.Init procedure is called in order to determine the default application font.
AnyFont:Disable bool(false)
This is used to disable AnyFont globally at runtime and is normally set to false. To disable AnyFont, set this global variable to true. This can be done anywhere in your code. Disabling AnyFont causes all windows to revert to the default system font. If they are already open, no change will occur. See FAQ 1.
Using the embed described below will help you when you want the user to be able to change the value of AnyFont:Disable.
Changing the value of AnyFont:Disable does not affect the value of the local AnyFont.AFdisable properties.
![]()
Call FontDialog to set Font Parameters
Save the AnyFont global Disable Variable
Call FontDialog to set Font Parameters
Insert this embed in order to change the application's font. It opens the font dialog window and saves the results to the place you have chosen in the global extension (.INI file or registry).
Save the AnyFont Global Disable Variable
Insert this embed where you want to change the state of the AnyFont global disable variable, for example in a menu item. It toggles the value of AnyFont:Disable and saves the value to the place you have chosen in the global extension (.INI file or registry).
This embed also allows you to insert code to change any text in the control used. For example, if you have used a menu item labeled 'Disable AnyFont', you can change the text to 'Enable AnyFont' inside the embed when AnyFont is disabled.
![]()
Version 1.53 Gold (September 3, 2007)
Template regression fix (in 1.52) - remove assert from anyfont1.tpw.
Version 1.52 Gold(August 29, 2007)
Object Fix - don't set the window pos if it's centered at (0;0) - check for less than 0, not less than 1.
Object Fix - setfont sometimes duplicates text on a button, use properties rather.
Object change - only set list column properties if they need changing.
Template Fix - legacy for C6 users - generates procedure definitions correctly (if derived). Was generating method declarations without the definition.
Template Fix - uses UPPER to check the template family (for legacy) - not always setting correctly.
Version 1.51 Gold (July 24, 2007)
Ability to use alternative Registry key for Vista compliancy (when saving settings to the registry).
Fix for legacy object generation (was not always generating the object definitions).
Track the use of the ini save settings with that of the ABCINIActive clarion template variable.
Version 1.50 Gold (November 13, 2006)
Fix - Unknown variable %INIActive% template error in some Clarion6 ABC applications.
Version 1.49 Gold (November 1, 2006)
Fix - legacy windows creep (requires a modification to the Standard.tpw template file, which you can find for details in the FAQ section)
Feature - can globally turn disabling on for reports (on by default).
Version 1.48 Gold (October 4, 2006)
Fix - if thread 1 was maximized, and font size was changed, then the window frame lost it's maximized state.
Version 1.47 Gold (July 28, 2006)
Fix - if AnyFont was not initialized, then don't kill - the calling window was being resized when no window was opened.
Version 1.46 Gold (July 25, 2006)
Multi-DLL legacy, was not defining procedures initially (template variable %Family was not initialized correctly).
Version 1.45 Gold (July 21, 2006)
Took off Flat attribute from template Var button checkboxes.
Version 1.44 Gold (July 10, 2006)
Fixed regression - was causing a 'shadow' in XP manifest applications.
Version 1.43 Gold (July 7, 2006)
Included new version of AnyFont1.tpw (does a case insensitive check for method names).
Documented re-display workaround (in ABC applications) - check FAQ8.
Version 1.42 Gold (June 27, 2006)
Fix - regression in 1.40 - tab character in the template was causing the IDE not to play too nicely.
Only set max to what it was if prop:max was changed (on kill).
use SetPosition instead of using props for each pos dimension.
In Kill method, removed prop:hide on the window (was taking too long to close).
Version 1.41 Gold (June 12, 2006)
Fix - regression in 1.40 (class property not declared)
Version 1.40 Gold (June 12, 2006)
Fix - defaults to INI storage method.
Fix - if Registry was not selected, then the AnyFontVal string was not being defined.
Includes C55 tpw or c6 tpw (for Clarion6 template functions only)
Disables AnyFont for DrawHeader control (if it's present).
Version 1.39 Gold (June 6, 2006)
Defaults to save and INIFile is defaulted to the application's INI file. This means that save is on automatically (rather turn save off if you don'r require it).
Version 1.38 Gold (June 5, 2006)
New anyfont1.tpw (sub template version 1.51) - fix for interference with other templates (using the Object01.tpw template)
Version 1.37 Gold (12 April 2006)
Fix - for windows that are maximised - was applying a resize attribute which was displaying the window slightly off x,y position.
Fix - for windows that are centered and maximised - was applying resizing to these windows.
Version 1.36 Gold (2 February 2006)
Fix - for windows that are centered (and has the postion saved in the Resizer class) the window was not re-opening in the correct position.
Version 1.35 Gold (1 February 2006)
Template change - allow disabling of AnyFont (locally) - without disabling the code templates (if populated) - for PowerToolbar support
Fix - slow window drawing (regression introduced in 1.34).
Template Fix - allow derivation of AnyFont object
Version 1.34 Gold (23 January 2006)
Removed client height adjustment for child windows (was not supporting resizing on maximized windows).
Used Width and Height Factors to adjust x and y pos as well as width and height.
Version 1.33 Gold (23 December 2005)
Template change - moved SetWindow command to after resizing template's point.
Removed client height adjustment for child windows (was not supporting resizing on maximized windows).
Version 1.32 Gold (29 July 2005)
Bug fix: v2.09 of EasyResizeAndSplit is not compatible with AnyFont. AnyFont now supports v2.10 of EasyResizeAndSplit.
Version 1.31 Gold (21 June 2005)
Bug fix: When using C55, there were compile errors when the project had already included C55util. C55util is no longer used in AnyFont.
Version 1.30 Gold (20 June 2005)
Bug fix: Importing a procedure from an AnyFont-enabled application into another AnyFont-enabled app. caused a second instance of AnyFont to be associated with the procedure.
Version 1.29 Gold (25 May 2005)
Bug fix: Restoring the global disable setting from an INI file did not work when the INI file was not the default Program INI file.
Bug fix: Locally disabling AnyFont did not hide the AnyFont code embeds, causing compile errors.
Version 1.28 Gold (19 May 2005)
Allows you to disable AnyFont globally at runtime, using the global variable AnyFont:Disable.
Added a new embed to help with the setting and saving of AnyFont:Disable.
Updated the documentation to include the embed points.
Version 1.27 Gold (12 May 2005)
Now supports ClearType fonts. All entries, spin buttons, combos and drop-combos can be set by an option to be fixed to MS Sans Serif. This stops strange-looking text in your entry fields.
Bug fix: Anyfont embeds were added to all templates, causing compile errors.
Version 1.26 Gold (6 May 2005)
Bug fix: changing the font of an MDI application while the window was maximized caused the window to restore to the wrong size.
Bug fix: the default setting on the local template was to disable AnyFont.
Bug fix: the x and y coordinates of a window could become negative.
Added an embed point after the .SetWindow call in the AnyFontDialog code. This is to allow the addition of other window resizer template code that is not currently supported by the AnyFont template.
Version 1.25 Gold (28 April 2005)
Added the SetControlTypeFont method to allow you to change the font of all the window controls of a specified type, e.g. all your buttons or entry fields.
Version 1.24 Gold (6 April 2005)
Bug Fix: Legacy apps had a problem to do with showing of AnyFont embed points.
Bug Fix: Lists that had horizontal scroll bars did not display the last column.
You can now set individual controls not to resize and/or to have their fonts remain unchanged.
Version 1.23 Gold (1 April 2005)
AnyFont is now automatically disabled for Reports and Source templates.
Version 1.22 Gold (29 March 2005)
Bug fix: listbox groups did not resize when the font size changed.
Bug fix: Inclusion of the anyfont.inc header file was done in the wrong place.
Bug fix: Now compatible with File Explorer.
Bug fix: C55, legacy apps sometimes gave a compile error.
Bug fix: C55 resizing altered the minimum height.
A new method, SetControlFont, is now available for setting the font of one control by itself.
Dynamic disabling and enabling of AnyFont is now possible with the Disable and Enable methods.
Version 1.21 Gold (16 March 2005)
The 'Set Font...' button on the Global Default Font tab can now set the font style and character set.
Display problems with the variable buttons fixed.
Version 1.20 Gold (8 March 2005)
Improved Default Font tab in the global extension. The user can now:
Enter the font name with or without quote marks.
Enter the font size using a spin button.
Use the Windows font-selection window to choose the font name, size and colour (not in C55).
Enter variables as well as constant values.
Version 1.11 Beta (25 February 2005)
Version 1.10 Beta (21 February 2005)
Version 1.09 Beta (19 January 2005)
Version 1.08 Beta (11 January 2005)
Version 1.07 Beta (6 January 2005)
Version 1.06 Beta (31 December 2004)
Version 1.05 Beta (17 December 2004)
Version 1.04 Beta (14 December 2004)
Version 1.03 Beta (12 November 2004)
Version 1.02 Beta (25 October 2004)
Version 1.01 Beta (21 October 2004)
Version 1.00 Beta (10 September 2004)
![]()