blob: 0da6c9e57a2c971bd992251e20cdd9b13d139aa5 [file] [log] [blame]
David Turnerd3c8e062000-12-04 22:53:55 +00001LATEST CHANGES
2
3 - changed the library header files inclusion scheme. Right now,
4 a client application can do something like this:
5
6 #include <ft2build.h> -- include build and setup configuration file
7 #include FT_FREETYPE_H -- main API file
8 #include FT_GLYPH_H -- abstract glyph image handling, etc..
9
10=========================================================================
David Turneraaac8132000-12-01 18:55:22 +000011LATEST CHANGES BETWEEN 2.0.1 and 2.0:
12
13 2.0.1 introduces a few changes:
14
15 - fixed many bugs related to the support of CFF / OpenType fonts.
16 These formats are now much better supported though there is still
17 work planned to deal with Charset tables and PDF-embedded CFF
18 files that use the old "seac" command.
19
20 - the library could not be compiled in debug mode with a very small
21 number of C compilers whose pre-processors didn't implement the
Werner Lemberg2e82c932000-12-01 21:56:47 +000022 "##" directive correctly (i.e. per se the ANSI C specification!)
David Turneraaac8132000-12-01 18:55:22 +000023 An elegant fix was found.
24
25 - added support for the free Borland command-line C++ Builder compiler
26 use "make setup bcc32" to use it. Also fixed a few source lines that
27 generated new warnings with BCC32.
28
29 - fixed a bug in FT_Outline_Get_BBox when computing the extrema of
Werner Lemberg2e82c932000-12-01 21:56:47 +000030 a conic Bezier arc.
David Turneraaac8132000-12-01 18:55:22 +000031
32 - updated the INSTALL file to add IDE compilation.
33
34 - other minor bug fixes, from invalid Type 1 style flags to correct
35 support of synthetic (obliqued) fonts in the auto-hinter, better
36 support for embedded bitmaps in a SFNT font.
37
38 - fixed some problems with "freetype-config"
39
40
41 Finally, the "standard" scheme for including FreeType headers is now
Werner Lemberg2e82c932000-12-01 21:56:47 +000042 gradually changing, but this will be explained in a later release
43 (probably 2.0.2) ...
David Turneraaac8132000-12-01 18:55:22 +000044
Werner Lemberg2e82c932000-12-01 21:56:47 +000045 And very special thanks to Tom Kacvinsky and YAMANO-UCHI Hidetoshi for
46 their contributions!
David Turneraaac8132000-12-01 18:55:22 +000047
48=========================================================================
49CHANGES BETWEEN beta8 and 2.0
David Turnerf9b8dec2000-06-16 19:34:52 +000050
David Turner27c88272000-11-09 19:10:22 +000051 - changed the default installation path for public headers from
52 "include/freetype" to "include/freetype2".
53
54 Also added a new "freetype-config" that is automatically
55 generated and installed on Unix and Cygwin systems. The
56 script itself is used to retrieve the current install path,
57 C compilation flags as well as linker flags..
58
59 - fixed several small bugs:
60
61 - incorrect max advance width for fixed-pitch Type 1 fonts
62
63 - incorrect glyph names for certain TrueType fonts
64
65 - the glyph advance was not copied when FT_Glyph_To_Bitmap was called
66
67 - the linearHoriAdvance and linerVertAdvance fields were not
68 correctly returned for glyphs processed by the auto-hinter
69
Werner Lembergb5084e12000-10-28 17:10:06 +000070 - "type1z" renamed back to "type1"; the old "type1" module has been
71 removed
72
David Turner046f7a02000-09-15 22:42:06 +000073 - revamped the build system to make it a lot more generic. This will
74 allow us to re-use nearly un-modified in lots of other projects
75 (including FreeType Layout)
76
David Turner34f1c2f2000-08-23 22:47:44 +000077 - changed "cid" to use "psaux" too..
78
David Turner3b2c50e2000-08-23 21:11:13 +000079 - added the cache sub-system. See <freetype/ftcache.h> as well as the
80 sources in "src/cache". Note that it compiles but is still untested
81 for now ..
82
David Turnera39acf52000-08-23 02:47:57 +000083 - updated "docs/docmaker.py", a draft API reference is available at
84 http://www.freetype.org/ft2api.html
85
Werner Lembergb5084e12000-10-28 17:10:06 +000086 - changed "type1" to use "psaux"
David Turnera39acf52000-08-23 02:47:57 +000087
88 - created a new module named "psaux" to hold the Type 1 & Type 2 parsing
Werner Lembergb5084e12000-10-28 17:10:06 +000089 routines. It should be used by "type1", "cid" and "cff" in the future
David Turnera39acf52000-08-23 02:47:57 +000090
91 - fixed an important bug in "FT_Glyph_Get_CBox"
92
David Turnerb1693412000-07-27 21:48:48 +000093 - fixed some compiler warnings that happened since the TrueType
94 bytecode decoder was deactivated by default..
95
David Turnerc5cdf8b2000-07-27 21:40:22 +000096 - fixed two memory leaks:
97 - the memory manager (16 bytes) isn't released in FT_Done_FreeType !!
Werner Lemberge4b32a52000-10-31 20:42:18 +000098
David Turnerc5cdf8b2000-07-27 21:40:22 +000099 - using custom input streams, the copy of the original stream
100 was never released
101
102 - fixed the auto-hinter by performing automatic computation of the
103 "filling direction" of each glyph. This is done through a simple and
104 fast approximation, and seems to work (problems spotted by Werner
105 though). The Arphic fonts are a lot nicer though there are still a
106 lot of things to do to handle Asian fonts correctly..
107
108===========================================================================
109BETA-8 (RELEASE CANDIDATE) CHANGES
110
David Turner5f5b4462000-07-26 19:13:51 +0000111 - deactivated the trueType bytecode interpreter by default
Werner Lemberge4b32a52000-10-31 20:42:18 +0000112
David Turner5f5b4462000-07-26 19:13:51 +0000113 - deactivated the "src/type1" font driver. Now "src/type1z" is
114 used by default..
115
David Turner5fe4c002000-07-26 19:04:08 +0000116 - updates to the build system. We now compile the library correctly
117 under Unix system through "configure" which is automatically called
118 on the first "make" invocation.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000119
David Turner5fe4c002000-07-26 19:04:08 +0000120 - added the auto-hinting module !!. Fixing some bugs here and there..
121
David Turner49bd4f02000-07-12 16:57:37 +0000122 - found some bugs in the composite loader (seac) of the Type1-based
123 font drivers..
124
125 - renamed the directory "freetype2/config" to "freetype2/builds" and
David Turner1ca6f2d2000-07-08 00:49:43 +0000126 updated all relevant files..
127
David Turner9b3d1c72000-07-07 19:47:34 +0000128 - found a memory leak in the "type1" driver
Werner Lemberge4b32a52000-10-31 20:42:18 +0000129
David Turner9b3d1c72000-07-07 19:47:34 +0000130 - incorporated Tom's patches to support flex operators correctly
131 in OpenType/CFF fonts.. Now all I need is to support pure CFF
132 and CEF fonts to be done with this driver.. :-)
133
134 - added the Windows FNT/FON driver in "src/winfonts". For now,
135 it always "simulates" a Unicode charmap, so it shouldn't be
136 considered completed right now..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000137
David Turner9b3d1c72000-07-07 19:47:34 +0000138 It's there to be more a proof of concept than anything else
139 anyway. The driver is a single C source file, that compiles
140 to 3 Kb of code..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000141
David Turner9b3d1c72000-07-07 19:47:34 +0000142 I'm still working on the PCF/BDF drivers.. but I'm too lazy
143 to finish them now..
144
145
David Turnerc06aba22000-06-30 23:38:23 +0000146 - CHANGES TO THE HIGH-LEVEL API
Werner Lemberge4b32a52000-10-31 20:42:18 +0000147
David Turnerc06aba22000-06-30 23:38:23 +0000148 o FT_Get_Kerning has a new parameter that allows you to select
149 the coordinates of the kerning vector ( font units, scaled,
150 scaled + grid-fitted ).
Werner Lemberge4b32a52000-10-31 20:42:18 +0000151
David Turnerc06aba22000-06-30 23:38:23 +0000152 o the outline functions are now in <freetype/ftoutln.h> and not
153 part of <freetype/freetype.h> anymore
Werner Lemberge4b32a52000-10-31 20:42:18 +0000154
David Turnerc06aba22000-06-30 23:38:23 +0000155 o <freetype/ftmodule.h> now contains declarations for
156 FT_New_Library, FT_Done_Library, FT_Add_Default_Modules
157
158 o the so-called convenience functions have moved from "ftoutln.c"
159 to "ftglyph.c", and are thus available with this optional component
160 of the library. They are declared in <freetype/ftglyph.h> now..
161
162 o anti-aliased rendering is now the default for FT_Render_Glyph
163 (i.e. corresponds to render_mode == 0 == ft_render_mode_normal).
164 To generate a monochrome bitmap, use ft_render_mode_mono, or the
165 FT_LOAD_MONOCHROME flag in FT_Load_Glyph/FT_Load_Char.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000166
David Turnerc06aba22000-06-30 23:38:23 +0000167 FT_LOAD_ANTI_ALIAS is still defined, but values to 0.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000168
David Turnerc06aba22000-06-30 23:38:23 +0000169 o <freetype/freetype.h> now include <freetype/config/ftconfig.h>,
170 solving a few headaches :-)
171
172 o the type FT_GlyphSlotRec has now a "library" field.
173
174
175
176 - CHANGES TO THE "ftglyph.h" API
Werner Lemberge4b32a52000-10-31 20:42:18 +0000177
David Turnerc06aba22000-06-30 23:38:23 +0000178 This API has been severely modified in order to make it simpler,
179 clearer, and more efficient. It certainly now looks like a real
180 "glyph factory" object, and allows client applications to manage
181 (i.e. transform, bbox and render) glyph images without ever knowing
182 their original format.
183
David Turner98258612000-06-28 20:43:07 +0000184 - added support for CID-keyed fonts to the CFF driver.
185 maybe support for pure CFF + CEF fonts should come in ??
David Turner9d636b62000-06-27 23:32:27 +0000186
187
188 - cleaned up source code in order to avoid two functions with the
189 same name. Also changed the names of the files in "type1z" from
190 "t1XXXX" to "z1XXXX" in order to avoid any conflicts.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000191
David Turner9d636b62000-06-27 23:32:27 +0000192 "make multi" now works well :-)
Werner Lemberge4b32a52000-10-31 20:42:18 +0000193
David Turner81bb4ad2000-06-28 04:19:49 +0000194 Also removed the use of "cidafm" for now, even if the source files
195 are still there. This functionality will certainly go into a specific
196 module..
David Turnerc06aba22000-06-30 23:38:23 +0000197
198
199
Werner Lemberge4b32a52000-10-31 20:42:18 +0000200 - ADDED SUPPORT FOR THE AUTO-HINTER
201
David Turnerc06aba22000-06-30 23:38:23 +0000202 It works :-) I have a demo program which simply is a copy of "ftview"
203 that does a FT_Add_Module( library, &autohinter_module_class ) after
204 library initialisation, and Type 1 & OpenType/CFF fonts are now hinted.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000205
David Turnerc06aba22000-06-30 23:38:23 +0000206 CID fonts are not hinted, as they include no charmap and the auto-hinter
207 doesn't include "generic" global metrics computations yet..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000208
David Turnerc06aba22000-06-30 23:38:23 +0000209 Now, I need to release this thing to the FreeType 2 source..
210
211
Werner Lemberge4b32a52000-10-31 20:42:18 +0000212
213
David Turner9d636b62000-06-27 23:32:27 +0000214
215 - CHANGES TO THE RENDERER MODULES
Werner Lemberge4b32a52000-10-31 20:42:18 +0000216
David Turner9d636b62000-06-27 23:32:27 +0000217 the monochrome and smooth renderers are now in two distinct directories,
218 namely "src/raster1" and "src/smooth". Note that the old "src/renderer"
219 is now gone..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000220
David Turner9d636b62000-06-27 23:32:27 +0000221 I ditched the 5-gray-levels renderers. Basically, it involved a simple
222 #define toggle in 'src/raster1/ftraster.c'
Werner Lemberge4b32a52000-10-31 20:42:18 +0000223
David Turner9d636b62000-06-27 23:32:27 +0000224 FT_Render_Glyph, FT_Outline_Render & FT_Outline_Get_Bitmap now select
225 the best renderer available, depending on render mode. If the current
226 renderer for a given glyph image format isn't capable of supporting
227 the render mode, another one will be found in the library's list.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000228
David Turner9d636b62000-06-27 23:32:27 +0000229 This means that client applications do not need to switch or set the
230 renderers themselves (as in the latest change), they'll get what they
231 want automatically... At last..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000232
David Turner9d636b62000-06-27 23:32:27 +0000233 Changed the demo programs accordingly..
Werner Lemberge4b32a52000-10-31 20:42:18 +0000234
235
David Turner9d636b62000-06-27 23:32:27 +0000236
David Turnerf0df85b2000-06-22 00:17:42 +0000237 - MAJOR INTERNAL REDESIGN:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000238
David Turnerf0df85b2000-06-22 00:17:42 +0000239 A lot of internal modifications have been performed lately on the
240 source in order to provide the following enhancements:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000241
David Turnerf0df85b2000-06-22 00:17:42 +0000242 - more generic module support:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000243
David Turnerf0df85b2000-06-22 00:17:42 +0000244 The FT_Module type is now defined to represent a handle to a given
245 module. The file <freetype/ftmodule.h> contains the FT_Module_Class
246 definition, as well as the module-loading public API
247
248 The FT_Driver type is still defined, and still represents a pointer
249 to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
250 FT_Get_Driver by FT_Get_Module, etc..
251
252
253 - support for generic glyph image types:
254
255 The FT_Renderer type is a pointer to a module used to perform various
256 operations on glyph image.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000257
David Turnerf0df85b2000-06-22 00:17:42 +0000258 Each renderer is capable of handling images in a single format
259 (e.g. ft_glyph_format_outline). Its functions are used to:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000260
David Turnerf0df85b2000-06-22 00:17:42 +0000261 - transform an glyph image
262 - render a glyph image into a bitmap
263 - return the control box (dimensions) of a given glyph image
264
265
266 The scan converters "ftraster.c" and "ftgrays.c" have been moved
267 to the new directory "src/renderer", and are used to provide two
268 default renderer modules.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000269
David Turnerf0df85b2000-06-22 00:17:42 +0000270 One corresponds to the "standard" scan-converter, the other to the
271 "smooth" one.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000272
David Turnerf0df85b2000-06-22 00:17:42 +0000273 The current renderer can be set through the new function
274 FT_Set_Renderer.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000275
David Turnerf0df85b2000-06-22 00:17:42 +0000276 The old raster-related function FT_Set_Raster, FT_Get_Raster and
277 FT_Set_Raster_Mode have now disappeared, in favor of the new:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000278
David Turnerf0df85b2000-06-22 00:17:42 +0000279 FT_Get_Renderer
280 FT_Set_Renderer
281
282 see the file <freetype/ftrender.h> for more details..
283
284 These changes were necessary to properly support different scalable
285 formats in the future, like bi-color glyphs, etc..
286
287
288 - glyph loader object:
289
290 A new internal object, called a 'glyph loader' has been introduced
291 in the base layer. It is used by all scalable format font drivers
292 to load glyphs and composites.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000293
David Turnerf0df85b2000-06-22 00:17:42 +0000294 This object has been created to reduce the code size of each driver,
295 as each one of them basically re-implemented its functionality.
296
297 See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
298 more information..
299
300
301
302 - FT_GlyphSlot had new fields:
303
304 In order to support extended features (see below), the FT_GlyphSlot
305 structure has a few new fields:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000306
David Turnerf0df85b2000-06-22 00:17:42 +0000307 linearHoriAdvance: this field gives the linearly scaled (i.e.
308 scaled but unhinted) advance width for the glyph,
309 expressed as a 16.16 fixed pixel value. This
310 is useful to perform WYSIWYG text.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000311
David Turnerf0df85b2000-06-22 00:17:42 +0000312 linearVertAdvance: this field gives the linearly scaled advance
313 height for the glyph (relevant in vertical glyph
314 layouts only). This is useful to perform
Werner Lemberge4b32a52000-10-31 20:42:18 +0000315 WYSIWYG text.
David Turnerf0df85b2000-06-22 00:17:42 +0000316
317 Note that the two above field replace the removed "metrics2" field
318 in the glyph slot.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000319
David Turnerf0df85b2000-06-22 00:17:42 +0000320 advance: this field is a vector that gives the transformed
321 advance for the glyph. By default, it corresponds
322 to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
323 was specified when calling FT_Load_Glyph or FT_Load_Char
324
325 bitmap_left: this field gives the distance in integer pixels from
326 the current pen position to the left-most pixel of
327 a glyph image WHEN IT IS A BITMAP. It is only valid
328 when the "format" field is set to
329 "ft_glyph_format_bitmap", for example, after calling
330 the new function FT_Render_Glyph.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000331
David Turnerf0df85b2000-06-22 00:17:42 +0000332 bitmap_top: this field gives the distance in integer pixels from
333 the current pen position (located on the baseline) to
334 the top-most pixel of the glyph image WHEN IT IS A
335 BITMAP. Positive values correspond to upwards Y.
336
337 loader: this is a new private field for the glyph slot. Client
338 applications should not touch it..
339
340
341 - support for transforms and direct rendering in FT_Load_Glyph:
342
343 Most of the functionality found in <freetype/ftglyph.h> has been
344 moved to the core library. Hence, the following:
Werner Lemberge4b32a52000-10-31 20:42:18 +0000345
David Turnerf0df85b2000-06-22 00:17:42 +0000346 - a transform can be specified for a face through FT_Set_Transform.
347 this transform is applied by FT_Load_Glyph to scalable glyph images
348 (i.e. NOT TO BITMAPS) before the function returns, unless the
349 bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
350
351
352 - once a glyph image has been loaded, it can be directly converted to
353 a bitmap by using the new FT_Render_Glyph function. Note that this
354 function takes the glyph image from the glyph slot, and converts
355 it to a bitmap whose properties are returned in "face.glyph.bitmap",
356 "face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
357 native image might be lost after the conversion.
358
359
360 - when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
361 and FT_Load_Char functions will call FT_Render_Glyph automatically
362 when needed.
363
364
365
366
David Turnerf9b8dec2000-06-16 19:34:52 +0000367 - reformated all modules source code in order to get rid of the basic
368 data types redifinitions (i.e. "TT_Int" instead of "FT_Int", "T1_Fixed"
369 instead of "FT_Fixed"). Hence the format-specific prefixes like "TT_",
370 "T1_", "T2_" and "CID_" are only used for relevant structures..
371
372============================================================================
373OLD CHANGES FOR BETA 7
David Turner3475e7f2000-05-17 20:56:01 +0000374
David Turner2b9be992000-06-07 23:41:17 +0000375 - bug-fixed the OpenType/CFF parser. It now loads and displays my two
376 fonts nicely, but I'm pretty certain that more testing is needed :-)
Werner Lemberge4b32a52000-10-31 20:42:18 +0000377
David Turner2b9be992000-06-07 23:41:17 +0000378 - fixed the crummy Type 1 hinter, it now handles accented characters
379 correctly (well, the accent is not always well placed, but that's
380 another problem..)
381
David Turner04aa8002000-06-01 03:27:48 +0000382 - added the CID-keyed Type 1 driver in "src/cid". Works pretty well for
383 only 13 Kb of code ;-) Doesn't read AFM files though, nor the really
384 useful CMAP files..
385
386 - fixed two bugs in the smooth renderer (src/base/ftgrays.c). Thanks to
387 Boris Letocha for spotting them and providing a fix..
388
David Turner4f99c3c2000-05-29 20:55:13 +0000389 - fixed potential "divide by zero" bugs in ftcalc.c.. my god..
390
391 - added source code for the OpenType/CFF driver (still incomplete though..)
392
393 - modified the SFNT driver slightly to perform more robust header
394 checks in TT_Load_SFNT_Header. This prevents certain font files
395 (e.g. some Type 1 Multiple Masters) from being incorrectly "recognized"
396 as TrueType font files..
397
David Turner2e421312000-05-26 22:13:17 +0000398 - moved a lot of stuff from the TrueType driver to the SFNT module,
399 this allows greater code re-use between font drivers (e.g. TrueType,
400 OpenType, Compact-TrueType, etc..)
401
402 - added a tiny segment cache to the SFNT Charmap 4 decoder, in order
403 to minimally speed it up..
404
David Turner11187202000-05-26 17:13:23 +0000405 - added support for Multiple Master fonts in "type1z". There is also
406 a new file named <freetype/ftmm.h> which defines functions to
407 manage them from client applications.
Werner Lemberge4b32a52000-10-31 20:42:18 +0000408
David Turner11187202000-05-26 17:13:23 +0000409 The new file "src/base/ftmm.c" is also optional to the engine..
410
411 - various formatting changes (e.g. EXPORT_DEF -> FT_EXPORT_DEF) +
412 small bug fixes in FT_Load_Glyph, the "type1" driver, etc..
413
David Turnerf5dcdd52000-05-23 22:16:27 +0000414 - a minor fix to the Type 1 driver to let them apply the font matrix
415 correctly (used for many oblique fonts..)
416
David Turner51179f02000-05-18 16:18:05 +0000417 - some fixes for 64-bit systems (mainly changing some FT_TRACE calls
418 to use %p instead of %lx).. Thanks to Karl Robillard
419
David Turner109fcf62000-05-17 23:35:37 +0000420 - fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added
421 a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be cropped when
422 loaded from a file (maybe I should move the bitmap cropper to the
423 base layer ??).
424
David Turner3475e7f2000-05-17 20:56:01 +0000425 - changed the default number of gray levels of the smooth renderer to
426 256 (instead of the previous 128). Of course, the human eye can't
Werner Lembergb5084e12000-10-28 17:10:06 +0000427 see any difference ;-)
David Turner3475e7f2000-05-17 20:56:01 +0000428
429 - removed TT_MAX_SUBGLYPHS, there is no static limit on the number of
430 subglyphs in a TrueType font now..
431
432=============================================================================
433OLD CHANGES 16 May 2000
David Turnerefce08d2000-05-11 18:23:52 +0000434
David Turner968f0c32000-05-16 23:26:01 +0000435 - tagged "BETA-6" in the CVS tree. This one is a serious release candidate
436 even though it doesn't incorporate the auto-hinter yet..
437
438 - various obsolete files were removed, and copyright header updated
439
440 - finally updated the standard raster to fix the monochrome rendering bug
441 + re-enable support for 5-gray levels anti-aliasing (suck, suck..)
442
443 - created new header files, and modified sources accordingly:
David Turnere49ab252000-05-16 23:44:38 +0000444
David Turner968f0c32000-05-16 23:26:01 +0000445 <freetype/fttypes.h> - simple FreeType types, without the API
446 <freetype/internal/ftmemory.h> - definition of memory-management macros
447
448 - added the "DSIG" (OpenType Digital Signature) tag to <freetype/tttags.h>
449
David Turnerc30aea92000-05-12 15:01:18 +0000450 - light update/cleaning of the build system + changes to the sources in
451 order to get rid of _all_ compiler warnings with three compilers, i.e:
452
453 gcc with "-ansi -pedantic -Wall -W", Visual C++ with "/W3 /WX"
454 and LCC
455
456 IMPORTANT NOTE FOR WIN32-LCC USERS:
457 |
458 | It seems the C pre-processor that comes with LCC is broken, it
459 | doesn't recognize the ANSI standard directives # and ## correctly
460 | when one of the argument is a macro. Also, something like:
David Turnere49ab252000-05-16 23:44:38 +0000461 |
David Turnerc30aea92000-05-12 15:01:18 +0000462 | #define F(x) print##x
David Turnere49ab252000-05-16 23:44:38 +0000463 |
David Turnerc30aea92000-05-12 15:01:18 +0000464 | F(("hello"))
David Turnere49ab252000-05-16 23:44:38 +0000465 |
David Turnerc30aea92000-05-12 15:01:18 +0000466 | will get incorrectly translated to:
David Turnere49ab252000-05-16 23:44:38 +0000467 |
David Turnerc30aea92000-05-12 15:01:18 +0000468 | print "hello")
David Turnere49ab252000-05-16 23:44:38 +0000469 |
David Turnerc30aea92000-05-12 15:01:18 +0000470 | by its pre-processor. For this reason, you simply cannot build
471 | FreeType 2 in debug mode with this compiler..
472
473
David Turnerbfe2f982000-05-12 12:17:15 +0000474 - yet another massive grunt work. I've changed the definition of the
475 EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now take
476 an argument, which is the function's return value type.
David Turnere49ab252000-05-16 23:44:38 +0000477
David Turnerbfe2f982000-05-12 12:17:15 +0000478 This is necessary to compile FreeType as a DLL on Windows and OS/2.
479 Depending on the compiler used, a compiler-specific keyword like __export
480 or __system must be placed before (VisualC++) or after (BorlandC++)
481 the type..
David Turnere49ab252000-05-16 23:44:38 +0000482
David Turnerbfe2f982000-05-12 12:17:15 +0000483 Of course, this needed a lot of changes throughout the source code
484 to make it compile again... All cleaned up now, apparently..
485
486 Note also that there is a new EXPORT_VAR macro defined to allow the
487 _declaration_ of an exportable public (constant) variable. This is the
488 case of the raster interfaces (see ftraster.h and ftgrays.h), as well
489 as each module's interface (see sfdriver.h, psdriver.h, etc..)
490
491 - new feature: it is now possible to pass extra parameters to font
492 drivers when creating a new face object. For now, this
493 capability is unused. It could however prove to be useful
494 in a near future..
495
496 the FT_Open_Args structure was changes, as well as the internal
497 driver interface (the specific "init_face" module function has now
498 a different signature).
499
500 - updated the tutorial (not finished though).
David Turnerc30aea92000-05-12 15:01:18 +0000501 - updated the top-level BUILD document
David Turnerbfe2f982000-05-12 12:17:15 +0000502
David Turnerc60c61c2000-05-12 15:26:58 +0000503 - fixed a potential memory leak that could occur when loading embedded
504 bitmaps.
505
David Turnerbfe2f982000-05-12 12:17:15 +0000506 - added the declaration of FT_New_Memory_Face in <freetype/freetype.h>, as
507 it was missing from the public header (the implementation was already
508 in "ftobjs.c").
509
510 - the file <freetype/fterrors.h> has been seriously updated in order to
511 allow the automatic generation of error message tables. See the comments
512 within it for more information.
513
David Turnera9c251c2000-05-11 18:36:19 +0000514 - major directory hierarchy re-organisation. This was done for two things:
David Turnere49ab252000-05-16 23:44:38 +0000515
David Turnera9c251c2000-05-11 18:36:19 +0000516 * first, to ease the "manual" compilation of the library by requiring
517 at lot less include paths :-)
David Turnerbfe2f982000-05-12 12:17:15 +0000518
David Turnera9c251c2000-05-11 18:36:19 +0000519 * second, to allow external programs to effectively access internal
520 data fields. For example, this can be extremely useful if someone
521 wants to write a font producer or a font manager on top of FreeType.
522
523 Basically, you should now use the 'freetype/' prefix for header inclusion,
524 as in:
David Turnere49ab252000-05-16 23:44:38 +0000525
David Turnera9c251c2000-05-11 18:36:19 +0000526 #include <freetype/freetype.h>
527 #include <freetype/ftglyph.h>
528
529 Some new include sub-directories are available:
David Turnere49ab252000-05-16 23:44:38 +0000530
David Turnera9c251c2000-05-11 18:36:19 +0000531 a. the "freetype/config" directory, contains two files used to
532 configure the build of the library. Client applications should
533 not need to look at these normally, but they can if they want.
David Turnere49ab252000-05-16 23:44:38 +0000534
David Turnera9c251c2000-05-11 18:36:19 +0000535 #include <freetype/config/ftoption.h>
536 #include <freetype/config/ftconfig.h>
David Turnere49ab252000-05-16 23:44:38 +0000537
David Turnera9c251c2000-05-11 18:36:19 +0000538 b. the "freetype/internal" directory, contains header files that
539 describes library internals. These are the header files that were
540 previously found in the "src/base" and "src/shared" directories.
541
542
543 As usual, the build system and the demos have been updated to reflect
544 the change..
David Turnere49ab252000-05-16 23:44:38 +0000545
David Turnera9c251c2000-05-11 18:36:19 +0000546 Here's a layout of the new directory hierarchy:
David Turnere49ab252000-05-16 23:44:38 +0000547
David Turnera9c251c2000-05-11 18:36:19 +0000548 TOP
549 include/
550 freetype/
551 freetype.h
552 ...
553 config/
554 ftoption.h
555 ftconfig.h
556 ftmodule.h
David Turnere49ab252000-05-16 23:44:38 +0000557
David Turnera9c251c2000-05-11 18:36:19 +0000558 internal/
559 ftobjs.h
560 ftstream.h
561 ftcalc.h
562 ...
David Turnere49ab252000-05-16 23:44:38 +0000563
David Turnera9c251c2000-05-11 18:36:19 +0000564 src/
565 base/
566 ...
David Turnere49ab252000-05-16 23:44:38 +0000567
David Turnera9c251c2000-05-11 18:36:19 +0000568 sfnt/
569 psnames/
570 truetype/
571 type1/
572 type1z/
573
574
575 Compiling a module is now much easier, for example, the following should
David Turner968f0c32000-05-16 23:26:01 +0000576 work when in the TOP directory on an ANSI build:
David Turnere49ab252000-05-16 23:44:38 +0000577
David Turnera9c251c2000-05-11 18:36:19 +0000578 gcc -c -I./include -I./src/base src/base/ftbase.c
579 gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c
580 etc..
581
582 (of course, using -Iconfig/<system> if you provide system-specific
583 configuration files).
David Turnerefce08d2000-05-11 18:23:52 +0000584
585
586 - updated the structure of FT_Outline_Funcs in order to allow
587 direct coordinate scaling within the outline decomposition routine
588 (this is important for virtual "on" points with TrueType outlines)
589 + updates to the rasters to support this..
590
591 - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order
592 to support version 2 of the table (see OpenType 1.2 spec)
593
594 - created "include/tttables.h" and "include/t1tables.h" to allow
595 client applications to access some of the SFNT and T1 tables of a
596 face with a procedural interface (see FT_Get_Sfnt_Table())
597 + updates to internal source files to reflect the change..
598
599 - some cleanups in the source code to get rid of warnings when compiling
600 with the "-Wall -W -ansi -pedantic" options in gcc.
601
602 - debugged and moved the smooth renderer to "src/base/ftgrays.c" and
603 its header to "include/ftgrays.h"
604
605 - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with
606 up to 80 sub-glyphs !! Thanks to Werner
607
608================================================================================
609OLD CHANGES - 14-apr-2000
David Turner77054f22000-04-14 20:49:52 +0000610
611 - fixed a bug in the TrueType glyph loader that prevented the correct
612 loading of some CJK glyphs in mingli.ttf
David Turnere49ab252000-05-16 23:44:38 +0000613
David Turner77054f22000-04-14 20:49:52 +0000614 - improved the standard Type 1 hinter in "src/type1"
David Turnere49ab252000-05-16 23:44:38 +0000615
David Turner77054f22000-04-14 20:49:52 +0000616 - fixed two bugs in the experimental Type 1 driver in "src/type1z"
617 to handle the new XFree86 4.0 fonts (and a few other ones..)
618
619 - the smooth renderer is now complete and supports sub-banding
620 to render large glyphs at high speed. However, it is still located
621 in "demos/src/ftgrays.c" and should move to the library itself
622 in the next beta.. NOTE: The smooth renderer doesn't compile in
623 stand-alone mode anymore, but this should be fixed RSN..
David Turnere49ab252000-05-16 23:44:38 +0000624
David Turner77054f22000-04-14 20:49:52 +0000625 - introduced convenience functions to more easily deal with glyph
626 images, see "include/ftglyph.h" for more details, as well as the
627 new demo program named "demos/src/ftstring.c" that demonstrates
628 its use
629
630 - implemented FT_LOAD_NO_RECURSE in both the TrueType and Type 1
631 drivers (this is required by the auto-hinter to improve its results).
632
633 - changed the raster interface, in order to allow client applications
634 to provide their own span-drawing callbacks. However, only the
635 smooth renderer supports this. See "FT_Raster_Params" in the
636 file "include/ftimage.h"
637
638 - fixed a small bug in FT_MulFix that caused incorrect transform
639 computation !!
640
641 - Note: The tutorial is out-of-date, grumpf.. :-(
642
643================================================================================
644OLD CHANGES - 12-mar-2000
David Turnerc3c7e7f2000-03-13 14:19:31 +0000645
646 - changed the layout of configuration files : now, all ANSI configuration
647 files are located in "freetype2/config". System-specific over-rides
648 can be placed in "freetype2/config/<system>".
David Turnere49ab252000-05-16 23:44:38 +0000649
David Turnerc3c7e7f2000-03-13 14:19:31 +0000650 - moved all configuration macros to "config/ftoption.h"
David Turnere49ab252000-05-16 23:44:38 +0000651
David Turnerc3c7e7f2000-03-13 14:19:31 +0000652 - improvements in the Type 1 driver with AFM support
David Turnere49ab252000-05-16 23:44:38 +0000653
David Turnerc3c7e7f2000-03-13 14:19:31 +0000654 - changed the fields in the FT_Outline structure : the old "flags"
655 array is re-named "tags", while all ancient flags are encoded into
656 a single unsigned int named "flags".
657
658 - introduced new flags in FT_Outline.flags (see ft_outline_.... enums in
659 "ftimage.h").
660
661 - changed outline functions to "FT_Outline_<action>" syntax
662
663 - added a smooth anti-alias renderer to the demonstration programs
664 - added Mac graphics driver (thanks Just)
David Turnere49ab252000-05-16 23:44:38 +0000665
David Turnerc3c7e7f2000-03-13 14:19:31 +0000666 - FT_Open_Face changed in order to received a pointer to a FT_Open_Args
667 descriptor..
David Turnere49ab252000-05-16 23:44:38 +0000668
David Turnerc3c7e7f2000-03-13 14:19:31 +0000669 - various cleanups, a few more API functions implemented (see FT_Attach_File)
670
671 - updated some docs
672
673================================================================================
674OLD CHANGES - 22-feb-2000
David Turner58c10b52000-02-22 14:31:42 +0000675
676 - introduced the "psnames" module. It is used to:
677
678 o convert a Postscript glyph name into the equivalent Unicode
679 character code (used by the Type 1 driver(s) to synthetize
680 on the fly a Unicode charmap).
681
682 o provide an interface to retrieve the Postscript names of
683 the Macintosh, Adobe Standard & Adobe Expert character codes.
684 (the Macintosh names are used by the SFNT-module postscript
685 names support routines, while the other two tables are used
686 by the Type 1 driver(s)).
687
688 - introduced the "type1z" alternate Type 1 driver. This is a (still
689 experimental) driver for the Type 1 format that will ultimately
690 replace the one in "src/type1". It uses pattern matching to load
691 data from the font, instead of a finite state analyzer. It works
692 much better than the "old" driver with "broken" fonts. It is also
693 much smaller (under 15 Kb).
694
695 - the Type 1 drivers (both in "src/type1" and "src/type1z") are
696 nearly complete. They both provide automatic Unicode charmap
697 synthesis through the "psnames" module. No re-encoding vector
698 is needed. (note that they still leak memory due to some code
699 missing, and I'm getting lazy).
700
701 Trivial AFM support has been added to read kerning information
702 but wasn't exactly tested as it should ;-)
703
704 - The TrueType glyph loader has been seriously rewritten (see the
705 file "src/truetype/ttgload.c". It is now much, much simpler as
706 well as easier to read, maintain and understand :-) Preliminary
707 versions introduced a memory leak that has been reported by Jack
708 Davis, and is now fixed..
709
710 - introduced the new "ft_glyph_format_plotter", used to represent
711 stroked outlines like Windows "Vector" fonts, and certain Type 1
712 fonts like "Hershey". The corresponding raster will be written
713 soon.
714
715 - FT_New_Memory_Face is gone. Likewise, FT_Open_Face has a new
716 interface that uses a structure to describe the input stream,
717 the driver (if required), etc..
718
719TODO
720 - Write FT_Get_Glyph_Bitmap and FT_Load_Glyph_Bitmap
721
722 - Add a function like FT_Load_Character( face, char_code, load_flags )
723 that would really embbed a call to FT_Get_Char_Index then FT_Load_Glyph
724 to ease developer's work.
725
726 - Update the tutorial !!
727 - consider adding support for Multiple Master fonts in the Type 1
728 drivers.
729
730 - Test the AFM routines of the Type 1 drivers to check that kerning
731 information is returned correctly.
732
733 - write a decent auto-gridding component !! We need this to release
734 FreeType 2.0 gold !
735
736
737----- less urgent needs : ----------
738 - add a CFF/Type2 driver
739 - add a BDF driver
740 - add a FNT/PCF/HBF driver
741 - add a Speedo driver from the X11 sources
742
743
744==============================================================================
745OLDER CHANGES - 27-jan-2000
David Turner633da992000-01-27 14:07:33 +0000746
747 - updated the "sfnt" module interface to allow several SFNT-based
748 drivers to co-exist peacefully
David Turnere49ab252000-05-16 23:44:38 +0000749
David Turner633da992000-01-27 14:07:33 +0000750 - updated the "T1_Face" type to better separate Postscript font content
751 from the rest of the FT_Face structure. Might be used later by the
752 CFF/Type2 driver..
David Turnere49ab252000-05-16 23:44:38 +0000753
David Turner633da992000-01-27 14:07:33 +0000754 - added an experimental replacement Type 1 driver featuring advanced
755 (and speedy) pattern matching to retrieve the data from postscript
756 fonts.
757
758 - very minor changes in the implementation of FT_Set_Char_Size and
759 FT_Set_Pixel_Sizes (they now implement default to ligthen the
760 font driver's code).
761
762
763=============================================================================
764OLD MESSAGE
765
David Turnerd2b1f351999-12-16 23:11:37 +0000766This file summarizes the changes that occured since the last "beta" of FreeType 2.
767Because the list is important, it has been divided into separate sections:
768
David Turner5951ce91999-12-29 00:53:44 +0000769Table Of Contents:
770
771 I High-Level Interface (easier !)
772 II Directory Structure
773 III Glyph Image Formats
774 IV Build System
775 V Portability
776 VI Font Drivers
David Turnerd2b1f351999-12-16 23:11:37 +0000777
778-----------------------------------------------------------------------------------------
779High-Level Interface :
780
781 The high-level API has been considerably simplified. Here is how :
782
David Turner5951ce91999-12-29 00:53:44 +0000783 - resource objects have disappeared. this means that face objects can
784 now be created with a single function call (see FT_New_Face and
David Turnerd2b1f351999-12-16 23:11:37 +0000785 FT_Open_Face)
David Turnere49ab252000-05-16 23:44:38 +0000786
David Turnerd2b1f351999-12-16 23:11:37 +0000787 - when calling either FT_New_Face & FT_Open_Face, a size object and a
788 glyph slot object are automatically created for the face, and can be
789 accessed through "face->glyph" and "face->size" if one really needs to.
790 In most cases, there's no need to call FT_New_Size or FT_New_Glyph.
David Turnere49ab252000-05-16 23:44:38 +0000791
David Turnerd2b1f351999-12-16 23:11:37 +0000792 - similarly, FT_Load_Glyph now only takes a "face" argument (instead of
793 a glyph slot and a size). Also, it's "result" parameter is gone, as
794 the glyph image type is returned in the field "face->glyph.format"
David Turnere49ab252000-05-16 23:44:38 +0000795
David Turnerd2b1f351999-12-16 23:11:37 +0000796 - the list of available charmaps is directly accessible through
797 "face->charmaps", counting "face->num_charmaps" elements. Each
798 charmap has an 'encoding' field which specifies which known encoding
799 it deals with. Valid values are, for example :
David Turnere49ab252000-05-16 23:44:38 +0000800
David Turnerd2b1f351999-12-16 23:11:37 +0000801 ft_encoding_unicode (for ASCII, Latin-1 and Unicode)
802 ft_encoding_apple_roman
803 ft_encoding_sjis
804 ft_encoding_adobe_standard
David Turner5951ce91999-12-29 00:53:44 +0000805 ft_encoding_adobe_expert
David Turnere49ab252000-05-16 23:44:38 +0000806
David Turnerd2b1f351999-12-16 23:11:37 +0000807 other values may be added in the future. Each charmap still holds its
808 "platform_id" and "encoding_id" values in case the encoding is too
809 exotic for the current library
810
811
812-----------------------------------------------------------------------------------------
813Directory Structure:
814
815 Should seem obvious to most of you:
816
817 freetype/
818 config/ -- configuration sub-makefiles
819 ansi/
David Turner5951ce91999-12-29 00:53:44 +0000820 unix/ -- platform-specific configuration files
David Turnerd2b1f351999-12-16 23:11:37 +0000821 win32/
822 os2/
823 msdos/
824
825 include/ -- public header files, those to be included directly
826 by client apps
827
828 src/ -- sources of the library
829 base/ -- the base layer
830 sfnt/ -- the sfnt "driver" (see the drivers section below)
831 truetype/ -- the truetype driver
832 type1/ -- the type1 driver
833 shared/ -- some header files shared between drivers
834
835 demos/ -- demos/tools
836
837 docs/ -- documentation (a bit empty for now)
838
839-----------------------------------------------------------------------------------------
840Glyph Image Formats :
841
842 Drivers are now able to register new glyph image formats within the library.
843 For now, the base layer supports of course bitmaps and vector outlines, but
844 one could imagine something different like colored bitmaps, bi-color
845 vectors or wathever else (Metafonts anyone ??).
846
847 See the file `include/ftimage.h'. Note also that the type FT_Raster_Map is
848 gone, and is now replaced by FT_Bitmap, which should encompass all known
849 bitmap types.
850
851 Each new image format must provide at least one "raster", i.e. a module
David Turner5951ce91999-12-29 00:53:44 +0000852 capable of transforming the glyph image into a bitmap. It's also possible
David Turnerd2b1f351999-12-16 23:11:37 +0000853 to change the default raster used for a given glyph image format.
854
855 The default outline scan-converter now uses 128 levels of grays by default,
856 which tends to smooth many things. Note that the demo programs have been
David Turner5951ce91999-12-29 00:53:44 +0000857 updated significantly in order to display these..
David Turnerd2b1f351999-12-16 23:11:37 +0000858
859
860-----------------------------------------------------------------------------------------
861Build system :
862
863 You still need GNU Make to build the library. The build system has been
864 very seriously re-vamped in order to provide things like :
865
866 - automatic host platform detection (reverting to 'config/ansi'
867 if it is not detected, with pseudo-standard compilation flags)
868
869 - the ability to compile from the Makefiles with very different and
870 exotic compilers. Note that linking the library can be difficult for
871 some platforms.
872
873 For example, the file `config/win32/lcclib.bat' is invoked by the
874 build system to create the ".lib" file with LCC-Win32 because its
875 librarian has too many flaws to be invoked directly from the Makefile.
876
877 Here's how it works :
878
879 - the first time you type `make', the build system runs a series of
880 sub-makefiles in order to detect your host platform. It then dumps
881 what it found, and creates a file called `config.mk' in the current
882 directory. This is a sub-Makefile used to define many important Make
883 variables used to build the library.
884
885 - the second time, the build system detects the `config.mk' then use it
886 to build the library. All object files go into 'obj' by default, as
887 well as the library file, but this can easily be changed.
888
889 Note that you can run "make setup" to force another host platform detection
890 even if a `config.mk' is present in the current directory. Another solution
891 is simply to delete the file, then re-run make.
892
893 Finally, the default compiler for all platforms is gcc (for now, this will
894 hopefully changed in the future). You can however specify a different
895 compiler by specifying it after the 'setup' target as in :
896
897 gnumake setup lcc on Win32 to use the LCC compiler
898 gnumake setup visualc on Win32 to use Visual C++
899
900 See the file `config/<system>/detect.mk' for a list of supported compilers
901 for your platforms.
902
903 It should be relatively easy to write new detection rules files and
904 config.mk..
905
906 Finally, to build the demo programs, go to `demos' and launch GNU Make,
907 it will use the `config.mk' in the top directory to build the test
908 programs..
909
910-----------------------------------------------------------------------------------------
911Portability :
912
913 In the previous beta, a single FT_System object was used to encompass
914 all low-level operations like thread synchronisation, memory management
915 and i/o access. This has been greatly simplified :
916
917 - thread synchronisation has been dropped, for the simple reason that
918 the library is already re-entrant, and that if you really need two
919 threads accessing the same FT_Library, you should really synchronize
920 access to it yourself with a simple mutex.
921
922 - memory management is performed through a very simple object called
923 "FT_Memory", which really is a table containing a table of pointers
924 to functions like malloc, realloc and free as well as some user data
925 (closure).
926
927 - resources have disappeared (they created more problems than they
928 solved), and i/o management have been simplified greatly as a
929 result. Streams are defined through FT_Stream objects, which can
930 be either memory-based or disk-based.
931
932 Note that each face has its own stream, which is closed only when
933 the face object is destroyed. Hence, a function like TT_Flush_Face
934 in 1.x cannot be directly supported. However, if you really need
935 something like this, you can easily tailor your own streams to achieve
936 the same feature at a lower level (and use FT_Open_Face instead of
937 FT_New_Face to create the face).
938
939 See the file "include/ftsystem.h" for more details, as well as the
940 implementations found in "config/unix" and "config/ansi".
941
942
943-----------------------------------------------------------------------------------------
David Turner5951ce91999-12-29 00:53:44 +0000944Font Drivers :
David Turnere49ab252000-05-16 23:44:38 +0000945
David Turner5951ce91999-12-29 00:53:44 +0000946
947 The Font Driver interface has been modified in order to support
948 extensions & versioning.
949
950
951 The list of the font drivers that are statically linked to the
952 library at compile time is managed through a new configuration file
953 called `config/<platform>/ftmodule.h'.
954
955 This file is autogenerated when invoking `make modules'. This target
956 will parse all sub-directories of 'src', looking for a "module.mk"
957 rules file, used to describe the driver to the build system.
958
959 Hence, one should call `make modules' each time a font driver is added
960 or removed from the `src' directory.
961
962
963 Finally, this version provides a "pseudo-driver" in `src/sfnt'. This
964 driver doesn't support font files directly, but provides services used
965 by all TrueType-like font drivers. Hence, its code is shared between
966 the TrueType & OpenType font formats, and possibly more formats to
967 come if we're lucky..
David Turnerd2b1f351999-12-16 23:11:37 +0000968
969-----------------------------------------------------------------------------------------
970Extensions support :
David Turner5951ce91999-12-29 00:53:44 +0000971
972 The extensions support is inspired by the one found in 1.x.
973
974 Now, each font driver has its own "extension registry", which lists
975 which extensions are available for the font faces managed by the driver.
976
977 Extension ids are now strings, rather than 4-byte tags, as this is
978 usually more readable..
979
980 Each extension has:
981 - some data, associated to each face object
982 - an interface (table of function pointers)
983
984 An extension that is format-specific should simply register itself
985 to the correct font driver. Here is some example code:
986
987 // Registering an extensions
988 //
989 FT_Error FT_Init_XXXX_Extension( FT_Library library )
990 {
991 FT_DriverInterface* tt_driver;
992
993 driver = FT_Get_Driver( library, "truetype" );
994 if (!driver) return FT_Err_Unimplemented_Feature;
995
David Turnere49ab252000-05-16 23:44:38 +0000996 return FT_Register_Extension( driver, &extension_class );
David Turner5951ce91999-12-29 00:53:44 +0000997 }
998
David Turnere49ab252000-05-16 23:44:38 +0000999
David Turner5951ce91999-12-29 00:53:44 +00001000 // Implementing the extensions
1001 //
1002 FT_Error FT_Proceed_Extension_XXX( FT_Face face )
1003 {
1004 FT_XXX_Extension ext;
1005 FT_XXX_Extension_Interface ext_interface;
1006
1007 ext = FT_Get_Extension( face, "extensionid", &ext_interface );
1008 if (!ext) return error;
1009
1010 return ext_interface->do_it(ext);
1011 }
David Turnerd2b1f351999-12-16 23:11:37 +00001012