Mercurial > hg > Game > Cerium
annotate freetype2/freetype/ftlzw.h @ 1985:d703157bb280 draft
add Read mode in fileread
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Apr 2014 00:24:16 +0900 |
parents | a8ab91f49cac |
children |
rev | line source |
---|---|
1206
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 /***************************************************************************/ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 /* ftlzw.h */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 /* LZW-compressed stream support. */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 /* Copyright 2004, 2006 by */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 /* This file is part of the FreeType project, and may only be used, */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 /* modified, and distributed under the terms of the FreeType project */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 /* this file you indicate that you have read the license and */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 /* understand and accept it fully. */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 /***************************************************************************/ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 #ifndef __FTLZW_H__ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 #define __FTLZW_H__ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 #include <ft2build.h> |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 #include FT_FREETYPE_H |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 #ifdef FREETYPE_H |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 #error "freetype.h of FreeType 1 has been loaded!" |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 #error "Please fix the directory search order for header files" |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 #error "so that freetype.h of FreeType 2 is found first." |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 #endif |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 FT_BEGIN_HEADER |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 /*************************************************************************/ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 /* <Section> */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 /* lzw */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 /* <Title> */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 /* LZW Streams */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 /* <Abstract> */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 /* Using LZW-compressed font files. */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 /* <Description> */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 /* This section contains the declaration of LZW-specific functions. */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 /*************************************************************************/ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 /************************************************************************ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 * @function: |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 * FT_Stream_OpenLZW |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 * @description: |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 * Open a new stream to parse LZW-compressed font files. This is |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 * mainly used to support the compressed `*.pcf.Z' fonts that come |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 * with XFree86. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 * @input: |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 * stream :: The target embedding stream. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 * source :: The source stream. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 * @return: |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 * FreeType error code. 0~means success. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 * @note: |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 * The source stream must be opened _before_ calling this function. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 * Calling the internal function `FT_Stream_Close' on the new stream will |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 * *not* call `FT_Stream_Close' on the source stream. None of the stream |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 * objects will be released to the heap. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 * The stream implementation is very basic and resets the decompression |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 * process each time seeking backwards is needed within the stream |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 * In certain builds of the library, LZW compression recognition is |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 * automatically handled when calling @FT_New_Face or @FT_Open_Face. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 * This means that if no font driver is capable of handling the raw |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 * compressed file, the library will try to open a LZW stream from it |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 * and re-open the face with it. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 * |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 * This function may return `FT_Err_Unimplemented_Feature' if your build |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 * of FreeType was not compiled with LZW support. |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 FT_EXPORT( FT_Error ) |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 FT_Stream_OpenLZW( FT_Stream stream, |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 FT_Stream source ); |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 /* */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 FT_END_HEADER |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 #endif /* __FTLZW_H__ */ |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 |
a8ab91f49cac
add freetype2,ft2build.h
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 /* END */ |