blob: 249665e7a83b029d4579a0edd99a961c3e7c6278 [file] [log] [blame]
David Turner3475e7f2000-05-17 20:56:01 +00001LATEST_CHANGES
2
David Turner51179f02000-05-18 16:18:05 +00003 - some fixes for 64-bit systems (mainly changing some FT_TRACE calls
4 to use %p instead of %lx).. Thanks to Karl Robillard
5
David Turner109fcf62000-05-17 23:35:37 +00006 - fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added
7 a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be cropped when
8 loaded from a file (maybe I should move the bitmap cropper to the
9 base layer ??).
10
David Turner3475e7f2000-05-17 20:56:01 +000011 - changed the default number of gray levels of the smooth renderer to
12 256 (instead of the previous 128). Of course, the human eye can't
13 see any difference ;-)
14
15 - removed TT_MAX_SUBGLYPHS, there is no static limit on the number of
16 subglyphs in a TrueType font now..
17
18=============================================================================
19OLD CHANGES 16 May 2000
David Turnerefce08d2000-05-11 18:23:52 +000020
David Turner968f0c32000-05-16 23:26:01 +000021 - tagged "BETA-6" in the CVS tree. This one is a serious release candidate
22 even though it doesn't incorporate the auto-hinter yet..
23
24 - various obsolete files were removed, and copyright header updated
25
26 - finally updated the standard raster to fix the monochrome rendering bug
27 + re-enable support for 5-gray levels anti-aliasing (suck, suck..)
28
29 - created new header files, and modified sources accordingly:
David Turnere49ab252000-05-16 23:44:38 +000030
David Turner968f0c32000-05-16 23:26:01 +000031 <freetype/fttypes.h> - simple FreeType types, without the API
32 <freetype/internal/ftmemory.h> - definition of memory-management macros
33
34 - added the "DSIG" (OpenType Digital Signature) tag to <freetype/tttags.h>
35
David Turnerc30aea92000-05-12 15:01:18 +000036 - light update/cleaning of the build system + changes to the sources in
37 order to get rid of _all_ compiler warnings with three compilers, i.e:
38
39 gcc with "-ansi -pedantic -Wall -W", Visual C++ with "/W3 /WX"
40 and LCC
41
42 IMPORTANT NOTE FOR WIN32-LCC USERS:
43 |
44 | It seems the C pre-processor that comes with LCC is broken, it
45 | doesn't recognize the ANSI standard directives # and ## correctly
46 | when one of the argument is a macro. Also, something like:
David Turnere49ab252000-05-16 23:44:38 +000047 |
David Turnerc30aea92000-05-12 15:01:18 +000048 | #define F(x) print##x
David Turnere49ab252000-05-16 23:44:38 +000049 |
David Turnerc30aea92000-05-12 15:01:18 +000050 | F(("hello"))
David Turnere49ab252000-05-16 23:44:38 +000051 |
David Turnerc30aea92000-05-12 15:01:18 +000052 | will get incorrectly translated to:
David Turnere49ab252000-05-16 23:44:38 +000053 |
David Turnerc30aea92000-05-12 15:01:18 +000054 | print "hello")
David Turnere49ab252000-05-16 23:44:38 +000055 |
David Turnerc30aea92000-05-12 15:01:18 +000056 | by its pre-processor. For this reason, you simply cannot build
57 | FreeType 2 in debug mode with this compiler..
58
59
David Turnerbfe2f982000-05-12 12:17:15 +000060 - yet another massive grunt work. I've changed the definition of the
61 EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now take
62 an argument, which is the function's return value type.
David Turnere49ab252000-05-16 23:44:38 +000063
David Turnerbfe2f982000-05-12 12:17:15 +000064 This is necessary to compile FreeType as a DLL on Windows and OS/2.
65 Depending on the compiler used, a compiler-specific keyword like __export
66 or __system must be placed before (VisualC++) or after (BorlandC++)
67 the type..
David Turnere49ab252000-05-16 23:44:38 +000068
David Turnerbfe2f982000-05-12 12:17:15 +000069 Of course, this needed a lot of changes throughout the source code
70 to make it compile again... All cleaned up now, apparently..
71
72 Note also that there is a new EXPORT_VAR macro defined to allow the
73 _declaration_ of an exportable public (constant) variable. This is the
74 case of the raster interfaces (see ftraster.h and ftgrays.h), as well
75 as each module's interface (see sfdriver.h, psdriver.h, etc..)
76
77 - new feature: it is now possible to pass extra parameters to font
78 drivers when creating a new face object. For now, this
79 capability is unused. It could however prove to be useful
80 in a near future..
81
82 the FT_Open_Args structure was changes, as well as the internal
83 driver interface (the specific "init_face" module function has now
84 a different signature).
85
86 - updated the tutorial (not finished though).
David Turnerc30aea92000-05-12 15:01:18 +000087 - updated the top-level BUILD document
David Turnerbfe2f982000-05-12 12:17:15 +000088
David Turnerc60c61c2000-05-12 15:26:58 +000089 - fixed a potential memory leak that could occur when loading embedded
90 bitmaps.
91
David Turnerbfe2f982000-05-12 12:17:15 +000092 - added the declaration of FT_New_Memory_Face in <freetype/freetype.h>, as
93 it was missing from the public header (the implementation was already
94 in "ftobjs.c").
95
96 - the file <freetype/fterrors.h> has been seriously updated in order to
97 allow the automatic generation of error message tables. See the comments
98 within it for more information.
99
David Turnera9c251c2000-05-11 18:36:19 +0000100 - major directory hierarchy re-organisation. This was done for two things:
David Turnere49ab252000-05-16 23:44:38 +0000101
David Turnera9c251c2000-05-11 18:36:19 +0000102 * first, to ease the "manual" compilation of the library by requiring
103 at lot less include paths :-)
David Turnerbfe2f982000-05-12 12:17:15 +0000104
David Turnera9c251c2000-05-11 18:36:19 +0000105 * second, to allow external programs to effectively access internal
106 data fields. For example, this can be extremely useful if someone
107 wants to write a font producer or a font manager on top of FreeType.
108
109 Basically, you should now use the 'freetype/' prefix for header inclusion,
110 as in:
David Turnere49ab252000-05-16 23:44:38 +0000111
David Turnera9c251c2000-05-11 18:36:19 +0000112 #include <freetype/freetype.h>
113 #include <freetype/ftglyph.h>
114
115 Some new include sub-directories are available:
David Turnere49ab252000-05-16 23:44:38 +0000116
David Turnera9c251c2000-05-11 18:36:19 +0000117 a. the "freetype/config" directory, contains two files used to
118 configure the build of the library. Client applications should
119 not need to look at these normally, but they can if they want.
David Turnere49ab252000-05-16 23:44:38 +0000120
David Turnera9c251c2000-05-11 18:36:19 +0000121 #include <freetype/config/ftoption.h>
122 #include <freetype/config/ftconfig.h>
David Turnere49ab252000-05-16 23:44:38 +0000123
David Turnera9c251c2000-05-11 18:36:19 +0000124 b. the "freetype/internal" directory, contains header files that
125 describes library internals. These are the header files that were
126 previously found in the "src/base" and "src/shared" directories.
127
128
129 As usual, the build system and the demos have been updated to reflect
130 the change..
David Turnere49ab252000-05-16 23:44:38 +0000131
David Turnera9c251c2000-05-11 18:36:19 +0000132 Here's a layout of the new directory hierarchy:
David Turnere49ab252000-05-16 23:44:38 +0000133
David Turnera9c251c2000-05-11 18:36:19 +0000134 TOP
135 include/
136 freetype/
137 freetype.h
138 ...
139 config/
140 ftoption.h
141 ftconfig.h
142 ftmodule.h
David Turnere49ab252000-05-16 23:44:38 +0000143
David Turnera9c251c2000-05-11 18:36:19 +0000144 internal/
145 ftobjs.h
146 ftstream.h
147 ftcalc.h
148 ...
David Turnere49ab252000-05-16 23:44:38 +0000149
David Turnera9c251c2000-05-11 18:36:19 +0000150 src/
151 base/
152 ...
David Turnere49ab252000-05-16 23:44:38 +0000153
David Turnera9c251c2000-05-11 18:36:19 +0000154 sfnt/
155 psnames/
156 truetype/
157 type1/
158 type1z/
159
160
161 Compiling a module is now much easier, for example, the following should
David Turner968f0c32000-05-16 23:26:01 +0000162 work when in the TOP directory on an ANSI build:
David Turnere49ab252000-05-16 23:44:38 +0000163
David Turnera9c251c2000-05-11 18:36:19 +0000164 gcc -c -I./include -I./src/base src/base/ftbase.c
165 gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c
166 etc..
167
168 (of course, using -Iconfig/<system> if you provide system-specific
169 configuration files).
David Turnerefce08d2000-05-11 18:23:52 +0000170
171
172 - updated the structure of FT_Outline_Funcs in order to allow
173 direct coordinate scaling within the outline decomposition routine
174 (this is important for virtual "on" points with TrueType outlines)
175 + updates to the rasters to support this..
176
177 - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order
178 to support version 2 of the table (see OpenType 1.2 spec)
179
180 - created "include/tttables.h" and "include/t1tables.h" to allow
181 client applications to access some of the SFNT and T1 tables of a
182 face with a procedural interface (see FT_Get_Sfnt_Table())
183 + updates to internal source files to reflect the change..
184
185 - some cleanups in the source code to get rid of warnings when compiling
186 with the "-Wall -W -ansi -pedantic" options in gcc.
187
188 - debugged and moved the smooth renderer to "src/base/ftgrays.c" and
189 its header to "include/ftgrays.h"
190
191 - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with
192 up to 80 sub-glyphs !! Thanks to Werner
193
194================================================================================
195OLD CHANGES - 14-apr-2000
David Turner77054f22000-04-14 20:49:52 +0000196
197 - fixed a bug in the TrueType glyph loader that prevented the correct
198 loading of some CJK glyphs in mingli.ttf
David Turnere49ab252000-05-16 23:44:38 +0000199
David Turner77054f22000-04-14 20:49:52 +0000200 - improved the standard Type 1 hinter in "src/type1"
David Turnere49ab252000-05-16 23:44:38 +0000201
David Turner77054f22000-04-14 20:49:52 +0000202 - fixed two bugs in the experimental Type 1 driver in "src/type1z"
203 to handle the new XFree86 4.0 fonts (and a few other ones..)
204
205 - the smooth renderer is now complete and supports sub-banding
206 to render large glyphs at high speed. However, it is still located
207 in "demos/src/ftgrays.c" and should move to the library itself
208 in the next beta.. NOTE: The smooth renderer doesn't compile in
209 stand-alone mode anymore, but this should be fixed RSN..
David Turnere49ab252000-05-16 23:44:38 +0000210
David Turner77054f22000-04-14 20:49:52 +0000211 - introduced convenience functions to more easily deal with glyph
212 images, see "include/ftglyph.h" for more details, as well as the
213 new demo program named "demos/src/ftstring.c" that demonstrates
214 its use
215
216 - implemented FT_LOAD_NO_RECURSE in both the TrueType and Type 1
217 drivers (this is required by the auto-hinter to improve its results).
218
219 - changed the raster interface, in order to allow client applications
220 to provide their own span-drawing callbacks. However, only the
221 smooth renderer supports this. See "FT_Raster_Params" in the
222 file "include/ftimage.h"
223
224 - fixed a small bug in FT_MulFix that caused incorrect transform
225 computation !!
226
227 - Note: The tutorial is out-of-date, grumpf.. :-(
228
229================================================================================
230OLD CHANGES - 12-mar-2000
David Turnerc3c7e7f2000-03-13 14:19:31 +0000231
232 - changed the layout of configuration files : now, all ANSI configuration
233 files are located in "freetype2/config". System-specific over-rides
234 can be placed in "freetype2/config/<system>".
David Turnere49ab252000-05-16 23:44:38 +0000235
David Turnerc3c7e7f2000-03-13 14:19:31 +0000236 - moved all configuration macros to "config/ftoption.h"
David Turnere49ab252000-05-16 23:44:38 +0000237
David Turnerc3c7e7f2000-03-13 14:19:31 +0000238 - improvements in the Type 1 driver with AFM support
David Turnere49ab252000-05-16 23:44:38 +0000239
David Turnerc3c7e7f2000-03-13 14:19:31 +0000240 - changed the fields in the FT_Outline structure : the old "flags"
241 array is re-named "tags", while all ancient flags are encoded into
242 a single unsigned int named "flags".
243
244 - introduced new flags in FT_Outline.flags (see ft_outline_.... enums in
245 "ftimage.h").
246
247 - changed outline functions to "FT_Outline_<action>" syntax
248
249 - added a smooth anti-alias renderer to the demonstration programs
250 - added Mac graphics driver (thanks Just)
David Turnere49ab252000-05-16 23:44:38 +0000251
David Turnerc3c7e7f2000-03-13 14:19:31 +0000252 - FT_Open_Face changed in order to received a pointer to a FT_Open_Args
253 descriptor..
David Turnere49ab252000-05-16 23:44:38 +0000254
David Turnerc3c7e7f2000-03-13 14:19:31 +0000255 - various cleanups, a few more API functions implemented (see FT_Attach_File)
256
257 - updated some docs
258
259================================================================================
260OLD CHANGES - 22-feb-2000
David Turner58c10b52000-02-22 14:31:42 +0000261
262 - introduced the "psnames" module. It is used to:
263
264 o convert a Postscript glyph name into the equivalent Unicode
265 character code (used by the Type 1 driver(s) to synthetize
266 on the fly a Unicode charmap).
267
268 o provide an interface to retrieve the Postscript names of
269 the Macintosh, Adobe Standard & Adobe Expert character codes.
270 (the Macintosh names are used by the SFNT-module postscript
271 names support routines, while the other two tables are used
272 by the Type 1 driver(s)).
273
274 - introduced the "type1z" alternate Type 1 driver. This is a (still
275 experimental) driver for the Type 1 format that will ultimately
276 replace the one in "src/type1". It uses pattern matching to load
277 data from the font, instead of a finite state analyzer. It works
278 much better than the "old" driver with "broken" fonts. It is also
279 much smaller (under 15 Kb).
280
281 - the Type 1 drivers (both in "src/type1" and "src/type1z") are
282 nearly complete. They both provide automatic Unicode charmap
283 synthesis through the "psnames" module. No re-encoding vector
284 is needed. (note that they still leak memory due to some code
285 missing, and I'm getting lazy).
286
287 Trivial AFM support has been added to read kerning information
288 but wasn't exactly tested as it should ;-)
289
290 - The TrueType glyph loader has been seriously rewritten (see the
291 file "src/truetype/ttgload.c". It is now much, much simpler as
292 well as easier to read, maintain and understand :-) Preliminary
293 versions introduced a memory leak that has been reported by Jack
294 Davis, and is now fixed..
295
296 - introduced the new "ft_glyph_format_plotter", used to represent
297 stroked outlines like Windows "Vector" fonts, and certain Type 1
298 fonts like "Hershey". The corresponding raster will be written
299 soon.
300
301 - FT_New_Memory_Face is gone. Likewise, FT_Open_Face has a new
302 interface that uses a structure to describe the input stream,
303 the driver (if required), etc..
304
305TODO
306 - Write FT_Get_Glyph_Bitmap and FT_Load_Glyph_Bitmap
307
308 - Add a function like FT_Load_Character( face, char_code, load_flags )
309 that would really embbed a call to FT_Get_Char_Index then FT_Load_Glyph
310 to ease developer's work.
311
312 - Update the tutorial !!
313 - consider adding support for Multiple Master fonts in the Type 1
314 drivers.
315
316 - Test the AFM routines of the Type 1 drivers to check that kerning
317 information is returned correctly.
318
319 - write a decent auto-gridding component !! We need this to release
320 FreeType 2.0 gold !
321
322
323----- less urgent needs : ----------
324 - add a CFF/Type2 driver
325 - add a BDF driver
326 - add a FNT/PCF/HBF driver
327 - add a Speedo driver from the X11 sources
328
329
330==============================================================================
331OLDER CHANGES - 27-jan-2000
David Turner633da992000-01-27 14:07:33 +0000332
333 - updated the "sfnt" module interface to allow several SFNT-based
334 drivers to co-exist peacefully
David Turnere49ab252000-05-16 23:44:38 +0000335
David Turner633da992000-01-27 14:07:33 +0000336 - updated the "T1_Face" type to better separate Postscript font content
337 from the rest of the FT_Face structure. Might be used later by the
338 CFF/Type2 driver..
David Turnere49ab252000-05-16 23:44:38 +0000339
David Turner633da992000-01-27 14:07:33 +0000340 - added an experimental replacement Type 1 driver featuring advanced
341 (and speedy) pattern matching to retrieve the data from postscript
342 fonts.
343
344 - very minor changes in the implementation of FT_Set_Char_Size and
345 FT_Set_Pixel_Sizes (they now implement default to ligthen the
346 font driver's code).
347
348
349=============================================================================
350OLD MESSAGE
351
David Turnerd2b1f351999-12-16 23:11:37 +0000352This file summarizes the changes that occured since the last "beta" of FreeType 2.
353Because the list is important, it has been divided into separate sections:
354
David Turner5951ce91999-12-29 00:53:44 +0000355Table Of Contents:
356
357 I High-Level Interface (easier !)
358 II Directory Structure
359 III Glyph Image Formats
360 IV Build System
361 V Portability
362 VI Font Drivers
David Turnerd2b1f351999-12-16 23:11:37 +0000363
364-----------------------------------------------------------------------------------------
365High-Level Interface :
366
367 The high-level API has been considerably simplified. Here is how :
368
David Turner5951ce91999-12-29 00:53:44 +0000369 - resource objects have disappeared. this means that face objects can
370 now be created with a single function call (see FT_New_Face and
David Turnerd2b1f351999-12-16 23:11:37 +0000371 FT_Open_Face)
David Turnere49ab252000-05-16 23:44:38 +0000372
David Turnerd2b1f351999-12-16 23:11:37 +0000373 - when calling either FT_New_Face & FT_Open_Face, a size object and a
374 glyph slot object are automatically created for the face, and can be
375 accessed through "face->glyph" and "face->size" if one really needs to.
376 In most cases, there's no need to call FT_New_Size or FT_New_Glyph.
David Turnere49ab252000-05-16 23:44:38 +0000377
David Turnerd2b1f351999-12-16 23:11:37 +0000378 - similarly, FT_Load_Glyph now only takes a "face" argument (instead of
379 a glyph slot and a size). Also, it's "result" parameter is gone, as
380 the glyph image type is returned in the field "face->glyph.format"
David Turnere49ab252000-05-16 23:44:38 +0000381
David Turnerd2b1f351999-12-16 23:11:37 +0000382 - the list of available charmaps is directly accessible through
383 "face->charmaps", counting "face->num_charmaps" elements. Each
384 charmap has an 'encoding' field which specifies which known encoding
385 it deals with. Valid values are, for example :
David Turnere49ab252000-05-16 23:44:38 +0000386
David Turnerd2b1f351999-12-16 23:11:37 +0000387 ft_encoding_unicode (for ASCII, Latin-1 and Unicode)
388 ft_encoding_apple_roman
389 ft_encoding_sjis
390 ft_encoding_adobe_standard
David Turner5951ce91999-12-29 00:53:44 +0000391 ft_encoding_adobe_expert
David Turnere49ab252000-05-16 23:44:38 +0000392
David Turnerd2b1f351999-12-16 23:11:37 +0000393 other values may be added in the future. Each charmap still holds its
394 "platform_id" and "encoding_id" values in case the encoding is too
395 exotic for the current library
396
397
398-----------------------------------------------------------------------------------------
399Directory Structure:
400
401 Should seem obvious to most of you:
402
403 freetype/
404 config/ -- configuration sub-makefiles
405 ansi/
David Turner5951ce91999-12-29 00:53:44 +0000406 unix/ -- platform-specific configuration files
David Turnerd2b1f351999-12-16 23:11:37 +0000407 win32/
408 os2/
409 msdos/
410
411 include/ -- public header files, those to be included directly
412 by client apps
413
414 src/ -- sources of the library
415 base/ -- the base layer
416 sfnt/ -- the sfnt "driver" (see the drivers section below)
417 truetype/ -- the truetype driver
418 type1/ -- the type1 driver
419 shared/ -- some header files shared between drivers
420
421 demos/ -- demos/tools
422
423 docs/ -- documentation (a bit empty for now)
424
425-----------------------------------------------------------------------------------------
426Glyph Image Formats :
427
428 Drivers are now able to register new glyph image formats within the library.
429 For now, the base layer supports of course bitmaps and vector outlines, but
430 one could imagine something different like colored bitmaps, bi-color
431 vectors or wathever else (Metafonts anyone ??).
432
433 See the file `include/ftimage.h'. Note also that the type FT_Raster_Map is
434 gone, and is now replaced by FT_Bitmap, which should encompass all known
435 bitmap types.
436
437 Each new image format must provide at least one "raster", i.e. a module
David Turner5951ce91999-12-29 00:53:44 +0000438 capable of transforming the glyph image into a bitmap. It's also possible
David Turnerd2b1f351999-12-16 23:11:37 +0000439 to change the default raster used for a given glyph image format.
440
441 The default outline scan-converter now uses 128 levels of grays by default,
442 which tends to smooth many things. Note that the demo programs have been
David Turner5951ce91999-12-29 00:53:44 +0000443 updated significantly in order to display these..
David Turnerd2b1f351999-12-16 23:11:37 +0000444
445
446-----------------------------------------------------------------------------------------
447Build system :
448
449 You still need GNU Make to build the library. The build system has been
450 very seriously re-vamped in order to provide things like :
451
452 - automatic host platform detection (reverting to 'config/ansi'
453 if it is not detected, with pseudo-standard compilation flags)
454
455 - the ability to compile from the Makefiles with very different and
456 exotic compilers. Note that linking the library can be difficult for
457 some platforms.
458
459 For example, the file `config/win32/lcclib.bat' is invoked by the
460 build system to create the ".lib" file with LCC-Win32 because its
461 librarian has too many flaws to be invoked directly from the Makefile.
462
463 Here's how it works :
464
465 - the first time you type `make', the build system runs a series of
466 sub-makefiles in order to detect your host platform. It then dumps
467 what it found, and creates a file called `config.mk' in the current
468 directory. This is a sub-Makefile used to define many important Make
469 variables used to build the library.
470
471 - the second time, the build system detects the `config.mk' then use it
472 to build the library. All object files go into 'obj' by default, as
473 well as the library file, but this can easily be changed.
474
475 Note that you can run "make setup" to force another host platform detection
476 even if a `config.mk' is present in the current directory. Another solution
477 is simply to delete the file, then re-run make.
478
479 Finally, the default compiler for all platforms is gcc (for now, this will
480 hopefully changed in the future). You can however specify a different
481 compiler by specifying it after the 'setup' target as in :
482
483 gnumake setup lcc on Win32 to use the LCC compiler
484 gnumake setup visualc on Win32 to use Visual C++
485
486 See the file `config/<system>/detect.mk' for a list of supported compilers
487 for your platforms.
488
489 It should be relatively easy to write new detection rules files and
490 config.mk..
491
492 Finally, to build the demo programs, go to `demos' and launch GNU Make,
493 it will use the `config.mk' in the top directory to build the test
494 programs..
495
496-----------------------------------------------------------------------------------------
497Portability :
498
499 In the previous beta, a single FT_System object was used to encompass
500 all low-level operations like thread synchronisation, memory management
501 and i/o access. This has been greatly simplified :
502
503 - thread synchronisation has been dropped, for the simple reason that
504 the library is already re-entrant, and that if you really need two
505 threads accessing the same FT_Library, you should really synchronize
506 access to it yourself with a simple mutex.
507
508 - memory management is performed through a very simple object called
509 "FT_Memory", which really is a table containing a table of pointers
510 to functions like malloc, realloc and free as well as some user data
511 (closure).
512
513 - resources have disappeared (they created more problems than they
514 solved), and i/o management have been simplified greatly as a
515 result. Streams are defined through FT_Stream objects, which can
516 be either memory-based or disk-based.
517
518 Note that each face has its own stream, which is closed only when
519 the face object is destroyed. Hence, a function like TT_Flush_Face
520 in 1.x cannot be directly supported. However, if you really need
521 something like this, you can easily tailor your own streams to achieve
522 the same feature at a lower level (and use FT_Open_Face instead of
523 FT_New_Face to create the face).
524
525 See the file "include/ftsystem.h" for more details, as well as the
526 implementations found in "config/unix" and "config/ansi".
527
528
529-----------------------------------------------------------------------------------------
David Turner5951ce91999-12-29 00:53:44 +0000530Font Drivers :
David Turnere49ab252000-05-16 23:44:38 +0000531
David Turner5951ce91999-12-29 00:53:44 +0000532
533 The Font Driver interface has been modified in order to support
534 extensions & versioning.
535
536
537 The list of the font drivers that are statically linked to the
538 library at compile time is managed through a new configuration file
539 called `config/<platform>/ftmodule.h'.
540
541 This file is autogenerated when invoking `make modules'. This target
542 will parse all sub-directories of 'src', looking for a "module.mk"
543 rules file, used to describe the driver to the build system.
544
545 Hence, one should call `make modules' each time a font driver is added
546 or removed from the `src' directory.
547
548
549 Finally, this version provides a "pseudo-driver" in `src/sfnt'. This
550 driver doesn't support font files directly, but provides services used
551 by all TrueType-like font drivers. Hence, its code is shared between
552 the TrueType & OpenType font formats, and possibly more formats to
553 come if we're lucky..
David Turnerd2b1f351999-12-16 23:11:37 +0000554
555-----------------------------------------------------------------------------------------
556Extensions support :
David Turner5951ce91999-12-29 00:53:44 +0000557
558 The extensions support is inspired by the one found in 1.x.
559
560 Now, each font driver has its own "extension registry", which lists
561 which extensions are available for the font faces managed by the driver.
562
563 Extension ids are now strings, rather than 4-byte tags, as this is
564 usually more readable..
565
566 Each extension has:
567 - some data, associated to each face object
568 - an interface (table of function pointers)
569
570 An extension that is format-specific should simply register itself
571 to the correct font driver. Here is some example code:
572
573 // Registering an extensions
574 //
575 FT_Error FT_Init_XXXX_Extension( FT_Library library )
576 {
577 FT_DriverInterface* tt_driver;
578
579 driver = FT_Get_Driver( library, "truetype" );
580 if (!driver) return FT_Err_Unimplemented_Feature;
581
David Turnere49ab252000-05-16 23:44:38 +0000582 return FT_Register_Extension( driver, &extension_class );
David Turner5951ce91999-12-29 00:53:44 +0000583 }
584
David Turnere49ab252000-05-16 23:44:38 +0000585
David Turner5951ce91999-12-29 00:53:44 +0000586 // Implementing the extensions
587 //
588 FT_Error FT_Proceed_Extension_XXX( FT_Face face )
589 {
590 FT_XXX_Extension ext;
591 FT_XXX_Extension_Interface ext_interface;
592
593 ext = FT_Get_Extension( face, "extensionid", &ext_interface );
594 if (!ext) return error;
595
596 return ext_interface->do_it(ext);
597 }
David Turnerd2b1f351999-12-16 23:11:37 +0000598