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.  The great thing about AnyFont
      is that it resizes the window to accommodate the different font sizes, as
      well as moving the window controls proportionally.  If you don't want
      AnyFont to be quite so clever, you can disable certain features so that
      you can use other moving and sizing programs. You can even control the
      behavior of individual window controls. Using AnyFont you can change the
      application's font name, size, color, style and character set.  AnyFont
      supports Clarion 8 and later and both the ABC and Legacy (Clarion)
      template chains.
    Installation
     Run the supplied installation file: 
      
    
    JumpStart
     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:
      
        - Add "ActivateAnyFont - Activate CapeSoft AnyFont" to the project
          global extensions.
      This will add the global extension to you application. It will also add
      local extensions to each of your windows. 
      
      
NOTE: For Multi-DLL applications, you will
      need to do this in each DLL (and EXE) that has windows. See the 
Global
        Multi-DLL Tab on the Global Extension template for settings
      pertaining to Multi-DLL applications. 
      
      
Changing your Application's Default Font 
      This can be done in the 
Global Default
        Font tab. (For Multi-DLL apps, this is done in the EXE)
 
        
        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.
      
        - Create a "Change Font..." menu item in your application's menu
          editor.
- Go to the Embeds section in the Actions tab.
- Expand the whole tree and double-click on the "Accepted | Generated
          Code" item.
- Select "AnyFontDialog - Call FontDialog to set Font parameters". The
          name of the Change Font window is editable, but the default has
          already been added for you.
      Your application is now ready for use! 
Examples 
     There are 4 examples that ship with Anyfont. They
      include
      
      ABC
      Legacy
      Multi-DLL ABC
      Multi-DLL Legacy
       
    Why Windows sometimes flicker a lot when they
      open, after applying AnyFont
     Before discussing possible solutions, it's helpful to
      understand the problem. 
      
      It all starts with the Window structure - which is how we "describe" a
      window in Clarion. The window structure is OPENed (using the cunningly
      named OPEN command), then there is an ACCEPT command which acts as the
      event loop. Once the loop ends the window is closed. In code this looks
      something like this;
      
      
OPEN(window)
        ACCEPT
        END
        CLOSE(window)
      
      One thing to understand is that the OPEN does not DISPLAY the window. The
      window only becomes visible when the ACCEPT command is reached. This means
      that code (like AnyFont) can manipulate the window between it 
      being OPENed and being visible. Something like this; 
      
      
OPEN(window)
        ! AnyFont manipulations here
        ACCEPT
      
      If you wish to DISPLAY the window before the ACCEPT command then the
      DISPLAY command is used.
      
      
OPEN(window)
        ! Some Code
        DISPLAY
        ! Some other code
        ACCEPT
      
      The flickering effect occurs when there is a call to DISPLAY before
      AnyFont has manipulated the window. In other words;
      
      
OPEN(window)
        ! Some Code
        DISPLAY
        ! AnyFont manipulations here
        ACCEPT
      
      The key to fixing the flicker is to isolate and (ideally) remove the
      offending DISPLAY command.
      
      
The following bug was fixed in Clarion 11, and the line
        removed. If you are using Clarion 11 or later you no longer need to do
        this.
      
      First things first - there is a known errant  
DISPLAY
      command in the ABC library (Clarion 10 and earlier) which you should fix.
      To do this;
      
        -   Open your ABTOOLBA.clw file in a
          text editor. 
-   Search for ToolbarUpdateClass.DisplayButtons
            PROCEDURE 
-   Go to the last line of the procedure:
 
 DISPLAY(Toolbar:First,Toolbar:Last)
 
 and comment it out (probably line 240 of ABTOOLBA.clw):
 
 !DISPLAY(Toolbar:First,Toolbar:Last)
 
 
-  Save and exit. 
The following applies to all versions of Clarion, and
        relates to your program, not Clarion itself.
      Secondly (if the flicker persists) examine your own code to see if there
      is a DISPLAY command between the 
 Self.Open
      and the AnyFont initialization.
      
      In ABC the key is the INIT method. This is the method where the Window is
      opened, and where the AnyFont code exists. Something in this method is
      causing the window to display. To find it is recommended to use the 
STOP command as a debugging tool.
      
      So what you want to do is right-click on the procedure in question and
      choose SOURCE. Use search to find the 
        ThisWindow.INIT method. Scroll down to the 
self.OPEN
      command put a 
STOP immediately after that -
      for example
      
      
STOP('a')
      
      then at further embed points in the method
      
      
STOP('b')
      and
      
STOP('c')
      
      and so on. Then run the program. Go to the procedure. The STOPs will
      appear, but after one of them the window will appear. So, for example you
      might see the 'a' and then the 'b' and then the window appears, and the
      'c' STOP also appears. So you know that between the Stop('b') and the
      Stop('c') that DISPLAY is being called.
      
      You may be able to isolate that part further (more stops, repeat test) or
      you may not. If you have hand-code in the errant section (a common case)
      then you can obviously inspect the hand code to determine which line is
      causing the 
      Display. Be especially aware that 
do SomeThing
      lines call routines, and these in turn may trigger a 
DISPLAY.
      
    
Programmer's Guide
     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.
      
        - Set the global font parameters Anyfont:FontName,
          etc.
- Call the SetWindow method.
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.
      
        - If you're using Legacy code with WindowResize, the code should look
          like this: 
 WinResize.Destroy()
 ThisAnyFont.SetWindow(...)
 WinResize.Initialize(...) This
          call should have the same parameters as the one that is called just
          after the window has opened.
 
        - If you're using ABC code with WindowResize, the code should look
          like this:
 ThisAnyFont.SetWindow(...)
 Resizer.Resize()
 
        - If you're using EasyResizeAndSplit, the code should look like this:
 ERS:Resizer.Destruct()
 ThisAnyFont.SetWindow(...)
 ERS:Resizer.Construct()
 ERS:Resizer.Init(...)This call should have
          the same parameters as the one that is called just after the window
          has opened.
 ERS:Resizer.Resize()
 
    FAQ
    Compile Errors? Check out general product 
        CompilerErrors.
    
      
        - Why don't all my open windows' fonts update
            immediately?
- When I change the font properties, why does moving
            and resizing of the controls not work properly?
- 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?
- AnyFont doesn't remember my window's position
            correctly.
- The controls on my MDI child window don't resize.
- How do I disable AnyFont dynamically?
- My windows flicker a lot when I open/resize them.
- How do I restrict my users to select a certain
            range of font settings?
- My decimal fields are not correctly justified when
            using a larger font.
- I lost my
            settings after upgrading AnyFont.
- I need to refresh the Font manually. How do I do
            this?
        -  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.
        
        -  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 CapeSoft's ResizeAndSplit. However, support for more resizers is
          on the way. In the meantime, there are a few ways to fix this...
 
 
            - Override the way these templates handle moving and sizing, or
- Disable AnyFont's moving and sizing using the local window
              template and handle these functions either manually or using one
              of the 3rd-party templates, or
- Change to a supported resizer template.
 
        -  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? 
 
 Answer: 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.
 
 
            - Put in a valid value for the window's minimum size. This will
              stop the window shrinking.
- Add one of the supported resizer templates to your window (see
              FAQ number 3). This won't stop the window shrinking but the window
              controls will adjust their size and positions accordingly.
 
        -  AnyFont doesn't remember my
            window's position correctly. 
 
 Answer: 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.
        
        -  The controls on my MDI child
            window don't resize. 
 
 Answer: 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.
        
        - How do I disable AnyFont
            dynamically? 
 
 Answer: 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().
        
        -  My windows flicker a lot
            when I open/resize them. 
 
 See the section on flickering.
 
 
-  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
-  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. 
 
 Answer: 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 the Global Save
            & Load Tab), which will maintain your current settings, but
          will make your program Vista unfriendly.
-  I need to refresh the Font manually.
            How do I do this?
 
 Answer: You need to set the global AnyFont variables, and
          the call the SetWindow and the Refresh methods:
 
 First set the AnyFont:Fontname, etc variables to what they should be
          then call:
 
 ThisAnyFont.SetWindow(AnyFont:Fontname,Anyfont:Fontsize,
 Anyfont:Fontcolor, Anyfont:FontStyle, Anyfont:FontCharset,
            true)
 ThisAnyFont.Refresh()
 
    Support
     Your questions, comments and suggestions are welcome. 
      You can contact us in one of the following ways:
      
      
        
          
            | CapeSoft Support | 
          
            | Support Page | Find support page with various options here | 
          
            | Email |  | 
          
            | Telephone | +27 87 828 0123 | 
        
      
    Upgrading From AnyFont 1.72 or Earlier
     Note: This section is
        obsolete. This change has been reverted in build 1.76.
      
      Build 1.73 introduced a change in the way
        AnyFont settings were loaded and saved. This will (only) affect
        Multi-DLL (ie Multi-app) ABC systems. 
        
        In build 1.72 and earlier the load and save
          settings were only set in the Exe, and the settings were only loaded
          once a procedure in the exe had executed. This can be a problem if
          procedures are called before any procedures in the Exe app, or if
          there are no procedures in the Exe app. To solve this problem the
          settings are now used in the Program Setup embed (which in an ABC
          Multi-DLL app means that this needs to happen in the Data DLL.)
        
        The default place to store the Anyfont
          settings is in the Program INI file. However in many systems this is
          set as a different name for each app. In this situation it is
          recommended you specify the INI File Name so that the Load and Save
          can happen in different apps.
        
        Clarion Legacy based programs (single apps,
          or multi-dll)  are unaffected by this change. In legacy apps the
          startup code in the Exe runs first, so the Font settings are set in
          the Exe app and are applied there, although the loading has moved to
          the program setup embed point, and not the Frame procedure.
        
        Clarion ABC programs, with just a single Exe
          app are also unaffected by this change. The settings in the Exe app
          are used, although the loading has moved to the program setup embed
          point, and not the Frame procedure.
       
     Distribution
     No additional files are required for shipping.
    
    The Global AnyFont Extension
     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. 
      
      
General Tab
      Default Font Tab
      Multi-DLL Tab
      Save & Load Tab 
      General Tab
      
        Disable All AnyFont Features
        This disables the AnyFont template, and no AnyFont code will be
        generated into the application. This is useful for debugging.
        
Disable on Reports
        This disables the AnyFont template on Report procedures, and prevents
        AnyFont from changing the font on reports. 
      
 
      
      Default Font Tab
      
        Font Parameters
        These parameters override the application font settings. All the fields
        can accept either literal values or program variables. To enter a
        variable, check the 'Var' button next to the relevant field.
        
Support ClearType
        If you're using ClearType fonts, checking this option will change the
        font of all your Entries, Spin Buttons and Combos into MS Sans Serif.
        You only need to do this in Clarion 6, Clarion 7 and up support
        ClearType natively.
        
IF (expr)
        Allows a conditional expression to determine if ClearType support (in
        Clarion 6) is needed or not.
        
Font Name
        The application font name. This can be any supported windows font. If
        the default application font is the same as the window font, leave the
        field empty.
        
NOTE: The font name can be entered with
        or without quote marks. 
        
Font Size
        The application font size in points. See the note at the end of this
        section. For default size, set the value to -1.
        
Font Color
        Choose a color from the color box or enter the value manually. You can
        use either a color definition (e.g. color:black) or an RGB value. For
        default colour, set the value to -1 (color:none).
        
Font Style
        Choose a font style from the drop-down list. The default is 'None',
        which equates to -1.
        
Font Charset
        Choose a font character set from the drop-down list. The default is
        'None', which equates to -1.
        
Change Font...
        This is an alternative method to set the font parameters. 
 
      
      Multi-DLL Tab
      
        This is part of a Multi-DLL program
        If this app is part of a suite of apps, where you are making your own
        DLL's, then tick this option on in all the apps, including the DLL apps
        and the EXE apps in the suite.
        
Export AnyFont Class from this DLL
        Check this box if this app is the root DLL of the app suite. 
 
      
      Save & Load Tab
      
        Save Settings
        Check this box if you want to save the font settings.
        
Which Storage Method?
        Choose to save the settings in either an INI file or the system
        registry.
        
Save in Program's INI
        Check this box if you want to store the settings in the program's INI
        file. For Multi-DLL, ABC apps this setting is not recommended. In a
        Multi-DLL, ABC, system it is better to specify the INI name below.
        
INI File Name
        If you want to store the settings in another INI file, enter its name
        here.
        
INI Section
        Enter the section name to contain the AnyFont settings in your INI file.
      
 
    Local AnyFont Extension
     This allows you to control how AnyFont will behave for
      each window in your application.
      
      General Tab
      Options Tab
      Classes Tab
      
      General Tab
      
        Disable AnyFont in this Procedure
        Disables all AnyFont code in this procedure. This is useful for
        debugging.
        
Disable Moving and Sizing of Controls
        Stops AnyFont from changing the position and size of the window
        controls. This is useful when you want other code to do the moving and
        sizing instead.
        
Override Individual Control Behavior
        You can set individual controls so that AnyFont doesn't resize it or
        change its font. 
 
      
      Options Tab
      
        Preserve Menubar
        If this is on then AnyFont changes will not be applied to the Menubar in
        this procedure.
        
Preserve Toolbar
        If this is on then the AnyFont changes will not be applied to the
        Toolbar in this procedure.
        
Maximum Style Number
        AnyFont is applied to the List-Box Styles which are used in the window.
        By default AnyFont will detect the number of styles defined in your
        ListBox Styles options of the window, and will only apply to those
        styles. If you are adding styles by hand then you may want to override
        that detection with your own maximum style number. 
 
      
      Classes Tab
      
        Object Name
        The name of the AnyFont instance used in the window. ThisAnyFont is used
        by default.
        
Class Name
        You can specify your own class to use. AnyFont is used by default. 
 
    Relationship
      with other 3rdParty products
     PowerToolbar
      
      
      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. 
 
    Class Methods
     SetWindow 
      SetControlFont
      SetControlTypeFont
      Disable
      Enable
      Refresh
      
      SetWindow
       SetWindow
          (<string p_FontName>, long p_FontSize= -1, long p_Fontcolor= -1,
          long p_FontStyle= -1, long p_FontCharset= -1, byte p_NoMoveSize=0)
        
        Description 
        
        Sets the font of the current window.
        
        
Parameters
        
        
          
            
              | Parameter | Description | 
            
              | 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.
        
          
            
              | Example | 
            
              | Anyfont:Fontname = 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:
        
          
            
              | Example | 
            
              | thisAnyFont.SetWindow(' ',8,
                color:red,
                style:bold,
                charset:ansi,
                true) | 
          
        
       
      SetControlFont 
       SetControlFont
          (long p_Ctrl, <string p_FontName>, long p_FontSize= -1, long
          p_Fontcolor= -1, long p_FontStyle= -1, long p_FontCharset= -1)
        
        Description
        
        Sets the font of the selected window control. If this control is the
        window, then resizing also takes place.
        
        
Parameters
        
        
          
            
              | Parameter | Description | 
            
              | 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
        
          
            
              | Example | 
            
              | thisAnyFont.SetControlFont (?Listbox,
                ,8,
                  color:red,
                style:bold, charset:ansi)
 | 
          
        
       
      SetControlTypeFont 
       SetControlTypeFont
          (long p_CtrlType, <string p_FontName>, long p_FontSize= -1, long
          p_Fontcolor= -1, long p_FontStyle= -1, long p_FontCharset= -1)
        
        Description
        
        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
        
        
          
            
              | Parameter | Description | 
            
              | 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
        
          
            
              | Example | 
            
              | thisAnyFont.SetControlTypeFont (create:button,
                ,
                  8, color:red, style:bold,  charset:ansi)
 | 
          
        
       
      Disable
       Disable()
        
        Description
        
        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
        
        
          
            
              | Example | 
            
              | thisAnyFont.Disable() | 
          
        
       
      Enable
       Enable()
        
        Description
        
        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
        
          
            
              | Example | 
            
              | thisAnyFont.Enable() | 
          
        
       
      Refresh
       Refresh()
        
        Description
        
        Re-applies the Font settings to the window. Can be called manually or by
        posting the ThisMakevoer.RefreshEvent to the window.
        
        
Parameters
        
        none
        
        
Return Value
        
        none
        
        
Example 
        
          
            
              | Example | 
            
              | thisAnyFont.Refresh() | 
          
        
       
     
    Class Properties and Global Variable Reference
    
      Properties
      
      
        
          
            
              | Property | Description | 
            
              | Oldfont Group(FontParams) | 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
 | 
            
              | Newfont Group(FontParams) | The new font attributes changed by the user. | 
            
              | RegistryFolder String | 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. | 
            
              | AFDisable Long | 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(). | 
            
              | RefreshEvent Long | If this event is posted to the window, then the Refresh method
                will be called, causing the new font settings to be applied to
                the window. | 
          
        
       
      Global Variables
      
       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. 
 
     
    Embeds
     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. 
 
     License & Copyright
     This template is copyright 2025 by CapeSoft Software.
      None of the included files may be distributed. Your programs which use
      AnyFont can be distributed without any royalties. 
      
      This product is provided as-is. CapeSoft Software and CapeSoft Electronics
      (collectively trading as CapeSoft), their employees and dealers explicitly
      accept no liability for any loss or damages which may occur from using
      this package. Use of this package constitutes agreement with this license.
      This package is used entirely at your own risk. 
      
      Use of this product implies your acceptance of this, along with the
      recognition of the copyright stated above. In no way will CapeSoft , their
      employees or affiliates be liable in any way for any damages or business
      losses you may incur as a direct or indirect result of using this product.
      
      For the full EULA see 
https://capesoft.com/eula.htmlVersion History
     Version 1.97 (May 27, 2025) 
      
      Version 1.96 (July 16, 2024) 
      
        - Fix: For drop-width of drop lists and combo boxes. Courtesy of Igor
          Stolyarov.
Version 1.95 (January 11,
        2023)
        - Fix: If the first window was not the Frame, then GetPosition on
          Target could fail.
Version 1.94 (January 6, 2023)
        - Improvement: Applying changes to window on open optimized.
Version 1.93 (September 9, 2021)
        - Fix: Check for Draw control in template code tested the wrong value.
Version 1.92 (May 24, 2021)
        - Add Clarion 11.1 to Install
Version 1.91 (November 19, 2020)
        - Update: Adjusted default font-style so that if not set it uses
          Font:Regular.
- Change: GetReg Method returns a String not an ANY. Missing values
          are returned as a blank string, not 0.
- Change: Template settings for Load/Save exposed in Exe. (make sure
          these are the same as the Data DLL).
Version 1.90 (March 27, 2020)
        - Update: Shortened LinkMode and DLLMode compile switch names.
          Starting to encounter limits in the project system.
Version 1.89 (February 20, 2019)
        - Change: (ABC) Tweaked support for CapeSoft Message Box. On the
          MessageBox window Anyfont is applied before MessageBox does layout
          calculations.
Version 1.88 (February 13, 2019)
        - Change: (Legacy) Tweaked support for CapeSoft Message Box. On the
          MessageBox window Anyfont is applied before MessageBox does layout
          calculations.
Version 1.87 (September 14, 2018)
        - Add: Clarion 11 support to Install.
- Moved: Automatic Draw Control Detection to the Local Extension, out
          of the Global Extension template.
Version 1.86 (April 20, 2018)
        - Change: The order of events when the window open has changed, and
          the AnyFont startup code has moved to before the INIMGR reads the
          saved window position. This greatly improves compatibility with
          resizing.
- Add: NoWindowSave property. Allows window to recenter windows if no
          window restore in in play.
- Add: SetListStyles method, moved this functionality from SetWindow
          to after SetListStyles routine.
- Deprecated and Removed SetControlFont, SetControlTypeFont, ClearType
          methods. (No longer needed since C6 support dropped.)
- Deprecated, and removed DebugView method. Use Trace instead.
Version 1.85 (April 16, 2018)
        - Change: Legacy: Moved undo to before the INI is saved.
Version 1.84 (February 12, 2018)
        - Fix: If font size changed, then windows would flicker when closing.
- Template: Updated to Cape templates version 4.11
Version 1.83 (September 26, 2016)
        - Fix: Could get errors declaring %temp and %max in same scope.
Version 1.82 (April 21, 2016)
        - Fix: Legacy template did not change browse styles correctly.
Version 1.81 (October 19, 2015)
        - Fix: Changing the font of a string control causes it to ignore it's
          "Angle" property. Resetting the Angle property to the existing values
          sorts this out.
Version 1.80 (October 8, 2015)
        - Fix: Setting Fonts on Menus and Menu Items stopped working.
Version 1.79 (August 7, 2015)
        - Speed improvement when opening windows with lots of controls.
Version 1.78 (February 25, 2015)
        - Clarion 10 compatible build.
Version 1.77 (February 12, 2015)
        - Fix for unknown %ClearType variable Regression in 1.76.
Version 1.76 (January 23, 2015)
        - Undo: The change to Saving,
          introduced in build 1.73 is more complicated than first thought. Thus
          Saving has been reverted to Version 1.72. Changes to saving will be
          revisited in AnyFont 2.
Version 1.75 (January 2, 2015)
        - Fix: Better compatibility with ResizeAndSplit template on window
          with "Save Font" Dialog Code template.
Version 1.74 (December 23, 2014)
        - Fix: Compiling an ABC exe app could cause a compile error id the
          "Save" option was off.
Version 1.73 (December 17, 2014)
        - Change: (This will affect your ABC Multi-DLL
            app! [update: Change reverted in
          version 1.76]) - Global AnyFont settings (Default Font, and Load &
          Save Settings) have moved from the EXE app to the Data-DLL app.
- Change:  Saved Font settings are loaded on program startup, not when
          "a procedure in the Exe app is run".
- Change: Clear Font support for Clarion 6 support removed.
Version 1.72 (December 16, 2014)
        - Update: Examples updated. Multi-DLL examples added.
Version 1.71 (July 14, 2014)
        - Fix: AnyFontEnabled equate should be generated even if AnyFont
          template is disabled.
- Fix: Some startup code moved outside of #IF statement.
Version 1.70 (January 31, 2014)
      
      Version 1.69 (Oct 8, 2013)
        - Add: Option to explicitly set wallpaper to stretched/tiled/centered
          when window resized because of a font change.
- Add: Option to force the font color to a specific value, regardless
          of the color chosen by the user.
Version 1.68 (Aug 21, 2013)
        - Local Anyfont template suppressed on procedures with no window.
- Maximum Style used by the window detected, and the SetWindow call
          limited to those styles. This can be overridden on the Options tab of
          the local extension. a lower number can improve window performance,
          especially windows with a large number of List controls.
- Preserve Menubar and Preserve Toolbar local options added.
- Internal: prefixed all API calls with af, not cs.
- Internal: Added Trace method to class.
Version 1.67 (Aug 1, 2013)
        - Update: Implement 4.04 of cape templates.
- Fix: Could get template warnings when selecting AnyFont local
          extension in Legacy program.
Version 1.66 (May 24, 2013)
        - Update: Implement 4.02 of cape templates.
- Fix: Could get template warnings when adding a new procedure.
Version 1.65 (April 30, 2013)
        - Updated Install to detect Clarion 9.
Version 1.64 (March 14, 2013)
        - Changed to Ver4 object/template management system. IMPORTANT
           READ
              THIS.
- Add: support for Multi-Proj in C8
Version 1.63 (January 23, 2013)
        - Fix: Problem with List Styles if the List font is set to something
          other than the window font.
Version 1.62 (June 13, 2012)
        - Added Refresh method to object. Template generates SetWindow call
          into Refresh method.
- Added TakeEvent method to object. Does a refresh when receiving the
          self.RefreshEvent property.
- Class tweak - sublist control type added for exclusion by Anyfont
          save and restore size methods (can't do setposition on this control
          type at this stage).
Version 1.62 (June 13, 2012)
        - Added Refresh method to object. Template generates SetWindow call
          into Refresh method.
- Added TakeEvent method to object. Does a refresh when receiving the
          self.RefreshEvent property.
- Class tweak - sublist control type added for exclusion by Anyfont
          save and restore size methods (can't do setposition on this control
          type at this stage).
 
Version 1.61 (October 5, 2011)
        - Stamp what AnyFont version template was added to the application.
- Work around for missing %ReportOrSource template variable.
- Legacy embed point check moved to the global template.
- Corrected embed point for when legacy is enabled (was the same embed
          point as disabled).
- AnyFont01.tpw updated from 1.54 to 1.66
Version 1.60 (February 19, 2010)
        - Fix for possible memory leak.
Version 1.59 (February 17, 2010)
        - Added Cleartype method to class to reduce code generated by
          template. Code in the method is suppressed in Clarion 7.0 and later.
- Added a property to the class, ClearTypeDisable, which if set to
          true, suppresses cleartype support.
- Conditional "IF" statement added to template to support property
          above.
Version 1.58 (December 29, 2009)
        - Fix for Legacy apps. Supports saving ini settings in program INI
          file, 
 if program ini name is a variable of the form !glo:somename
Version 1.57  Gold (October 20, 2009)
        - Specify default font per application (in Multi-DLL apps).
- Support Clear type font is available for DLLs (as well as EXEs).
- Cleaned up runtime set template symbols (%ABCINIActive,
          %ListControls, %INISaveWindow)
Version 1.56  Gold (May 25, 2009)
        - Allows user definable INI section to write the stored settings to.
- Template change - use WinResize.kill and WinResize.Init (rather than
          destroy and initialize)
- Class fix - only set the prop:fontname if the fontname is specified
          (otherwise leave as is).
Version 1.54  Gold (November 10, 2008)
        -  Clarion 7 compatible install.
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't 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 position 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.
- Can now change the character set from the Font Dialog embedded code.
Version 1.11 Beta (25 February 2005)
        - If the window has the CENTER property enabled, the window stays
          centered after adjusting the font. Otherwise the top left-hand corner
          of the window now stays in the same place.
Version 1.10 Beta (21 February 2005)
        -  Bug fix: resizing a non-MDI window with a toolbar and minimum
          height set would cause the new height to be a little too large.
-  Now works with Easy Resize And Split v2.07 and later.
Version 1.09 Beta (19 January 2005)
        -  Bug fix: default-sized images with icons would shrink or grow when
          the font size changed. They now remain the same size.
-  Now works with Ingasoft's Easy Resize And Split template v2.06.
Version 1.08 Beta (11 January 2005)
        -  Major re-write of the resizing functions. This fixes the tendency
          of controls to creep across the window when the font size changes.
-  Can now save the font settings in the registry as well as the INI
          file.
-  Bug fix: changing the font size so that the window was too large
          for the screen caused some controls to disappear. This has been fixed
          (see FAQ number 4).
-  Deleted various procedures and variables, which are now no longer
          needed.
Version 1.07 Beta (6 January 2005)
        -  Bug fix: When importing an application to C6 and then adding
          AnyFont, some template variables were undefined.
-  Bug fix: In C6, the window and first control did not always resize
          when reducing the font size.
Version 1.06 Beta (31 December 2004)
        -  AnyFont now works with Special Agent.
-  Bug fix: In C55, the window and first control did not always resize
          when reducing the font size.
-  Resizing of window controls is now more stable.
Version 1.05 Beta (17 December 2004)
        -  Bug fix: Drop-down combo boxes had their drop-down width set really
          narrow.
-  Bug fix: Drop-down lists (combo boxes and list boxes) now have
          their line height adjusted when the font size changes.
Version 1.04 Beta (14 December 2004)
        -  Bug fix: Font Style and Character Set did not have the option to be
          set to -1.
Version 1.03 Beta (12 November 2004)
        -  Now works with WindowResize.
- List box styles change correctly (C6.1 and later).
- Modified font parameter setting in the global extension: now uses
          list boxes and standard Windows colour box.
Version 1.02 Beta (25 October 2004)
        - Bug fix: RTF not supported in Clarion 5.5.
Version 1.01 Beta (21 October 2004)
        - Bug fix: RTF strings lost their formatting. Now ignores RTF string
          formatting.
Version 1.00 Beta (10 September 2004)
        - First release of CapeSoft AnyFont.