IFontBDF.h
资源名称:ilib [点击查看]
上传用户:changbiao
上传日期:2007-01-13
资源大小:141k
文件大小:2k
源码类别:

图片显示

开发平台:

C/C++

  1. /*
  2. ** Routines for reading in a BDF (font) file.
  3. ** BDF files can be obtained as part of the X Windows System.
  4. ** URL: ftp://ftp.x.org/pub/R6.1/xc/fonts/bdf/75dpi/
  5. **
  6. ** Copyright 1996 Craig Knudsen
  7. **
  8. ** 17-May-96 Craig Knudsen cknudsen@radix.net
  9. ** Created
  10. */
  11. #ifndef _ifontbdf_h
  12. #define _ifontbdf_h
  13. /*
  14. ** Read in a BDF font file.
  15. */
  16. IError IFontBDFReadFile (
  17. #ifndef _NO_PROTO
  18.   char *name, /* font name */
  19.   char *path /* full path to BDF file */
  20. #endif
  21. );
  22. IError IFontBDFReadData (
  23. #ifndef _NO_PROTO
  24.   char *name, /* font name */
  25.   char **lines /* font file data lines of text */
  26. /* terminated with a NULL */
  27. #endif
  28. );
  29. /*
  30. ** Free a font
  31. */
  32. IError IFontBDFFree (
  33. #ifndef _NO_PROTO
  34.   char *name
  35. #endif
  36. );
  37. /*
  38. ** Get the pixel size (height) of the font
  39. */
  40. IError IFontBDFGetSize (
  41. #ifndef _NO_PROTO
  42.   char *name, /* BDF filename */
  43.   unsigned int *height_return /* pixel height */
  44. #endif
  45. );
  46. /*
  47. ** Get the width of a character string
  48. */
  49. IError IFontBDFTextWidth (
  50. #ifndef _NO_PROTO
  51.   char *name, /* BDF font name */
  52.   char *ptr, /* input chars */
  53.   int len, /* length of ptr */
  54.   unsigned int *width_return /* length of text in pixels */
  55. #endif
  56. );
  57. /*
  58. ** Get the definition of a character
  59. */
  60. IError IFontBDFGetChar (
  61. #ifndef _NO_PROTO
  62.   char *name, /* BDF font name */
  63.   char *ch,  /* char we are looking up ("A", "33agrave;") */
  64.   unsigned int **bitdata, /* array of 0/1 values containing the char definition */
  65.   unsigned int *width, /* width of bitdata */
  66.   unsigned int *height, /* height of bitdata */
  67.   unsigned int *actual_width, /* actual character width */
  68.   unsigned int *size, /* size of returned array - same as bdfGetSize() */
  69.   int *xoffset, /* pixels to move to the right before drawing */
  70.   int *yoffset /* pixel to move up before drawing */
  71. #endif
  72. );
  73. #endif /* _ifontbdf_h */