home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / e / extralib / !ExtrasLib / h / Font < prev    next >
Encoding:
Text File  |  1996-03-03  |  3.3 KB  |  89 lines

  1. /* ExtrasLib:Font.h */
  2.  
  3. /* ExtrasLib by Peter Hartley 1995-96
  4.  * (K) All Rites Reversed - Copy What You Like
  5.  */
  6.  
  7. /* Veneers for Font_Paint (RO3 version)
  8.  *         and Font_ScanString (RO3 only)
  9.  */
  10.  
  11. typedef union Font_scanflags {          /* P = Font_PaintTransformed only */
  12.     struct {                            /* S = Font_ScanString only */
  13.  /* 0*/ unsigned int cursorjustify : 1; /* P if set, usecoords must be 0 */
  14.  /* 1*/ unsigned int rubout        : 1; /* P */
  15.         unsigned int _reserved     : 2;
  16.  /* 4*/ unsigned int osunits       : 1; /* P else millipoints */
  17.  /* 5*/ unsigned int usecoords     : 1; /*   if set, osunits and cursorjustify
  18.                                                must be 0 */
  19.  /* 6*/ unsigned int usematrix     : 1; /*   if set, osunits must be 0 */
  20.  /* 7*/ unsigned int uselength     : 1;
  21.  /* 8*/ unsigned int zeroiscurrent : 1; /*   allow 0 as handle */
  22.  /* 9*/ unsigned int kern          : 1;
  23.  /*10*/ unsigned int righttoleft   : 1;
  24.         unsigned int _reserved2    : 6;
  25.  /*17*/ unsigned int returncaret   : 1; /* S else returns length of string */
  26.  /*18*/ unsigned int returnbbox    : 1; /* S if set, usecoords must be 1 */
  27.  /*19*/ unsigned int returnmatrix  : 1; /* S if set, usematrix must be 1 */
  28.  /*20*/ unsigned int returnsplits  : 1; /* S if set, uselength must be 1 */
  29.         unsigned int _reserved3    : 11;
  30.     } data;
  31.     int value;
  32. } Font_scanflags;
  33.  
  34. /* constants for using in Font_scanflags.value */
  35. #define fontscan_CURSORJUSTIFY         1
  36. #define fontscan_RUBOUT                2
  37. #define fontscan_OSUNITS            0x10
  38. #define fontscan_USECOORDS          0x20
  39. #define fontscan_USEMATRIX          0x40
  40. #define fontscan_USELENGTH          0x80
  41. #define fontscan_USEHANDLE         0x100
  42. #define fontscan_KERN              0x200
  43. #define fontscan_RIGHTTOLEFT       0x400
  44. #define fontscan_RETURNCARET     0x20000
  45. #define fontscan_RETURNBBOX      0x40000
  46. #define fontscan_RETURNMATRIX    0x80000
  47. #define fontscan_RETURNSPLITS   0x100000
  48.  
  49. typedef struct Font_justifyinfo {
  50.     wimp_point addspace;   /* additional movement on each space */
  51.     wimp_point addchar;    /* additional movement on each char */
  52. } Font_justifyinfo;
  53.  
  54. typedef struct Font_paintcoords {
  55.     Font_justifyinfo j;
  56.     wimp_box         rubout;
  57. } Font_paintcoords;
  58.  
  59. typedef struct Font_scancoords {
  60.     Font_justifyinfo j;
  61.     int              splitchar;
  62.     wimp_box         bbox;
  63. } Font_scancoords;
  64.  
  65. enum {
  66.     matrix_XX,
  67.     matrix_XY,
  68.     matrix_YX,
  69.     matrix_YY,      /* these four fixed point ( value<<16 ) */
  70.     matrix_XOFF,
  71.     matrix_YOFF     /* in millipoints */
  72. };
  73.  
  74. extern os_error *Font_PaintTransformed( int fonthandle,
  75.                                         char *string,
  76.                                         Font_scanflags flags,
  77.                                         int x, int y,
  78.                                         Font_paintcoords *coords,
  79.                                         int matrix[6],
  80.                                         int length );
  81.  
  82. extern os_error *Font_ScanString( int fonthandle,
  83.                                   char **string,    /* updated */
  84.                                   Font_scanflags flags,
  85.                                   int *x, int *y,   /* updated */
  86.                                   Font_scancoords *coords,
  87.                                   int matrix[6],
  88.                                   int *length       /* updated */ );
  89.