1 /**************************************************************************** 2 * 3 * ftlzw.h 4 * 5 * LZW-compressed stream support. 6 * 7 * Copyright 2004-2018 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 18 19 #ifndef FTLZW_H_ 20 #define FTLZW_H_ 21 22 #include <ft2build.h> 23 #include FT_FREETYPE_H 24 25 #ifdef FREETYPE_H 26 #error "freetype.h of FreeType 1 has been loaded!" 27 #error "Please fix the directory search order for header files" 28 #error "so that freetype.h of FreeType 2 is found first." 29 #endif 30 31 32 FT_BEGIN_HEADER 33 34 /************************************************************************** 35 * 36 * @section: 37 * lzw 38 * 39 * @title: 40 * LZW Streams 41 * 42 * @abstract: 43 * Using LZW-compressed font files. 44 * 45 * @description: 46 * This section contains the declaration of LZW-specific functions. 47 * 48 */ 49 50 /************************************************************************ 51 * 52 * @function: 53 * FT_Stream_OpenLZW 54 * 55 * @description: 56 * Open a new stream to parse LZW-compressed font files. This is 57 * mainly used to support the compressed `*.pcf.Z' fonts that come 58 * with XFree86. 59 * 60 * @input: 61 * stream :: 62 * The target embedding stream. 63 * 64 * source :: 65 * The source stream. 66 * 67 * @return: 68 * FreeType error code. 0~means success. 69 * 70 * @note: 71 * The source stream must be opened _before_ calling this function. 72 * 73 * Calling the internal function `FT_Stream_Close' on the new stream will 74 * *not* call `FT_Stream_Close' on the source stream. None of the stream 75 * objects will be released to the heap. 76 * 77 * The stream implementation is very basic and resets the decompression 78 * process each time seeking backwards is needed within the stream 79 * 80 * In certain builds of the library, LZW compression recognition is 81 * automatically handled when calling @FT_New_Face or @FT_Open_Face. 82 * This means that if no font driver is capable of handling the raw 83 * compressed file, the library will try to open a LZW stream from it 84 * and re-open the face with it. 85 * 86 * This function may return `FT_Err_Unimplemented_Feature' if your build 87 * of FreeType was not compiled with LZW support. 88 */ 89 FT_EXPORT( FT_Error ) 90 FT_Stream_OpenLZW( FT_Stream stream, 91 FT_Stream source ); 92 93 /* */ 94 95 96 FT_END_HEADER 97 98 #endif /* FTLZW_H_ */ 99 100 101 /* END */ 102