GEMLIB
0.44.0
|
font selector functions More...
Data Structures | |
struct | UTXT_FN_args |
struct | _fnts_item |
Macros | |
#define | fnts_add(a, b) mt_fnts_add(a,b,aes_global) |
#define | fnts_close(a, b, c) mt_fnts_close(a,b,c,aes_global) |
#define | fnts_create(a, b, c, d, e, f) mt_fnts_create(a,b,c,d,e,f,aes_global) |
#define | fnts_delete(a, b) mt_fnts_delete(a,b,aes_global) |
#define | fnts_do(a, b, c, d, e, f, g, h, i) mt_fnts_do(a,b,c,d,e,f,g,h,i,aes_global) |
#define | fnts_evnt(a, b, c, d, e, f, g) mt_fnts_evnt(a,b,c,d,e,f,g,aes_global) |
#define | fnts_get_info(a, b, c, d) mt_fnts_get_info(a,b,c,d,aes_global) |
#define | fnts_get_name(a, b, c, d, e) mt_fnts_get_name(a,b,c,d,e,aes_global) |
#define | fnts_get_no_styles(a, b) mt_fnts_get_no_styles(a,b,aes_global) |
#define | fnts_get_style(a, b, c) mt_fnts_get_style(a,b,c,aes_global) |
#define | fnts_open(a, b, c, d, e, f, g) mt_fnts_open(a,b,c,d,e,f,g,aes_global) |
#define | fnts_remove(a) mt_fnts_remove(a,aes_global) |
#define | fnts_update(a, b, c, d, e) mt_fnts_update(a,b,c,d,e,aes_global) |
#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 struct _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_DIALOG * | mt_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) |
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 FNTS_3D 1 |
Display selector in 3D-look
#define fnts_add | ( | a, | |
b | |||
) | mt_fnts_add(a,b,aes_global) |
single-thread version of mt_fnts_add()
#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_close | ( | a, | |
b, | |||
c | |||
) | mt_fnts_close(a,b,c,aes_global) |
single-thread version of mt_fnts_close()
#define fnts_create | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f | |||
) | mt_fnts_create(a,b,c,d,e,f,aes_global) |
single-thread version of mt_fnts_create()
#define fnts_delete | ( | a, | |
b | |||
) | mt_fnts_delete(a,b,aes_global) |
single-thread version of mt_fnts_delete()
#define fnts_do | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i | |||
) | mt_fnts_do(a,b,c,d,e,f,g,h,i,aes_global) |
single-thread version of mt_fnts_do()
#define fnts_evnt | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g | |||
) | mt_fnts_evnt(a,b,c,d,e,f,g,aes_global) |
single-thread version of mt_fnts_evnt()
#define fnts_get_info | ( | a, | |
b, | |||
c, | |||
d | |||
) | mt_fnts_get_info(a,b,c,d,aes_global) |
single-thread version of mt_fnts_get_info()
#define fnts_get_name | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | mt_fnts_get_name(a,b,c,d,e,aes_global) |
single-thread version of mt_fnts_get_name()
#define fnts_get_no_styles | ( | a, | |
b | |||
) | mt_fnts_get_no_styles(a,b,aes_global) |
single-thread version of mt_fnts_get_no_styles()
#define fnts_get_style | ( | a, | |
b, | |||
c | |||
) | mt_fnts_get_style(a,b,c,aes_global) |
single-thread version of mt_fnts_get_style()
#define FNTS_MARK 4 |
TODO
#define FNTS_MONO 4 |
Display mono-spaced fonts
#define FNTS_OK 2 |
TODO
#define fnts_open | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g | |||
) | mt_fnts_open(a,b,c,d,e,f,g,aes_global) |
single-thread version of mt_fnts_open()
#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_remove | ( | a | ) | mt_fnts_remove(a,aes_global) |
single-thread version of mt_fnts_remove()
#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
#define fnts_update | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | mt_fnts_update(a,b,c,d,e,aes_global) |
single-thread version of mt_fnts_update()
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
short mt_fnts_add | ( | FNT_DIALOG * | fnt_dialog, |
FNTS_ITEM * | user_fonts, | ||
short * | global_aes | ||
) |
add user fonts
fnt_dialog | Pointer to management structure |
user_fonts | Pointer to user fonts |
global_aes | global AES array |
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.
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 |
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
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:
|
dialog_flags | Appearance of the dialog as following:
|
sample | Pointer to string for the sample text |
opt_button | Pointer to string for optional button or 0L |
global_aes | global AES array |
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.
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 |
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.
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 |
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()
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:
|
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 |
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
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 |
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
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 |
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.
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 |
long mt_fnts_get_style | ( | FNT_DIALOG * | fnt_dialog, |
long | id, | ||
short | index, | ||
short * | global_aes | ||
) |
font selector - get style id
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 |
index
-th font of the familyshort 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
fnt_dialog | Pointer to management structure |
button_flags | Flags for supported buttons:
|
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 |
void mt_fnts_remove | ( | FNT_DIALOG * | fnt_dialog, |
short * | global_aes | ||
) |
removes the fonts installed with mt_fnts_add()
fnt_dialog | Pointer to management structure |
global_aes | global AES array |
short mt_fnts_update | ( | FNT_DIALOG * | fnt_dialog, |
short | button_flags, | ||
long | id, | ||
long | pt, | ||
long | ratio, | ||
short * | global_aes | ||
) |
font selector - update window
fnt_dialog | Pointer to management structure |
button_flags | Flags for supported buttons:
|
id | Font ID |
pt | Height in 1/65536 point |
ratio | Width/height ratio in 1/65536 |
global_aes | global AES array |