GUI ScreenIO for Windows

 ScreenIO.com


ChooseFont

The ChooseFont API launches the Choose Font common dialog which allows the user to select one of the fonts installed on the system. 

The use of the ChooseFont API is beyond the scope of a typical GUI ScreenIO application.  ChooseFont is used by the GUI ScreenIO panel editor but is of limited use to you in your application, since you can't change fonts on panels at run time using this API

See the Microsoft Windows documentation if you intend to use this API.

This may be useful for applications doing low-level printing applications.

Client/Server issues

No issues; this API will behave as if it were running locally on the client.

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY CHOOSFNT.

* ------------------------: Call the API.

     SET API-CHOOSEFONT TO TRUE.

     CALL 'GSWINAPI' USING WIN32API-PARMS

                           CHOOSEFONT-PARMS
                           CHOOSEFONT-LOGFONT
                           WIN32API-C
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.

Parameters specific to this function

CHOOSEFONT-HINSTANCE

Instance handle of your application, from your main panel.

CHOOSEFONT-HWNDOWNER

Handle of the owner window; panel-HWND.

CHOOSEFONT-FLAGS

Flags used to initialize the font dialog box.

A combination of bit flags that specify various options used to initialize the common dialog. 

You OR these values to specify the bit values used for CHOOSEFONT-FLAGS.  You can ADD them together, but you must be certain that the addition does not result in a carry, which would not set the desired bits.

You assign these values like this:

 CF-EFFECTS  PIC 9(9) COMP-5 VALUE H'00000100'.     

Flag Value Description
CF-EFFECTS 100h Offers strikeout, underline, colors
CF-FIXEDPITCHONLY 4000h Shows only fixed pitch fonts.
CF-INITTOLOGFONTSTRUCT 0040h Use LOGFONT values to initialize.
CF-NOSCRIPTSEL 800000h Disables the Script combobox.
CF-NOVERTFONTS 1000000h List only horizontal fonts.
CF-PRINTERFONTS 2h List printer fonts (requires hDC for the printer)
CF-SCREENFONTS 1h List screen fonts.
CF-TTONLY 40000h List only TrueType fonts.

CHOOSEFONT-POINTSIZE

Size of the selected font, in units of 1/10 of a point.

CHOOSEFONT-FONTTYPE

Type of selected font.

CHOOSEFONT-RGBCOLORS

If CF_EFFECTS is set, this is the text color.

CHOOSEFONT-HEIGHT

Height of the font's character cell, in logical units.

CHOOSEFONT-WIDTH

Average width of the font's characters, in logical units.

CHOOSEFONT-ESCAPEMENT

Angle of the escapement vector and x-axis of the device.

CHOOSEFONT-ORIENTATION

Angle, in tenths of a degree, between each character's baseline and the x-axis of the device.

CHOOSEFONT-WEIGHT

Weight of the font in the range 0 to 100.

CHOOSEFONT-ITALIC

If TRUE, specifies an italic font.

CHOOSEFONT-UNDERLINE

If TRUE, specifies an underline font.

CHOOSEFONT-STRIKEOUT

If TRUE, specifies an underline font.

CHOOSEFONT-CHARSET

Specifies the character set.

CHOOSEFONT-OUTPRECISION

Specifies the output precision.

CHOOSEFONT-PITCHANDFAMILY

Specifies the pitch and family of the font.

CHOOSEFONT-FACENAME

Facename of the font.

CHOOSEFONT-QUALITY

Specifies the output quality of the font.

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom