home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / font < prev    next >
Encoding:
Text File  |  1994-09-22  |  46.6 KB  |  1,522 lines

  1. #ifndef font_H
  2. #define font_H
  3.  
  4. /* C header file for Font
  5.  * written by DefMod (Sep 16 1994) on Thu Sep 22 16:40:12 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  Font_CacheAddr
  27. #define Font_CacheAddr                          0x40080
  28. #undef  XFont_CacheAddr
  29. #define XFont_CacheAddr                         0x60080
  30. #undef  Font_FindFont
  31. #define Font_FindFont                           0x40081
  32. #undef  XFont_FindFont
  33. #define XFont_FindFont                          0x60081
  34. #undef  Font_LoseFont
  35. #define Font_LoseFont                           0x40082
  36. #undef  XFont_LoseFont
  37. #define XFont_LoseFont                          0x60082
  38. #undef  Font_ReadDefn
  39. #define Font_ReadDefn                           0x40083
  40. #undef  XFont_ReadDefn
  41. #define XFont_ReadDefn                          0x60083
  42. #undef  Font_ReadIdentifier
  43. #define Font_ReadIdentifier                     0x40083
  44. #undef  XFont_ReadIdentifier
  45. #define XFont_ReadIdentifier                    0x60083
  46. #undef  Font_ReadInfo
  47. #define Font_ReadInfo                           0x40084
  48. #undef  XFont_ReadInfo
  49. #define XFont_ReadInfo                          0x60084
  50. #undef  Font_StringWidth
  51. #define Font_StringWidth                        0x40085
  52. #undef  XFont_StringWidth
  53. #define XFont_StringWidth                       0x60085
  54. #undef  Font_Paint
  55. #define Font_Paint                              0x40086
  56. #undef  XFont_Paint
  57. #define XFont_Paint                             0x60086
  58. #undef  Font_Caret
  59. #define Font_Caret                              0x40087
  60. #undef  XFont_Caret
  61. #define XFont_Caret                             0x60087
  62. #undef  Font_ConverttoOS
  63. #define Font_ConverttoOS                        0x40088
  64. #undef  XFont_ConverttoOS
  65. #define XFont_ConverttoOS                       0x60088
  66. #undef  Font_Converttopoints
  67. #define Font_Converttopoints                    0x40089
  68. #undef  XFont_Converttopoints
  69. #define XFont_Converttopoints                   0x60089
  70. #undef  Font_SetFont
  71. #define Font_SetFont                            0x4008A
  72. #undef  XFont_SetFont
  73. #define XFont_SetFont                           0x6008A
  74. #undef  Font_CurrentFont
  75. #define Font_CurrentFont                        0x4008B
  76. #undef  XFont_CurrentFont
  77. #define XFont_CurrentFont                       0x6008B
  78. #undef  Font_FutureFont
  79. #define Font_FutureFont                         0x4008C
  80. #undef  XFont_FutureFont
  81. #define XFont_FutureFont                        0x6008C
  82. #undef  Font_FindCaret
  83. #define Font_FindCaret                          0x4008D
  84. #undef  XFont_FindCaret
  85. #define XFont_FindCaret                         0x6008D
  86. #undef  Font_CharBBox
  87. #define Font_CharBBox                           0x4008E
  88. #undef  XFont_CharBBox
  89. #define XFont_CharBBox                          0x6008E
  90. #undef  Font_ReadScaleFactor
  91. #define Font_ReadScaleFactor                    0x4008F
  92. #undef  XFont_ReadScaleFactor
  93. #define XFont_ReadScaleFactor                   0x6008F
  94. #undef  Font_SetScaleFactor
  95. #define Font_SetScaleFactor                     0x40090
  96. #undef  XFont_SetScaleFactor
  97. #define XFont_SetScaleFactor                    0x60090
  98. #undef  Font_ListFonts
  99. #define Font_ListFonts                          0x40091
  100. #undef  XFont_ListFonts
  101. #define XFont_ListFonts                         0x60091
  102. #undef  Font_SetFontColours
  103. #define Font_SetFontColours                     0x40092
  104. #undef  XFont_SetFontColours
  105. #define XFont_SetFontColours                    0x60092
  106. #undef  Font_SetPalette
  107. #define Font_SetPalette                         0x40093
  108. #undef  XFont_SetPalette
  109. #define XFont_SetPalette                        0x60093
  110. #undef  Font_SetTruePalette
  111. #define Font_SetTruePalette                     0x40093
  112. #undef  XFont_SetTruePalette
  113. #define XFont_SetTruePalette                    0x60093
  114. #undef  Font_ReadThresholds
  115. #define Font_ReadThresholds                     0x40094
  116. #undef  XFont_ReadThresholds
  117. #define XFont_ReadThresholds                    0x60094
  118. #undef  Font_SetThresholds
  119. #define Font_SetThresholds                      0x40095
  120. #undef  XFont_SetThresholds
  121. #define XFont_SetThresholds                     0x60095
  122. #undef  Font_FindCaretJ
  123. #define Font_FindCaretJ                         0x40096
  124. #undef  XFont_FindCaretJ
  125. #define XFont_FindCaretJ                        0x60096
  126. #undef  Font_StringBBox
  127. #define Font_StringBBox                         0x40097
  128. #undef  XFont_StringBBox
  129. #define XFont_StringBBox                        0x60097
  130. #undef  Font_ReadColourTable
  131. #define Font_ReadColourTable                    0x40098
  132. #undef  XFont_ReadColourTable
  133. #define XFont_ReadColourTable                   0x60098
  134. #undef  Font_MakeBitmap
  135. #define Font_MakeBitmap                         0x40099
  136. #undef  XFont_MakeBitmap
  137. #define XFont_MakeBitmap                        0x60099
  138. #undef  Font_UnCacheFile
  139. #define Font_UnCacheFile                        0x4009A
  140. #undef  XFont_UnCacheFile
  141. #define XFont_UnCacheFile                       0x6009A
  142. #undef  Font_SetFontMax
  143. #define Font_SetFontMax                         0x4009B
  144. #undef  XFont_SetFontMax
  145. #define XFont_SetFontMax                        0x6009B
  146. #undef  Font_ReadFontMax
  147. #define Font_ReadFontMax                        0x4009C
  148. #undef  XFont_ReadFontMax
  149. #define XFont_ReadFontMax                       0x6009C
  150. #undef  Font_ReadFontPrefix
  151. #define Font_ReadFontPrefix                     0x4009D
  152. #undef  XFont_ReadFontPrefix
  153. #define XFont_ReadFontPrefix                    0x6009D
  154. #undef  Font_SwitchOutputToBuffer
  155. #define Font_SwitchOutputToBuffer               0x4009E
  156. #undef  XFont_SwitchOutputToBuffer
  157. #define XFont_SwitchOutputToBuffer              0x6009E
  158. #undef  Font_ReadFontMetrics
  159. #define Font_ReadFontMetrics                    0x4009F
  160. #undef  XFont_ReadFontMetrics
  161. #define XFont_ReadFontMetrics                   0x6009F
  162. #undef  Font_DecodeMenu
  163. #define Font_DecodeMenu                         0x400A0
  164. #undef  XFont_DecodeMenu
  165. #define XFont_DecodeMenu                        0x600A0
  166. #undef  Font_ScanString
  167. #define Font_ScanString                         0x400A1
  168. #undef  XFont_ScanString
  169. #define XFont_ScanString                        0x600A1
  170. #undef  Font_SetColourTable
  171. #define Font_SetColourTable                     0x400A2
  172. #undef  XFont_SetColourTable
  173. #define XFont_SetColourTable                    0x600A2
  174. #undef  Font_CurrentRGB
  175. #define Font_CurrentRGB                         0x400A3
  176. #undef  XFont_CurrentRGB
  177. #define XFont_CurrentRGB                        0x600A3
  178. #undef  Font_FutureRGB
  179. #define Font_FutureRGB                          0x400A4
  180. #undef  XFont_FutureRGB
  181. #define XFont_FutureRGB                         0x600A4
  182. #undef  Font_ReadEncodingFilename
  183. #define Font_ReadEncodingFilename               0x400A5
  184. #undef  XFont_ReadEncodingFilename
  185. #define XFont_ReadEncodingFilename              0x600A5
  186. #undef  Font_FindField
  187. #define Font_FindField                          0x400A6
  188. #undef  XFont_FindField
  189. #define XFont_FindField                         0x600A6
  190. #undef  Font_ApplyFields
  191. #define Font_ApplyFields                        0x400A7
  192. #undef  XFont_ApplyFields
  193. #define XFont_ApplyFields                       0x600A7
  194. #undef  Font_LookupFont
  195. #define Font_LookupFont                         0x400A8
  196. #undef  XFont_LookupFont
  197. #define XFont_LookupFont                        0x600A8
  198. #undef  Service_FontsChanged
  199. #define Service_FontsChanged                    0x6E
  200.  
  201. /************************************
  202.  * Structure and union declarations *
  203.  ************************************/
  204. typedef struct font_paint_block                 font_paint_block;
  205. typedef struct font_scan_block                  font_scan_block;
  206. typedef struct font_thresholds                  font_thresholds;
  207. typedef struct font_colour_table                font_colour_table;
  208. typedef struct font_bbox_info                   font_bbox_info;
  209. typedef struct font_width_info                  font_width_info;
  210. typedef struct font_misc_info                   font_misc_info;
  211. typedef struct font_long_kern_pair              font_long_kern_pair;
  212. typedef union  font_kern_info                   font_kern_info;
  213.  
  214. /********************
  215.  * Type definitions *
  216.  ********************/
  217. typedef byte font_f;
  218.  
  219. struct font_paint_block
  220.    {  os_coord space;
  221.       os_coord letter;
  222.       os_box rubout;
  223.    };
  224.  
  225. struct font_scan_block
  226.    {  os_coord space;
  227.       os_coord letter;
  228.       int split_char;
  229.       os_box bbox;
  230.    };
  231.  
  232. struct font_thresholds
  233.    {  byte t [UNKNOWN];
  234.    };
  235.  
  236. #define font_THRESHOLDS(N) \
  237.    struct \
  238.       {  byte t [N]; \
  239.       }
  240.  
  241. #define font_SIZEOF_THRESHOLDS(N) \
  242.    ((N)*sizeof ((font_thresholds *) NULL)->t)
  243.  
  244. struct font_colour_table
  245.    {  byte c [UNKNOWN];
  246.    };
  247.  
  248. #define font_COLOUR_TABLE(N) \
  249.    struct \
  250.       {  byte c [N]; \
  251.       }
  252.  
  253. #define font_SIZEOF_COLOUR_TABLE(N) \
  254.    ((N)*sizeof ((font_colour_table *) NULL)->c)
  255.  
  256. struct font_bbox_info
  257.    {  os_box bboxes [256];
  258.    };
  259.  
  260. struct font_width_info
  261.    {  int widths [256];
  262.    };
  263.  
  264. struct font_misc_info
  265.    {  short x0;
  266.       short y0;
  267.       short x1;
  268.       short y1;
  269.       short xkern;
  270.       short ykern;
  271.       short italic_correction;
  272.       byte underline_position;
  273.       byte underline_thickness;
  274.       short cap_height;
  275.       short xheight;
  276.       short descender;
  277.       short ascender;
  278.       int reserved;
  279.    };
  280.  
  281. typedef bits font_short_kern_pair;
  282.  
  283. struct font_long_kern_pair
  284.    {  int c;
  285.       int xkern;
  286.       int ykern;
  287.    };
  288.  
  289. union font_kern_info
  290.    {  struct
  291.       {  int table [256];
  292.          int size;
  293.          bits flags;
  294.          font_long_kern_pair pairs [UNKNOWN];
  295.       }
  296.       long_info;
  297.       struct
  298.       {  int table [256];
  299.          int size;
  300.          bits flags;
  301.          font_short_kern_pair pairs [UNKNOWN];
  302.       }
  303.       short_info;
  304.    };
  305.  
  306. /************************
  307.  * Constant definitions *
  308.  ************************/
  309. #define font_OS_UNIT                            400
  310. #define font_INCH                               72000
  311. #define font_POINT                              1000
  312. #define font_COMMAND_NULL                       ((char) '\x00')
  313. #define font_COMMAND_XMOVE                      ((char) '\x09')
  314. #define font_COMMAND_LINEFEED                   ((char) '\x0A')
  315. #define font_COMMAND_YMOVE                      ((char) '\x0B')
  316. #define font_COMMAND_RETURN                     ((char) '\x0D')
  317. #define font_COMMAND_GCOL                       ((char) '\x11')
  318. #define font_COMMAND_COLOURS                    ((char) '\x12')
  319. #define font_COMMAND_TRUE_COLOURS               ((char) '\x13')
  320. #define font_COMMAND_COMMENT                    ((char) '\x15')
  321. #define font_COMMAND_UNDERLINE                  ((char) '\x19')
  322. #define font_COMMAND_FONT                       ((char) '\x1A')
  323. #define font_COMMAND_HOM_TRFM                   ((char) '\x1B')
  324. #define font_COMMAND_TRFM                       ((char) '\x1C')
  325. #define font_JUSTIFY                            0x1u
  326. #define font_RUBOUT                             0x2u
  327. #define font_OS_UNITS                           0x10u
  328. #define font_GIVEN_BLOCK                        0x20u
  329. #define font_GIVEN_TRFM                         0x40u
  330. #define font_GIVEN_LENGTH                       0x80u
  331. #define font_GIVEN_FONT                         0x100u
  332. #define font_KERN                               0x200u
  333. #define font_RIGHT_TO_LEFT                      0x400u
  334. #define font_RETURN_CARET_POS                   0x20000u
  335. #define font_RETURN_BBOX                        0x40000u
  336. #define font_RETURN_MATRIX                      0x80000u
  337. #define font_RETURN_SPLIT_COUNT                 0x100000u
  338. #define font_NO_OUTPUT                          0x1u
  339. #define font_ADD_HINTS                          0x2u
  340. #define font_OUTPUT_SKELETON                    0x4u
  341. #define font_CONVERT_BITMAP                     0x8u
  342. #define font_ERROR_IF_BITMAP                    0x10u
  343. #define error_FONT_NO_ROOM                      0x200u
  344. #define error_FONT_CACHE_FULL                   0x201u
  345. #define error_FONT_NO_CACHE                     0x202u
  346. #define error_FONT_TOO_LONG                     0x203u
  347. #define error_FONT64K                           0x204u
  348. #define error_FONT_PAL_TOO_BIG                  0x205u
  349. #define error_FONT_BAD_TRAN_BITS                0x206u
  350. #define error_FONT_NOT_ENOUGH_BITS              0x207u
  351. #define error_FONT_NO_FONT                      0x208u
  352. #define error_FONT_NO_PIXELS                    0x209u
  353. #define error_FONT_BAD_FONT_NUMBER              0x20Au
  354. #define error_FONT_NOT_FOUND                    0x20Bu
  355. #define error_FONT_BAD_FONT_FILE                0x20Cu
  356. #define error_FONT_NO_HANDLES                   0x20Du
  357. #define error_FONT_BAD_COUNTER                  0x20Eu
  358. #define error_FONT_BAD_CTRL_CHAR                0x20Fu
  359. #define error_FONTS_IN_USE                      0x210u
  360. #define error_FONT_BAD_SEGMENT                  0x211u
  361. #define error_FONT_BAD_PREFIX                   0x212u
  362. #define error_FONT_RESERVED                     0x213u
  363. #define error_FONT_BAD_CHAR_CODE                0x214u
  364. #define error_FONT_NO_BITMAPS                   0x215u
  365. #define error_FONT_NO_BITMAPS2                  0x216u
  366. #define error_FONT_BAD_FONT_CACHE_FILE          0x217u
  367. #define error_FONT_FIELD_NOT_FOUND              0x218u
  368. #define error_FONT_BAD_MATRIX                   0x219u
  369. #define error_FONT_OVERFLOW                     0x21Au
  370. #define error_FONT_DIVBY0                       0x21Bu
  371. #define error_FONT_BAD_READ_METRICS             0x21Cu
  372. #define error_FONT_BAD_RGB                      0x21Du
  373. #define error_FONT_ENCODING_NOT_FOUND           0x21Eu
  374. #define error_FONT_MUST_HAVE_SLASH              0x21Fu
  375. #define error_FONT_BAD_ENCODING_SIZE            0x220u
  376. #define error_FONT_TOO_MANY_IDS                 0x221u
  377. #define error_FONT_TOO_FEW_IDS                  0x222u
  378. #define error_FONT_NO_BASE_ENCODING             0x223u
  379. #define error_FONT_IDENTIFIER_NOT_FOUND         0x224u
  380. #define error_FONT_TOO_MANY_CHUNKS              0x225u
  381. #define error_FONT_BAD_FONT_FILE2               0x226u
  382. #define error_FONT_DATA_NOT_FOUND               0x20Bu
  383. #define error_FONT_DATA_NOT_FOUND2              0x20Bu
  384. #define font_NAME_LIMIT                         40
  385. #define font_SYSTEM                             ((font_f) 0)
  386. #define font_CURRENT                            ((font_f) 0)
  387. #define font_BITMAP_DEEP                        0x1u
  388. #define font_BITMAP_HORIZONTAL_SUB_PIXEL        0x2u
  389. #define font_BITMAP_VERTICAL_SUB_PIXEL          0x4u
  390. #define font_BITMAP_DELETE                      0x8u
  391. #define font_CHARACTERISTIC_OLD_FORMAT          0x1u
  392. #define font_CHARACTERISTIC_ROM                 0x2u
  393. #define font_CHARACTERISTIC_MONOCHROME          0x4u
  394. #define font_CHARACTERISTIC_FILL_RULE_NON_ZERO  0x8u
  395. #define font_RETURN_FONT_NAME                   0x10000u
  396. #define font_RETURN_LOCAL_FONT_NAME             0x20000u
  397. #define font_USE_LINEFEED                       0x40000u
  398. #define font_RETURN_FONT_MENU                   0x80000u
  399. #define font_ALLOW_SYSTEM_FONT                  0x100000u
  400. #define font_GIVEN_TICK                         0x200000u
  401. #define font_RETURN_ENCODING_MENU               0x480000u
  402. #define font_TICK_NONE                          ((char *) 0)
  403. #define font_TICK_SYSTEM_FONT                   ((char *) 1)
  404. #define font_METRICS_KERN_YONLY                 0x2u
  405. #define font_METRICS_KERN_XONLY                 0x4u
  406. #define font_METRICS_MANY_KERN_PAIRS            0x8u
  407. #define font_GIVEN_ENCODING_MENU                0x1u
  408.  
  409. /*************************
  410.  * Function declarations *
  411.  *************************/
  412.  
  413. #ifdef __cplusplus
  414.    extern "C" {
  415. #endif
  416.  
  417. /*************************************************************
  418.  * NOTE: The following functions provide direct access to    *
  419.  *       the SWI's noted in the function description.        *
  420.  *       Please read the relevant PRM section for more       *
  421.  *       information on their input/output parameters.       *
  422.  *************************************************************/
  423.  
  424. /* ------------------------------------------------------------------------
  425.  * Function:      font_cache_addr()
  426.  *
  427.  * Description:   Gets the version number, font cache size and amount used
  428.  *
  429.  * Output:        version - value of R0 on exit
  430.  *                cache_size - value of R2 on exit
  431.  *                cache_used - value of R3 on exit
  432.  *
  433.  * Other notes:   Calls SWI 0x40080.
  434.  */
  435.  
  436. extern os_error *xfont_cache_addr (int *version,
  437.       int *cache_size,
  438.       int *cache_used);
  439. extern void font_cache_addr (int *version,
  440.       int *cache_size,
  441.       int *cache_used);
  442.  
  443. /* ------------------------------------------------------------------------
  444.  * Function:      font_find_font()
  445.  *
  446.  * Description:   Gets the handle for a font
  447.  *
  448.  * Input:         font_name - value of R1 on entry
  449.  *                xsize - value of R2 on entry
  450.  *                ysize - value of R3 on entry
  451.  *                xres - value of R4 on entry
  452.  *                yres - value of R5 on entry
  453.  *
  454.  * Output:        font - value of R0 on exit (X version only)
  455.  *                xres_out - value of R4 on exit
  456.  *                yres_out - value of R5 on exit
  457.  *
  458.  * Returns:       R0 (non-X version only)
  459.  *
  460.  * Other notes:   Calls SWI 0x40081.
  461.  */
  462.  
  463. extern os_error *xfont_find_font (char *font_name,
  464.       int xsize,
  465.       int ysize,
  466.       int xres,
  467.       int yres,
  468.       font_f *font,
  469.       int *xres_out,
  470.       int *yres_out);
  471. extern font_f font_find_font (char *font_name,
  472.       int xsize,
  473.       int ysize,
  474.       int xres,
  475.       int yres,
  476.       int *xres_out,
  477.       int *yres_out);
  478.  
  479. /* ------------------------------------------------------------------------
  480.  * Function:      font_lose_font()
  481.  *
  482.  * Description:   Finishes use of a font
  483.  *
  484.  * Input:         font - value of R0 on entry
  485.  *
  486.  * Other notes:   Calls SWI 0x40082.
  487.  */
  488.  
  489. extern os_error *xfont_lose_font (font_f font);
  490. extern void font_lose_font (font_f font);
  491.  
  492. /* ------------------------------------------------------------------------
  493.  * Function:      font_read_defn()
  494.  *
  495.  * Description:   Reads details about a font
  496.  *
  497.  * Input:         font - value of R0 on entry
  498.  *
  499.  * Output:        xsize - value of R2 on exit
  500.  *                ysize - value of R3 on exit
  501.  *                xres - value of R4 on exit
  502.  *                yres - value of R5 on exit
  503.  *                age - value of R6 on exit
  504.  *                usage_count - value of R7 on exit
  505.  *
  506.  * Other notes:   Calls SWI 0x40083 with R3 = 0x0.
  507.  */
  508.  
  509. extern os_error *xfont_read_defn (font_f font,
  510.       int *xsize,
  511.       int *ysize,
  512.       int *xres,
  513.       int *yres,
  514.       int *age,
  515.       int *usage_count);
  516. extern void font_read_defn (font_f font,
  517.       int *xsize,
  518.       int *ysize,
  519.       int *xres,
  520.       int *yres,
  521.       int *age,
  522.       int *usage_count);
  523.  
  524. /* ------------------------------------------------------------------------
  525.  * Function:      font_read_identifier()
  526.  *
  527.  * Description:   Reads the full font identifier
  528.  *
  529.  * Input:         font - value of R0 on entry
  530.  *                buffer - value of R1 on entry
  531.  *
  532.  * Output:        used - value of R2 on exit
  533.  *
  534.  * Other notes:   Calls SWI 0x40083 with R3 = 0x4C4C5546.
  535.  */
  536.  
  537. extern os_error *xfont_read_identifier (font_f font,
  538.       byte *buffer,
  539.       int *used);
  540. extern void font_read_identifier (font_f font,
  541.       byte *buffer,
  542.       int *used);
  543.  
  544. /* ------------------------------------------------------------------------
  545.  * Function:      font_read_info()
  546.  *
  547.  * Description:   Gets the font bounding box
  548.  *
  549.  * Input:         font - value of R0 on entry
  550.  *
  551.  * Output:        x0 - value of R1 on exit
  552.  *                y0 - value of R2 on exit
  553.  *                x1 - value of R3 on exit
  554.  *                y1 - value of R4 on exit
  555.  *
  556.  * Other notes:   Calls SWI 0x40084.
  557.  */
  558.  
  559. extern os_error *xfont_read_info (font_f font,
  560.       int *x0,
  561.       int *y0,
  562.       int *x1,
  563.       int *y1);
  564. extern void font_read_info (font_f font,
  565.       int *x0,
  566.       int *y0,
  567.       int *x1,
  568.       int *y1);
  569.  
  570. /* ------------------------------------------------------------------------
  571.  * Function:      font_string_width()
  572.  *
  573.  * Description:   Calculates how wide a string would be in the current font
  574.  *                (prefer Font_ScanString)
  575.  *
  576.  * Input:         s - value of R1 on entry
  577.  *                xmax - value of R2 on entry
  578.  *                ymax - value of R3 on entry
  579.  *                split - value of R4 on entry
  580.  *                length - value of R5 on entry
  581.  *
  582.  * Output:        split_point - value of R1 on exit
  583.  *                x - value of R2 on exit
  584.  *                y - value of R3 on exit
  585.  *                length_out - value of R4 on exit
  586.  *                index_out - value of R5 on exit
  587.  *
  588.  * Other notes:   Calls SWI 0x40085.
  589.  */
  590.  
  591. extern os_error *xfont_string_width (char *s,
  592.       int xmax,
  593.       int ymax,
  594.       int split,
  595.       int length,
  596.       char **split_point,
  597.       int *x,
  598.       int *y,
  599.       int *length_out,
  600.       int *index_out);
  601. extern void font_string_width (char *s,
  602.       int xmax,
  603.       int ymax,
  604.       int split,
  605.       int length,
  606.       char **split_point,
  607.       int *x,
  608.       int *y,
  609.       int *length_out,
  610.       int *index_out);
  611.  
  612. /* ------------------------------------------------------------------------
  613.  * Function:      font_paint()
  614.  *
  615.  * Description:   Writes a string to the screen
  616.  *
  617.  * Input:         font - value of R0 on entry
  618.  *                string - value of R1 on entry
  619.  *                flags - value of R2 on entry
  620.  *                xpos - value of R3 on entry
  621.  *                ypos - value of R4 on entry
  622.  *                block - value of R5 on entry
  623.  *                trfm - value of R6 on entry
  624.  *                length - value of R7 on entry
  625.  *
  626.  * Other notes:   Calls SWI 0x40086.
  627.  */
  628.  
  629. extern os_error *xfont_paint (font_f font,
  630.       char *string,
  631.       bits flags,
  632.       int xpos,
  633.       int ypos,
  634.       font_paint_block *block,
  635.       os_trfm *trfm,
  636.       int length);
  637. extern void font_paint (font_f font,
  638.       char *string,
  639.       bits flags,
  640.       int xpos,
  641.       int ypos,
  642.       font_paint_block *block,
  643.       os_trfm *trfm,
  644.       int length);
  645.  
  646. /* ------------------------------------------------------------------------
  647.  * Function:      font_caret()
  648.  *
  649.  * Description:   Defines text cursor for Font Manager
  650.  *
  651.  * Input:         colour_number - value of R0 on entry
  652.  *                height - value of R1 on entry
  653.  *                flags - value of R2 on entry
  654.  *                x - value of R3 on entry
  655.  *                y - value of R4 on entry
  656.  *
  657.  * Other notes:   Calls SWI 0x40087.
  658.  */
  659.  
  660. extern os_error *xfont_caret (os_colour_number colour_number,
  661.       int height,
  662.       bits flags,
  663.       int x,
  664.       int y);
  665. extern void font_caret (os_colour_number colour_number,
  666.       int height,
  667.       bits flags,
  668.       int x,
  669.       int y);
  670.  
  671. /* ------------------------------------------------------------------------
  672.  * Function:      font_convertto_os()
  673.  *
  674.  * Description:   Converts internal coordinates to OS coordinates
  675.  *
  676.  * Input:         x - value of R1 on entry
  677.  *                y - value of R2 on entry
  678.  *
  679.  * Output:        x_out - value of R1 on exit
  680.  *                y_out - value of R2 on exit
  681.  *
  682.  * Other notes:   Calls SWI 0x40088.
  683.  */
  684.  
  685. extern os_error *xfont_convertto_os (int x,
  686.       int y,
  687.       int *x_out,
  688.       int *y_out);
  689. extern void font_convertto_os (int x,
  690.       int y,
  691.       int *x_out,
  692.       int *y_out);
  693.  
  694. /* ------------------------------------------------------------------------
  695.  * Function:      font_converttopoints()
  696.  *
  697.  * Description:   Converts OS coordinates to internal coordinates
  698.  *
  699.  * Input:         x - value of R1 on entry
  700.  *                y - value of R2 on entry
  701.  *
  702.  * Output:        x_out - value of R1 on exit
  703.  *                y_out - value of R2 on exit
  704.  *
  705.  * Other notes:   Calls SWI 0x40089.
  706.  */
  707.  
  708. extern os_error *xfont_converttopoints (int x,
  709.       int y,
  710.       int *x_out,
  711.       int *y_out);
  712. extern void font_converttopoints (int x,
  713.       int y,
  714.       int *x_out,
  715.       int *y_out);
  716.  
  717. /* ------------------------------------------------------------------------
  718.  * Function:      font_set_font()
  719.  *
  720.  * Description:   Selects the font to be subsequently used
  721.  *
  722.  * Input:         font - value of R0 on entry
  723.  *
  724.  * Other notes:   Calls SWI 0x4008A.
  725.  */
  726.  
  727. extern os_error *xfont_set_font (font_f font);
  728. extern void font_set_font (font_f font);
  729.  
  730. /* ------------------------------------------------------------------------
  731.  * Function:      font_current_font()
  732.  *
  733.  * Description:   Gets the current font handle and colours
  734.  *
  735.  * Output:        font - value of R0 on exit (X version only)
  736.  *                bg_hint - value of R1 on exit
  737.  *                fill - value of R2 on exit
  738.  *                offset - value of R3 on exit
  739.  *
  740.  * Returns:       R0 (non-X version only)
  741.  *
  742.  * Other notes:   Calls SWI 0x4008B.
  743.  */
  744.  
  745. extern os_error *xfont_current_font (font_f *font,
  746.       os_gcol *bg_hint,
  747.       os_gcol *fill,
  748.       int *offset);
  749. extern font_f font_current_font (os_gcol *bg_hint,
  750.       os_gcol *fill,
  751.       int *offset);
  752.  
  753. /* ------------------------------------------------------------------------
  754.  * Function:      font_future_font()
  755.  *
  756.  * Description:   Checks font characteristics after Font_StringWidth
  757.  *
  758.  * Output:        font - value of R0 on exit (X version only)
  759.  *                bg_hint - value of R1 on exit
  760.  *                fill - value of R2 on exit
  761.  *                offset - value of R3 on exit
  762.  *
  763.  * Returns:       R0 (non-X version only)
  764.  *
  765.  * Other notes:   Calls SWI 0x4008C.
  766.  */
  767.  
  768. extern os_error *xfont_future_font (font_f *font,
  769.       os_gcol *bg_hint,
  770.       os_gcol *fill,
  771.       int *offset);
  772. extern font_f font_future_font (os_gcol *bg_hint,
  773.       os_gcol *fill,
  774.       int *offset);
  775.  
  776. /* ------------------------------------------------------------------------
  777.  * Function:      font_find_caret()
  778.  *
  779.  * Description:   Finds where the caret is in a string
  780.  *
  781.  * Input:         s - value of R1 on entry
  782.  *                x - value of R2 on entry
  783.  *                y - value of R3 on entry
  784.  *
  785.  * Output:        split_point - value of R1 on exit
  786.  *                x_out - value of R2 on exit
  787.  *                y_out - value of R3 on exit
  788.  *                length_out - value of R4 on exit
  789.  *                index_out - value of R5 on exit
  790.  *
  791.  * Other notes:   Calls SWI 0x4008D.
  792.  */
  793.  
  794. extern os_error *xfont_find_caret (char *s,
  795.       int x,
  796.       int y,
  797.       char **split_point,
  798.       int *x_out,
  799.       int *y_out,
  800.       int *length_out,
  801.       int *index_out);
  802. extern void font_find_caret (char *s,
  803.       int x,
  804.       int y,
  805.       char **split_point,
  806.       int *x_out,
  807.       int *y_out,
  808.       int *length_out,
  809.       int *index_out);
  810.  
  811. /* ------------------------------------------------------------------------
  812.  * Function:      font_char_bbox()
  813.  *
  814.  * Description:   Gets the bounding box of a character
  815.  *
  816.  * Input:         font - value of R0 on entry
  817.  *                c - value of R1 on entry
  818.  *                flags - value of R2 on entry
  819.  *
  820.  * Output:        x0 - value of R1 on exit
  821.  *                y0 - value of R2 on exit
  822.  *                x1 - value of R3 on exit
  823.  *                y1 - value of R4 on exit
  824.  *
  825.  * Other notes:   Calls SWI 0x4008E.
  826.  */
  827.  
  828. extern os_error *xfont_char_bbox (font_f font,
  829.       char c,
  830.       bits flags,
  831.       int *x0,
  832.       int *y0,
  833.       int *x1,
  834.       int *y1);
  835. extern void font_char_bbox (font_f font,
  836.       char c,
  837.       bits flags,
  838.       int *x0,
  839.       int *y0,
  840.       int *x1,
  841.       int *y1);
  842.  
  843. /* ------------------------------------------------------------------------
  844.  * Function:      font_read_scale_factor()
  845.  *
  846.  * Description:   Reads the internal to OS conversion factor
  847.  *
  848.  * Output:        xfactor - value of R1 on exit
  849.  *                yfactor - value of R2 on exit
  850.  *
  851.  * Other notes:   Calls SWI 0x4008F.
  852.  */
  853.  
  854. extern os_error *xfont_read_scale_factor (int *xfactor,
  855.       int *yfactor);
  856. extern void font_read_scale_factor (int *xfactor,
  857.       int *yfactor);
  858.  
  859. /* ------------------------------------------------------------------------
  860.  * Function:      font_set_scale_factor()
  861.  *
  862.  * Description:   Sets the internal to OS conversion factor
  863.  *
  864.  * Input:         xfactor - value of R1 on entry
  865.  *                yfactor - value of R2 on entry
  866.  *
  867.  * Other notes:   Calls SWI 0x40090.
  868.  */
  869.  
  870. extern os_error *xfont_set_scale_factor (int xfactor,
  871.       int yfactor);
  872. extern void font_set_scale_factor (int xfactor,
  873.       int yfactor);
  874.  
  875. /* ------------------------------------------------------------------------
  876.  * Function:      font_list_fonts()
  877.  *
  878.  * Description:   Scans for fonts, returning their identifiers one at a
  879.  *                time; or or builds a menu of fonts
  880.  *
  881.  * Input:         buffer1 - value of R1 on entry
  882.  *                context - value of R2 on entry
  883.  *                size1 - value of R3 on entry
  884.  *                buffer2 - value of R4 on entry
  885.  *                size2 - value of R5 on entry
  886.  *                tick_font - value of R6 on entry
  887.  *
  888.  * Output:        context_out - value of R2 on exit (X version only)
  889.  *                used1 - value of R3 on exit
  890.  *                used2 - value of R5 on exit
  891.  *
  892.  * Returns:       R2 (non-X version only)
  893.  *
  894.  * Other notes:   Calls SWI 0x40091.
  895.  */
  896.  
  897. extern os_error *xfont_list_fonts (byte *buffer1,
  898.       int context,
  899.       int size1,
  900.       byte *buffer2,
  901.       int size2,
  902.       char *tick_font,
  903.       int *context_out,
  904.       int *used1,
  905.       int *used2);
  906. extern int font_list_fonts (byte *buffer1,
  907.       int context,
  908.       int size1,
  909.       byte *buffer2,
  910.       int size2,
  911.       char *tick_font,
  912.       int *used1,
  913.       int *used2);
  914.  
  915. /* ------------------------------------------------------------------------
  916.  * Function:      font_set_font_colours()
  917.  *
  918.  * Description:   Changes the current colours and (optionally) the current
  919.  *                font (prefer ColourTrans_SetFontColours)
  920.  *
  921.  * Input:         font - value of R0 on entry
  922.  *                bg_hint - value of R1 on entry
  923.  *                fill - value of R2 on entry
  924.  *                offset - value of R3 on entry
  925.  *
  926.  * Other notes:   Calls SWI 0x40092.
  927.  */
  928.  
  929. extern os_error *xfont_set_font_colours (font_f font,
  930.       os_gcol bg_hint,
  931.       os_gcol fill,
  932.       int offset);
  933. extern void font_set_font_colours (font_f font,
  934.       os_gcol bg_hint,
  935.       os_gcol fill,
  936.       int offset);
  937.  
  938. /* ------------------------------------------------------------------------
  939.  * Function:      font_set_palette()
  940.  *
  941.  * Description:   Defines the anti-alias palette
  942.  *
  943.  * Input:         bg_hint - value of R1 on entry
  944.  *                fill - value of R2 on entry
  945.  *                offset - value of R3 on entry
  946.  *                bg_hint_out - value of R4 on entry
  947.  *                fill_out - value of R5 on entry
  948.  *
  949.  * Other notes:   Calls SWI 0x40093 with R6 = 0x0.
  950.  */
  951.  
  952. extern os_error *xfont_set_palette (os_gcol bg_hint,
  953.       os_gcol fill,
  954.       int offset,
  955.       os_colour bg_hint_out,
  956.       os_colour fill_out);
  957. extern void font_set_palette (os_gcol bg_hint,
  958.       os_gcol fill,
  959.       int offset,
  960.       os_colour bg_hint_out,
  961.       os_colour fill_out);
  962.  
  963. /* ------------------------------------------------------------------------
  964.  * Function:      font_set_true_palette()
  965.  *
  966.  * Description:   Defines the anti-alias palette with true colour values
  967.  *
  968.  * Input:         bg_hint - value of R1 on entry
  969.  *                fill - value of R2 on entry
  970.  *                offset - value of R3 on entry
  971.  *                bg_hint_out - value of R4 on entry
  972.  *                fill_out - value of R5 on entry
  973.  *
  974.  * Other notes:   Calls SWI 0x40093 with R6 = 0x65757254.
  975.  */
  976.  
  977. extern os_error *xfont_set_true_palette (os_gcol bg_hint,
  978.       os_gcol fill,
  979.       int offset,
  980.       os_colour bg_hint_out,
  981.       os_colour fill_out);
  982. extern void font_set_true_palette (os_gcol bg_hint,
  983.       os_gcol fill,
  984.       int offset,
  985.       os_colour bg_hint_out,
  986.       os_colour fill_out);
  987.  
  988. /* ------------------------------------------------------------------------
  989.  * Function:      font_read_thresholds()
  990.  *
  991.  * Description:   Reads the list of threshold values for painting
  992.  *
  993.  * Input:         buffer - value of R1 on entry
  994.  *
  995.  * Other notes:   Calls SWI 0x40094.
  996.  */
  997.  
  998. extern os_error *xfont_read_thresholds (font_thresholds *buffer);
  999. extern void font_read_thresholds (font_thresholds *buffer);
  1000.  
  1001. /* ------------------------------------------------------------------------
  1002.  * Function:      font_set_thresholds()
  1003.  *
  1004.  * Description:   Defines the list of threshold values for painting
  1005.  *
  1006.  * Input:         thresholds - value of R1 on entry
  1007.  *
  1008.  * Other notes:   Calls SWI 0x40095.
  1009.  */
  1010.  
  1011. extern os_error *xfont_set_thresholds (font_thresholds *thresholds);
  1012. extern void font_set_thresholds (font_thresholds *thresholds);
  1013.  
  1014. /* ------------------------------------------------------------------------
  1015.  * Function:      font_find_caretj()
  1016.  *
  1017.  * Description:   Finds where the caret is in a justified string
  1018.  *
  1019.  * Input:         s - value of R1 on entry
  1020.  *                x - value of R2 on entry
  1021.  *                y - value of R3 on entry
  1022.  *                xjust - value of R4 on entry
  1023.  *                yjust - value of R5 on entry
  1024.  *
  1025.  * Output:        split_point - value of R1 on exit
  1026.  *                x_out - value of R2 on exit
  1027.  *                y_out - value of R3 on exit
  1028.  *                length_out - value of R4 on exit
  1029.  *                index_out - value of R5 on exit
  1030.  *
  1031.  * Other notes:   Calls SWI 0x40096.
  1032.  */
  1033.  
  1034. extern os_error *xfont_find_caretj (char *s,
  1035.       int x,
  1036.       int y,
  1037.       int xjust,
  1038.       int yjust,
  1039.       char **split_point,
  1040.       int *x_out,
  1041.       int *y_out,
  1042.       int *length_out,
  1043.       int *index_out);
  1044. extern void font_find_caretj (char *s,
  1045.       int x,
  1046.       int y,
  1047.       int xjust,
  1048.       int yjust,
  1049.       char **split_point,
  1050.       int *x_out,
  1051.       int *y_out,
  1052.       int *length_out,
  1053.       int *index_out);
  1054.  
  1055. /* ------------------------------------------------------------------------
  1056.  * Function:      font_string_bbox()
  1057.  *
  1058.  * Description:   Measures the size of a string (prefer Font_ScanString)
  1059.  *
  1060.  * Input:         s - value of R1 on entry
  1061.  *
  1062.  * Output:        x0 - value of R1 on exit
  1063.  *                y0 - value of R2 on exit
  1064.  *                x1 - value of R3 on exit
  1065.  *                y1 - value of R4 on exit
  1066.  *
  1067.  * Other notes:   Calls SWI 0x40097.
  1068.  */
  1069.  
  1070. extern os_error *xfont_string_bbox (char *s,
  1071.       int *x0,
  1072.       int *y0,
  1073.       int *x1,
  1074.       int *y1);
  1075. extern void font_string_bbox (char *s,
  1076.       int *x0,
  1077.       int *y0,
  1078.       int *x1,
  1079.       int *y1);
  1080.  
  1081. /* ------------------------------------------------------------------------
  1082.  * Function:      font_read_colour_table()
  1083.  *
  1084.  * Description:   Reads the anti-alias colour table
  1085.  *
  1086.  * Input:         colour_table - value of R1 on entry
  1087.  *
  1088.  * Other notes:   Calls SWI 0x40098.
  1089.  */
  1090.  
  1091. extern os_error *xfont_read_colour_table (font_colour_table *colour_table);
  1092. extern void font_read_colour_table (font_colour_table *colour_table);
  1093.  
  1094. /* ------------------------------------------------------------------------
  1095.  * Function:      font_make_bitmap()
  1096.  *
  1097.  * Description:   Make a font bitmap file
  1098.  *
  1099.  * Input:         font_name - value of R1 on entry
  1100.  *                xsize - value of R2 on entry
  1101.  *                ysize - value of R3 on entry
  1102.  *                xres - value of R4 on entry
  1103.  *                yres - value of R5 on entry
  1104.  *                flags - value of R6 on entry
  1105.  *
  1106.  * Other notes:   Calls SWI 0x40099.
  1107.  */
  1108.  
  1109. extern os_error *xfont_make_bitmap (char *font_name,
  1110.       int xsize,
  1111.       int ysize,
  1112.       int xres,
  1113.       int yres,
  1114.       bits flags);
  1115. extern void font_make_bitmap (char *font_name,
  1116.       int xsize,
  1117.       int ysize,
  1118.       int xres,
  1119.       int yres,
  1120.       bits flags);
  1121.  
  1122. /* ------------------------------------------------------------------------
  1123.  * Function:      font_un_cache_file()
  1124.  *
  1125.  * Description:   Deletes font cache information, or recaches it
  1126.  *
  1127.  * Input:         file_name - value of R0 on entry
  1128.  *                recache - value of R1 on entry
  1129.  *
  1130.  * Other notes:   Calls SWI 0x4009A.
  1131.  */
  1132.  
  1133. extern os_error *xfont_un_cache_file (char *file_name,
  1134.       bool recache);
  1135. extern void font_un_cache_file (char *file_name,
  1136.       bool recache);
  1137.  
  1138. /* ------------------------------------------------------------------------
  1139.  * Function:      font_set_font_max()
  1140.  *
  1141.  * Description:   Sets the FontMax values
  1142.  *
  1143.  * Input:         font_max - value of R0 on entry
  1144.  *                font_max1 - value of R1 on entry
  1145.  *                font_max2 - value of R2 on entry
  1146.  *                font_max3 - value of R3 on entry
  1147.  *                font_max4 - value of R4 on entry
  1148.  *                font_max5 - value of R5 on entry
  1149.  *
  1150.  * Other notes:   Calls SWI 0x4009B with R6 = 0x0, R7 = 0x0.
  1151.  */
  1152.  
  1153. extern os_error *xfont_set_font_max (int font_max,
  1154.       int font_max1,
  1155.       int font_max2,
  1156.       int font_max3,
  1157.       int font_max4,
  1158.       int font_max5);
  1159. extern void font_set_font_max (int font_max,
  1160.       int font_max1,
  1161.       int font_max2,
  1162.       int font_max3,
  1163.       int font_max4,
  1164.       int font_max5);
  1165.  
  1166. /* ------------------------------------------------------------------------
  1167.  * Function:      font_read_font_max()
  1168.  *
  1169.  * Description:   Reads the FontMax values
  1170.  *
  1171.  * Output:        font_max - value of R0 on exit
  1172.  *                font_max1 - value of R1 on exit
  1173.  *                font_max2 - value of R2 on exit
  1174.  *                font_max3 - value of R3 on exit
  1175.  *                font_max4 - value of R4 on exit
  1176.  *                font_max5 - value of R5 on exit
  1177.  *
  1178.  * Other notes:   Calls SWI 0x4009C.
  1179.  */
  1180.  
  1181. extern os_error *xfont_read_font_max (int *font_max,
  1182.       int *font_max1,
  1183.       int *font_max2,
  1184.       int *font_max3,
  1185.       int *font_max4,
  1186.       int *font_max5);
  1187. extern void font_read_font_max (int *font_max,
  1188.       int *font_max1,
  1189.       int *font_max2,
  1190.       int *font_max3,
  1191.       int *font_max4,
  1192.       int *font_max5);
  1193.  
  1194. /* ------------------------------------------------------------------------
  1195.  * Function:      font_read_font_prefix()
  1196.  *
  1197.  * Description:   Finds the directory prefix for a given font handle
  1198.  *
  1199.  * Input:         font - value of R0 on entry
  1200.  *                buffer - value of R1 on entry
  1201.  *                size - value of R2 on entry
  1202.  *
  1203.  * Output:        end - value of R1 on exit
  1204.  *
  1205.  * Other notes:   Calls SWI 0x4009D.
  1206.  */
  1207.  
  1208. extern os_error *xfont_read_font_prefix (font_f font,
  1209.       char *buffer,
  1210.       int size,
  1211.       char **end);
  1212. extern void font_read_font_prefix (font_f font,
  1213.       char *buffer,
  1214.       int size,
  1215.       char **end);
  1216.  
  1217. /* ------------------------------------------------------------------------
  1218.  * Function:      font_switch_output_to_buffer()
  1219.  *
  1220.  * Description:   Switches output to a buffer, creating a Draw file
  1221.  *                structure
  1222.  *
  1223.  * Input:         flags - value of R0 on entry
  1224.  *                buffer - value of R1 on entry
  1225.  *
  1226.  * Output:        end - value of R1 on exit
  1227.  *
  1228.  * Other notes:   Calls SWI 0x4009E.
  1229.  */
  1230.  
  1231. extern os_error *xfont_switch_output_to_buffer (bits flags,
  1232.       byte *buffer,
  1233.       char **end);
  1234. extern void font_switch_output_to_buffer (bits flags,
  1235.       byte *buffer,
  1236.       char **end);
  1237.  
  1238. /* ------------------------------------------------------------------------
  1239.  * Function:      font_read_font_metrics()
  1240.  *
  1241.  * Description:   Reads the full metrics information held in a font's
  1242.  *                IntMetrics file
  1243.  *
  1244.  * Input:         font - value of R0 on entry
  1245.  *                bbox_info - value of R1 on entry
  1246.  *                xwidth_info - value of R2 on entry
  1247.  *                ywidth_info - value of R3 on entry
  1248.  *                misc_info - value of R4 on entry
  1249.  *                kern_info - value of R5 on entry
  1250.  *
  1251.  * Output:        flags - value of R0 on exit
  1252.  *                bbox_info_size - value of R1 on exit
  1253.  *                xwidth_info_size - value of R2 on exit
  1254.  *                ywidth_info_size - value of R3 on exit
  1255.  *                misc_info_size - value of R4 on exit
  1256.  *                kern_info_size - value of R5 on exit
  1257.  *
  1258.  * Other notes:   Calls SWI 0x4009F with R6 = 0x0, R7 = 0x0.
  1259.  */
  1260.  
  1261. extern os_error *xfont_read_font_metrics (font_f font,
  1262.       font_bbox_info *bbox_info,
  1263.       font_width_info *xwidth_info,
  1264.       font_width_info *ywidth_info,
  1265.       font_misc_info *misc_info,
  1266.       font_kern_info *kern_info,
  1267.       bits *flags,
  1268.       int *bbox_info_size,
  1269.       int *xwidth_info_size,
  1270.       int *ywidth_info_size,
  1271.       int *misc_info_size,
  1272.       int *kern_info_size);
  1273. extern void font_read_font_metrics (font_f font,
  1274.       font_bbox_info *bbox_info,
  1275.       font_width_info *xwidth_info,
  1276.       font_width_info *ywidth_info,
  1277.       font_misc_info *misc_info,
  1278.       font_kern_info *kern_info,
  1279.       bits *flags,
  1280.       int *bbox_info_size,
  1281.       int *xwidth_info_size,
  1282.       int *ywidth_info_size,
  1283.       int *misc_info_size,
  1284.       int *kern_info_size);
  1285.  
  1286. /* ------------------------------------------------------------------------
  1287.  * Function:      font_decode_menu()
  1288.  *
  1289.  * Description:   Decode a selection made from a font menu
  1290.  *
  1291.  * Input:         flags - value of R0 on entry
  1292.  *                menu - value of R1 on entry
  1293.  *                block - value of R2 on entry
  1294.  *                buffer - value of R3 on entry
  1295.  *                size - value of R4 on entry
  1296.  *
  1297.  * Output:        next_selection - value of R3 on exit
  1298.  *                used - value of R4 on exit
  1299.  *
  1300.  * Other notes:   Calls SWI 0x400A0.
  1301.  */
  1302.  
  1303. extern os_error *xfont_decode_menu (bits flags,
  1304.       byte *menu,
  1305.       byte *block,
  1306.       byte *buffer,
  1307.       int size,
  1308.       int **next_selection,
  1309.       int *used);
  1310. extern void font_decode_menu (bits flags,
  1311.       byte *menu,
  1312.       byte *block,
  1313.       byte *buffer,
  1314.       int size,
  1315.       int **next_selection,
  1316.       int *used);
  1317.  
  1318. /* ------------------------------------------------------------------------
  1319.  * Function:      font_scan_string()
  1320.  *
  1321.  * Description:   Returns information on a string
  1322.  *
  1323.  * Input:         font - value of R0 on entry
  1324.  *                s - value of R1 on entry
  1325.  *                flags - value of R2 on entry
  1326.  *                x - value of R3 on entry
  1327.  *                y - value of R4 on entry
  1328.  *                block - value of R5 on entry
  1329.  *                trfm - value of R6 on entry
  1330.  *                length - value of R7 on entry
  1331.  *
  1332.  * Output:        split_point - value of R1 on exit
  1333.  *                x_out - value of R3 on exit
  1334.  *                y_out - value of R4 on exit
  1335.  *                length_out - value of R7 on exit
  1336.  *
  1337.  * Other notes:   Calls SWI 0x400A1.
  1338.  */
  1339.  
  1340. extern os_error *xfont_scan_string (font_f font,
  1341.       char *s,
  1342.       bits flags,
  1343.       int x,
  1344.       int y,
  1345.       font_scan_block *block,
  1346.       os_trfm *trfm,
  1347.       int length,
  1348.       char **split_point,
  1349.       int *x_out,
  1350.       int *y_out,
  1351.       int *length_out);
  1352. extern void font_scan_string (font_f font,
  1353.       char *s,
  1354.       bits flags,
  1355.       int x,
  1356.       int y,
  1357.       font_scan_block *block,
  1358.       os_trfm *trfm,
  1359.       int length,
  1360.       char **split_point,
  1361.       int *x_out,
  1362.       int *y_out,
  1363.       int *length_out);
  1364.  
  1365. /* ------------------------------------------------------------------------
  1366.  * Function:      font_current_rgb()
  1367.  *
  1368.  * Description:   Reads the settings of colours after calling Font_Paint
  1369.  *
  1370.  * Output:        font - value of R0 on exit (X version only)
  1371.  *                bg_hint - value of R1 on exit
  1372.  *                fill - value of R2 on exit
  1373.  *                offset - value of R3 on exit
  1374.  *
  1375.  * Returns:       R0 (non-X version only)
  1376.  *
  1377.  * Other notes:   Calls SWI 0x400A3.
  1378.  */
  1379.  
  1380. extern os_error *xfont_current_rgb (font_f *font,
  1381.       os_colour *bg_hint,
  1382.       os_colour *fill,
  1383.       int *offset);
  1384. extern font_f font_current_rgb (os_colour *bg_hint,
  1385.       os_colour *fill,
  1386.       int *offset);
  1387.  
  1388. /* ------------------------------------------------------------------------
  1389.  * Function:      font_future_rgb()
  1390.  *
  1391.  * Description:   Reads the settings of colours after calling various
  1392.  *                Font... SWI's
  1393.  *
  1394.  * Output:        font - value of R0 on exit (X version only)
  1395.  *                bg_hint - value of R1 on exit
  1396.  *                fill - value of R2 on exit
  1397.  *                offset - value of R3 on exit
  1398.  *
  1399.  * Returns:       R0 (non-X version only)
  1400.  *
  1401.  * Other notes:   Calls SWI 0x400A4.
  1402.  */
  1403.  
  1404. extern os_error *xfont_future_rgb (font_f *font,
  1405.       os_colour *bg_hint,
  1406.       os_colour *fill,
  1407.       int *offset);
  1408. extern font_f font_future_rgb (os_colour *bg_hint,
  1409.       os_colour *fill,
  1410.       int *offset);
  1411.  
  1412. /* ------------------------------------------------------------------------
  1413.  * Function:      font_read_encoding_filename()
  1414.  *
  1415.  * Description:   Returns the file name of the encoding file used for a
  1416.  *                given font handle
  1417.  *
  1418.  * Input:         font - value of R0 on entry
  1419.  *                buffer - value of R1 on entry
  1420.  *                size - value of R2 on entry
  1421.  *
  1422.  * Output:        end - value of R1 on exit
  1423.  *
  1424.  * Other notes:   Calls SWI 0x400A5.
  1425.  */
  1426.  
  1427. extern os_error *xfont_read_encoding_filename (font_f font,
  1428.       char *buffer,
  1429.       int size,
  1430.       char **end);
  1431. extern void font_read_encoding_filename (font_f font,
  1432.       char *buffer,
  1433.       int size,
  1434.       char **end);
  1435.  
  1436. /* ------------------------------------------------------------------------
  1437.  * Function:      font_find_field()
  1438.  *
  1439.  * Description:   Returns a pointer to a specified field within a font
  1440.  *                identifier
  1441.  *
  1442.  * Input:         identifier - value of R0 on entry
  1443.  *                qualifier - value of R2 on entry
  1444.  *
  1445.  * Output:        field - value of R1 on exit
  1446.  *                found - value of R2 on exit (X version only)
  1447.  *
  1448.  * Returns:       R2 (non-X version only)
  1449.  *
  1450.  * Other notes:   Calls SWI 0x400A6.
  1451.  */
  1452.  
  1453. extern os_error *xfont_find_field (char *identifier,
  1454.       char qualifier,
  1455.       char **field,
  1456.       bool *found);
  1457. extern bool font_find_field (char *identifier,
  1458.       char qualifier,
  1459.       char **field);
  1460.  
  1461. /* ------------------------------------------------------------------------
  1462.  * Function:      font_apply_fields()
  1463.  *
  1464.  * Description:   Merges a new set of fields with those already in a given
  1465.  *                font identifier
  1466.  *
  1467.  * Input:         identifier - value of R0 on entry
  1468.  *                fields - value of R1 on entry
  1469.  *                buffer - value of R2 on entry
  1470.  *                size - value of R3 on entry
  1471.  *
  1472.  * Output:        spare - value of R3 on exit
  1473.  *
  1474.  * Other notes:   Calls SWI 0x400A7.
  1475.  */
  1476.  
  1477. extern os_error *xfont_apply_fields (char *identifier,
  1478.       char *fields,
  1479.       char *buffer,
  1480.       int size,
  1481.       int *spare);
  1482. extern void font_apply_fields (char *identifier,
  1483.       char *fields,
  1484.       char *buffer,
  1485.       int size,
  1486.       int *spare);
  1487.  
  1488. /* ------------------------------------------------------------------------
  1489.  * Function:      font_lookup_font()
  1490.  *
  1491.  * Description:   Returns information about a given font
  1492.  *
  1493.  * Input:         font - value of R0 on entry
  1494.  *
  1495.  * Output:        flags - value of R2 on exit (X version only)
  1496.  *
  1497.  * Returns:       R2 (non-X version only)
  1498.  *
  1499.  * Other notes:   Calls SWI 0x400A8 with R1 = 0x0, R2 = 0x0.
  1500.  */
  1501.  
  1502. extern os_error *xfont_lookup_font (font_f font,
  1503.       bits *flags);
  1504. extern bits font_lookup_font (font_f font);
  1505.  
  1506. /* ------------------------------------------------------------------------
  1507.  * Function:      service_fonts_changed()
  1508.  *
  1509.  * Description:   New Font$Path detected
  1510.  *
  1511.  * Other notes:   Calls SWI 0x30 with R1 = 0x6E.
  1512.  */
  1513.  
  1514. extern os_error *xservice_fonts_changed (void);
  1515. extern void service_fonts_changed (void);
  1516.  
  1517. #ifdef __cplusplus
  1518.    }
  1519. #endif
  1520.  
  1521. #endif
  1522.