michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftgzip.h */ michael@0: /* */ michael@0: /* Gzip-compressed stream support. */ michael@0: /* */ michael@0: /* Copyright 2002-2004, 2006, 2013 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FTGZIP_H__ michael@0: #define __FTGZIP_H__ michael@0: michael@0: #include michael@0: #include FT_FREETYPE_H michael@0: michael@0: #ifdef FREETYPE_H michael@0: #error "freetype.h of FreeType 1 has been loaded!" michael@0: #error "Please fix the directory search order for header files" michael@0: #error "so that freetype.h of FreeType 2 is found first." michael@0: #endif michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /*
*/ michael@0: /* gzip */ michael@0: /* */ michael@0: /* */ michael@0: /* GZIP Streams */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* Using gzip-compressed font files. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This section contains the declaration of Gzip-specific functions. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * @function: michael@0: * FT_Stream_OpenGzip michael@0: * michael@0: * @description: michael@0: * Open a new stream to parse gzip-compressed font files. This is michael@0: * mainly used to support the compressed `*.pcf.gz' fonts that come michael@0: * with XFree86. michael@0: * michael@0: * @input: michael@0: * stream :: michael@0: * The target embedding stream. michael@0: * michael@0: * source :: michael@0: * The source stream. michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * The source stream must be opened _before_ calling this function. michael@0: * michael@0: * Calling the internal function `FT_Stream_Close' on the new stream will michael@0: * *not* call `FT_Stream_Close' on the source stream. None of the stream michael@0: * objects will be released to the heap. michael@0: * michael@0: * The stream implementation is very basic and resets the decompression michael@0: * process each time seeking backwards is needed within the stream. michael@0: * michael@0: * In certain builds of the library, gzip compression recognition is michael@0: * automatically handled when calling @FT_New_Face or @FT_Open_Face. michael@0: * This means that if no font driver is capable of handling the raw michael@0: * compressed file, the library will try to open a gzipped stream from michael@0: * it and re-open the face with it. michael@0: * michael@0: * This function may return `FT_Err_Unimplemented_Feature' if your build michael@0: * of FreeType was not compiled with zlib support. michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Stream_OpenGzip( FT_Stream stream, michael@0: FT_Stream source ); michael@0: michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * @function: michael@0: * FT_Gzip_Uncompress michael@0: * michael@0: * @description: michael@0: * Decompress a zipped input buffer into an output buffer. This function michael@0: * is modeled after zlib's `uncompress' function. michael@0: * michael@0: * @input: michael@0: * memory :: michael@0: * A FreeType memory handle. michael@0: * michael@0: * input :: michael@0: * The input buffer. michael@0: * michael@0: * input_len :: michael@0: * The length of the input buffer. michael@0: * michael@0: * @output: michael@0: * output:: michael@0: * The output buffer. michael@0: * michael@0: * @inout: michael@0: * output_len :: michael@0: * Before calling the function, this is the the total size of the michael@0: * output buffer, which must be large enough to hold the entire michael@0: * uncompressed data (so the size of the uncompressed data must be michael@0: * known in advance). After calling the function, `output_len' is the michael@0: * size of the used data in `output'. michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * This function may return `FT_Err_Unimplemented_Feature' if your build michael@0: * of FreeType was not compiled with zlib support. michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Gzip_Uncompress( FT_Memory memory, michael@0: FT_Byte* output, michael@0: FT_ULong* output_len, michael@0: const FT_Byte* input, michael@0: FT_ULong input_len ); michael@0: michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FTGZIP_H__ */ michael@0: michael@0: michael@0: /* END */