home *** CD-ROM | disk | FTP | other *** search
- /* ExtrasLib:Font.h */
-
- /* ExtrasLib by Peter Hartley 1995-96
- * (K) All Rites Reversed - Copy What You Like
- */
-
- /* Veneers for Font_Paint (RO3 version)
- * and Font_ScanString (RO3 only)
- */
-
- typedef union Font_scanflags { /* P = Font_PaintTransformed only */
- struct { /* S = Font_ScanString only */
- /* 0*/ unsigned int cursorjustify : 1; /* P if set, usecoords must be 0 */
- /* 1*/ unsigned int rubout : 1; /* P */
- unsigned int _reserved : 2;
- /* 4*/ unsigned int osunits : 1; /* P else millipoints */
- /* 5*/ unsigned int usecoords : 1; /* if set, osunits and cursorjustify
- must be 0 */
- /* 6*/ unsigned int usematrix : 1; /* if set, osunits must be 0 */
- /* 7*/ unsigned int uselength : 1;
- /* 8*/ unsigned int zeroiscurrent : 1; /* allow 0 as handle */
- /* 9*/ unsigned int kern : 1;
- /*10*/ unsigned int righttoleft : 1;
- unsigned int _reserved2 : 6;
- /*17*/ unsigned int returncaret : 1; /* S else returns length of string */
- /*18*/ unsigned int returnbbox : 1; /* S if set, usecoords must be 1 */
- /*19*/ unsigned int returnmatrix : 1; /* S if set, usematrix must be 1 */
- /*20*/ unsigned int returnsplits : 1; /* S if set, uselength must be 1 */
- unsigned int _reserved3 : 11;
- } data;
- int value;
- } Font_scanflags;
-
- /* constants for using in Font_scanflags.value */
- #define fontscan_CURSORJUSTIFY 1
- #define fontscan_RUBOUT 2
- #define fontscan_OSUNITS 0x10
- #define fontscan_USECOORDS 0x20
- #define fontscan_USEMATRIX 0x40
- #define fontscan_USELENGTH 0x80
- #define fontscan_USEHANDLE 0x100
- #define fontscan_KERN 0x200
- #define fontscan_RIGHTTOLEFT 0x400
- #define fontscan_RETURNCARET 0x20000
- #define fontscan_RETURNBBOX 0x40000
- #define fontscan_RETURNMATRIX 0x80000
- #define fontscan_RETURNSPLITS 0x100000
-
- typedef struct Font_justifyinfo {
- wimp_point addspace; /* additional movement on each space */
- wimp_point addchar; /* additional movement on each char */
- } Font_justifyinfo;
-
- typedef struct Font_paintcoords {
- Font_justifyinfo j;
- wimp_box rubout;
- } Font_paintcoords;
-
- typedef struct Font_scancoords {
- Font_justifyinfo j;
- int splitchar;
- wimp_box bbox;
- } Font_scancoords;
-
- enum {
- matrix_XX,
- matrix_XY,
- matrix_YX,
- matrix_YY, /* these four fixed point ( value<<16 ) */
- matrix_XOFF,
- matrix_YOFF /* in millipoints */
- };
-
- extern os_error *Font_PaintTransformed( int fonthandle,
- char *string,
- Font_scanflags flags,
- int x, int y,
- Font_paintcoords *coords,
- int matrix[6],
- int length );
-
- extern os_error *Font_ScanString( int fonthandle,
- char **string, /* updated */
- Font_scanflags flags,
- int *x, int *y, /* updated */
- Font_scancoords *coords,
- int matrix[6],
- int *length /* updated */ );
-