:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / subsys / win32k / freetype / docs / freetype2.html
1 <html>
2 <head>
3 <title>FreeType 2 Introduction</title>
4 <basefont face="Georgia, Arial, Helvetica, Geneva">
5 <style content="text/css">
6   P { text-align=justify }
7   H1 { text-align=center }
8   H2 { text-align=center }
9   LI { text-align=justify }
10 </style>
11 </head>
12
13 <body text="#000000"
14       bgcolor="#FFFFFF"
15       link="#0000EF"
16       vlink="#51188E"
17       alink="#FF0000">
18
19
20 <font size=1>http://www.freetype.org</font><p> 
21
22 <center>
23   <a href="freetype.html">
24   <img src="image/freetype.jpg" width=550 height=105 alt="The FreeType Project" border=0></a>
25   <h1>An Introduction to FreeType 2</h1>
26 </center>
27
28 <center><table width=750 cellspacing=10 cellpadding=30><tr><td>
29 <hr><p>
30
31 DOCUMENT INDEX:<br>
32 <ul>
33   <li><a href="#what">What is FreeType 2 ?</a>
34   <li><a href="#features">Features</a>
35   <li><a href="#requirements">Requirements</a>
36   <li><a href="#patents">Patents issues</a>
37 </ul><p>
38
39
40 <hr><p>
41
42 <table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
43 <h2 align=center><a name="what">What is FreeType 2 ?</h2>
44 </td></tr><tr><td>
45
46 <p>The FreeType project is a team of volunteers who develop free, portable
47 and high-quality software solutions for digital typography. We specifically
48 target embedded systems and focus on bringing small, efficient and
49 ubiquitous products.</p>
50
51 <p>the FreeType 2 library is our new software font engine. It has been
52    designed to provide the following important features:</p>
53
54   <ul>
55   <li><p>
56     <b>A universal and simple API to manage font files:</b><br>
57     <ul>
58       <p>The FreeType 2 API is simple and easy to use. It supports both
59          bitmapped and scalable fonts and is well-suited to manage font
60          files of all formats. Unlike other font libraries, FreeType 2
61          returns and manages outline font data (images & metrics).</p>
62    </ul>
63    </p></li>
64  
65   <li><p>
66     <b>Support for several font formats through loadable modules:</b><br>
67     <ul>
68       <p>FreeType 2 uses <em>"font drivers"</em>. Each driver is a loadable
69          module used to support one specific font format. Each driver can also
70          provide specific extensions used to access format-specific features of
71          the font.</p>
72     </ul>
73   </p></li>
74   
75   
76   <li><p>
77     <b>High-quality anti-aliasing:</b><br>
78     <ul>
79       <p>FreeType 2 produces etremely smooth outlines at small sizes, with its new
80          anti-aliasing renderer, which produces bitmaps with 256-levels of gray.
81          It uses a new algorithm that has been specifically designed to render
82          small complex shapes (like glyphs) at high speed. Indeed, it's even
83          faster than the monochrome renderer for small character sizes (under
84          20 pixels) !!
85       </p>
86     </ul>
87
88
89  <li><b>High portability & performance:</b><br>
90      <ul>
91        <p>The FreeType 2 source code is written in ANSI C and runs on any
92           platform with a compliant compiler. Client applications can
93           provide their own memory manager or input stream to the library
94           (which means that font files can come from any place: disk,
95           memory, compressed file, network, etc..).
96        </p>
97      </ul>
98             
99   </ul>
100   
101   <p>Note that <em>the beta of FreeType 2 is available <b>now</b></em>. For more
102   info, check our <a href="download.html">Download page</a> or see the source
103   and its diffs through our <a href="cgi-bin/cvsweb.cgi">CVS Web interface</a>.
104   </p>
105 </ul>
106
107 </td></tr></table>
108
109 <table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
110 <h2 align=center><a name="features">Features</h2>
111 </td></tr><tr><td>
112
113 <h3>Supported font formats</h3>
114
115 <p>FreeType 2 readily supports the following font formats:</p>
116
117 <ul>
118   <li>TrueType files (.ttf) and collections (.ttc)</li>
119   <li>Type 1 font files both in ASCII (.pfa) or binary (.pfb) format</li>
120   <li>Type 1 Multiple Master fonts. The FreeType 2 API also provides
121       routines to manage design instances easily</li>
122   <li>Type 1 CID-keyed fonts</li>
123   <li>OpenType/CFF (.otf) fonts</li>
124   <li>CFF/Type 2 fonts</li>
125   <li>Adobe CEF fonts (.cef), used to embed fonts in SVG documents
126       with the Adobe SVG viewer plugin.</li>
127   <li>Windows FNT/FON bitmap fonts</li>
128 </ul>
129
130 <p>Note that Apple's TrueType GX fonts are supported as normal TTFs,
131    (the advanced tables are ignored).</p>
132
133 <p>Besides, it's possible to add support for new font formats by providing
134    a specific <em>font driver</em> module. Modules can be added either at
135    build time (when recompiling the library), or at <em>run-time</em>;
136    this allows, for example, applications to register their own
137    font driver to support program-specific formats.</p>
138
139
140 <h3>Patent-free automatic hinter</h3>
141
142 <p>TrueType fonts are normally renderered (hinted) with the help of a
143    specific bytecode where the behaviour of a few opcodes is patented by
144    Apple. We're currently in contact with Apple to discuss the importance
145    of such patents and their use in open source projects like FreeType.
146    </p>
147    
148 <p>In the meantime, we have developped our own alternative technology that
149    is capable of automatically hinting scalable glyph images. It is
150    now part of the FreeType 2 source tree as the "autohint" module,
151    and is used to hint glyphs when the bytecode interpreter is disabled
152    (through a configuration macro when building the engine). Note that
153    the auto-hinter is also used to handle glyphs in other formats like
154    CFF and Type 1.</p>
155
156 <p>The auto-hinter provides pretty good results (in some cases, it even
157    significantly improves the output of poorly hinted fonts) but we'll
158    continue to improve it with each new release of FreeType to achieve
159    the highest possible quality.</p>
160
161
162 <h3>Modular design:</h3>
163
164 <p>The design of FreeType 2 is extremely modular as most features are
165    supported through optional modules. This means it's easily possible to
166    only compile the features you need. As each module is between
167    10 and 20 Kb in size, it's possible to build a bare-bones
168    font engine that supports anti-aliasing in about 30 Kb !!</p>
169    
170 <p>Configuration is performed by  modifications of only two header
171    files (one to select global features, another one to select modules)
172    and don't need tweaking of source code. Note that it is however
173    possible to provide your own implementation of certain components.</p>
174    
175 <p>For example, when building on Unix, the engine will automatically
176    use memory-mapped files when available on the target platform,
177    thus significantly increasing font file i/o.</p>
178
179
180 <p>Due to its very flexible design, it is possible to add, remove and
181    upgrade modules at run-time.</p>
182
183
184
185 <h3>Advanced glyph management</h3>
186
187 <p>The API comes with a standard extension used to extract individual
188    glyph images from font files. These images can be bitmaps, scalable
189    bezier outlines or even anything else. (e.g. bi-color or metafont
190    glyphs, as long as they're supported by a module).</p>
191    
192 <p>Each scalable glyph image can be transformed, measured and
193    rendered into a monochrome or anti-aliased bitmaps easily
194    through a uniform interface.
195
196    This allows client applications to easily cache glyphs or
197    perform text rendering effects with minimal difficulty
198    (look at the FreeType 2 Tutorial to see how to render
199     rotated text with very few lines of code).
200 </p>
201
202
203
204 <h3>Advanced font access</h3>
205
206 <p>The FreeType 2 API is useful to retrieve advanced information from
207    various fonts:</p>
208    
209 <ul>
210   <li>vertical metrics are available whenever found in the font file</li>
211   
212   <li>kerning distances are available when found in the font file. It
213       is also possible to "attach" a given additional file to a given
214       font face. This is useful to load kerning distances from an
215       .afm file into a Type 1 face for example.</li>
216
217   <li>provides ASCII glyph names whenever available in the font
218       (TrueType, OpenType, Type1, etc..)</li>
219       
220   <li>provides access to important tables for SFNT-based font formats
221       (i.e. TrueType, OpenType, CEF, etc..), like the name table,
222       font header, maximum profile, etc...</li>
223
224   <li>automatic synthesis of Unicode-based character maps for
225       those fonts or formats that do not provide one. This is
226       extremely useful with Type 1 fonts which are normally
227       limited to a stupid 256-characters encoding.</li>
228 </ul>      
229
230   
231 <h3>Simple & clean API</h3>
232
233 <p>The FreeType 2 high-level API is simple and straightforward, as it
234    has been specifically designed to make the most commmon font operations
235    easy</p>
236    
237 <p>As a comparison, the number of function calls needed to perform a
238    the tasks of font face creation/opening and glyph loading/rendering
239    has been reduced by a factor of 4 !!</p>
240
241 <p>The API is also independent of any font-format specific issue, though
242    it provides standard extensions to access format-specific tables and
243    information. More extensions can also be easily added through new
244    modules</p>
245    
246
247 <h3>Robust & Portable code</h3>
248
249 <p>Because it is written in industry-standard ANSI C, FreeType 2 compiles
250    on all platforms with a compliant compiler. Because the default build
251    only relies on the C library, it is free of any system-specific
252    dependencies, even if it is possible to "enhance" certain components
253    by providing a specific implementation.</p>
254
255 <p>The code doesn't use global or static variables. Client applications
256    can provide their own memory manager. Font files can be read from
257    a disk file, memory, or through a client-provided input stream. This
258    allows to support compressed font files, remote fonts, fonts embedded
259    in other streams (e.g. Type42 fonts), etc..</p>
260    
261 <p>An advanced i/o sub-system is used to optimise file access, as well
262    as reduce memory usage of the library when the file is memory-based
263    ( ROM, RAM, memory-mapped ).</p>
264
265
266 <h3>Open Source & Vendor Independence</h3>
267
268 <p>Finally, FreeType 2 is released under its own BSD-like open source
269    license, one of the less restricting licenses available, and this
270    means that:</p>
271    
272 <ul>
273   <li><p>
274     It can be included in all kinds of products, be they proprietary
275     or not.
276   </p></li>
277   
278   <li><p>
279     As any module can be added or replaced anytime, any third party
280     vendor  has the ability to provide its own set of modules (under
281     its own license) in order to support proprietary font formats or
282     more advanced features (e.g. a new auto-hinter, or a new
283     anti-aliasing renderer for LCDs or TV screens).
284   </p></li>
285 </ul>
286
287 <p>One could even imagine an application using the FreeType 2 API with
288    a "wrapper" module used to access system-specific fonts (like through
289    the Windows GDI). This would mean native font support with more portable
290    application code (as simply changing the wrapper module would be required
291    to port the application to another system).</p>
292
293 </td></tr></table>
294
295 <table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
296 <h2 align=center><a name="requirements">Requirements</h2>
297 </td></tr><tr><td>
298
299 <p>FreeType 2 is written in ANSI&nbsp;C and should compile with no problems
300    on a great variety of platforms. We have taken care of removing all
301    compilation warnings from major compliant compilers. Detailed compilation
302    instructions are provided in the software archive.</p>
303
304 <p>This version of the library has been succesfully compiled and run
305    under the following systems: Dos, OS/2, Windows, Macintosh, Unix
306    (including the 64-bits DEC Unix, a.k.a. "True64"). You should not
307    encounter major problems compiling it on any other kind of platform.
308    In all cases, contact us if you do.</p>
309
310 <p>Note that a small set of demonstration programs is also separately
311    available. They include a tiny graphics sub-system that is used to
312    display and show-off the library's capabilities on the following
313    platforms: X11, MacOS, OS/2 & Windows.</p>
314
315 <p>Please visit our <a href="http://www.freetype.org/download.html">
316    Download section</a> to access the software archives.</p>
317
318 </ul>
319
320 </td></tr></table>
321
322 <table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
323 <h2 align=center><a name="patents">Patents issues</h2>
324 </td></tr><tr><td>
325
326 <p>The FreeType 2 source code includes a TrueType bytecode interpreter that
327    is covered by the Apple patents. However, this piece of code is never
328    compiled by default in this release (unlike in previous betas) making
329    a default build of the library <em>entirely patent-free !!</em></p>
330    
331 <p>Note that in order to compile the interpreter, one needs to define
332    the configuration macro <tt><b>TT_CONFIG_OPTION_BYTECODE_INTERPRETER</b></tt> configuration
333    macro in the file "<tt>ftoption.h</tt>". More details are available in
334    the software archive. Note that the use of the interpreter is normally
335    protected by US, UK and French patents. In the event you'd absolutely
336    need it, you may have to <a href="mailto:patents@apple.org">contact
337    Apple legal department</a> for licensing conditions, depending on your
338    location and the places you distribute/sell your products.</p>
339
340 <p>Please do not ask us any detailed information regarding licensing, as
341    we're still discussing with Apple this issue, we're unable to inform
342    the public of what's currently going on..</p>
343
344 </td></tr></table>
345
346 <hr>
347 <p>
348 <a href="index.html">Back to FreeType homepage</a><p>
349
350 </td></tr></table>
351 </body>
352 </html>