Imported Upstream version 2.8
[platform/upstream/freetype2.git] / docs / reference / ft2-gzip.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>FreeType-2.8 API Reference</title>
7 <style type="text/css">
8   a:link { color: #0000EF; }
9   a:visited { color: #51188E; }
10   a:hover { color: #FF0000; }
11
12   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
13          color: #000000;
14          background: #FFFFFF;
15          width: 87%;
16          margin: auto; }
17
18   div.section { width: 75%;
19                 margin: auto; }
20   div.section hr { margin: 4ex 0 1ex 0; }
21   div.section h4 { background-color: #EEEEFF;
22                    font-size: medium;
23                    font-style: oblique;
24                    font-weight: bold;
25                    margin: 3ex 0 1.5ex 9%;
26                    padding: 0.3ex 0 0.3ex 1%; }
27   div.section p { margin: 1.5ex 0 1.5ex 10%; }
28   div.section pre { margin: 3ex 0 3ex 9%;
29                     background-color: #D6E8FF;
30                     padding: 2ex 0 2ex 1%; }
31   div.section table.fields { width: 90%;
32                              margin: 1.5ex 0 1.5ex 10%; }
33   div.section table.toc { width: 95%;
34                           margin: 1.5ex 0 1.5ex 5%; }
35   div.timestamp { text-align: center;
36                   font-size: 69%;
37                   margin: 1.5ex 0 1.5ex 0; }
38
39   h1 { text-align: center; }
40   h3 { font-size: medium;
41        margin: 4ex 0 1.5ex 0; }
42
43   p { text-align: justify; }
44
45   pre.colored { color: blue; }
46
47   span.keyword { font-family: monospace;
48                  text-align: left;
49                  white-space: pre;
50                  color: darkblue; }
51
52   table.fields td.val { font-weight: bold;
53                         text-align: right;
54                         width: 30%;
55                         vertical-align: baseline;
56                         padding: 1ex 1em 1ex 0; }
57   table.fields td.desc { vertical-align: baseline;
58                          padding: 1ex 0 1ex 1em; }
59   table.fields td.desc p:first-child { margin: 0; }
60   table.fields td.desc p { margin: 1.5ex 0 0 0; }
61   table.index { margin: 6ex auto 6ex auto;
62                 border: 0;
63                 border-collapse: separate;
64                 border-spacing: 1em 0.3ex; }
65   table.index tr { padding: 0; }
66   table.index td { padding: 0; }
67   table.index-toc-link { width: 100%;
68                          border: 0;
69                          border-spacing: 0;
70                          margin: 1ex 0 1ex 0; }
71   table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
72                                  font-size: 83%;
73                                  text-align: left; }
74   table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
75                                    font-size: 83%;
76                                    text-align: center; }
77   table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
78                                   font-size: 83%;
79                                   text-align: right; }
80   table.synopsis { margin: 6ex auto 6ex auto;
81                    border: 0;
82                    border-collapse: separate;
83                    border-spacing: 2em 0.6ex; }
84   table.synopsis tr { padding: 0; }
85   table.synopsis td { padding: 0; }
86   table.toc td.link { width: 30%;
87                       text-align: right;
88                       vertical-align: baseline;
89                       padding: 1ex 1em 1ex 0; }
90   table.toc td.desc { vertical-align: baseline;
91                       padding: 1ex 0 1ex 1em;
92                       text-align: left; }
93   table.toc td.desc p:first-child { margin: 0;
94                                     text-align: left; }
95   table.toc td.desc p { margin: 1.5ex 0 0 0;
96                         text-align: left; }
97
98 </style>
99 </head>
100 <body>
101
102 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table>
103 <h1>FreeType-2.8 API Reference</h1>
104
105 <h1 id="gzip">GZIP Streams</h1>
106 <h2>Synopsis</h2>
107 <table class="synopsis">
108 <tr><td><a href="#FT_Stream_OpenGzip">FT_Stream_OpenGzip</a></td><td><a href="#FT_Gzip_Uncompress">FT_Gzip_Uncompress</a></td><td></td></tr>
109 </table>
110
111
112 <p>This section contains the declaration of Gzip-specific functions.</p>
113
114 <div class="section">
115 <h3 id="FT_Stream_OpenGzip">FT_Stream_OpenGzip</h3>
116 <p>Defined in FT_GZIP_H (freetype/ftgzip.h).</p>
117 <pre>
118   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
119   <b>FT_Stream_OpenGzip</b>( <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  stream,
120                       <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  source );
121 </pre>
122
123 <p>Open a new stream to parse gzip-compressed font files. This is mainly used to support the compressed &lsquo;*.pcf.gz&rsquo; fonts that come with XFree86.</p>
124
125 <h4>input</h4>
126 <table class="fields">
127 <tr><td class="val" id="stream">stream</td><td class="desc">
128 <p>The target embedding stream.</p>
129 </td></tr>
130 <tr><td class="val" id="source">source</td><td class="desc">
131 <p>The source stream.</p>
132 </td></tr>
133 </table>
134
135 <h4>return</h4>
136 <p>FreeType error code. 0&nbsp;means success.</p>
137
138 <h4>note</h4>
139 <p>The source stream must be opened <i>before</i> calling this function.</p>
140 <p>Calling the internal function &lsquo;FT_Stream_Close&rsquo; on the new stream will <b>not</b> call &lsquo;FT_Stream_Close&rsquo; on the source stream. None of the stream objects will be released to the heap.</p>
141 <p>The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream.</p>
142 <p>In certain builds of the library, gzip compression recognition is automatically handled when calling <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it.</p>
143 <p>This function may return &lsquo;FT_Err_Unimplemented_Feature&rsquo; if your build of FreeType was not compiled with zlib support.</p>
144
145 <hr>
146 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
147
148 <div class="section">
149 <h3 id="FT_Gzip_Uncompress">FT_Gzip_Uncompress</h3>
150 <p>Defined in FT_GZIP_H (freetype/ftgzip.h).</p>
151 <pre>
152   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
153   <b>FT_Gzip_Uncompress</b>( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>       memory,
154                       <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*        output,
155                       <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>*       output_len,
156                       <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  input,
157                       <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        input_len );
158 </pre>
159
160 <p>Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's &lsquo;uncompress&rsquo; function.</p>
161
162 <h4>input</h4>
163 <table class="fields">
164 <tr><td class="val" id="memory">memory</td><td class="desc">
165 <p>A FreeType memory handle.</p>
166 </td></tr>
167 <tr><td class="val" id="input">input</td><td class="desc">
168 <p>The input buffer.</p>
169 </td></tr>
170 <tr><td class="val" id="input_len">input_len</td><td class="desc">
171 <p>The length of the input buffer.</p>
172 </td></tr>
173 </table>
174
175 <h4>output</h4>
176 <table class="fields">
177 <tr><td class="val" id="output">output</td><td class="desc">
178 <p>The output buffer.</p>
179 </td></tr>
180 </table>
181
182 <h4>inout</h4>
183 <table class="fields">
184 <tr><td class="val" id="output_len">output_len</td><td class="desc">
185 <p>Before calling the function, this is the total size of the output buffer, which must be large enough to hold the entire uncompressed data (so the size of the uncompressed data must be known in advance). After calling the function, &lsquo;output_len&rsquo; is the size of the used data in &lsquo;output&rsquo;.</p>
186 </td></tr>
187 </table>
188
189 <h4>return</h4>
190 <p>FreeType error code. 0&nbsp;means success.</p>
191
192 <h4>note</h4>
193 <p>This function may return &lsquo;FT_Err_Unimplemented_Feature&rsquo; if your build of FreeType was not compiled with zlib support.</p>
194
195 <hr>
196 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
197
198 </body>
199 </html>