David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 1 | LATEST CHANGES |
| 2 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 3 | - "type1z" renamed back to "type1"; the old "type1" module has been |
| 4 | removed |
| 5 | |
David Turner | 046f7a0 | 2000-09-15 22:42:06 +0000 | [diff] [blame] | 6 | - revamped the build system to make it a lot more generic. This will |
| 7 | allow us to re-use nearly un-modified in lots of other projects |
| 8 | (including FreeType Layout) |
| 9 | |
David Turner | 34f1c2f | 2000-08-23 22:47:44 +0000 | [diff] [blame] | 10 | - changed "cid" to use "psaux" too.. |
| 11 | |
David Turner | 3b2c50e | 2000-08-23 21:11:13 +0000 | [diff] [blame] | 12 | - added the cache sub-system. See <freetype/ftcache.h> as well as the |
| 13 | sources in "src/cache". Note that it compiles but is still untested |
| 14 | for now .. |
| 15 | |
David Turner | a39acf5 | 2000-08-23 02:47:57 +0000 | [diff] [blame] | 16 | - updated "docs/docmaker.py", a draft API reference is available at |
| 17 | http://www.freetype.org/ft2api.html |
| 18 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 19 | - changed "type1" to use "psaux" |
David Turner | a39acf5 | 2000-08-23 02:47:57 +0000 | [diff] [blame] | 20 | |
| 21 | - created a new module named "psaux" to hold the Type 1 & Type 2 parsing |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 22 | routines. It should be used by "type1", "cid" and "cff" in the future |
David Turner | a39acf5 | 2000-08-23 02:47:57 +0000 | [diff] [blame] | 23 | |
| 24 | - fixed an important bug in "FT_Glyph_Get_CBox" |
| 25 | |
David Turner | b169341 | 2000-07-27 21:48:48 +0000 | [diff] [blame] | 26 | - fixed some compiler warnings that happened since the TrueType |
| 27 | bytecode decoder was deactivated by default.. |
| 28 | |
David Turner | c5cdf8b | 2000-07-27 21:40:22 +0000 | [diff] [blame] | 29 | - fixed two memory leaks: |
| 30 | - the memory manager (16 bytes) isn't released in FT_Done_FreeType !! |
| 31 | |
| 32 | - using custom input streams, the copy of the original stream |
| 33 | was never released |
| 34 | |
| 35 | - fixed the auto-hinter by performing automatic computation of the |
| 36 | "filling direction" of each glyph. This is done through a simple and |
| 37 | fast approximation, and seems to work (problems spotted by Werner |
| 38 | though). The Arphic fonts are a lot nicer though there are still a |
| 39 | lot of things to do to handle Asian fonts correctly.. |
| 40 | |
| 41 | =========================================================================== |
| 42 | BETA-8 (RELEASE CANDIDATE) CHANGES |
| 43 | |
David Turner | 5f5b446 | 2000-07-26 19:13:51 +0000 | [diff] [blame] | 44 | - deactivated the trueType bytecode interpreter by default |
| 45 | |
| 46 | - deactivated the "src/type1" font driver. Now "src/type1z" is |
| 47 | used by default.. |
| 48 | |
David Turner | 5fe4c00 | 2000-07-26 19:04:08 +0000 | [diff] [blame] | 49 | - updates to the build system. We now compile the library correctly |
| 50 | under Unix system through "configure" which is automatically called |
| 51 | on the first "make" invocation. |
| 52 | |
| 53 | - added the auto-hinting module !!. Fixing some bugs here and there.. |
| 54 | |
David Turner | 49bd4f0 | 2000-07-12 16:57:37 +0000 | [diff] [blame] | 55 | - found some bugs in the composite loader (seac) of the Type1-based |
| 56 | font drivers.. |
| 57 | |
| 58 | - renamed the directory "freetype2/config" to "freetype2/builds" and |
David Turner | 1ca6f2d | 2000-07-08 00:49:43 +0000 | [diff] [blame] | 59 | updated all relevant files.. |
| 60 | |
David Turner | 9b3d1c7 | 2000-07-07 19:47:34 +0000 | [diff] [blame] | 61 | - found a memory leak in the "type1" driver |
| 62 | |
| 63 | - incorporated Tom's patches to support flex operators correctly |
| 64 | in OpenType/CFF fonts.. Now all I need is to support pure CFF |
| 65 | and CEF fonts to be done with this driver.. :-) |
| 66 | |
| 67 | - added the Windows FNT/FON driver in "src/winfonts". For now, |
| 68 | it always "simulates" a Unicode charmap, so it shouldn't be |
| 69 | considered completed right now.. |
| 70 | |
| 71 | It's there to be more a proof of concept than anything else |
| 72 | anyway. The driver is a single C source file, that compiles |
| 73 | to 3 Kb of code.. |
| 74 | |
| 75 | I'm still working on the PCF/BDF drivers.. but I'm too lazy |
| 76 | to finish them now.. |
| 77 | |
| 78 | |
David Turner | c06aba2 | 2000-06-30 23:38:23 +0000 | [diff] [blame] | 79 | - CHANGES TO THE HIGH-LEVEL API |
| 80 | |
| 81 | o FT_Get_Kerning has a new parameter that allows you to select |
| 82 | the coordinates of the kerning vector ( font units, scaled, |
| 83 | scaled + grid-fitted ). |
| 84 | |
| 85 | o the outline functions are now in <freetype/ftoutln.h> and not |
| 86 | part of <freetype/freetype.h> anymore |
| 87 | |
| 88 | o <freetype/ftmodule.h> now contains declarations for |
| 89 | FT_New_Library, FT_Done_Library, FT_Add_Default_Modules |
| 90 | |
| 91 | o the so-called convenience functions have moved from "ftoutln.c" |
| 92 | to "ftglyph.c", and are thus available with this optional component |
| 93 | of the library. They are declared in <freetype/ftglyph.h> now.. |
| 94 | |
| 95 | o anti-aliased rendering is now the default for FT_Render_Glyph |
| 96 | (i.e. corresponds to render_mode == 0 == ft_render_mode_normal). |
| 97 | To generate a monochrome bitmap, use ft_render_mode_mono, or the |
| 98 | FT_LOAD_MONOCHROME flag in FT_Load_Glyph/FT_Load_Char. |
| 99 | |
| 100 | FT_LOAD_ANTI_ALIAS is still defined, but values to 0. |
| 101 | |
| 102 | o <freetype/freetype.h> now include <freetype/config/ftconfig.h>, |
| 103 | solving a few headaches :-) |
| 104 | |
| 105 | o the type FT_GlyphSlotRec has now a "library" field. |
| 106 | |
| 107 | |
| 108 | |
| 109 | - CHANGES TO THE "ftglyph.h" API |
| 110 | |
| 111 | This API has been severely modified in order to make it simpler, |
| 112 | clearer, and more efficient. It certainly now looks like a real |
| 113 | "glyph factory" object, and allows client applications to manage |
| 114 | (i.e. transform, bbox and render) glyph images without ever knowing |
| 115 | their original format. |
| 116 | |
David Turner | 9825861 | 2000-06-28 20:43:07 +0000 | [diff] [blame] | 117 | - added support for CID-keyed fonts to the CFF driver. |
| 118 | maybe support for pure CFF + CEF fonts should come in ?? |
David Turner | 9d636b6 | 2000-06-27 23:32:27 +0000 | [diff] [blame] | 119 | |
| 120 | |
| 121 | - cleaned up source code in order to avoid two functions with the |
| 122 | same name. Also changed the names of the files in "type1z" from |
| 123 | "t1XXXX" to "z1XXXX" in order to avoid any conflicts. |
| 124 | |
| 125 | "make multi" now works well :-) |
| 126 | |
David Turner | 81bb4ad | 2000-06-28 04:19:49 +0000 | [diff] [blame] | 127 | Also removed the use of "cidafm" for now, even if the source files |
| 128 | are still there. This functionality will certainly go into a specific |
| 129 | module.. |
David Turner | c06aba2 | 2000-06-30 23:38:23 +0000 | [diff] [blame] | 130 | |
| 131 | |
| 132 | |
| 133 | - ADDED SUPPORT FOR THE AUTO-HINTER |
| 134 | |
| 135 | It works :-) I have a demo program which simply is a copy of "ftview" |
| 136 | that does a FT_Add_Module( library, &autohinter_module_class ) after |
| 137 | library initialisation, and Type 1 & OpenType/CFF fonts are now hinted. |
| 138 | |
| 139 | CID fonts are not hinted, as they include no charmap and the auto-hinter |
| 140 | doesn't include "generic" global metrics computations yet.. |
| 141 | |
| 142 | Now, I need to release this thing to the FreeType 2 source.. |
| 143 | |
| 144 | |
| 145 | |
David Turner | 9d636b6 | 2000-06-27 23:32:27 +0000 | [diff] [blame] | 146 | |
| 147 | |
| 148 | - CHANGES TO THE RENDERER MODULES |
| 149 | |
| 150 | the monochrome and smooth renderers are now in two distinct directories, |
| 151 | namely "src/raster1" and "src/smooth". Note that the old "src/renderer" |
| 152 | is now gone.. |
| 153 | |
| 154 | I ditched the 5-gray-levels renderers. Basically, it involved a simple |
| 155 | #define toggle in 'src/raster1/ftraster.c' |
| 156 | |
| 157 | FT_Render_Glyph, FT_Outline_Render & FT_Outline_Get_Bitmap now select |
| 158 | the best renderer available, depending on render mode. If the current |
| 159 | renderer for a given glyph image format isn't capable of supporting |
| 160 | the render mode, another one will be found in the library's list. |
| 161 | |
| 162 | This means that client applications do not need to switch or set the |
| 163 | renderers themselves (as in the latest change), they'll get what they |
| 164 | want automatically... At last.. |
| 165 | |
| 166 | Changed the demo programs accordingly.. |
| 167 | |
| 168 | |
| 169 | |
David Turner | f0df85b | 2000-06-22 00:17:42 +0000 | [diff] [blame] | 170 | - MAJOR INTERNAL REDESIGN: |
| 171 | |
| 172 | A lot of internal modifications have been performed lately on the |
| 173 | source in order to provide the following enhancements: |
| 174 | |
| 175 | - more generic module support: |
| 176 | |
| 177 | The FT_Module type is now defined to represent a handle to a given |
| 178 | module. The file <freetype/ftmodule.h> contains the FT_Module_Class |
| 179 | definition, as well as the module-loading public API |
| 180 | |
| 181 | The FT_Driver type is still defined, and still represents a pointer |
| 182 | to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module, |
| 183 | FT_Get_Driver by FT_Get_Module, etc.. |
| 184 | |
| 185 | |
| 186 | - support for generic glyph image types: |
| 187 | |
| 188 | The FT_Renderer type is a pointer to a module used to perform various |
| 189 | operations on glyph image. |
| 190 | |
| 191 | Each renderer is capable of handling images in a single format |
| 192 | (e.g. ft_glyph_format_outline). Its functions are used to: |
| 193 | |
| 194 | - transform an glyph image |
| 195 | - render a glyph image into a bitmap |
| 196 | - return the control box (dimensions) of a given glyph image |
| 197 | |
| 198 | |
| 199 | The scan converters "ftraster.c" and "ftgrays.c" have been moved |
| 200 | to the new directory "src/renderer", and are used to provide two |
| 201 | default renderer modules. |
| 202 | |
| 203 | One corresponds to the "standard" scan-converter, the other to the |
| 204 | "smooth" one. |
| 205 | |
| 206 | The current renderer can be set through the new function |
| 207 | FT_Set_Renderer. |
| 208 | |
| 209 | The old raster-related function FT_Set_Raster, FT_Get_Raster and |
| 210 | FT_Set_Raster_Mode have now disappeared, in favor of the new: |
| 211 | |
| 212 | FT_Get_Renderer |
| 213 | FT_Set_Renderer |
| 214 | |
| 215 | see the file <freetype/ftrender.h> for more details.. |
| 216 | |
| 217 | These changes were necessary to properly support different scalable |
| 218 | formats in the future, like bi-color glyphs, etc.. |
| 219 | |
| 220 | |
| 221 | - glyph loader object: |
| 222 | |
| 223 | A new internal object, called a 'glyph loader' has been introduced |
| 224 | in the base layer. It is used by all scalable format font drivers |
| 225 | to load glyphs and composites. |
| 226 | |
| 227 | This object has been created to reduce the code size of each driver, |
| 228 | as each one of them basically re-implemented its functionality. |
| 229 | |
| 230 | See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for |
| 231 | more information.. |
| 232 | |
| 233 | |
| 234 | |
| 235 | - FT_GlyphSlot had new fields: |
| 236 | |
| 237 | In order to support extended features (see below), the FT_GlyphSlot |
| 238 | structure has a few new fields: |
| 239 | |
| 240 | linearHoriAdvance: this field gives the linearly scaled (i.e. |
| 241 | scaled but unhinted) advance width for the glyph, |
| 242 | expressed as a 16.16 fixed pixel value. This |
| 243 | is useful to perform WYSIWYG text. |
| 244 | |
| 245 | linearVertAdvance: this field gives the linearly scaled advance |
| 246 | height for the glyph (relevant in vertical glyph |
| 247 | layouts only). This is useful to perform |
| 248 | WYSIWYG text. |
| 249 | |
| 250 | Note that the two above field replace the removed "metrics2" field |
| 251 | in the glyph slot. |
| 252 | |
| 253 | advance: this field is a vector that gives the transformed |
| 254 | advance for the glyph. By default, it corresponds |
| 255 | to the advance width, unless FT_LOAD_VERTICAL_LAYOUT |
| 256 | was specified when calling FT_Load_Glyph or FT_Load_Char |
| 257 | |
| 258 | bitmap_left: this field gives the distance in integer pixels from |
| 259 | the current pen position to the left-most pixel of |
| 260 | a glyph image WHEN IT IS A BITMAP. It is only valid |
| 261 | when the "format" field is set to |
| 262 | "ft_glyph_format_bitmap", for example, after calling |
| 263 | the new function FT_Render_Glyph. |
| 264 | |
| 265 | bitmap_top: this field gives the distance in integer pixels from |
| 266 | the current pen position (located on the baseline) to |
| 267 | the top-most pixel of the glyph image WHEN IT IS A |
| 268 | BITMAP. Positive values correspond to upwards Y. |
| 269 | |
| 270 | loader: this is a new private field for the glyph slot. Client |
| 271 | applications should not touch it.. |
| 272 | |
| 273 | |
| 274 | - support for transforms and direct rendering in FT_Load_Glyph: |
| 275 | |
| 276 | Most of the functionality found in <freetype/ftglyph.h> has been |
| 277 | moved to the core library. Hence, the following: |
| 278 | |
| 279 | - a transform can be specified for a face through FT_Set_Transform. |
| 280 | this transform is applied by FT_Load_Glyph to scalable glyph images |
| 281 | (i.e. NOT TO BITMAPS) before the function returns, unless the |
| 282 | bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags.. |
| 283 | |
| 284 | |
| 285 | - once a glyph image has been loaded, it can be directly converted to |
| 286 | a bitmap by using the new FT_Render_Glyph function. Note that this |
| 287 | function takes the glyph image from the glyph slot, and converts |
| 288 | it to a bitmap whose properties are returned in "face.glyph.bitmap", |
| 289 | "face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original |
| 290 | native image might be lost after the conversion. |
| 291 | |
| 292 | |
| 293 | - when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph |
| 294 | and FT_Load_Char functions will call FT_Render_Glyph automatically |
| 295 | when needed. |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 300 | - reformated all modules source code in order to get rid of the basic |
| 301 | data types redifinitions (i.e. "TT_Int" instead of "FT_Int", "T1_Fixed" |
| 302 | instead of "FT_Fixed"). Hence the format-specific prefixes like "TT_", |
| 303 | "T1_", "T2_" and "CID_" are only used for relevant structures.. |
| 304 | |
| 305 | ============================================================================ |
| 306 | OLD CHANGES FOR BETA 7 |
David Turner | 3475e7f | 2000-05-17 20:56:01 +0000 | [diff] [blame] | 307 | |
David Turner | 2b9be99 | 2000-06-07 23:41:17 +0000 | [diff] [blame] | 308 | - bug-fixed the OpenType/CFF parser. It now loads and displays my two |
| 309 | fonts nicely, but I'm pretty certain that more testing is needed :-) |
| 310 | |
| 311 | - fixed the crummy Type 1 hinter, it now handles accented characters |
| 312 | correctly (well, the accent is not always well placed, but that's |
| 313 | another problem..) |
| 314 | |
David Turner | 04aa800 | 2000-06-01 03:27:48 +0000 | [diff] [blame] | 315 | - added the CID-keyed Type 1 driver in "src/cid". Works pretty well for |
| 316 | only 13 Kb of code ;-) Doesn't read AFM files though, nor the really |
| 317 | useful CMAP files.. |
| 318 | |
| 319 | - fixed two bugs in the smooth renderer (src/base/ftgrays.c). Thanks to |
| 320 | Boris Letocha for spotting them and providing a fix.. |
| 321 | |
David Turner | 4f99c3c | 2000-05-29 20:55:13 +0000 | [diff] [blame] | 322 | - fixed potential "divide by zero" bugs in ftcalc.c.. my god.. |
| 323 | |
| 324 | - added source code for the OpenType/CFF driver (still incomplete though..) |
| 325 | |
| 326 | - modified the SFNT driver slightly to perform more robust header |
| 327 | checks in TT_Load_SFNT_Header. This prevents certain font files |
| 328 | (e.g. some Type 1 Multiple Masters) from being incorrectly "recognized" |
| 329 | as TrueType font files.. |
| 330 | |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 331 | - moved a lot of stuff from the TrueType driver to the SFNT module, |
| 332 | this allows greater code re-use between font drivers (e.g. TrueType, |
| 333 | OpenType, Compact-TrueType, etc..) |
| 334 | |
| 335 | - added a tiny segment cache to the SFNT Charmap 4 decoder, in order |
| 336 | to minimally speed it up.. |
| 337 | |
David Turner | 1118720 | 2000-05-26 17:13:23 +0000 | [diff] [blame] | 338 | - added support for Multiple Master fonts in "type1z". There is also |
| 339 | a new file named <freetype/ftmm.h> which defines functions to |
| 340 | manage them from client applications. |
| 341 | |
| 342 | The new file "src/base/ftmm.c" is also optional to the engine.. |
| 343 | |
| 344 | - various formatting changes (e.g. EXPORT_DEF -> FT_EXPORT_DEF) + |
| 345 | small bug fixes in FT_Load_Glyph, the "type1" driver, etc.. |
| 346 | |
David Turner | f5dcdd5 | 2000-05-23 22:16:27 +0000 | [diff] [blame] | 347 | - a minor fix to the Type 1 driver to let them apply the font matrix |
| 348 | correctly (used for many oblique fonts..) |
| 349 | |
David Turner | 51179f0 | 2000-05-18 16:18:05 +0000 | [diff] [blame] | 350 | - some fixes for 64-bit systems (mainly changing some FT_TRACE calls |
| 351 | to use %p instead of %lx).. Thanks to Karl Robillard |
| 352 | |
David Turner | 109fcf6 | 2000-05-17 23:35:37 +0000 | [diff] [blame] | 353 | - fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added |
| 354 | a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be cropped when |
| 355 | loaded from a file (maybe I should move the bitmap cropper to the |
| 356 | base layer ??). |
| 357 | |
David Turner | 3475e7f | 2000-05-17 20:56:01 +0000 | [diff] [blame] | 358 | - changed the default number of gray levels of the smooth renderer to |
| 359 | 256 (instead of the previous 128). Of course, the human eye can't |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 360 | see any difference ;-) |
David Turner | 3475e7f | 2000-05-17 20:56:01 +0000 | [diff] [blame] | 361 | |
| 362 | - removed TT_MAX_SUBGLYPHS, there is no static limit on the number of |
| 363 | subglyphs in a TrueType font now.. |
| 364 | |
| 365 | ============================================================================= |
| 366 | OLD CHANGES 16 May 2000 |
David Turner | efce08d | 2000-05-11 18:23:52 +0000 | [diff] [blame] | 367 | |
David Turner | 968f0c3 | 2000-05-16 23:26:01 +0000 | [diff] [blame] | 368 | - tagged "BETA-6" in the CVS tree. This one is a serious release candidate |
| 369 | even though it doesn't incorporate the auto-hinter yet.. |
| 370 | |
| 371 | - various obsolete files were removed, and copyright header updated |
| 372 | |
| 373 | - finally updated the standard raster to fix the monochrome rendering bug |
| 374 | + re-enable support for 5-gray levels anti-aliasing (suck, suck..) |
| 375 | |
| 376 | - created new header files, and modified sources accordingly: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 377 | |
David Turner | 968f0c3 | 2000-05-16 23:26:01 +0000 | [diff] [blame] | 378 | <freetype/fttypes.h> - simple FreeType types, without the API |
| 379 | <freetype/internal/ftmemory.h> - definition of memory-management macros |
| 380 | |
| 381 | - added the "DSIG" (OpenType Digital Signature) tag to <freetype/tttags.h> |
| 382 | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 383 | - light update/cleaning of the build system + changes to the sources in |
| 384 | order to get rid of _all_ compiler warnings with three compilers, i.e: |
| 385 | |
| 386 | gcc with "-ansi -pedantic -Wall -W", Visual C++ with "/W3 /WX" |
| 387 | and LCC |
| 388 | |
| 389 | IMPORTANT NOTE FOR WIN32-LCC USERS: |
| 390 | | |
| 391 | | It seems the C pre-processor that comes with LCC is broken, it |
| 392 | | doesn't recognize the ANSI standard directives # and ## correctly |
| 393 | | when one of the argument is a macro. Also, something like: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 394 | | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 395 | | #define F(x) print##x |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 396 | | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 397 | | F(("hello")) |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 398 | | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 399 | | will get incorrectly translated to: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 400 | | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 401 | | print "hello") |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 402 | | |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 403 | | by its pre-processor. For this reason, you simply cannot build |
| 404 | | FreeType 2 in debug mode with this compiler.. |
| 405 | |
| 406 | |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 407 | - yet another massive grunt work. I've changed the definition of the |
| 408 | EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now take |
| 409 | an argument, which is the function's return value type. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 410 | |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 411 | This is necessary to compile FreeType as a DLL on Windows and OS/2. |
| 412 | Depending on the compiler used, a compiler-specific keyword like __export |
| 413 | or __system must be placed before (VisualC++) or after (BorlandC++) |
| 414 | the type.. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 415 | |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 416 | Of course, this needed a lot of changes throughout the source code |
| 417 | to make it compile again... All cleaned up now, apparently.. |
| 418 | |
| 419 | Note also that there is a new EXPORT_VAR macro defined to allow the |
| 420 | _declaration_ of an exportable public (constant) variable. This is the |
| 421 | case of the raster interfaces (see ftraster.h and ftgrays.h), as well |
| 422 | as each module's interface (see sfdriver.h, psdriver.h, etc..) |
| 423 | |
| 424 | - new feature: it is now possible to pass extra parameters to font |
| 425 | drivers when creating a new face object. For now, this |
| 426 | capability is unused. It could however prove to be useful |
| 427 | in a near future.. |
| 428 | |
| 429 | the FT_Open_Args structure was changes, as well as the internal |
| 430 | driver interface (the specific "init_face" module function has now |
| 431 | a different signature). |
| 432 | |
| 433 | - updated the tutorial (not finished though). |
David Turner | c30aea9 | 2000-05-12 15:01:18 +0000 | [diff] [blame] | 434 | - updated the top-level BUILD document |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 435 | |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 436 | - fixed a potential memory leak that could occur when loading embedded |
| 437 | bitmaps. |
| 438 | |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 439 | - added the declaration of FT_New_Memory_Face in <freetype/freetype.h>, as |
| 440 | it was missing from the public header (the implementation was already |
| 441 | in "ftobjs.c"). |
| 442 | |
| 443 | - the file <freetype/fterrors.h> has been seriously updated in order to |
| 444 | allow the automatic generation of error message tables. See the comments |
| 445 | within it for more information. |
| 446 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 447 | - major directory hierarchy re-organisation. This was done for two things: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 448 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 449 | * first, to ease the "manual" compilation of the library by requiring |
| 450 | at lot less include paths :-) |
David Turner | bfe2f98 | 2000-05-12 12:17:15 +0000 | [diff] [blame] | 451 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 452 | * second, to allow external programs to effectively access internal |
| 453 | data fields. For example, this can be extremely useful if someone |
| 454 | wants to write a font producer or a font manager on top of FreeType. |
| 455 | |
| 456 | Basically, you should now use the 'freetype/' prefix for header inclusion, |
| 457 | as in: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 458 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 459 | #include <freetype/freetype.h> |
| 460 | #include <freetype/ftglyph.h> |
| 461 | |
| 462 | Some new include sub-directories are available: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 463 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 464 | a. the "freetype/config" directory, contains two files used to |
| 465 | configure the build of the library. Client applications should |
| 466 | not need to look at these normally, but they can if they want. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 467 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 468 | #include <freetype/config/ftoption.h> |
| 469 | #include <freetype/config/ftconfig.h> |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 470 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 471 | b. the "freetype/internal" directory, contains header files that |
| 472 | describes library internals. These are the header files that were |
| 473 | previously found in the "src/base" and "src/shared" directories. |
| 474 | |
| 475 | |
| 476 | As usual, the build system and the demos have been updated to reflect |
| 477 | the change.. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 478 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 479 | Here's a layout of the new directory hierarchy: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 480 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 481 | TOP |
| 482 | include/ |
| 483 | freetype/ |
| 484 | freetype.h |
| 485 | ... |
| 486 | config/ |
| 487 | ftoption.h |
| 488 | ftconfig.h |
| 489 | ftmodule.h |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 490 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 491 | internal/ |
| 492 | ftobjs.h |
| 493 | ftstream.h |
| 494 | ftcalc.h |
| 495 | ... |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 496 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 497 | src/ |
| 498 | base/ |
| 499 | ... |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 500 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 501 | sfnt/ |
| 502 | psnames/ |
| 503 | truetype/ |
| 504 | type1/ |
| 505 | type1z/ |
| 506 | |
| 507 | |
| 508 | Compiling a module is now much easier, for example, the following should |
David Turner | 968f0c3 | 2000-05-16 23:26:01 +0000 | [diff] [blame] | 509 | work when in the TOP directory on an ANSI build: |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 510 | |
David Turner | a9c251c | 2000-05-11 18:36:19 +0000 | [diff] [blame] | 511 | gcc -c -I./include -I./src/base src/base/ftbase.c |
| 512 | gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c |
| 513 | etc.. |
| 514 | |
| 515 | (of course, using -Iconfig/<system> if you provide system-specific |
| 516 | configuration files). |
David Turner | efce08d | 2000-05-11 18:23:52 +0000 | [diff] [blame] | 517 | |
| 518 | |
| 519 | - updated the structure of FT_Outline_Funcs in order to allow |
| 520 | direct coordinate scaling within the outline decomposition routine |
| 521 | (this is important for virtual "on" points with TrueType outlines) |
| 522 | + updates to the rasters to support this.. |
| 523 | |
| 524 | - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order |
| 525 | to support version 2 of the table (see OpenType 1.2 spec) |
| 526 | |
| 527 | - created "include/tttables.h" and "include/t1tables.h" to allow |
| 528 | client applications to access some of the SFNT and T1 tables of a |
| 529 | face with a procedural interface (see FT_Get_Sfnt_Table()) |
| 530 | + updates to internal source files to reflect the change.. |
| 531 | |
| 532 | - some cleanups in the source code to get rid of warnings when compiling |
| 533 | with the "-Wall -W -ansi -pedantic" options in gcc. |
| 534 | |
| 535 | - debugged and moved the smooth renderer to "src/base/ftgrays.c" and |
| 536 | its header to "include/ftgrays.h" |
| 537 | |
| 538 | - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with |
| 539 | up to 80 sub-glyphs !! Thanks to Werner |
| 540 | |
| 541 | ================================================================================ |
| 542 | OLD CHANGES - 14-apr-2000 |
David Turner | 77054f2 | 2000-04-14 20:49:52 +0000 | [diff] [blame] | 543 | |
| 544 | - fixed a bug in the TrueType glyph loader that prevented the correct |
| 545 | loading of some CJK glyphs in mingli.ttf |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 546 | |
David Turner | 77054f2 | 2000-04-14 20:49:52 +0000 | [diff] [blame] | 547 | - improved the standard Type 1 hinter in "src/type1" |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 548 | |
David Turner | 77054f2 | 2000-04-14 20:49:52 +0000 | [diff] [blame] | 549 | - fixed two bugs in the experimental Type 1 driver in "src/type1z" |
| 550 | to handle the new XFree86 4.0 fonts (and a few other ones..) |
| 551 | |
| 552 | - the smooth renderer is now complete and supports sub-banding |
| 553 | to render large glyphs at high speed. However, it is still located |
| 554 | in "demos/src/ftgrays.c" and should move to the library itself |
| 555 | in the next beta.. NOTE: The smooth renderer doesn't compile in |
| 556 | stand-alone mode anymore, but this should be fixed RSN.. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 557 | |
David Turner | 77054f2 | 2000-04-14 20:49:52 +0000 | [diff] [blame] | 558 | - introduced convenience functions to more easily deal with glyph |
| 559 | images, see "include/ftglyph.h" for more details, as well as the |
| 560 | new demo program named "demos/src/ftstring.c" that demonstrates |
| 561 | its use |
| 562 | |
| 563 | - implemented FT_LOAD_NO_RECURSE in both the TrueType and Type 1 |
| 564 | drivers (this is required by the auto-hinter to improve its results). |
| 565 | |
| 566 | - changed the raster interface, in order to allow client applications |
| 567 | to provide their own span-drawing callbacks. However, only the |
| 568 | smooth renderer supports this. See "FT_Raster_Params" in the |
| 569 | file "include/ftimage.h" |
| 570 | |
| 571 | - fixed a small bug in FT_MulFix that caused incorrect transform |
| 572 | computation !! |
| 573 | |
| 574 | - Note: The tutorial is out-of-date, grumpf.. :-( |
| 575 | |
| 576 | ================================================================================ |
| 577 | OLD CHANGES - 12-mar-2000 |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 578 | |
| 579 | - changed the layout of configuration files : now, all ANSI configuration |
| 580 | files are located in "freetype2/config". System-specific over-rides |
| 581 | can be placed in "freetype2/config/<system>". |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 582 | |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 583 | - moved all configuration macros to "config/ftoption.h" |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 584 | |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 585 | - improvements in the Type 1 driver with AFM support |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 586 | |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 587 | - changed the fields in the FT_Outline structure : the old "flags" |
| 588 | array is re-named "tags", while all ancient flags are encoded into |
| 589 | a single unsigned int named "flags". |
| 590 | |
| 591 | - introduced new flags in FT_Outline.flags (see ft_outline_.... enums in |
| 592 | "ftimage.h"). |
| 593 | |
| 594 | - changed outline functions to "FT_Outline_<action>" syntax |
| 595 | |
| 596 | - added a smooth anti-alias renderer to the demonstration programs |
| 597 | - added Mac graphics driver (thanks Just) |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 598 | |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 599 | - FT_Open_Face changed in order to received a pointer to a FT_Open_Args |
| 600 | descriptor.. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 601 | |
David Turner | c3c7e7f | 2000-03-13 14:19:31 +0000 | [diff] [blame] | 602 | - various cleanups, a few more API functions implemented (see FT_Attach_File) |
| 603 | |
| 604 | - updated some docs |
| 605 | |
| 606 | ================================================================================ |
| 607 | OLD CHANGES - 22-feb-2000 |
David Turner | 58c10b5 | 2000-02-22 14:31:42 +0000 | [diff] [blame] | 608 | |
| 609 | - introduced the "psnames" module. It is used to: |
| 610 | |
| 611 | o convert a Postscript glyph name into the equivalent Unicode |
| 612 | character code (used by the Type 1 driver(s) to synthetize |
| 613 | on the fly a Unicode charmap). |
| 614 | |
| 615 | o provide an interface to retrieve the Postscript names of |
| 616 | the Macintosh, Adobe Standard & Adobe Expert character codes. |
| 617 | (the Macintosh names are used by the SFNT-module postscript |
| 618 | names support routines, while the other two tables are used |
| 619 | by the Type 1 driver(s)). |
| 620 | |
| 621 | - introduced the "type1z" alternate Type 1 driver. This is a (still |
| 622 | experimental) driver for the Type 1 format that will ultimately |
| 623 | replace the one in "src/type1". It uses pattern matching to load |
| 624 | data from the font, instead of a finite state analyzer. It works |
| 625 | much better than the "old" driver with "broken" fonts. It is also |
| 626 | much smaller (under 15 Kb). |
| 627 | |
| 628 | - the Type 1 drivers (both in "src/type1" and "src/type1z") are |
| 629 | nearly complete. They both provide automatic Unicode charmap |
| 630 | synthesis through the "psnames" module. No re-encoding vector |
| 631 | is needed. (note that they still leak memory due to some code |
| 632 | missing, and I'm getting lazy). |
| 633 | |
| 634 | Trivial AFM support has been added to read kerning information |
| 635 | but wasn't exactly tested as it should ;-) |
| 636 | |
| 637 | - The TrueType glyph loader has been seriously rewritten (see the |
| 638 | file "src/truetype/ttgload.c". It is now much, much simpler as |
| 639 | well as easier to read, maintain and understand :-) Preliminary |
| 640 | versions introduced a memory leak that has been reported by Jack |
| 641 | Davis, and is now fixed.. |
| 642 | |
| 643 | - introduced the new "ft_glyph_format_plotter", used to represent |
| 644 | stroked outlines like Windows "Vector" fonts, and certain Type 1 |
| 645 | fonts like "Hershey". The corresponding raster will be written |
| 646 | soon. |
| 647 | |
| 648 | - FT_New_Memory_Face is gone. Likewise, FT_Open_Face has a new |
| 649 | interface that uses a structure to describe the input stream, |
| 650 | the driver (if required), etc.. |
| 651 | |
| 652 | TODO |
| 653 | - Write FT_Get_Glyph_Bitmap and FT_Load_Glyph_Bitmap |
| 654 | |
| 655 | - Add a function like FT_Load_Character( face, char_code, load_flags ) |
| 656 | that would really embbed a call to FT_Get_Char_Index then FT_Load_Glyph |
| 657 | to ease developer's work. |
| 658 | |
| 659 | - Update the tutorial !! |
| 660 | - consider adding support for Multiple Master fonts in the Type 1 |
| 661 | drivers. |
| 662 | |
| 663 | - Test the AFM routines of the Type 1 drivers to check that kerning |
| 664 | information is returned correctly. |
| 665 | |
| 666 | - write a decent auto-gridding component !! We need this to release |
| 667 | FreeType 2.0 gold ! |
| 668 | |
| 669 | |
| 670 | ----- less urgent needs : ---------- |
| 671 | - add a CFF/Type2 driver |
| 672 | - add a BDF driver |
| 673 | - add a FNT/PCF/HBF driver |
| 674 | - add a Speedo driver from the X11 sources |
| 675 | |
| 676 | |
| 677 | ============================================================================== |
| 678 | OLDER CHANGES - 27-jan-2000 |
David Turner | 633da99 | 2000-01-27 14:07:33 +0000 | [diff] [blame] | 679 | |
| 680 | - updated the "sfnt" module interface to allow several SFNT-based |
| 681 | drivers to co-exist peacefully |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 682 | |
David Turner | 633da99 | 2000-01-27 14:07:33 +0000 | [diff] [blame] | 683 | - updated the "T1_Face" type to better separate Postscript font content |
| 684 | from the rest of the FT_Face structure. Might be used later by the |
| 685 | CFF/Type2 driver.. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 686 | |
David Turner | 633da99 | 2000-01-27 14:07:33 +0000 | [diff] [blame] | 687 | - added an experimental replacement Type 1 driver featuring advanced |
| 688 | (and speedy) pattern matching to retrieve the data from postscript |
| 689 | fonts. |
| 690 | |
| 691 | - very minor changes in the implementation of FT_Set_Char_Size and |
| 692 | FT_Set_Pixel_Sizes (they now implement default to ligthen the |
| 693 | font driver's code). |
| 694 | |
| 695 | |
| 696 | ============================================================================= |
| 697 | OLD MESSAGE |
| 698 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 699 | This file summarizes the changes that occured since the last "beta" of FreeType 2. |
| 700 | Because the list is important, it has been divided into separate sections: |
| 701 | |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 702 | Table Of Contents: |
| 703 | |
| 704 | I High-Level Interface (easier !) |
| 705 | II Directory Structure |
| 706 | III Glyph Image Formats |
| 707 | IV Build System |
| 708 | V Portability |
| 709 | VI Font Drivers |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 710 | |
| 711 | ----------------------------------------------------------------------------------------- |
| 712 | High-Level Interface : |
| 713 | |
| 714 | The high-level API has been considerably simplified. Here is how : |
| 715 | |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 716 | - resource objects have disappeared. this means that face objects can |
| 717 | now be created with a single function call (see FT_New_Face and |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 718 | FT_Open_Face) |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 719 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 720 | - when calling either FT_New_Face & FT_Open_Face, a size object and a |
| 721 | glyph slot object are automatically created for the face, and can be |
| 722 | accessed through "face->glyph" and "face->size" if one really needs to. |
| 723 | In most cases, there's no need to call FT_New_Size or FT_New_Glyph. |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 724 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 725 | - similarly, FT_Load_Glyph now only takes a "face" argument (instead of |
| 726 | a glyph slot and a size). Also, it's "result" parameter is gone, as |
| 727 | the glyph image type is returned in the field "face->glyph.format" |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 728 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 729 | - the list of available charmaps is directly accessible through |
| 730 | "face->charmaps", counting "face->num_charmaps" elements. Each |
| 731 | charmap has an 'encoding' field which specifies which known encoding |
| 732 | it deals with. Valid values are, for example : |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 733 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 734 | ft_encoding_unicode (for ASCII, Latin-1 and Unicode) |
| 735 | ft_encoding_apple_roman |
| 736 | ft_encoding_sjis |
| 737 | ft_encoding_adobe_standard |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 738 | ft_encoding_adobe_expert |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 739 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 740 | other values may be added in the future. Each charmap still holds its |
| 741 | "platform_id" and "encoding_id" values in case the encoding is too |
| 742 | exotic for the current library |
| 743 | |
| 744 | |
| 745 | ----------------------------------------------------------------------------------------- |
| 746 | Directory Structure: |
| 747 | |
| 748 | Should seem obvious to most of you: |
| 749 | |
| 750 | freetype/ |
| 751 | config/ -- configuration sub-makefiles |
| 752 | ansi/ |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 753 | unix/ -- platform-specific configuration files |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 754 | win32/ |
| 755 | os2/ |
| 756 | msdos/ |
| 757 | |
| 758 | include/ -- public header files, those to be included directly |
| 759 | by client apps |
| 760 | |
| 761 | src/ -- sources of the library |
| 762 | base/ -- the base layer |
| 763 | sfnt/ -- the sfnt "driver" (see the drivers section below) |
| 764 | truetype/ -- the truetype driver |
| 765 | type1/ -- the type1 driver |
| 766 | shared/ -- some header files shared between drivers |
| 767 | |
| 768 | demos/ -- demos/tools |
| 769 | |
| 770 | docs/ -- documentation (a bit empty for now) |
| 771 | |
| 772 | ----------------------------------------------------------------------------------------- |
| 773 | Glyph Image Formats : |
| 774 | |
| 775 | Drivers are now able to register new glyph image formats within the library. |
| 776 | For now, the base layer supports of course bitmaps and vector outlines, but |
| 777 | one could imagine something different like colored bitmaps, bi-color |
| 778 | vectors or wathever else (Metafonts anyone ??). |
| 779 | |
| 780 | See the file `include/ftimage.h'. Note also that the type FT_Raster_Map is |
| 781 | gone, and is now replaced by FT_Bitmap, which should encompass all known |
| 782 | bitmap types. |
| 783 | |
| 784 | Each new image format must provide at least one "raster", i.e. a module |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 785 | capable of transforming the glyph image into a bitmap. It's also possible |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 786 | to change the default raster used for a given glyph image format. |
| 787 | |
| 788 | The default outline scan-converter now uses 128 levels of grays by default, |
| 789 | which tends to smooth many things. Note that the demo programs have been |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 790 | updated significantly in order to display these.. |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 791 | |
| 792 | |
| 793 | ----------------------------------------------------------------------------------------- |
| 794 | Build system : |
| 795 | |
| 796 | You still need GNU Make to build the library. The build system has been |
| 797 | very seriously re-vamped in order to provide things like : |
| 798 | |
| 799 | - automatic host platform detection (reverting to 'config/ansi' |
| 800 | if it is not detected, with pseudo-standard compilation flags) |
| 801 | |
| 802 | - the ability to compile from the Makefiles with very different and |
| 803 | exotic compilers. Note that linking the library can be difficult for |
| 804 | some platforms. |
| 805 | |
| 806 | For example, the file `config/win32/lcclib.bat' is invoked by the |
| 807 | build system to create the ".lib" file with LCC-Win32 because its |
| 808 | librarian has too many flaws to be invoked directly from the Makefile. |
| 809 | |
| 810 | Here's how it works : |
| 811 | |
| 812 | - the first time you type `make', the build system runs a series of |
| 813 | sub-makefiles in order to detect your host platform. It then dumps |
| 814 | what it found, and creates a file called `config.mk' in the current |
| 815 | directory. This is a sub-Makefile used to define many important Make |
| 816 | variables used to build the library. |
| 817 | |
| 818 | - the second time, the build system detects the `config.mk' then use it |
| 819 | to build the library. All object files go into 'obj' by default, as |
| 820 | well as the library file, but this can easily be changed. |
| 821 | |
| 822 | Note that you can run "make setup" to force another host platform detection |
| 823 | even if a `config.mk' is present in the current directory. Another solution |
| 824 | is simply to delete the file, then re-run make. |
| 825 | |
| 826 | Finally, the default compiler for all platforms is gcc (for now, this will |
| 827 | hopefully changed in the future). You can however specify a different |
| 828 | compiler by specifying it after the 'setup' target as in : |
| 829 | |
| 830 | gnumake setup lcc on Win32 to use the LCC compiler |
| 831 | gnumake setup visualc on Win32 to use Visual C++ |
| 832 | |
| 833 | See the file `config/<system>/detect.mk' for a list of supported compilers |
| 834 | for your platforms. |
| 835 | |
| 836 | It should be relatively easy to write new detection rules files and |
| 837 | config.mk.. |
| 838 | |
| 839 | Finally, to build the demo programs, go to `demos' and launch GNU Make, |
| 840 | it will use the `config.mk' in the top directory to build the test |
| 841 | programs.. |
| 842 | |
| 843 | ----------------------------------------------------------------------------------------- |
| 844 | Portability : |
| 845 | |
| 846 | In the previous beta, a single FT_System object was used to encompass |
| 847 | all low-level operations like thread synchronisation, memory management |
| 848 | and i/o access. This has been greatly simplified : |
| 849 | |
| 850 | - thread synchronisation has been dropped, for the simple reason that |
| 851 | the library is already re-entrant, and that if you really need two |
| 852 | threads accessing the same FT_Library, you should really synchronize |
| 853 | access to it yourself with a simple mutex. |
| 854 | |
| 855 | - memory management is performed through a very simple object called |
| 856 | "FT_Memory", which really is a table containing a table of pointers |
| 857 | to functions like malloc, realloc and free as well as some user data |
| 858 | (closure). |
| 859 | |
| 860 | - resources have disappeared (they created more problems than they |
| 861 | solved), and i/o management have been simplified greatly as a |
| 862 | result. Streams are defined through FT_Stream objects, which can |
| 863 | be either memory-based or disk-based. |
| 864 | |
| 865 | Note that each face has its own stream, which is closed only when |
| 866 | the face object is destroyed. Hence, a function like TT_Flush_Face |
| 867 | in 1.x cannot be directly supported. However, if you really need |
| 868 | something like this, you can easily tailor your own streams to achieve |
| 869 | the same feature at a lower level (and use FT_Open_Face instead of |
| 870 | FT_New_Face to create the face). |
| 871 | |
| 872 | See the file "include/ftsystem.h" for more details, as well as the |
| 873 | implementations found in "config/unix" and "config/ansi". |
| 874 | |
| 875 | |
| 876 | ----------------------------------------------------------------------------------------- |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 877 | Font Drivers : |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 878 | |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 879 | |
| 880 | The Font Driver interface has been modified in order to support |
| 881 | extensions & versioning. |
| 882 | |
| 883 | |
| 884 | The list of the font drivers that are statically linked to the |
| 885 | library at compile time is managed through a new configuration file |
| 886 | called `config/<platform>/ftmodule.h'. |
| 887 | |
| 888 | This file is autogenerated when invoking `make modules'. This target |
| 889 | will parse all sub-directories of 'src', looking for a "module.mk" |
| 890 | rules file, used to describe the driver to the build system. |
| 891 | |
| 892 | Hence, one should call `make modules' each time a font driver is added |
| 893 | or removed from the `src' directory. |
| 894 | |
| 895 | |
| 896 | Finally, this version provides a "pseudo-driver" in `src/sfnt'. This |
| 897 | driver doesn't support font files directly, but provides services used |
| 898 | by all TrueType-like font drivers. Hence, its code is shared between |
| 899 | the TrueType & OpenType font formats, and possibly more formats to |
| 900 | come if we're lucky.. |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 901 | |
| 902 | ----------------------------------------------------------------------------------------- |
| 903 | Extensions support : |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 904 | |
| 905 | The extensions support is inspired by the one found in 1.x. |
| 906 | |
| 907 | Now, each font driver has its own "extension registry", which lists |
| 908 | which extensions are available for the font faces managed by the driver. |
| 909 | |
| 910 | Extension ids are now strings, rather than 4-byte tags, as this is |
| 911 | usually more readable.. |
| 912 | |
| 913 | Each extension has: |
| 914 | - some data, associated to each face object |
| 915 | - an interface (table of function pointers) |
| 916 | |
| 917 | An extension that is format-specific should simply register itself |
| 918 | to the correct font driver. Here is some example code: |
| 919 | |
| 920 | // Registering an extensions |
| 921 | // |
| 922 | FT_Error FT_Init_XXXX_Extension( FT_Library library ) |
| 923 | { |
| 924 | FT_DriverInterface* tt_driver; |
| 925 | |
| 926 | driver = FT_Get_Driver( library, "truetype" ); |
| 927 | if (!driver) return FT_Err_Unimplemented_Feature; |
| 928 | |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 929 | return FT_Register_Extension( driver, &extension_class ); |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 930 | } |
| 931 | |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 932 | |
David Turner | 5951ce9 | 1999-12-29 00:53:44 +0000 | [diff] [blame] | 933 | // Implementing the extensions |
| 934 | // |
| 935 | FT_Error FT_Proceed_Extension_XXX( FT_Face face ) |
| 936 | { |
| 937 | FT_XXX_Extension ext; |
| 938 | FT_XXX_Extension_Interface ext_interface; |
| 939 | |
| 940 | ext = FT_Get_Extension( face, "extensionid", &ext_interface ); |
| 941 | if (!ext) return error; |
| 942 | |
| 943 | return ext_interface->do_it(ext); |
| 944 | } |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 945 | |