home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / fontserver / FSlib.doc < prev    next >
Encoding:
Text File  |  1991-05-10  |  5.2 KB  |  216 lines

  1. Protocol requests
  2.  
  3. These functions make protocol requests corresponding to their names.
  4.  
  5. Connection Setup
  6.  
  7. FSServer     *
  8. FSOpenServer(server)
  9.     char       *server;
  10.  
  11. Creates a connection to the font server specified in the 'server' string.
  12.  
  13. FSCloseServer(svr)
  14.     FSServer     *svr;
  15.  
  16. Closes the connection to the font server.
  17.  
  18. Font Manipulation
  19.  
  20. Font
  21. FSOpenXBitmap(svr, hint, fmask, name, originalid)
  22.     FSServer     *svr;
  23.     fsBitmapFormat hint;
  24.     fsBitmapFormatMask    fmask;
  25.     char       *name;
  26.     Font    *originalid;
  27.  
  28. Opens the font that matches the given name (which may have '*' and '?'
  29. as wildcards).  The hint contains format information that will probably
  30. be used in subsequent QueryXBitmaps() requests.  The fmask tells which
  31. bits in the mask are valid.  If originalid is non-zero, then the server
  32. already has the font opened under that ID.
  33.  
  34. FSCloseFont(svr, fid)
  35.     FSServer     *svr;
  36.     Font        fid;
  37.  
  38. Closes the font.
  39.  
  40. char      **
  41. FSListFonts(svr, pattern, maxNames, actualCount)
  42.     FSServer     *svr;
  43.     char       *pattern;
  44.     int         maxNames;
  45.     int        *actualCount;
  46.  
  47. Returns the full names of the fonts matching pattern.  Up to maxNames
  48. names will be returned.  The actual value number be placed in
  49. actualCount.
  50.  
  51. char      **
  52. FSListWithXInfo(svr, pattern, maxNames, actualCount, info, pprops, offsets,
  53.                     prop_data)
  54.     FSServer     *svr;
  55.     char       *pattern;
  56.     int         maxNames;
  57.     int        *actualCount;
  58.     fsFontHeader ***info;
  59.     fsPropInfo ***pprops;
  60.     fsPropOffset ***offsets;
  61.     unsigned char ***prop_data;
  62.  
  63. Returns the full names of the fonts matching pattern.  Up to maxNames
  64. names will be returned.  The actual value number be placed in
  65. actualCount, and each font's header and property information will also
  66. be returned.
  67.  
  68. int
  69. FSQueryXInfo(svr, fid, info, props, offsets, prop_data)
  70.     FSServer     *svr;
  71.     Font        fid;
  72.     fsFontHeader *info;
  73.     fsPropInfo     *props;
  74.     fsPropOffset **offsets;
  75.     unsigned char **prop_data;
  76.  
  77. Returns the font's header information.
  78.  
  79. int
  80. FSQueryXExtents8(svr, fid, range_type, str, str_len, extents)
  81.     FSServer   *svr;
  82.     Font        fid;
  83.     Bool    range_type;
  84.     unsigned char *str;
  85.     unsigned long str_len;
  86.     fsCharInfo **extents;
  87.  
  88. int
  89. FSQueryXExtents16(svr, fid, range_type, str, str_len, extents)
  90.     FSServer   *svr;
  91.     Font        fid;
  92.     Bool    range_type;
  93.     fsChar2b    *str;
  94.     unsigned long str_len;
  95.     fsCharInfo **extents;
  96.  
  97. Returns the extents of the given characters.  If 'range_type' is set,
  98. the 'str' is considered a range, otherwise its considered a list of
  99. characters.  A NULL str when range_type is set means that all the
  100. character extents will be returned.
  101.  
  102. int
  103. FSQueryXBitmaps8(svr, fid, format, range_type, str, str_len,, offsets, glyph_data)
  104.     FSServer     *svr;
  105.     Font        fid;
  106.     fsRange    *range;
  107.     fsBitmapFormat format;
  108.     Bool    range_type;
  109.     unsigned char *str;
  110.     unsined long str_len;
  111.     unsigned long **offsets;
  112.     unsigned char **glyph_data;
  113.  
  114. int
  115. FSQueryXBitmaps16(svr, fid, format, range_type, str, str_len,, offsets, glyph_data)
  116.     FSServer     *svr;
  117.     Font        fid;
  118.     fsRange    *range;
  119.     fsBitmapFormat format;
  120.     Bool    range_type;
  121.     fsChar2b    *str;
  122.     unsined long str_len;
  123.     unsigned long **offsets;
  124.     unsigned char **glyph_data;
  125.  
  126. Returns the font's bitmaps in the requested format.  The other arguments
  127. are used as in QueryExtents above.
  128.  
  129. Extensions
  130.  
  131. char      **
  132. FSListExtensions(svr, next)
  133.     FSServer     *svr;
  134.     int        *next;
  135.  
  136. Lists any extension built into the font server.
  137.  
  138. Bool
  139. FSQueryExtension(svr, name, major_opcode, first_event, first_error)
  140.     FSServer     *svr;
  141.     char       *name;
  142.     int        *major_opcode;
  143.     int        *first_event;
  144.     int        *first_error;
  145.  
  146. Returns information on the specified extension.
  147.  
  148. FSFreeExtensionList(list)
  149.     char      **list;
  150.  
  151. Frees the list returned by FSListExtensions().
  152.  
  153.  
  154. Helper functions -- these don't map to protocol requests, but
  155. can make writing a FS client simpler.
  156.  
  157. Synchronization
  158.  
  159. FSSync(svr, discard)
  160.     FSServer     *svr;
  161.     Bool        discard;
  162.  
  163. Flushes the output queue and waits for a reply from the server,
  164. which will flush the server's output queue.
  165.  
  166. int
  167. (* FSSynchronize(svr, onoff)) ()
  168.     FSServer     *svr;
  169.     int         onoff;
  170.  
  171. Controls whether the server does every request in synchronous form.
  172.  
  173. int
  174. (* FSSetAfterFunction(svr, func)) ()
  175.     FSServer     *svr;
  176.     int         (*func) ();
  177.  
  178. Sets the function that will be called after every request.  This
  179. is usually NULL or FSSync().
  180.  
  181. FSFlush(svr)
  182.     FSServer     *svr;
  183.  
  184. Flushes any queued requests to the font server.
  185.  
  186. Error Handling
  187.  
  188. int         (* FSSetErrorHandler(handler)) ()
  189.     int         (*handler) ();
  190.  
  191. Changes the error handler to 'handler'.  A NULL value will reset
  192. it to use the default.
  193.  
  194. int         (* FSSetIOErrorHandler(handler)) ()
  195.     int         (*handler) ();
  196.  
  197. Changes the I/O error handler to 'handler'.  A NULL value will reset
  198. it to use the default.
  199.  
  200. Miscellaneous
  201.  
  202. long
  203. FSMaxRequestSize(svr)
  204.     FSServer     *svr;
  205.  
  206. Returns the largest request size in 4 byte quantities) that the
  207. server can handle.
  208.  
  209. char       *
  210. FSServerName(server)
  211.     char       *server;
  212.  
  213. Returns the name that FSlib would use to connect to the server.
  214. Translates a NULL in the value of $FONT_SERVER.
  215.  
  216.