- Werner made an impressive work by reviewing and fixing the source code for 16-bitness - Thread-safety and reentrancy support is now coded in the engine. This is still untested though, one must specialize the component ttmutex.c before even trying this.., as well as change a configuration macro in its ft_conf.h ========================================================================== - Changed the structure of a TT_Outline. Now, coordinates are placed in a single array of TT_Vector elements, instead of two parallel arrays of TT_PCoordinates. (many changes in ttapi, ttobjs, ttgload, ttraster and ttinterp) - Introduced the new TT_MulDiv and TT_MulFix functions. TT_MulFix is used for 16.16 multiplications - re-designed the cache manager to get rid of ttlists. It is now smaller and simpler (it's now certain that no other component needs a generic list :-) - _big_ changes in the object management scheme : Execution contexts are not childs of a face anymore. Rather, they're now listed by the engine, and their arrays (i.e loadStack, stack and glyphIns) grow whenever necessary in function "Context_Load" This should save between 7 and 15 Kb per opened face (except for the first one, of course). Great when having a lot of opened fonts at once. Also, the twilight zone and storage area are now part of a TInstance and are thus shared by all glyphs of a same instance. - Corrected the Makefiles and freetype.c so that the extensions aren't compiled with the engine into a single object. Rather, they're now compiled separately, and added to 'libttf' so that only the applications that need them will really link them. Also made some changes to allow to compile statically the test program with electric fence, in order to track memory overwrites. So far, no error was detected !! :-) - All in all, code size was reduced, and performance slightly increased ========================================================================== - Fixed some problems within the interpreter in SWITCH mode. Rather than trying to track the bug, and potentially lose several hours, I defined some macros from the functional definitions, and moved the non-trivial opcode like SCFS, GC and MD out of the switch. This means that the macro shouldn't interfere with debugging, as they're only used for trivial stuff now. All problems seem fixed now. ( previous problems : error 0x408 (invalid reference) in many glyphs of common fonts like times.ttf, etc.. - Some functions are now "EXPORTED", though they're not defined in the file "freetype.h". They're reserved for extensions that should now be able to link separately with the single-object freetype.o These functions are : o Memory management, i.e. TT_Alloc and TT_Free o File and Frame access : in ttfile.c, os2file.c and ttmmap.c o The function Extension_Register, defined in ttextend.h, has been renamed TT_Register_Extension and is now exported. current extensions have been modified accordingly o The function LookUp_TrueType_Table, defined in ttload.c has been renamed to TT_LookUp_Table and is now exported. Of course, changes, etc... Extensions are still free to #include all relevant FreeType header files, however, they should not try to call functions that are not exported now. If some internal function call is dearly needed, please contact us to discuss the issue.. - Updated Load_TrueType_Any (in ttload.c), as well as updated the documentation for this function (called by TT_Get_Font_Data) - added a #define TT_MAKE_OPTION_SINGLE_OBJECT to all the "freetype.c" files, to make sure to export only the correct symbols.. - removed the implementation of the TT_Get_Byte, TT_Get_UShort and TT_Get_ULong function, replacing them with simple macros in ttfile.h (there isn't a good reason to have two functions which perform _exactly_ the same task but return values of different signess). - fixed TT_Get_Face_Metrics : two serious bugs.. Oopss :-( !! Credits go to Michal.. - the macro TT_MAKE_TAG referenced the 'Long' type, instead of 'long' ---------------------------------------------------------------------- Many relatively important changes : - Major code clean-up to eliminate warnings when compiling with Visual C++ (4.0 and 5.0, warning level 3 now ok) and Borland C++ (5.0, some warnings must be deselected from the 'ANSI' set though..) - Vertical information support. The glyph loader uses the vertical data found in the file to build big glyph metrics.. Loading is automatic. NOTE: The glyph is _still_ placed relative to the horizontal roman metrics. You'll have to translate it yourself to position it correctly for vertical layouts.. (translation vector is : ( vertBearingX - bbox.xMin, vertBearingY - bbox.yMax ) ) - new APIS : o TT_Get_Face_Metrics : used to returned glyph metrics expressed in font units, as found in the "hmtx" and/or "vmtx" tables.. Much faster than loading each glyph individually.. o TT_Get_Big_Glyph_Metrics : used to return a glyph's big metrics, which include vertical bearings and advance. - huge re-organisation in the bytecode interpreter, to introduce a giant "switch" statement to interpret opcodes. This usually produce smaller and faster code, though this is HIGHLY dependent on your compiler. You can revert back to the old "call-jump-table" by undefining the macro TT_CONFIG_OPTION_INTERPRETER_SWITCH in ttconfig.h - removed tterror.h. All its functions and macros were moved to ttdebug.h/c. Fixed all references in the sources and Makefiles. - removed "ttcommon.h" which is now useless with the single object compilation mode. NOTE : It may be a good idea to get rid of all those ".lo" relocatable objects when compiling freetype as a shared library on Unix !! - introduced an opcode counter. The "RunIns" function will return an error code when an infinite loop is detected. See macro MAX_RUNNABLE_OPCODES in ttinterp.c, currently set to 10000 - two new error codes : TT_Err_No_Vertical_Data 0x030 /* there is no vertical data in */ /* the file. Returned by the new */ /* TT_Get_Face_Metrics API */ TT_Err_Execution_Too_Long 0x411 /* infinite loop detected */ - introduced four new fields in TT_Big_Glyph_Metrics to reflect un-hinted scaled glyph metrics (useful for device-independent positioning) : linearHoriBearingX left side bearing - horizontal layouts linearHoriAdvance advance width - " linearVertBearingY top side bearing - vertical layouts linearVertAdvance advance height - " -------------------------------------------------------------------------- Some more planned changes : - REENTRANCY SUPPORT !!!!!!!!!! I just printed the code on _lots_ of sheets of paper to study it carefully.. - A set of regression tests. Will probably help locate some evil bugs for the next "big change". - re-organisation of the outline coordinates layout, going from two parallel arrays to one single array of points (i.e. x & y) structures. This will require huge concurrent changes in the scan-line converter, the interpreter as well as the glyph loader. However, it should help reduce code size while improving performance (Actually, this is already done in the Pascal source..) - support for third-order beziers in the scan-line converter. (an easy but necessary "evil" ;-) - introducing an special "outline path iterator" function, much like "Decompose_Curve" but slightly more generic. It will be used to : 1. scan-line convert the curve into a bit/pixmap 2. compute a shape's _exact_ bounding box ! 3. provide clients with an API that will let them convert FreeType outlines to wathever format they choose The current, and speedy, TT_Get_Outline_BBox API will probably be renamed TT_Get_Outline_CBox (for "Control BOX") and thus still be available to speed-expecting clients.. - some fix in the raster, because I found some weird cases where some drop-outs can be generated outside of the current bbox (future "cbox") ! Darn !! - a faster and better anti-alias routine (with the ability to select between 5 or 17 shades of gray..) - in general, as most of the code seems now rock solid, the C version will progressively become more C-ish in style, mainly in order to reduce code size. Performance is already satisfying but some tricks might be introduced too.. - some new apis for ttfile.h in order to "load" permanently a frame in memory. For memory mapped files, this will do nothing but return a pointer to it. Very similar to the current frame scheme but persistent and nesting.. This will get rid of some stupid copies and allocations (programs, location table, etc...) and will reduce heap memory comsuption in the case of memory-mapped files and ROM/memory-placed fonts.