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