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