This library contains routines for handling a font selector, which an application can use to select fonts for its use. The routines were introduced with MagiC 4.
• fnts_add | Adds user's fonts for selection |
• fnts_close | Closes selector |
• fnts_create | Initializes the font selector |
• fnts_delete | Releases memory used by font selector |
• fnts_do | Displays font selector in modal dialog |
• fnts_evnt | Processes events for dialog in window |
• fnts_get_info | Obtains information about a font |
• fnts_get_name | Obtains name of a font |
• fnts_get_no_styles | Obtains number of styles of a font family |
• fnts_get_style | Obtains ID of the n-th style of a family |
• fnts_open | Opens font selector in a window |
• fnts_remove | Removes user's fonts from the list |
• fnts_update | Updates font selector |
Note: The existence of these functions is best established with a call of appl_getinfo (opcode 7).
See also:
Selector in a window Selector in a modal dialog WDIALOG xFSL interface
Name: | »Font selector add user fonts« - Add user's fonts for selection. | ||||||
Opcode: | 185 (sub-opcode 0) | ||||||
Syntax: | int16_t fnts_add ( FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts ); | ||||||
Description: | The call fnts_add adds the user's fonts to those of those
displayed by the font selector. The following apply:
Hint: 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 display. | ||||||
Return value: | On successful execution the function returns the value 1. A value of 0 on the other hand signals an error. | ||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||
Group: | Font selection | ||||||
See also: | Binding fnts_delete fnts_remove xFSL interface |
C: | int16_t fnts_add ( FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts ); | ||||||||||||||||||||||||||||||
Binding: | int16_t fnts_add ( FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts ) { addr_in[0] = fnt_dialog; addr_in[1] = user_fonts; int_in[0] = 0; crys_if (185); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector close window« - Close font selector window. | ||||||||
Opcode: | 183 | ||||||||
Syntax: | int16_t fnts_close ( FNT_DIALOG *fnt_dialog, int16_t *x, int16_t *y ); | ||||||||
Description: | The call fnts_close closes the window of the font selector. The
following apply:
Hint: 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. | ||||||||
Return value: | This function returns always 1. | ||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||
Group: | Font selection | ||||||||
See also: | Binding fnts_open xFSL interface |
C: | int16_t fnts_close ( FNT_DIALOG *fnt_dialog, int16_t *x, int16_t *y ); | ||||||||||||||||||||||||||||||
Binding: | int16_t fnts_close ( FNT_DIALOG *fnt_dialog, int16_t *x, int16_t *y ) { int_out[1] = -1; int_out[2] = -1; addr_in[0] = fnt_dialog; crys_if (183); *x = int_out[1]; *y = int_out[2]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector create« - Initializes the font selector. | ||||||||||||||||||||||||||||
Opcode: | 180 | ||||||||||||||||||||||||||||
Syntax: | FNT_DIALOG *fnts_create ( int16_t vdi_handle, int16_t no_fonts, int16_t font_flags, int16_t dialog_flags, int8_t *sample, int8_t *opt_button ); | ||||||||||||||||||||||||||||
Description: | The call fnts_create initializes the font selector. The
following apply:
Hint: 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). 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. Note: The font selector alters the attributes of the workstation described by vdi_handle. If one wants to use the workstation passed with 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. | ||||||||||||||||||||||||||||
Return value: | This function returns a pointer to management structure. | ||||||||||||||||||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||||||||||||||||||||
Group: | Font selection | ||||||||||||||||||||||||||||
See also: | Binding fnts_open fnts_close xFSL interface |
C: | FNT_DIALOG *fnts_create ( int16_t vdi_handle, int16_t no_fonts, int16_t font_flags, int16_t dialog_flags, int8_t *sample, int8_t *opt_button ); | |||||||||||||||||||||||||||||||||||||||
Binding: | FNT_DIALOG *fnts_create ( int16_t vdi_handle, int16_t no_fonts, int16_t font_flags, int16_t dialog_flags, int8_t *sample, int8_t *opt_button ) { addr_in[0] = sample; addr_in[1] = opt_button; int_in[0] = vdi_handle; int_in[1] = no_fonts; int_in[2] = font_flags; int_in[3] = dialog_flags; crys_if (180); return ( addr_out[0] ); } | |||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector delete« - Release memory used by font selector. | ||||||||
Opcode: | 181 | ||||||||
Syntax: | int16_t fnts_delete ( FNT_DIALOG *fnt_dialog, int16_t vdi_handle ); | ||||||||
Description: | The call fnts_delete releases the memory that was used by the
font selector. The following apply:
Hint: If vdi_handle is not 0, then vst_unload_fonts() will be called. | ||||||||
Return value: | This function returns always one. | ||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||
Group: | Font selection | ||||||||
See also: | Binding fnts_close fnts_remove xFSL interface |
C: | int16_t fnts_delete ( FNT_DIALOG *fnt_dialog, int16_t vdi_handle ); | |||||||||||||||||||||||||||
Binding: | int16_t fnts_delete ( FNT_DIALOG *fnt_dialog, int16_t vdi_handle ) { addr_in[0] = fnt_dialog; int_in[0] = vdi_handle; crys_if (181); return ( int_out[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector do« - Display font selector in a modal dialog. | ||||||||||||||||||||||||||||||||||||||||||||
Opcode: | 187 | ||||||||||||||||||||||||||||||||||||||||||||
Syntax: | int16_t fnts_do ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id_in, int32_t pt_in, int32_t ratio_in, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ); | ||||||||||||||||||||||||||||||||||||||||||||
Description: | The call fnts_do displays the font selector in a modal dialog.
The following apply:
Hint: This function is the counterpart to fnts_open/fnts_evnt/fnts_close. This function opens a modal dialog and only returns to the caller when one of the exit buttons was activated. | ||||||||||||||||||||||||||||||||||||||||||||
Return value: | This function returns the index of the exit button
| ||||||||||||||||||||||||||||||||||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||||||||||||||||||||||||||||||||||||
Group: | Font selection | ||||||||||||||||||||||||||||||||||||||||||||
See also: | Binding fnts_open fnts_evnt xFSL interface |
C: | int16_t fnts_do ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id_in, int32_t pt_in, int32_t ratio_in, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ); | ||||||||||||||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_do ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id_in, int32_t pt_in, int32_t ratio_in, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ) { addr_in[0] = fnt_dialog; int_in[0] = button_flags; int_in[1..2] = id_in; int_in[3..4] = pt_in; int_in[5..6] = ratio_in; crys_if (187); *check_boxes = int_out[1]; *id = int_out[2..3]; *pt = int_out[4..5]; *ratio = int_out[6..7]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector handle event« - Process events for a font selector dialog in a window. | ||||||||||||||||||||||||||||||||||||
Opcode: | 186 | ||||||||||||||||||||||||||||||||||||
Syntax: | int16_t fnts_evnt ( FNT_DIALOG *fnt_dialog, EVNT *events, int16_t *button, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ); | ||||||||||||||||||||||||||||||||||||
Description: | The call fnts_evnt evaluates the passed EVNT structure. The
following apply:
Hint: The function calls internally wdlg_evnt. | ||||||||||||||||||||||||||||||||||||
Return value: | The function returns the value 0 if an exit button was selected, else the value 1 if nothing happened. | ||||||||||||||||||||||||||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||||||||||||||||||||||||||||
Group: | Font selection | ||||||||||||||||||||||||||||||||||||
See also: | Binding fnts_do xFSL interface |
C: | int16_t fnts_evnt ( FNT_DIALOG *fnt_dialog, EVNT *events, int16_t *button, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ); | ||||||||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_evnt ( FNT_DIALOG *fnt_dialog, EVNT *events, int16_t *button, int16_t *check_boxes, int32_t *id, fix31 *pt, int32_t *ratio ) { addr_in[0] = fnt_dialog; addr_in[1] = events; crys_if (186); *button = int_out[1]; *check_boxes = int_out[2]; *id = int_out[3..4]; *pt = int_out[5..6]; *ratio = int_out[7..8]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector get font info« - Obtain information about a font. | ||||||||||
Opcode: | 184 (sub-opcode 3) | ||||||||||
Syntax: | int16_t fnts_get_info ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t *mono, int16_t *outline ); | ||||||||||
Description: | The call fnts_get_info obtains various items of information
about a font. The following apply:
Note: The function determines whether the specified font is a monospaced one, or a vector (outline) font. | ||||||||||
Return value: | The function returns the index of the font (or the value 0 in case of error). | ||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||
Group: | Font selection | ||||||||||
See also: | Binding fnts_get_name fnts_get_style xFSL interface |
C: | int16_t fnts_get_info ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t *mono, int16_t *outline ); | ||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_get_info ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t *mono, int16_t *outline ) { addr_in[0] = fnt_dialog; int_in[0] = 3; int_in[1..2] = id; crys_if (184); *mono = int_out[1]; *outline = int_out[2]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector get font name« - Obtain name of a font. | ||||||||||||
Opcode: | 184 (sub-opcode 2) | ||||||||||||
Syntax: | int16_t fnts_get_name ( FNT_DIALOG *fnt_dialog, int32_t id, int8_t *full_name, int8_t *family_name, int8_t *style_name ); | ||||||||||||
Description: | The call fnts_get_name obtains the name, family name and style
name of a font. The following apply:
| ||||||||||||
Return value: | The function returns the value 1 on error-free execution; a value of 0, on the other hand, signals an error has occurred. | ||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||||
Group: | Font selection | ||||||||||||
See also: | Binding fnts_get_info fnts_get_style xFSL interface |
C: | int16_t fnts_get_name ( FNT_DIALOG *fnt_dialog, int32_t id, int8_t *full_name, int8_t *family_name, int8_t *style_name ); | |||||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_get_name ( FNT_DIALOG *fnt_dialog, int32_t id, int8_t *full_name, int8_t *family_name, int8_t *style_name ) { addr_in[0] = fnt_dialog; addr_in[1] = full_name; addr_in[2] = family_name; addr_in[3] = style_name; int_in[0] = 2; int_in[1..2] = id; crys_if (184); return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector get number of styles« - Obtain number of styles of a font family. | ||||||
Opcode: | 184 (sub-opcode 0) | ||||||
Syntax: | int16_t fnts_get_no_styles ( FNT_DIALOG *fnt_dialog, int32_t id ); | ||||||
Description: | The call fnts_get_no_styles obtains the number of styles of a
font. The following apply:
Hint: The parameter id is the ID of a font of this family, that may have been returned by fnts_evnt for instance. | ||||||
Return value: | This function returns the number of styles belonging to the family. | ||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||
Group: | Font selection | ||||||
See also: | Binding fnts_get_info fnts_get_name xFSL interface |
C: | int16_t fnts_get_no_styles ( FNT_DIALOG *fnt_dialog, int32_t id ); | ||||||||||||||||||||||||||||||
Binding: | int16_t fnts_get_no_styles ( FNT_DIALOG *fnt_dialog, int32_t id ) { addr_in[0] = fnt_dialog; int_in[0] = 0; int_in[1..2] = id; crys_if (184); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector get style ID« - Obtain ID of the n-th style of a font family. | ||||||||
Opcode: | 184 (sub-opcode 1) | ||||||||
Syntax: | int32_t fnts_get_style ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t index ); | ||||||||
Description: | The call fnts_get_style obtains the ID of the n-th font of a
font family. The following apply:
Hint: The parameter index must be a number between 1 and the result of fnts_get_no_styles. | ||||||||
Return value: | This function returns ID of the index-th font of the family. | ||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||
Group: | Font selection | ||||||||
See also: | Binding fnts_get_info fnts_get_name xFSL interface |
C: | int32_t fnts_get_style ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t index ); | |||||||||||||||||||||||||||||||||
Binding: | int32_t fnts_get_style ( FNT_DIALOG *fnt_dialog, int32_t id, int16_t index ) { addr_in[0] = fnt_dialog; int_in[0] = 1; int_in[1..2] = id; int_in[3] = index; crys_if (184); return ( int_out[0..1] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector open window« - Open font selector in a window. | ||||||||||||||||||||||||||||||||||||||||
Opcode: | 182 | ||||||||||||||||||||||||||||||||||||||||
Syntax: | int16_t fnts_open ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int16_t x, int16_t y, int32_t id, fix31 pt, fix31 ratio ); | ||||||||||||||||||||||||||||||||||||||||
Description: | The call fnts_open opens a window dialog with the font
selector. The following apply:
| ||||||||||||||||||||||||||||||||||||||||
Return value: | This function returns the AES handle of the window or 0 (error). | ||||||||||||||||||||||||||||||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||||||||||||||||||||||||||||||||||||||
Group: | Font selection | ||||||||||||||||||||||||||||||||||||||||
See also: | Binding fnts_close xFSL interface |
C: | int16_t fnts_open ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int16_t x, int16_t y, int32_t id, fix31 pt, fix31 ratio ); | ||||||||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_open ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int16_t x, int16_t y, int32_t id, fix31 pt, fix31 ratio ) { addr_in[0] = fnt_dialog; int_in[0] = button_flags; int_in[1] = x; int_in[2] = y; int_in[3..4] = id; int_in[5..6] = pt; int_in[7..8] = ratio; crys_if (182); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Font selector remove user fonts« - Remove user's fonts from the font list. | ||||
Opcode: | 185 (sub-opcode 1) | ||||
Syntax: | void fnts_remove ( FNT_DIALOG *fnt_dialog ); | ||||
Description: | The call fnts_remove removes the fonts registered with fnts_add
from the font list. The following applies:
Hint: If a program's user fonts have been installed, then fnts_remove must be called before fnts_delete. | ||||
Return value: | The function does not return a result. | ||||
Availability: | The presence of this call should be checked for using appl_getinfo (Opcode 7). | ||||
Group: | Font selection | ||||
See also: | Binding fnts_delete fnts_add xFSL interface |
C: | void fnts_remove ( FNT_DIALOG *fnt_dialog ); |
Binding: | void fnts_remove ( FNT_DIALOG *fnt_dialog ) { addr_in[0] = fnt_dialog; int_in[0] = 1; crys_if (185); } |
GEM-Arrays: |
Name: | »Font selector update window« - Update font selector. | ||||||||||||||||||||||||||||||||||||
Opcode: | 185 (sub-opcode 2) | ||||||||||||||||||||||||||||||||||||
Syntax: | int16_t fnts_update ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id, fix31 pt, int32_t ratio ); | ||||||||||||||||||||||||||||||||||||
Description: | The call fnts_update ensures an update of the font selector.
The following apply:
| ||||||||||||||||||||||||||||||||||||
Return value: | The function returns one of the following values:
| ||||||||||||||||||||||||||||||||||||
Availability: | The presence of this call should be checked for using appl_getinfo
(Opcode 7). This function was not present in older versions of WDIALOG. The binding ensures that in that case intout[0] returns -1. | ||||||||||||||||||||||||||||||||||||
Group: | Font selection | ||||||||||||||||||||||||||||||||||||
See also: | Binding fnts_close xFSL interface |
C: | int16_t fnts_update ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id, fix31 pt, int32_t ratio ); | |||||||||||||||||||||||||||||||||||||||
Binding: | int16_t fnts_update ( FNT_DIALOG *fnt_dialog, int16_t button_flags, int32_t id, fix31 pt, int32_t ratio ) { addr_in[0] = fnt_dialog; int_in[0] = 2; int_in[1] = button_flags; int_in[2..3] = id; int_in[4..5] = pt; int_in[6..7] = ratio; crys_if (185); return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Program start: | fnts_create()
. |
Calling the font selector: | fnts_open()
. |
Event loop: | fnts_evnt()
. ......Possibly fnts_get_no_styles()/fnts_get_style()/... (depending on the status of the checkboxes) . |
Closing the font selector: | fnts_close()
. |
Program end: | fnts_delete() |
Program start: | fnts_create()
. |
Calling the font selector: | fnts_do()
. ......Possibly fnts_get_no_styles()/fnts_get_style()/... (depending on status of the checkboxes) . |
Program end: | fnts_delete() |