1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/freetype2/include/ftgzip.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,149 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftgzip.h */ 1.7 +/* */ 1.8 +/* Gzip-compressed stream support. */ 1.9 +/* */ 1.10 +/* Copyright 2002-2004, 2006, 2013 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTGZIP_H__ 1.23 +#define __FTGZIP_H__ 1.24 + 1.25 +#include <ft2build.h> 1.26 +#include FT_FREETYPE_H 1.27 + 1.28 +#ifdef FREETYPE_H 1.29 +#error "freetype.h of FreeType 1 has been loaded!" 1.30 +#error "Please fix the directory search order for header files" 1.31 +#error "so that freetype.h of FreeType 2 is found first." 1.32 +#endif 1.33 + 1.34 + 1.35 +FT_BEGIN_HEADER 1.36 + 1.37 + /*************************************************************************/ 1.38 + /* */ 1.39 + /* <Section> */ 1.40 + /* gzip */ 1.41 + /* */ 1.42 + /* <Title> */ 1.43 + /* GZIP Streams */ 1.44 + /* */ 1.45 + /* <Abstract> */ 1.46 + /* Using gzip-compressed font files. */ 1.47 + /* */ 1.48 + /* <Description> */ 1.49 + /* This section contains the declaration of Gzip-specific functions. */ 1.50 + /* */ 1.51 + /*************************************************************************/ 1.52 + 1.53 + 1.54 + /************************************************************************ 1.55 + * 1.56 + * @function: 1.57 + * FT_Stream_OpenGzip 1.58 + * 1.59 + * @description: 1.60 + * Open a new stream to parse gzip-compressed font files. This is 1.61 + * mainly used to support the compressed `*.pcf.gz' fonts that come 1.62 + * with XFree86. 1.63 + * 1.64 + * @input: 1.65 + * stream :: 1.66 + * The target embedding stream. 1.67 + * 1.68 + * source :: 1.69 + * The source stream. 1.70 + * 1.71 + * @return: 1.72 + * FreeType error code. 0~means success. 1.73 + * 1.74 + * @note: 1.75 + * The source stream must be opened _before_ calling this function. 1.76 + * 1.77 + * Calling the internal function `FT_Stream_Close' on the new stream will 1.78 + * *not* call `FT_Stream_Close' on the source stream. None of the stream 1.79 + * objects will be released to the heap. 1.80 + * 1.81 + * The stream implementation is very basic and resets the decompression 1.82 + * process each time seeking backwards is needed within the stream. 1.83 + * 1.84 + * In certain builds of the library, gzip compression recognition is 1.85 + * automatically handled when calling @FT_New_Face or @FT_Open_Face. 1.86 + * This means that if no font driver is capable of handling the raw 1.87 + * compressed file, the library will try to open a gzipped stream from 1.88 + * it and re-open the face with it. 1.89 + * 1.90 + * This function may return `FT_Err_Unimplemented_Feature' if your build 1.91 + * of FreeType was not compiled with zlib support. 1.92 + */ 1.93 + FT_EXPORT( FT_Error ) 1.94 + FT_Stream_OpenGzip( FT_Stream stream, 1.95 + FT_Stream source ); 1.96 + 1.97 + 1.98 + /************************************************************************ 1.99 + * 1.100 + * @function: 1.101 + * FT_Gzip_Uncompress 1.102 + * 1.103 + * @description: 1.104 + * Decompress a zipped input buffer into an output buffer. This function 1.105 + * is modeled after zlib's `uncompress' function. 1.106 + * 1.107 + * @input: 1.108 + * memory :: 1.109 + * A FreeType memory handle. 1.110 + * 1.111 + * input :: 1.112 + * The input buffer. 1.113 + * 1.114 + * input_len :: 1.115 + * The length of the input buffer. 1.116 + * 1.117 + * @output: 1.118 + * output:: 1.119 + * The output buffer. 1.120 + * 1.121 + * @inout: 1.122 + * output_len :: 1.123 + * Before calling the function, this is the the total size of the 1.124 + * output buffer, which must be large enough to hold the entire 1.125 + * uncompressed data (so the size of the uncompressed data must be 1.126 + * known in advance). After calling the function, `output_len' is the 1.127 + * size of the used data in `output'. 1.128 + * 1.129 + * @return: 1.130 + * FreeType error code. 0~means success. 1.131 + * 1.132 + * @note: 1.133 + * This function may return `FT_Err_Unimplemented_Feature' if your build 1.134 + * of FreeType was not compiled with zlib support. 1.135 + */ 1.136 + FT_EXPORT( FT_Error ) 1.137 + FT_Gzip_Uncompress( FT_Memory memory, 1.138 + FT_Byte* output, 1.139 + FT_ULong* output_len, 1.140 + const FT_Byte* input, 1.141 + FT_ULong input_len ); 1.142 + 1.143 + 1.144 + /* */ 1.145 + 1.146 + 1.147 +FT_END_HEADER 1.148 + 1.149 +#endif /* __FTGZIP_H__ */ 1.150 + 1.151 + 1.152 +/* END */