blob: d19b854cba4922d4a1ebcd8027bcfe907a73d967 [file] [log] [blame]
David Turnerf9b8dec2000-06-16 19:34:52 +00001LATEST CHANGES
2
David Turnerf0df85b2000-06-22 00:17:42 +00003 - MAJOR INTERNAL REDESIGN:
4
5 A lot of internal modifications have been performed lately on the
6 source in order to provide the following enhancements:
7
8 - more generic module support:
9
10 The FT_Module type is now defined to represent a handle to a given
11 module. The file <freetype/ftmodule.h> contains the FT_Module_Class
12 definition, as well as the module-loading public API
13
14 The FT_Driver type is still defined, and still represents a pointer
15 to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
16 FT_Get_Driver by FT_Get_Module, etc..
17
18
19 - support for generic glyph image types:
20
21 The FT_Renderer type is a pointer to a module used to perform various
22 operations on glyph image.
23
24 Each renderer is capable of handling images in a single format
25 (e.g. ft_glyph_format_outline). Its functions are used to:
26
27 - transform an glyph image
28 - render a glyph image into a bitmap
29 - return the control box (dimensions) of a given glyph image
30
31
32 The scan converters "ftraster.c" and "ftgrays.c" have been moved
33 to the new directory "src/renderer", and are used to provide two
34 default renderer modules.
35
36 One corresponds to the "standard" scan-converter, the other to the
37 "smooth" one.
38
39 The current renderer can be set through the new function
40 FT_Set_Renderer.
41
42 The old raster-related function FT_Set_Raster, FT_Get_Raster and
43 FT_Set_Raster_Mode have now disappeared, in favor of the new:
44
45 FT_Get_Renderer
46 FT_Set_Renderer
47
48 see the file <freetype/ftrender.h> for more details..
49
50 These changes were necessary to properly support different scalable
51 formats in the future, like bi-color glyphs, etc..
52
53
54 - glyph loader object:
55
56 A new internal object, called a 'glyph loader' has been introduced
57 in the base layer. It is used by all scalable format font drivers
58 to load glyphs and composites.
59
60 This object has been created to reduce the code size of each driver,
61 as each one of them basically re-implemented its functionality.
62
63 See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
64 more information..
65
66
67
68 - FT_GlyphSlot had new fields:
69
70 In order to support extended features (see below), the FT_GlyphSlot
71 structure has a few new fields:
72
73 linearHoriAdvance: this field gives the linearly scaled (i.e.
74 scaled but unhinted) advance width for the glyph,
75 expressed as a 16.16 fixed pixel value. This
76 is useful to perform WYSIWYG text.
77
78 linearVertAdvance: this field gives the linearly scaled advance
79 height for the glyph (relevant in vertical glyph
80 layouts only). This is useful to perform
81 WYSIWYG text.
82
83 Note that the two above field replace the removed "metrics2" field
84 in the glyph slot.
85
86 advance: this field is a vector that gives the transformed
87 advance for the glyph. By default, it corresponds
88 to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
89 was specified when calling FT_Load_Glyph or FT_Load_Char
90
91 bitmap_left: this field gives the distance in integer pixels from
92 the current pen position to the left-most pixel of
93 a glyph image WHEN IT IS A BITMAP. It is only valid
94 when the "format" field is set to
95 "ft_glyph_format_bitmap", for example, after calling
96 the new function FT_Render_Glyph.
97
98 bitmap_top: this field gives the distance in integer pixels from
99 the current pen position (located on the baseline) to
100 the top-most pixel of the glyph image WHEN IT IS A
101 BITMAP. Positive values correspond to upwards Y.
102
103 loader: this is a new private field for the glyph slot. Client
104 applications should not touch it..
105
106
107 - support for transforms and direct rendering in FT_Load_Glyph:
108
109 Most of the functionality found in <freetype/ftglyph.h> has been
110 moved to the core library. Hence, the following:
111
112 - a transform can be specified for a face through FT_Set_Transform.
113 this transform is applied by FT_Load_Glyph to scalable glyph images
114 (i.e. NOT TO BITMAPS) before the function returns, unless the
115 bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
116
117
118 - once a glyph image has been loaded, it can be directly converted to
119 a bitmap by using the new FT_Render_Glyph function. Note that this
120 function takes the glyph image from the glyph slot, and converts
121 it to a bitmap whose properties are returned in "face.glyph.bitmap",
122 "face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
123 native image might be lost after the conversion.
124
125
126 - when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
127 and FT_Load_Char functions will call FT_Render_Glyph automatically
128 when needed.
129
130
131
132
David Turnerf9b8dec2000-06-16 19:34:52 +0000133 - reformated all modules source code in order to get rid of the basic
134 data types redifinitions (i.e. "TT_Int" instead of "FT_Int", "T1_Fixed"
135 instead of "FT_Fixed"). Hence the format-specific prefixes like "TT_",
136 "T1_", "T2_" and "CID_" are only used for relevant structures..
137
138============================================================================
139OLD CHANGES FOR BETA 7
David Turner3475e7f2000-05-17 20:56:01 +0000140
David Turner2b9be992000-06-07 23:41:17 +0000141 - bug-fixed the OpenType/CFF parser. It now loads and displays my two
142 fonts nicely, but I'm pretty certain that more testing is needed :-)
143
144 - fixed the crummy Type 1 hinter, it now handles accented characters
145 correctly (well, the accent is not always well placed, but that's
146 another problem..)
147
David Turner04aa8002000-06-01 03:27:48 +0000148 - added the CID-keyed Type 1 driver in "src/cid". Works pretty well for
149 only 13 Kb of code ;-) Doesn't read AFM files though, nor the really
150 useful CMAP files..
151
152 - fixed two bugs in the smooth renderer (src/base/ftgrays.c). Thanks to
153 Boris Letocha for spotting them and providing a fix..
154
David Turner4f99c3c2000-05-29 20:55:13 +0000155 - fixed potential "divide by zero" bugs in ftcalc.c.. my god..
156
157 - added source code for the OpenType/CFF driver (still incomplete though..)
158
159 - modified the SFNT driver slightly to perform more robust header
160 checks in TT_Load_SFNT_Header. This prevents certain font files
161 (e.g. some Type 1 Multiple Masters) from being incorrectly "recognized"
162 as TrueType font files..
163
David Turner2e421312000-05-26 22:13:17 +0000164 - moved a lot of stuff from the TrueType driver to the SFNT module,
165 this allows greater code re-use between font drivers (e.g. TrueType,
166 OpenType, Compact-TrueType, etc..)
167
168 - added a tiny segment cache to the SFNT Charmap 4 decoder, in order
169 to minimally speed it up..
170
David Turner11187202000-05-26 17:13:23 +0000171 - added support for Multiple Master fonts in "type1z". There is also
172 a new file named <freetype/ftmm.h> which defines functions to
173 manage them from client applications.
174
175 The new file "src/base/ftmm.c" is also optional to the engine..
176
177 - various formatting changes (e.g. EXPORT_DEF -> FT_EXPORT_DEF) +
178 small bug fixes in FT_Load_Glyph, the "type1" driver, etc..
179
David Turnerf5dcdd52000-05-23 22:16:27 +0000180 - a minor fix to the Type 1 driver to let them apply the font matrix
181 correctly (used for many oblique fonts..)
182
David Turner51179f02000-05-18 16:18:05 +0000183 - some fixes for 64-bit systems (mainly changing some FT_TRACE calls
184 to use %p instead of %lx).. Thanks to Karl Robillard
185
David Turner109fcf62000-05-17 23:35:37 +0000186 - fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added
187 a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be cropped when
188 loaded from a file (maybe I should move the bitmap cropper to the
189 base layer ??).
190
David Turner3475e7f2000-05-17 20:56:01 +0000191 - changed the default number of gray levels of the smooth renderer to
192 256 (instead of the previous 128). Of course, the human eye can't
193 see any difference ;-)
194
195 - removed TT_MAX_SUBGLYPHS, there is no static limit on the number of
196 subglyphs in a TrueType font now..
197
198=============================================================================
199OLD CHANGES 16 May 2000
David Turnerefce08d2000-05-11 18:23:52 +0000200
David Turner968f0c32000-05-16 23:26:01 +0000201 - tagged "BETA-6" in the CVS tree. This one is a serious release candidate
202 even though it doesn't incorporate the auto-hinter yet..
203
204 - various obsolete files were removed, and copyright header updated
205
206 - finally updated the standard raster to fix the monochrome rendering bug
207 + re-enable support for 5-gray levels anti-aliasing (suck, suck..)
208
209 - created new header files, and modified sources accordingly:
David Turnere49ab252000-05-16 23:44:38 +0000210
David Turner968f0c32000-05-16 23:26:01 +0000211 <freetype/fttypes.h> - simple FreeType types, without the API
212 <freetype/internal/ftmemory.h> - definition of memory-management macros
213
214 - added the "DSIG" (OpenType Digital Signature) tag to <freetype/tttags.h>
215
David Turnerc30aea92000-05-12 15:01:18 +0000216 - light update/cleaning of the build system + changes to the sources in
217 order to get rid of _all_ compiler warnings with three compilers, i.e:
218
219 gcc with "-ansi -pedantic -Wall -W", Visual C++ with "/W3 /WX"
220 and LCC
221
222 IMPORTANT NOTE FOR WIN32-LCC USERS:
223 |
224 | It seems the C pre-processor that comes with LCC is broken, it
225 | doesn't recognize the ANSI standard directives # and ## correctly
226 | when one of the argument is a macro. Also, something like:
David Turnere49ab252000-05-16 23:44:38 +0000227 |
David Turnerc30aea92000-05-12 15:01:18 +0000228 | #define F(x) print##x
David Turnere49ab252000-05-16 23:44:38 +0000229 |
David Turnerc30aea92000-05-12 15:01:18 +0000230 | F(("hello"))
David Turnere49ab252000-05-16 23:44:38 +0000231 |
David Turnerc30aea92000-05-12 15:01:18 +0000232 | will get incorrectly translated to:
David Turnere49ab252000-05-16 23:44:38 +0000233 |
David Turnerc30aea92000-05-12 15:01:18 +0000234 | print "hello")
David Turnere49ab252000-05-16 23:44:38 +0000235 |
David Turnerc30aea92000-05-12 15:01:18 +0000236 | by its pre-processor. For this reason, you simply cannot build
237 | FreeType 2 in debug mode with this compiler..
238
239
David Turnerbfe2f982000-05-12 12:17:15 +0000240 - yet another massive grunt work. I've changed the definition of the
241 EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now take
242 an argument, which is the function's return value type.
David Turnere49ab252000-05-16 23:44:38 +0000243
David Turnerbfe2f982000-05-12 12:17:15 +0000244 This is necessary to compile FreeType as a DLL on Windows and OS/2.
245 Depending on the compiler used, a compiler-specific keyword like __export
246 or __system must be placed before (VisualC++) or after (BorlandC++)
247 the type..
David Turnere49ab252000-05-16 23:44:38 +0000248
David Turnerbfe2f982000-05-12 12:17:15 +0000249 Of course, this needed a lot of changes throughout the source code
250 to make it compile again... All cleaned up now, apparently..
251
252 Note also that there is a new EXPORT_VAR macro defined to allow the
253 _declaration_ of an exportable public (constant) variable. This is the
254 case of the raster interfaces (see ftraster.h and ftgrays.h), as well
255 as each module's interface (see sfdriver.h, psdriver.h, etc..)
256
257 - new feature: it is now possible to pass extra parameters to font
258 drivers when creating a new face object. For now, this
259 capability is unused. It could however prove to be useful
260 in a near future..
261
262 the FT_Open_Args structure was changes, as well as the internal
263 driver interface (the specific "init_face" module function has now
264 a different signature).
265
266 - updated the tutorial (not finished though).
David Turnerc30aea92000-05-12 15:01:18 +0000267 - updated the top-level BUILD document
David Turnerbfe2f982000-05-12 12:17:15 +0000268
David Turnerc60c61c2000-05-12 15:26:58 +0000269 - fixed a potential memory leak that could occur when loading embedded
270 bitmaps.
271
David Turnerbfe2f982000-05-12 12:17:15 +0000272 - added the declaration of FT_New_Memory_Face in <freetype/freetype.h>, as
273 it was missing from the public header (the implementation was already
274 in "ftobjs.c").
275
276 - the file <freetype/fterrors.h> has been seriously updated in order to
277 allow the automatic generation of error message tables. See the comments
278 within it for more information.
279
David Turnera9c251c2000-05-11 18:36:19 +0000280 - major directory hierarchy re-organisation. This was done for two things:
David Turnere49ab252000-05-16 23:44:38 +0000281
David Turnera9c251c2000-05-11 18:36:19 +0000282 * first, to ease the "manual" compilation of the library by requiring
283 at lot less include paths :-)
David Turnerbfe2f982000-05-12 12:17:15 +0000284
David Turnera9c251c2000-05-11 18:36:19 +0000285 * second, to allow external programs to effectively access internal
286 data fields. For example, this can be extremely useful if someone
287 wants to write a font producer or a font manager on top of FreeType.
288
289 Basically, you should now use the 'freetype/' prefix for header inclusion,
290 as in:
David Turnere49ab252000-05-16 23:44:38 +0000291
David Turnera9c251c2000-05-11 18:36:19 +0000292 #include <freetype/freetype.h>
293 #include <freetype/ftglyph.h>
294
295 Some new include sub-directories are available:
David Turnere49ab252000-05-16 23:44:38 +0000296
David Turnera9c251c2000-05-11 18:36:19 +0000297 a. the "freetype/config" directory, contains two files used to
298 configure the build of the library. Client applications should
299 not need to look at these normally, but they can if they want.
David Turnere49ab252000-05-16 23:44:38 +0000300
David Turnera9c251c2000-05-11 18:36:19 +0000301 #include <freetype/config/ftoption.h>
302 #include <freetype/config/ftconfig.h>
David Turnere49ab252000-05-16 23:44:38 +0000303
David Turnera9c251c2000-05-11 18:36:19 +0000304 b. the "freetype/internal" directory, contains header files that
305 describes library internals. These are the header files that were
306 previously found in the "src/base" and "src/shared" directories.
307
308
309 As usual, the build system and the demos have been updated to reflect
310 the change..
David Turnere49ab252000-05-16 23:44:38 +0000311
David Turnera9c251c2000-05-11 18:36:19 +0000312 Here's a layout of the new directory hierarchy:
David Turnere49ab252000-05-16 23:44:38 +0000313
David Turnera9c251c2000-05-11 18:36:19 +0000314 TOP
315 include/
316 freetype/
317 freetype.h
318 ...
319 config/
320 ftoption.h
321 ftconfig.h
322 ftmodule.h
David Turnere49ab252000-05-16 23:44:38 +0000323
David Turnera9c251c2000-05-11 18:36:19 +0000324 internal/
325 ftobjs.h
326 ftstream.h
327 ftcalc.h
328 ...
David Turnere49ab252000-05-16 23:44:38 +0000329
David Turnera9c251c2000-05-11 18:36:19 +0000330 src/
331 base/
332 ...
David Turnere49ab252000-05-16 23:44:38 +0000333
David Turnera9c251c2000-05-11 18:36:19 +0000334 sfnt/
335 psnames/
336 truetype/
337 type1/
338 type1z/
339
340
341 Compiling a module is now much easier, for example, the following should
David Turner968f0c32000-05-16 23:26:01 +0000342 work when in the TOP directory on an ANSI build:
David Turnere49ab252000-05-16 23:44:38 +0000343
David Turnera9c251c2000-05-11 18:36:19 +0000344 gcc -c -I./include -I./src/base src/base/ftbase.c
345 gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c
346 etc..
347
348 (of course, using -Iconfig/<system> if you provide system-specific
349 configuration files).
David Turnerefce08d2000-05-11 18:23:52 +0000350
351
352 - updated the structure of FT_Outline_Funcs in order to allow
353 direct coordinate scaling within the outline decomposition routine
354 (this is important for virtual "on" points with TrueType outlines)
355 + updates to the rasters to support this..
356
357 - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order
358 to support version 2 of the table (see OpenType 1.2 spec)
359
360 - created "include/tttables.h" and "include/t1tables.h" to allow
361 client applications to access some of the SFNT and T1 tables of a
362 face with a procedural interface (see FT_Get_Sfnt_Table())
363 + updates to internal source files to reflect the change..
364
365 - some cleanups in the source code to get rid of warnings when compiling
366 with the "-Wall -W -ansi -pedantic" options in gcc.
367
368 - debugged and moved the smooth renderer to "src/base/ftgrays.c" and
369 its header to "include/ftgrays.h"
370
371 - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with
372 up to 80 sub-glyphs !! Thanks to Werner
373
374================================================================================
375OLD CHANGES - 14-apr-2000
David Turner77054f22000-04-14 20:49:52 +0000376
377 - fixed a bug in the TrueType glyph loader that prevented the correct
378 loading of some CJK glyphs in mingli.ttf
David Turnere49ab252000-05-16 23:44:38 +0000379
David Turner77054f22000-04-14 20:49:52 +0000380 - improved the standard Type 1 hinter in "src/type1"
David Turnere49ab252000-05-16 23:44:38 +0000381
David Turner77054f22000-04-14 20:49:52 +0000382 - fixed two bugs in the experimental Type 1 driver in "src/type1z"
383 to handle the new XFree86 4.0 fonts (and a few other ones..)
384
385 - the smooth renderer is now complete and supports sub-banding
386 to render large glyphs at high speed. However, it is still located
387 in "demos/src/ftgrays.c" and should move to the library itself
388 in the next beta.. NOTE: The smooth renderer doesn't compile in
389 stand-alone mode anymore, but this should be fixed RSN..
David Turnere49ab252000-05-16 23:44:38 +0000390
David Turner77054f22000-04-14 20:49:52 +0000391 - introduced convenience functions to more easily deal with glyph
392 images, see "include/ftglyph.h" for more details, as well as the
393 new demo program named "demos/src/ftstring.c" that demonstrates
394 its use
395
396 - implemented FT_LOAD_NO_RECURSE in both the TrueType and Type 1
397 drivers (this is required by the auto-hinter to improve its results).
398
399 - changed the raster interface, in order to allow client applications
400 to provide their own span-drawing callbacks. However, only the
401 smooth renderer supports this. See "FT_Raster_Params" in the
402 file "include/ftimage.h"
403
404 - fixed a small bug in FT_MulFix that caused incorrect transform
405 computation !!
406
407 - Note: The tutorial is out-of-date, grumpf.. :-(
408
409================================================================================
410OLD CHANGES - 12-mar-2000
David Turnerc3c7e7f2000-03-13 14:19:31 +0000411
412 - changed the layout of configuration files : now, all ANSI configuration
413 files are located in "freetype2/config". System-specific over-rides
414 can be placed in "freetype2/config/<system>".
David Turnere49ab252000-05-16 23:44:38 +0000415
David Turnerc3c7e7f2000-03-13 14:19:31 +0000416 - moved all configuration macros to "config/ftoption.h"
David Turnere49ab252000-05-16 23:44:38 +0000417
David Turnerc3c7e7f2000-03-13 14:19:31 +0000418 - improvements in the Type 1 driver with AFM support
David Turnere49ab252000-05-16 23:44:38 +0000419
David Turnerc3c7e7f2000-03-13 14:19:31 +0000420 - changed the fields in the FT_Outline structure : the old "flags"
421 array is re-named "tags", while all ancient flags are encoded into
422 a single unsigned int named "flags".
423
424 - introduced new flags in FT_Outline.flags (see ft_outline_.... enums in
425 "ftimage.h").
426
427 - changed outline functions to "FT_Outline_<action>" syntax
428
429 - added a smooth anti-alias renderer to the demonstration programs
430 - added Mac graphics driver (thanks Just)
David Turnere49ab252000-05-16 23:44:38 +0000431
David Turnerc3c7e7f2000-03-13 14:19:31 +0000432 - FT_Open_Face changed in order to received a pointer to a FT_Open_Args
433 descriptor..
David Turnere49ab252000-05-16 23:44:38 +0000434
David Turnerc3c7e7f2000-03-13 14:19:31 +0000435 - various cleanups, a few more API functions implemented (see FT_Attach_File)
436
437 - updated some docs
438
439================================================================================
440OLD CHANGES - 22-feb-2000
David Turner58c10b52000-02-22 14:31:42 +0000441
442 - introduced the "psnames" module. It is used to:
443
444 o convert a Postscript glyph name into the equivalent Unicode
445 character code (used by the Type 1 driver(s) to synthetize
446 on the fly a Unicode charmap).
447
448 o provide an interface to retrieve the Postscript names of
449 the Macintosh, Adobe Standard & Adobe Expert character codes.
450 (the Macintosh names are used by the SFNT-module postscript
451 names support routines, while the other two tables are used
452 by the Type 1 driver(s)).
453
454 - introduced the "type1z" alternate Type 1 driver. This is a (still
455 experimental) driver for the Type 1 format that will ultimately
456 replace the one in "src/type1". It uses pattern matching to load
457 data from the font, instead of a finite state analyzer. It works
458 much better than the "old" driver with "broken" fonts. It is also
459 much smaller (under 15 Kb).
460
461 - the Type 1 drivers (both in "src/type1" and "src/type1z") are
462 nearly complete. They both provide automatic Unicode charmap
463 synthesis through the "psnames" module. No re-encoding vector
464 is needed. (note that they still leak memory due to some code
465 missing, and I'm getting lazy).
466
467 Trivial AFM support has been added to read kerning information
468 but wasn't exactly tested as it should ;-)
469
470 - The TrueType glyph loader has been seriously rewritten (see the
471 file "src/truetype/ttgload.c". It is now much, much simpler as
472 well as easier to read, maintain and understand :-) Preliminary
473 versions introduced a memory leak that has been reported by Jack
474 Davis, and is now fixed..
475
476 - introduced the new "ft_glyph_format_plotter", used to represent
477 stroked outlines like Windows "Vector" fonts, and certain Type 1
478 fonts like "Hershey". The corresponding raster will be written
479 soon.
480
481 - FT_New_Memory_Face is gone. Likewise, FT_Open_Face has a new
482 interface that uses a structure to describe the input stream,
483 the driver (if required), etc..
484
485TODO
486 - Write FT_Get_Glyph_Bitmap and FT_Load_Glyph_Bitmap
487
488 - Add a function like FT_Load_Character( face, char_code, load_flags )
489 that would really embbed a call to FT_Get_Char_Index then FT_Load_Glyph
490 to ease developer's work.
491
492 - Update the tutorial !!
493 - consider adding support for Multiple Master fonts in the Type 1
494 drivers.
495
496 - Test the AFM routines of the Type 1 drivers to check that kerning
497 information is returned correctly.
498
499 - write a decent auto-gridding component !! We need this to release
500 FreeType 2.0 gold !
501
502
503----- less urgent needs : ----------
504 - add a CFF/Type2 driver
505 - add a BDF driver
506 - add a FNT/PCF/HBF driver
507 - add a Speedo driver from the X11 sources
508
509
510==============================================================================
511OLDER CHANGES - 27-jan-2000
David Turner633da992000-01-27 14:07:33 +0000512
513 - updated the "sfnt" module interface to allow several SFNT-based
514 drivers to co-exist peacefully
David Turnere49ab252000-05-16 23:44:38 +0000515
David Turner633da992000-01-27 14:07:33 +0000516 - updated the "T1_Face" type to better separate Postscript font content
517 from the rest of the FT_Face structure. Might be used later by the
518 CFF/Type2 driver..
David Turnere49ab252000-05-16 23:44:38 +0000519
David Turner633da992000-01-27 14:07:33 +0000520 - added an experimental replacement Type 1 driver featuring advanced
521 (and speedy) pattern matching to retrieve the data from postscript
522 fonts.
523
524 - very minor changes in the implementation of FT_Set_Char_Size and
525 FT_Set_Pixel_Sizes (they now implement default to ligthen the
526 font driver's code).
527
528
529=============================================================================
530OLD MESSAGE
531
David Turnerd2b1f351999-12-16 23:11:37 +0000532This file summarizes the changes that occured since the last "beta" of FreeType 2.
533Because the list is important, it has been divided into separate sections:
534
David Turner5951ce91999-12-29 00:53:44 +0000535Table Of Contents:
536
537 I High-Level Interface (easier !)
538 II Directory Structure
539 III Glyph Image Formats
540 IV Build System
541 V Portability
542 VI Font Drivers
David Turnerd2b1f351999-12-16 23:11:37 +0000543
544-----------------------------------------------------------------------------------------
545High-Level Interface :
546
547 The high-level API has been considerably simplified. Here is how :
548
David Turner5951ce91999-12-29 00:53:44 +0000549 - resource objects have disappeared. this means that face objects can
550 now be created with a single function call (see FT_New_Face and
David Turnerd2b1f351999-12-16 23:11:37 +0000551 FT_Open_Face)
David Turnere49ab252000-05-16 23:44:38 +0000552
David Turnerd2b1f351999-12-16 23:11:37 +0000553 - when calling either FT_New_Face & FT_Open_Face, a size object and a
554 glyph slot object are automatically created for the face, and can be
555 accessed through "face->glyph" and "face->size" if one really needs to.
556 In most cases, there's no need to call FT_New_Size or FT_New_Glyph.
David Turnere49ab252000-05-16 23:44:38 +0000557
David Turnerd2b1f351999-12-16 23:11:37 +0000558 - similarly, FT_Load_Glyph now only takes a "face" argument (instead of
559 a glyph slot and a size). Also, it's "result" parameter is gone, as
560 the glyph image type is returned in the field "face->glyph.format"
David Turnere49ab252000-05-16 23:44:38 +0000561
David Turnerd2b1f351999-12-16 23:11:37 +0000562 - the list of available charmaps is directly accessible through
563 "face->charmaps", counting "face->num_charmaps" elements. Each
564 charmap has an 'encoding' field which specifies which known encoding
565 it deals with. Valid values are, for example :
David Turnere49ab252000-05-16 23:44:38 +0000566
David Turnerd2b1f351999-12-16 23:11:37 +0000567 ft_encoding_unicode (for ASCII, Latin-1 and Unicode)
568 ft_encoding_apple_roman
569 ft_encoding_sjis
570 ft_encoding_adobe_standard
David Turner5951ce91999-12-29 00:53:44 +0000571 ft_encoding_adobe_expert
David Turnere49ab252000-05-16 23:44:38 +0000572
David Turnerd2b1f351999-12-16 23:11:37 +0000573 other values may be added in the future. Each charmap still holds its
574 "platform_id" and "encoding_id" values in case the encoding is too
575 exotic for the current library
576
577
578-----------------------------------------------------------------------------------------
579Directory Structure:
580
581 Should seem obvious to most of you:
582
583 freetype/
584 config/ -- configuration sub-makefiles
585 ansi/
David Turner5951ce91999-12-29 00:53:44 +0000586 unix/ -- platform-specific configuration files
David Turnerd2b1f351999-12-16 23:11:37 +0000587 win32/
588 os2/
589 msdos/
590
591 include/ -- public header files, those to be included directly
592 by client apps
593
594 src/ -- sources of the library
595 base/ -- the base layer
596 sfnt/ -- the sfnt "driver" (see the drivers section below)
597 truetype/ -- the truetype driver
598 type1/ -- the type1 driver
599 shared/ -- some header files shared between drivers
600
601 demos/ -- demos/tools
602
603 docs/ -- documentation (a bit empty for now)
604
605-----------------------------------------------------------------------------------------
606Glyph Image Formats :
607
608 Drivers are now able to register new glyph image formats within the library.
609 For now, the base layer supports of course bitmaps and vector outlines, but
610 one could imagine something different like colored bitmaps, bi-color
611 vectors or wathever else (Metafonts anyone ??).
612
613 See the file `include/ftimage.h'. Note also that the type FT_Raster_Map is
614 gone, and is now replaced by FT_Bitmap, which should encompass all known
615 bitmap types.
616
617 Each new image format must provide at least one "raster", i.e. a module
David Turner5951ce91999-12-29 00:53:44 +0000618 capable of transforming the glyph image into a bitmap. It's also possible
David Turnerd2b1f351999-12-16 23:11:37 +0000619 to change the default raster used for a given glyph image format.
620
621 The default outline scan-converter now uses 128 levels of grays by default,
622 which tends to smooth many things. Note that the demo programs have been
David Turner5951ce91999-12-29 00:53:44 +0000623 updated significantly in order to display these..
David Turnerd2b1f351999-12-16 23:11:37 +0000624
625
626-----------------------------------------------------------------------------------------
627Build system :
628
629 You still need GNU Make to build the library. The build system has been
630 very seriously re-vamped in order to provide things like :
631
632 - automatic host platform detection (reverting to 'config/ansi'
633 if it is not detected, with pseudo-standard compilation flags)
634
635 - the ability to compile from the Makefiles with very different and
636 exotic compilers. Note that linking the library can be difficult for
637 some platforms.
638
639 For example, the file `config/win32/lcclib.bat' is invoked by the
640 build system to create the ".lib" file with LCC-Win32 because its
641 librarian has too many flaws to be invoked directly from the Makefile.
642
643 Here's how it works :
644
645 - the first time you type `make', the build system runs a series of
646 sub-makefiles in order to detect your host platform. It then dumps
647 what it found, and creates a file called `config.mk' in the current
648 directory. This is a sub-Makefile used to define many important Make
649 variables used to build the library.
650
651 - the second time, the build system detects the `config.mk' then use it
652 to build the library. All object files go into 'obj' by default, as
653 well as the library file, but this can easily be changed.
654
655 Note that you can run "make setup" to force another host platform detection
656 even if a `config.mk' is present in the current directory. Another solution
657 is simply to delete the file, then re-run make.
658
659 Finally, the default compiler for all platforms is gcc (for now, this will
660 hopefully changed in the future). You can however specify a different
661 compiler by specifying it after the 'setup' target as in :
662
663 gnumake setup lcc on Win32 to use the LCC compiler
664 gnumake setup visualc on Win32 to use Visual C++
665
666 See the file `config/<system>/detect.mk' for a list of supported compilers
667 for your platforms.
668
669 It should be relatively easy to write new detection rules files and
670 config.mk..
671
672 Finally, to build the demo programs, go to `demos' and launch GNU Make,
673 it will use the `config.mk' in the top directory to build the test
674 programs..
675
676-----------------------------------------------------------------------------------------
677Portability :
678
679 In the previous beta, a single FT_System object was used to encompass
680 all low-level operations like thread synchronisation, memory management
681 and i/o access. This has been greatly simplified :
682
683 - thread synchronisation has been dropped, for the simple reason that
684 the library is already re-entrant, and that if you really need two
685 threads accessing the same FT_Library, you should really synchronize
686 access to it yourself with a simple mutex.
687
688 - memory management is performed through a very simple object called
689 "FT_Memory", which really is a table containing a table of pointers
690 to functions like malloc, realloc and free as well as some user data
691 (closure).
692
693 - resources have disappeared (they created more problems than they
694 solved), and i/o management have been simplified greatly as a
695 result. Streams are defined through FT_Stream objects, which can
696 be either memory-based or disk-based.
697
698 Note that each face has its own stream, which is closed only when
699 the face object is destroyed. Hence, a function like TT_Flush_Face
700 in 1.x cannot be directly supported. However, if you really need
701 something like this, you can easily tailor your own streams to achieve
702 the same feature at a lower level (and use FT_Open_Face instead of
703 FT_New_Face to create the face).
704
705 See the file "include/ftsystem.h" for more details, as well as the
706 implementations found in "config/unix" and "config/ansi".
707
708
709-----------------------------------------------------------------------------------------
David Turner5951ce91999-12-29 00:53:44 +0000710Font Drivers :
David Turnere49ab252000-05-16 23:44:38 +0000711
David Turner5951ce91999-12-29 00:53:44 +0000712
713 The Font Driver interface has been modified in order to support
714 extensions & versioning.
715
716
717 The list of the font drivers that are statically linked to the
718 library at compile time is managed through a new configuration file
719 called `config/<platform>/ftmodule.h'.
720
721 This file is autogenerated when invoking `make modules'. This target
722 will parse all sub-directories of 'src', looking for a "module.mk"
723 rules file, used to describe the driver to the build system.
724
725 Hence, one should call `make modules' each time a font driver is added
726 or removed from the `src' directory.
727
728
729 Finally, this version provides a "pseudo-driver" in `src/sfnt'. This
730 driver doesn't support font files directly, but provides services used
731 by all TrueType-like font drivers. Hence, its code is shared between
732 the TrueType & OpenType font formats, and possibly more formats to
733 come if we're lucky..
David Turnerd2b1f351999-12-16 23:11:37 +0000734
735-----------------------------------------------------------------------------------------
736Extensions support :
David Turner5951ce91999-12-29 00:53:44 +0000737
738 The extensions support is inspired by the one found in 1.x.
739
740 Now, each font driver has its own "extension registry", which lists
741 which extensions are available for the font faces managed by the driver.
742
743 Extension ids are now strings, rather than 4-byte tags, as this is
744 usually more readable..
745
746 Each extension has:
747 - some data, associated to each face object
748 - an interface (table of function pointers)
749
750 An extension that is format-specific should simply register itself
751 to the correct font driver. Here is some example code:
752
753 // Registering an extensions
754 //
755 FT_Error FT_Init_XXXX_Extension( FT_Library library )
756 {
757 FT_DriverInterface* tt_driver;
758
759 driver = FT_Get_Driver( library, "truetype" );
760 if (!driver) return FT_Err_Unimplemented_Feature;
761
David Turnere49ab252000-05-16 23:44:38 +0000762 return FT_Register_Extension( driver, &extension_class );
David Turner5951ce91999-12-29 00:53:44 +0000763 }
764
David Turnere49ab252000-05-16 23:44:38 +0000765
David Turner5951ce91999-12-29 00:53:44 +0000766 // Implementing the extensions
767 //
768 FT_Error FT_Proceed_Extension_XXX( FT_Face face )
769 {
770 FT_XXX_Extension ext;
771 FT_XXX_Extension_Interface ext_interface;
772
773 ext = FT_Get_Extension( face, "extensionid", &ext_interface );
774 if (!ext) return error;
775
776 return ext_interface->do_it(ext);
777 }
David Turnerd2b1f351999-12-16 23:11:37 +0000778