Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

MagiC/WDIALOG extension: Font selector Library
[AES Function Reference]

font selector functions More...

Data Structures

struct  UTXT_FN_args
struct  _fnts_item

Defines

#define FNTS_BTMP   1
#define FNTS_OUTL   2
#define FNTS_MONO   4
#define FNTS_PROP   8
#define FNTS_3D   1
#define FNTS_SNAME   0x01
#define FNTS_SSTYLE   0x02
#define FNTS_SSIZE   0x04
#define FNTS_SRATIO   0x08
#define FNTS_CHNAME   0x0100
#define FNTS_CHSTYLE   0x0200
#define FNTS_CHSIZE   0x0400
#define FNTS_CHRATIO   0x0800
#define FNTS_RATIO   0x1000
#define FNTS_BSET   0x2000
#define FNTS_BMARK   0x4000
#define FNTS_CANCEL   1
#define FNTS_OK   2
#define FNTS_SET   3
#define FNTS_MARK   4
#define FNTS_OPT   5
#define FNTS_OPTION   FNTS_OPT

Typedefs

typedef void * FNT_DIALOG
typedef void __CDECL(* UTXT_FN )(struct UTXT_FN_args)
typedef _fnts_item FNTS_ITEM

Functions

short mt_fnts_add (FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts, short *global)
short mt_fnts_close (FNT_DIALOG *fnt_dialog, short *x, short *y, short *global)
FNT_DIALOGmt_fnts_create (short vdi_handle, short no_fonts, short font_flags, short dialog_flags, char *sample, char *opt_button, short *global)
short mt_fnts_delete (FNT_DIALOG *fnt_dialog, short vdi_handle, short *global)
short mt_fnts_do (FNT_DIALOG *fnt_dialog, short button_flags, long id_in, long pt_in, long ratio_in, short *check_boxes, long *id, long *pt, long *ratio, short *global)
short mt_fnts_evnt (FNT_DIALOG *fnt_dialog, EVNT *events, short *button, short *check_boxes, long *id, long *pt, long *ratio, short *global)
short mt_fnts_get_info (FNT_DIALOG *fnt_dialog, long id, short *mono, short *outline, short *global)
short mt_fnts_get_name (FNT_DIALOG *fnt_dialog, long id, char *full_name, char *family_name, char *style_name, short *global)
short mt_fnts_get_no_styles (FNT_DIALOG *fnt_dialog, long id, short *global)
long mt_fnts_get_style (FNT_DIALOG *fnt_dialog, long id, short __index, short *global)
short mt_fnts_open (FNT_DIALOG *fnt_dialog, short button_flags, short x, short y, long id, long pt, long ratio, short *global)
void mt_fnts_remove (FNT_DIALOG *fnt_dialog, short *global)
short mt_fnts_update (FNT_DIALOG *fnt_dialog, short button_flags, long id, long pt, long ratio, short *global)

Detailed Description

font selector functions

This Font Selector library availability can be found calling mt_appl_getinfo(7). Bit 2 of ap_gout1, if equal to 1, says that mt_fnts_xx() functions are available.


Define Documentation

#define FNTS_3D   1
 

Display selector in 3D-look

#define FNTS_BMARK   0x4000
 

Button "Mark" selectable

#define FNTS_BSET   0x2000
 

Button "Set" selectable

#define FNTS_BTMP   1
 

Display bitmap fonts

#define FNTS_CANCEL   1
 

TODO

#define FNTS_CHNAME   0x0100
 

Display checkbox for names

#define FNTS_CHRATIO   0x0800
 

Display checkbox for width/height ratio

#define FNTS_CHSIZE   0x0400
 

Display checkbox for height

#define FNTS_CHSTYLE   0x0200
 

Display checkbox for style

#define FNTS_MARK   4
 

TODO

#define FNTS_MONO   4
 

Display mono-spaced fonts

#define FNTS_OK   2
 

TODO

#define FNTS_OPT   5
 

TODO

#define FNTS_OPTION   FNTS_OPT
 

see FNTS_OPT

#define FNTS_OUTL   2
 

Display vector fonts

#define FNTS_PROP   8
 

Display proportional fonts

#define FNTS_RATIO   0x1000
 

Width/height ratio adjustable

#define FNTS_SET   3
 

TODO

#define FNTS_SNAME   0x01
 

Select checkbox for names

#define FNTS_SRATIO   0x08
 

Select checkbox for width/height ratio

#define FNTS_SSIZE   0x04
 

Select checkbox for height

#define FNTS_SSTYLE   0x02
 

Select checkbox for style


Typedef Documentation

typedef void* FNT_DIALOG
 

opaque structure (internal management structure)

typedef struct _fnts_item FNTS_ITEM
 

TODO

typedef void __CDECL(* UTXT_FN)(struct UTXT_FN_args)
 

TODO


Function Documentation

short mt_fnts_add FNT_DIALOG fnt_dialog,
FNTS_ITEM user_fonts,
short global_aes
 

add user fonts

Parameters:
fnt_dialog Pointer to management structure
user_fonts Pointer to user fonts
global_aes global AES array
Returns:
0: Error 1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
With ADD USER FONTS a program can add its own user fonts to those displayed by the font selector. The IDs of these fonts must be higher than 65535. In addition the pointer to a display function must be entered into the structure element FNTS_ITEM::display.

short mt_fnts_close FNT_DIALOG fnt_dialog,
short x,
short y,
short global_aes
 

closes the window of the font selector.

Parameters:
fnt_dialog Pointer to management structure
x will contain the Last x-coordinate of the dialog
[option CHECK_NULLPTR] x may be NULL
y will contain the Last y-coordinate of the dialog
[option CHECK_NULLPTR] y may be NULL
global_aes global AES array
Returns:
1
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
Note: Old WDIALOG versions do not return the window coordinates. In that case the binding enters -1, so that the dialog will be centred automatically at the next call.

FNT_DIALOG* mt_fnts_create short  vdi_handle,
short  no_fonts,
short  font_flags,
short  dialog_flags,
char *  sample,
char *  opt_button,
short global_aes
 

This function initialises the font selector

Parameters:
vdi_handle Handle of the workstation to be used
no_fonts Number of available fonts or 0. If no_fonts is 0, vst_load_fonts() is called with vdi_handle. Otherwise an assumption is made that no_fonts is the number of all fonts available via vdi_handle, i.e. the number of all system fonts (work_out[10] for v_opnvwk()/vq_extnd()) plus the number of fonts loaded in later (return value of vst_load_fonts()).
font_flags Type of fonts to be displayed. It's a bitmap variable which have the following signification:
  • FNTS_BTMP (1) Display bitmap fonts
  • FNTS_OUTL (2) Display vector fonts
  • FNTS_MONO (4) Display mono-spaced fonts
  • FNTS_PROP (8) Display proportional fonts
dialog_flags Appearance of the dialog as following:
  • FNTS_3D (1) Display selector in 3D-look
sample Pointer to string for the sample text
opt_button Pointer to string for optional button or 0L
global_aes global AES array
Returns:
a Pointer to management structure
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
Note:
Depending on system configuration, this function may well take 1 second (possibly even more), so it should be called at program start and not just immediately before displaying the font selector.
Please note: The font selector alters the attributes of the workstation described by vdi_handle. If one wants to use the workstation passed with mt_fnts_create() also for other purposes, the attributes have to be set first each time, as they may have been altered meantime by the font selector.

short mt_fnts_delete FNT_DIALOG fnt_dialog,
short  vdi_handle,
short global_aes
 

releases the memory allocated for the font selector.

Parameters:
fnt_dialog Pointer to management structure
vdi_handle Handle of the Workstation or 0, if vst_unload_fonts() is not to be called
global_aes global AES array
Returns:
1
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

short mt_fnts_do FNT_DIALOG fnt_dialog,
short  button_flags,
long  id_in,
long  pt_in,
long  ratio_in,
short check_boxes,
long *  id,
long *  pt,
long *  ratio,
short global_aes
 

opens a modal dialog and only returns to the caller when one of the exit buttons ("Cancel", "OK", "Set", "Mark" or "Options") was activated.

Parameters:
fnt_dialog Pointer to management structure
button_flags 
id_in 
pt_in 
ratio_in 
check_boxes will contain the Status of the checkboxes
[option CHECK_NULLPTR] check_boxes may be NULL
id will contain the ID of the selected font
[option CHECK_NULLPTR] id may be NULL
pt will contain the Height in 1/65536 point
[option CHECK_NULLPTR] pt may be NULL
ratio will contain the Width/height ratio
[option CHECK_NULLPTR] ratio may be NULL
global_aes global AES array
Returns:
Selected button (or 0)
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

short mt_fnts_evnt FNT_DIALOG fnt_dialog,
EVNT events,
short button,
short check_boxes,
long *  id,
long *  pt,
long *  ratio,
short global_aes
 

evaluates the passed EVNT structure and internally calls mt_wdlg_evnt()

Parameters:
fnt_dialog Pointer to management structure
events Pointer to EVNT structure
button will contain the Selected button (or 0)
[option CHECK_NULLPTR] button may be NULL
check_boxes will contain the Status of the checkboxes:
  • FNTS_SNAME 0x01 Checkbox for the names selected
  • FNTS_SSTYLE 0x02 Checkbox for the style selected
  • FNTS_SSIZE 0x04 Checkbox for the height selected
  • FNTS_SRATIO 0x08 Checkbox for the width/height ratio selected
[option CHECK_NULLPTR] check_boxes may be NULL
id will contain the ID of the selected font
[option CHECK_NULLPTR] id may be NULL
pt will contain the Height in 1/65536 point
[option CHECK_NULLPTR] pt may be NULL
ratio will contain the Width/height ratio
[option CHECK_NULLPTR] ratio may be NULL
global_aes global AES array
Returns:
0 (Exit button selected) or 1 (Nothing happened)
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
If one of the exit buttons ("Cancel", "OK", "Set", "Mark" or "Options") was activated the function returns 0 and the button that the user has selected is returned in button.

short mt_fnts_get_info FNT_DIALOG fnt_dialog,
long  id,
short mono,
short outline,
short global_aes
 

get font info

Parameters:
fnt_dialog Pointer to management structure
id specifies the Font ID
mono will contain the Flag for mono-spaced font
[option CHECK_NULLPTR] mono may be NULL
outline will contain the Flag for vector font
[option CHECK_NULLPTR] outline may be NULL
global_aes global AES array
Returns:
0 (Error) or >0 (Index for vqt_name())
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

short mt_fnts_get_name FNT_DIALOG fnt_dialog,
long  id,
char *  full_name,
char *  family_name,
char *  style_name,
short global_aes
 

returns the full name, the family name and the style for the font given in parameter

Parameters:
fnt_dialog Pointer to management structure
id specifies the Font ID
full_name Pointer to the full name or 0L
family_name Pointer to the family name or 0L
style_name Pointer to den style name or 0L
global_aes global AES array
Returns:
0 (Error) or 1 (All OK)
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

short mt_fnts_get_no_styles FNT_DIALOG fnt_dialog,
long  id,
short global_aes
 

returns the number of fonts that belong to the same family as the font given as parameter.

Parameters:
fnt_dialog Pointer to management structure
id ID of a font of the family, that may have been returned by mt_fnts_evnt() for instance.
global_aes global AES array
Returns:
Number of styles belonging to the family.
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

long mt_fnts_get_style FNT_DIALOG fnt_dialog,
long  id,
short  index,
short global_aes
 

font selector - get style id

Parameters:
fnt_dialog Pointer to management structure
id ID of a font of the family
index Index within the family. index must be a number between 1 and the result of mt_fnts_get_no_styles().
global_aes global AES array
Returns:
ID of the index -th font of the family
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

short mt_fnts_open FNT_DIALOG fnt_dialog,
short  button_flags,
short  x,
short  y,
long  id,
long  pt,
long  ratio,
short global_aes
 

opens a window dialog with the font selector

Parameters:
fnt_dialog Pointer to management structure
button_flags Flags for supported buttons:
  • FNTS_SNAME 0x01 Select checkbox for names
  • FNTS_SSTYLE 0x02 Select checkbox for style
  • FNTS_SSIZE 0x04 Select checkbox for height
  • FNTS_SRATIO 0x08 Select checkbox for width/height ratio
  • FNTS_CHNAME 0x0100 Display checkbox for names
  • FNTS_CHSTYLE 0x0200 Display checkbox for style
  • FNTS_CHSIZE 0x0400 Display checkbox for height
  • FNTS_CHRATIO 0x0800 Display checkbox for width/height ratio
  • FNTS_RATIO 0x1000 Width/height ratio adjustable
  • FNTS_BSET 0x2000 Button "Set" selectable
  • FNTS_BMARK 0x4000 Button "Mark" selectable
x x-coordinate of the window or -1 (centred)
y y-coordinate of the window or -1 (centred)
id Font ID
pt Height in 1/65536 point
ratio Width/height ratio in 1/65536
global_aes global AES array
Returns:
Handle of the window or 0 (error)
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability

void mt_fnts_remove FNT_DIALOG fnt_dialog,
short global_aes
 

removes the fonts installed with mt_fnts_add()

Parameters:
fnt_dialog Pointer to management structure
global_aes global AES array
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
Note:
If a program's user fonts have been installed, then mt_fnts_remove() must be called before mt_fnts_delete().

short mt_fnts_update FNT_DIALOG fnt_dialog,
short  button_flags,
long  id,
long  pt,
long  ratio,
short global_aes
 

font selector - update window

Parameters:
fnt_dialog Pointer to management structure
button_flags Flags for supported buttons:
  • FNTS_SNAME 0x01 Select checkbox for the names
  • FNTS_SSTYLE 0x02 Select checkbox for the style
  • FNTS_SSIZE 0x04 Select checkbox for the height
  • FNTS_SRATIO 0x08 Select checkbox for the width/height ratio
  • FNTS_CHNAME 0x0100 Display checkbox for the names
  • FNTS_CHSTYLE 0x0200 Display checkbox for the style
  • FNTS_CHSIZE 0x0400 Display checkbox for the height
  • FNTS_CHRATIO 0x0800 Display checkbox for the width/height ratio
  • FNTS_RATIO 0x1000 Width/height ratio adjustable
  • FNTS_BSET 0x2000 Button "setting" selectable
  • FNTS_BMARK 0x4000 Button "marking" selectable
id Font ID
pt Height in 1/65536 point
ratio Width/height ratio in 1/65536
global_aes global AES array
Returns:
one of the following value:
  • -1: Function not present
  • 0: Error (insufficient memory), the font selector must then be closed with mt_fnts_close().
  • 1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability
Note:
This function was not present in older versions of WDIALOG. The binding ensures that in that case the function returns -1.


Generated on Wed Nov 3 22:42:21 2004 for GEMLIB by  doxygen 1.3.9.1