ftgzip.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /***************************************************************************/
  2. /* */
  3. /* ftgzip.h */
  4. /* */
  5. /* Gzip-compressed stream support. */
  6. /* */
  7. /* Copyright 2002 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. #ifndef __FTGZIP_H__
  18. #define __FTGZIP_H__
  19. #include <ft2build.h>
  20. #include FT_FREETYPE_H
  21. FT_BEGIN_HEADER
  22. /*************************************************************************/
  23. /* */
  24. /* <Section> */
  25. /* gzip */
  26. /* */
  27. /* <Title> */
  28. /* GZIP Streams */
  29. /* */
  30. /* <Abstract> */
  31. /* Using gzip-compressed font files */
  32. /* */
  33. /* <Description> */
  34. /* This section contains the declaration of Gzip-specific functions. */
  35. /* */
  36. /*************************************************************************/
  37. /************************************************************************
  38. *
  39. * @type: FT_Stream_OpenGzip
  40. *
  41. * @description:
  42. * open a new stream to parse gzip-compressed font files. This is
  43. * mainly used to support the compressed *.pcf.gz fonts that come
  44. * with XFree86
  45. *
  46. * @input:
  47. * stream :: target embedding stream
  48. * source :: source stream, used to
  49. *
  50. * @return:
  51. * error code. 0 means success
  52. *
  53. * @note:
  54. * the source stream must be opened _before_ calling this function.
  55. *
  56. * calling @FT_Stream_Close on the new stream will *not* call
  57. * @FT_Stream_Close on the source stream. None of the stream objects
  58. * will be released to the heap.
  59. *
  60. * the stream implementation is very basic, and resets the decompression
  61. * process each time seeking backwards is needed within the stream
  62. *
  63. * in certain builds of the library, gzip compression recognition is
  64. * automatic when calling @FT_New_Face or @FT_Open_Face. This means that
  65. * if no font driver is capable of handling the raw compressed file,
  66. * the library will try to open a gzip stream from it and re-open
  67. * the face with it.
  68. *
  69. * this function may return "FT_Err_Unimplemented" if your build of
  70. * FreeType was not compiled with zlib support.
  71. */
  72. FT_EXPORT( FT_Error )
  73. FT_Stream_OpenGzip( FT_Stream stream,
  74. FT_Stream source );
  75. /* */
  76. FT_END_HEADER
  77. #endif /* __FTGZIP_H__ */