Commit in reactos/lib/freetype on MAIN
ChangeLog+600-131.6 -> 1.7
Jamfile+1-11.6 -> 1.7
README+4-41.6 -> 1.7
README.ROS+2-21.5 -> 1.6
freetype.def+61.6 -> 1.7
builds/freetype.mk+1-11.5 -> 1.6
builds/unix/configure+1-11.6 -> 1.7
           /configure.ac+1-11.6 -> 1.7
builds/win32/visualc/freetype.dsp+6-61.3 -> 1.4
                    /freetype.vcproj+6-61.1 -> 1.2
                    /index.html+5-51.5 -> 1.6
devel/ftoption.h+101.5 -> 1.6
docs/formats.txt+139added 1.1
    /CHANGES+471.6 -> 1.7
    /VERSION.DLL+11.6 -> 1.7
include/freetype/freetype.h+90-221.6 -> 1.7
                /ftcache.h+10-91.5 -> 1.6
                /ftmm.h+193-31.4 -> 1.5
                /t1tables.h+1-11.5 -> 1.6
                /tttables.h+5-61.6 -> 1.7
                /tttags.h+9-61.4 -> 1.5
include/freetype/cache/ftcmru.h+3-31.3 -> 1.4
include/freetype/config/ftmodule.h+2-21.1 -> 1.2
                       /ftoption.h+101.8 -> 1.9
include/freetype/internal/ftmemory.h+681.5 -> 1.6
                         /ftstream.h+201.2 -> 1.3
                         /fttrace.h+11.2 -> 1.3
                         /psaux.h+15-71.5 -> 1.6
                         /tttypes.h+38-11.5 -> 1.6
include/freetype/internal/services/svmm.h+16-51.3 -> 1.4
src/autofit/afangles.c+92-41.3 -> 1.4
           /afdummy.c+8-61.1 -> 1.2
           /afglobal.c+1-11.3 -> 1.4
           /afhints.c+21-181.3 -> 1.4
           /afhints.h+6-41.3 -> 1.4
           /aflatin.c+117-351.3 -> 1.4
           /aflatin.h+4-31.3 -> 1.4
           /afloader.c+55-291.3 -> 1.4
           /afmodule.c+1-11.3 -> 1.4
           /aftypes.h+24-21.3 -> 1.4
src/autohint/ahhint.c+19-31.6 -> 1.7
            /ahmodule.c+16-101.2 -> 1.3
src/base/ftbbox.c+106-1001.2 -> 1.3
        /ftdbgmem.c+46-11.6 -> 1.7
        /ftgloadr.c+5-51.4 -> 1.5
        /ftglyph.c+81-591.6 -> 1.7
        /ftmm.c+72-11.4 -> 1.5
        /ftobjs.c+19-21.6 -> 1.7
        /ftstream.c+1-11.2 -> 1.3
        /ftutil.c+68-11.1 -> 1.2
        /ftexcept.c-1971.1 removed
        /fthash.c-2461.1 removed
        /ftlist.c-2171.1 removed
        /ftobject.c-3961.1 removed
        /ftsysio.c-1311.1 removed
        /ftsysmem.c-301.1 removed
src/bdf/bdf.h+2-21.2 -> 1.3
       /bdfdrivr.c+100-571.6 -> 1.7
       /bdfdrivr.h+3-11.5 -> 1.6
       /bdflib.c+3-31.5 -> 1.6
src/cache/ftcbasic.c+82-621.3 -> 1.4
         /ftccache.c+12-121.6 -> 1.7
         /ftccback.h+18-151.1 -> 1.2
         /ftccmap.c+43-271.6 -> 1.7
         /ftcglyph.c+29-181.4 -> 1.5
         /ftcimage.c+24-151.4 -> 1.5
         /ftcmanag.c+73-401.4 -> 1.5
         /ftcsbits.c+32-211.6 -> 1.7
src/cff/cffdrivr.c+33-301.5 -> 1.6
       /cffgload.c+25-271.6 -> 1.7
       /cffgload.h+1-51.2 -> 1.3
       /cffload.c+1-11.6 -> 1.7
       /cffobjs.c+103-821.5 -> 1.6
       /cffobjs.h+18-91.4 -> 1.5
       /cffparse.c+7-71.3 -> 1.4
src/cid/cidgload.c+33-301.6 -> 1.7
       /cidgload.h+5-51.1 -> 1.2
       /cidobjs.c+87-601.5 -> 1.6
       /cidobjs.h+18-131.1 -> 1.2
       /cidriver.c+20-211.5 -> 1.6
src/gzip/adler32.c+1-11.6 -> 1.7
        /ftgzip.c+1-11.4 -> 1.5
        /zconf.h+1-11.6 -> 1.7
        /zutil.c+1-11.6 -> 1.7
        /zutil.h+1-11.6 -> 1.7
src/lzw/zopen.c+41.1 -> 1.2
src/pcf/pcfdrivr.c+105-751.4 -> 1.5
       /pcfread.c+40-181.6 -> 1.7
       /pcfutil.c+3-31.2 -> 1.3
       /pcfutil.h+10-61.2 -> 1.3
src/pfr/pfrdrivr.c+34-311.5 -> 1.6
       /pfrobjs.c+72-631.6 -> 1.7
       /pfrobjs.h+11-111.2 -> 1.3
src/psaux/psobjs.c+13-91.6 -> 1.7
         /t1decode.c+32-161.5 -> 1.6
src/raster/ftraster.c+11-11.2 -> 1.3
src/sfnt/sfobjs.c+23-91.5 -> 1.6
        /ttload.c+60-231.6 -> 1.7
src/tools/cordic.py+8-71.1 -> 1.2
src/truetype/ttgxvar.c+1520added 1.1
            /ttgxvar.h+182added 1.1
            /Jamfile+2-21.1 -> 1.2
            /rules.mk+2-11.2 -> 1.3
            /truetype.c+9-51.1 -> 1.2
            /ttdriver.c+65-291.6 -> 1.7
            /ttgload.c+135-251.6 -> 1.7
            /ttobjs.c+24-91.6 -> 1.7
            /ttobjs.h+15-61.4 -> 1.5
            /ttpload.c+10-11.1 -> 1.2
src/type1/t1driver.c+6-41.5 -> 1.6
         /t1gload.c+1-11.6 -> 1.7
         /t1load.c+182-21.6 -> 1.7
         /t1load.h+10-11.1 -> 1.2
src/winfonts/winfnt.c+5-71.6 -> 1.7
+5444-2541
3 added + 6 removed + 105 modified, total 114 files
Update to FreeType 2.1.9

reactos/lib/freetype
ChangeLog 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ChangeLog	10 May 2004 17:48:21 -0000	1.6
+++ ChangeLog	18 Aug 2004 20:25:03 -0000	1.7
@@ -1,14 +1,601 @@
-2004-04-21  David Turner    <david@freetype.org>
+2004-06-23  Werner Lemberg  <wl@gnu.org>
 
-        * src/cff/cffobjs.c (cff_face_init): fixed a small memory leak
+	* include/freetype/internal/ftmemory.h [FT_DEBUG_MEMORY]: Declare
+	FT_QAlloc_Debug and FT_QRealloc_Debug.
 
-        * src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c:
-        removed compiler warnings
+	* src/base/ftutil.c (FT_QAlloc): Fix error and debug messages.
+	(FT_QRealloc): Call FT_QAlloc if original pointer is NULL.
+	Fix error message.
 
-        * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c,
-        src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c:
-        changed data arrays to "const" to avoid populating the ".data"
-        segment
+2004-06-23  David Turner  <david@freetype.org>
+
+	* include/freetype/internal/ftmemory.h, src/base/ftutil.c
+	(FT_QAlloc, FT_QRealloc), src/base/ftdbgmem.c (FT_QAlloc_Debug,
+	FT_QRealloc_Debug): New functions that perform allocation without
+	zero-ing out the corresponding blocks.
+
+	* include/freetype/internal/ftmemory.h (FT_MEM_QALLOC,
+	FT_MEM_QREALLOC, FT_MEM_QNEW, FT_MEM_QNEW_ARRAY,
+	FT_MEM_QRENEW_ARRAY, FT_QALLOC, FT_QREALLOC, FT_QNEW, FT_QNEW_ARRAY,
+	FT_QRENEW_ARRAY): New macros.
+
+	* src/base/ftstream.c (FT_Stream_EnterFrame): Use FT_QALLOC.
+	* src/gzip/ftgzip.c (FT_Stream_OpenGzip):  Use FT_QNEW_ARRAY.
+	* src/sfnt/sfobjs.c (tt_face_get_name): Use FT_QNEW_ARRAY.
+
+	* src/sfnt/ttload.c (tt_face_load_directory, tt_face_load_metrics,
+	tt_face_load_gasp): Use FT_QNEW_ARRAY.
+	(tt_face_load_kern): Use FT_QNEW_ARRAY.
+	Small optimization in the kerning table verifier; this speeds up
+	TrueType face opening by about 7%.
+	(tt_face_load_hdmx): Use FT_QNEW_ARRAY and FT_QALLOC.
+
+	* include/freetype/config/ftmodule.h: Changed the order of modules,
+	putting TrueType and Type 1 first.  This dramatically improves the
+	performance of face open/close operations.  For example, putting the
+	TrueType driver first in the list results in a 5x speedup when
+	opening `Vera.ttf'.
+
+	The very problem is that both the PCF and BDF drivers do a lot more
+	than necessary to detect that they cannot handle a font file.
+
+2004-06-22  Werner Lemberg  <wl@gnu.org>
+
+	* src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties,
+	pcf_get_metrics, pcf_get_bitmaps, pcf_get_encodings): Improve
+	debugging messages.
+
+	* src/pcf/pcfdrivr.c (FT_COMPOMENT): Move up.
+	(PCF_Face_Init): Simplify code.
+
+	* src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
+
+	* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start),
+	src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/.
+
+	* src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs.
+	Set `default_glyph'.
+	(BDF_Glyph_Load): Use `default_glyph' for undefined glyph.
+
+	* docs/CHANGES: Updated.
+
+2004-06-21  Werner Lemberg  <wl@gnu.org>
+
+	* docs/CHANGES: Updated.
+
+2004-06-21  David Turner  <david@freetype.org>
+
+	* src/truetype/ttgload.c (TT_Process_Simple_Glyph,
+	load_truetype_glyph): Don't access (unrounded)
+	`TT_Size.root.metrics' but (rounded) `TT_Size.metrics'.  This fixes
+	a scaling bug that caused incorrect rendering when the bytecode
+	interpreter was enabled.
+
+2004-06-14  Huw D M Davies  <h.davies1@physics.ox.ac.uk>
+
+	* src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem
+	based on pixel_width and pixel_height.
+	(FNT_Size_Set_Pixels): Updated.
+
+2004-06-14  Werner Lemberg  <wl@gnu.org>
+
+	* src/lzw/zopen.c: Comment out inclusion of signal.h and unistd.h.
+	Reported by Hyv�rinen Jyrki Juhani.
+
+2004-06-11  Werner Lemberg  <wl@gnu.org>
+
+	* docs/CHANGES: Updated.
+
+2004-06-10  David Turner  <david@freetype.org>
+
+	* src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
+	src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
+	Obsolete.
+
+	* src/raster/ftraster.c (Alignment, PAlignment): New union to fix
+	problems with 64bit systems.
+	(AlignProfileSize): Use it.
+
+2004-06-08  David Turner  <david@freetype.org>
+
+	* include/freetype/freetype.h (FT_GlyphMetrics): Move `lsb_delta'
+	and `rsb_delta' elements to...
+	(FT_GlyphSlotRec): Here to retain binary compatibility with older
+	FreeType versions.
+	Update all users.
+
+	* src/sfnt/sfobjs.c (tt_face_get_name): Remove compiler warning.
+
+	* src/winfonts/winfnt.c (FNT_Load_Glyph): Add missing initialization
+	of slot->metrics.width and slot->metrics.height when loading a
+	Windows FNT glyph.  Thanks to Huw Davies.
+
+	* include/freetype/cache/ftcmru.h (FTC_MruNode_CompareFunc): Change
+	return type to FT_Bool.
+
+	* src/cache/ftbasic.c (ftc_basic_family_compare): Change return
+	type to FT_Bool.
+
+	* src/cache/ftccache.c (FTC_Cache_Init, ftc_cache_init): Make
+	the former call the latter, not vice versa.
+	(FTC_Cache_Done, ftc_cache_done): Ditto.
+
+	* src/cache/ftcglyph.c (FTC_GNode_Compare, ftc_gnode_compare): Make
+	the former call the latter, not vice versa.
+	(FTC_GCache_Init, ftc_gcache_init): Ditto.
+	(FTC_GCache_Done, ftc_gcache_done): Ditto.
+
+	* src/cache/ftcimage.c (FTC_INode_Free, ftc_inode_free): Make the
+	former call the latter, not vice versa.
+	(FTC_INode_Weight, ftc_inode_weight): Ditto.
+
+	* src/cache/ftcmanag.c (ftc_size_node_compare,
+	ftc_size_node_compare_faceid, ftc_face_node_compare): Change return
+	type to FT_Bool.
+
+	* src/cache/ftcsbits.c (FTC_SNode_Free, ftc_snode_free): Make the
+	former call the latter, not vice versa.
+	(FTC_SNode_Weight, ftc_snode_weight): Ditto.
+	(FTC_SNode_Compare, ftc_snode_compare): Ditto.
+
+	* src/cache/ftcsbits.c: Fix some bugs and inefficiencies in the cache
+	sub-system.
+
+2004-06-05  Werner Lemberg  <wl@gnu.org>
+
+	* src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and
+	`rsb_delta' in slot->metrics and tune side bearings slightly.
+
+2004-06-04  Werner Lemberg  <wl@gnu.org>
+
+	* docs/CHANGES: Updated.
+
+2004-06-04  David Chester  <davidchester@gmx.net>
+
+	Improve inter-letter spacing for autohinted glyphs.
+
+	* include/freetype/freetype.h (FT_Glyph_Metrics): Add elements
+	`lsb_delta' and `rsb_delta'.
+
+	* src/autohint/ahhint.c (ah_hinter_load): Set `lsb_delta' and
+	`rsb_delta' in slot->metrics and tune side bearings slightly.
+
+2004-06-04  David Turner  <david@freetype.org>
+
+	* src/autofit/*: Important fixes to the auto-fitter.  The output
+	now seems to be 100% equivalent to the auto-hinter, while being
+	about 2% faster (which proves that script-specific algorithm
+	selection isn't a performance problem).
+
+	To test it, change `autohint' to `autofit' in
+	<freetype/config/ftmodule.h> and recompile.
+
+	A few more testing is needed before making this the official
+	auto-hinting module.
+
+2004-06-02  Werner Lemberg  <wl@gnu.org>
+
+	* src/truetype/ttgload.c (compute_glyph_metrics): Fix compiler
+	warnings.
+
+2004-06-01  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/sfobjs.c (tt_face_get_name): Make sure that an English
+	name record for the Apple platform is preferred to a non-English
+	entry for the Microsoft platform.  Problem reported by HANDA
+	Ken'ichi.
+
+2004-05-19  George Williams  <gww@silcom.com>
+
+	* src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): New
+	auxiliary functions.
+	(T1_Get_MM_Var): Provide axis tags.
+	Use mm_axis_unmap and mm_weights_unmap to provide default values
+	for design and normalized axis coordinates.
+
+	* include/freetype/t1tables.h (PS_DesignMapRec): Change type of
+	`design_points' to FT_Long.
+	Update all users.
+
+2004-05-17  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftbbox.c (BBox_Conic_Check): Fix boundary cases.
+	Reported by Mikey Anbary <manbary@vizrt.com>.
+
+2004-05-15  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/sfobjs.c (sfnt_done_face): Free face->postscript_name.
+
+2004-05-15  George Williams  <gww@silcom.com>
+
+	* src/sfnt/ttload.c (tt_face_load_max_profile): Always set
+	face->root.num_glyphs.
+
+2004-05-14  Masatake YAMATO  <jet@gyve.org>
+	    George Williams  <gww@silcom.com>
+
+	* src/sfnt/ttload.c (sfnt_dir_check): Handle `bhed' properly.
+
+2004-05-14  Werner Lemberg  <wl@gnu.org>
+
+	* src/cache/ftcbasic.c (ftc_basic_family_compare,
+	ftc_basic_family_init, ftc_basic_family_get_count,
+	ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
+	ftc_basic_gnode_compare_faceid): Adjust parameters and return types
+	to prototypes given in header files from include/freetype/cache.
+	Use casts to proper types locally.
+	(ftc_basic_image_family_class, ftc_basic_image_cache_class,
+	ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
+	casts.
+
+	* src/cache/ftccback.h: Adjust parameters and return types to
+	prototypes given in header files from include/freetype/cache.
+
+	* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
+	ftc_inode_weight): Adjust parameters and return types to prototypes
+	given in header files from include/freetype/cache.  Use casts to
+	proper types locally.
+
+	* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
+	ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
+	types to prototypes given in header files from
+	include/freetype/cache.  Use casts to proper types locally.
+
+	* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
+	ftc_cmap_node_weight, ftc_cmap_node_compare,
+	ftc_cmap_node_remove_faceid): Adjust parameters and return types to
+	prototypes given in header files from include/freetype/cache.  Use
+	casts to proper types locally.
+	(ftc_cmap_cache_class): Remove casts.
+
+	* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
+	ftc_gcache_done): Adjust parameters and return types to prototypes
+	given in header files from include/freetype/cache.  Use casts to
+	proper types locally.
+
+	* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
+	ftc_size_node_init, ftc_size_node_reset,
+	ftc_size_node_compare_faceid, ftc_face_node_init,
+	ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
+	return types to prototypes given in header files from
+	include/freetype/cache.  Use casts to proper types locally.
+
+	(ftc_size_list_class, ftc_face_list_class): Remove casts.
+
+2004-05-13  Werner Lemberg  <wl@gnu.org>
+
+	* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
+	Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
+	(autohint_module_class): Remove casts.
+
+	* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
+	ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
+	ft_outline_glyph_done, ft_outline_glyph_copy,
+	ft_outline_glyph_transform, ft_outline_glyph_bbox,
+	ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
+	to FT_XXXGlyph locally.
+	Use FT_CALLBACK_DEF throughout.
+	(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
+
+	* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
+	bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
+	and do a cast to BDF_CMap locally.
+	(bdf_cmap_class): Remove casts.
+
+2004-05-12  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffgload.h (CFF_Builder): Remove `error'.
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace
+	`Memory_Error' with `Fail' und update all users.
+
+2004-05-11  Werner Lemberg  <wl@gnu.org>
+
+	* include/freetype/internal/psaux.h (T1_ParseState): New
+	enumeration.
+	(T1_BuilderRec): Replace `path_begun' with `parse_state'.
+	Remove `error'.
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Replace
+	`Memory_Error' with `Fail' and update all users.
+	Don't use `builder->error'.
+	Replace `path_begun' with `parse_state' and check parsing states.
+
+	* src/psaux/psobjs.c (t1_builder_init, t1_builder_start_point):
+	Replace `path_begun' with `parse_state' and check parsing states.
+
+2004-05-10  George Williams  <gww@silcom.com>
+
+	* src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case
+	of error -- `avar' is optional so we can't rely on tt_done_blend
+	being called automatically.
+
+2004-05-09  George Williams  <gww@silcom.com>
+
+	* src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix
+	error handling.
+
+2004-05-07  Werner Lemberg  <wl@gnu.org>
+
+	* src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
+	pfr_face_done, pfr_face_get_kerning, pfr_slot_init, pfr_slot_done,
+	pfr_slot_load): Don't use PFR_XXX but FT_XXX arguments which are
+	typecast to the proper PFR_XXX types within the function.
+	Update code accordingly.
+
+	* src/pfr/pfrdrivr.c (pfr_get_kerning, pfr_get_advance,
+	pfr_get_metrics, pfr_get_service): Don't use PFR_XXX but FT_XXX
+	arguments which are typecast to the proper PFR_XXX types within the
+	function.
+	Update code accordingly.
+	Use FT_CALLBACK_DEF throughout.
+	(pfr_metrics_service_rec, pfr_driver_class): Remove casts.
+
+2004-05-06  Masatake YAMATO  <jet@gyve.org>
+
+	* src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
+	(*): Rename local variable OffsetToData to offsetToData.
+
+2004-05-06  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffobjs.c (cff_size_done, cff_size_init, cff_size_reset,
+	cff_slot_done, cff_slot_init, cff_face_init, cff_face_done): Access
+	root fields directly.
+	* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
+
+	* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
+	frame before calling TT_Vary_Get_Glyph_Deltas.
+
+	* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
+	consistency.
+	(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
+	pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
+	are typecast to the proper PCF_XXX types within the function.
+	Update code accordingly.
+	(pcf_cmap_class): Remove casts.
+	(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
+	PCF_XXX but FT_XXX arguments which are typecast to the proper
+	PCF_XXX types within the function.
+	Update code accordingly.
+	Use FT_CALLBACK_DEF throughout.
+	(PCF_Set_Point_Size): New wrapper function.
+	(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
+	(pcf_driver_class): Remove casts.
+
+2004-05-04  Steve Hartwell  <shspamsink@comcast.net>
+
+	* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
+
+2004-05-04  Werner Lemberg  <wl@gnu.org>
+
+	* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
+	BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
+	are typecast to the proper BDF_XXX types within the function.
+	Update code accordingly.
+	Use FT_CALLBACK_DEF throughout.
+	(BDF_Set_Point_Size): New wrapper function.
+	(bdf_driver_class): Remove casts.
+
+	* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
+	Don't use CFF_XXX but FT_XXX arguments which are typecast to the
+	proper CFF_XXX types within the function.
+	Update code accordingly.
+	Use FT_CALLBACK_DEF throughout.
+	(cff_driver_class): Remove casts.
+
+	* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
+	cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
+	cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
+	Don't use CFF_XXX but FT_XXX arguments which are typecast to the
+	proper CFF_XXX types within the function.
+	Update code accordingly.
+	(cff_point_size_reset): New wrapper function.
+
+	* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
+	cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
+	cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
+	Don't use CID_XXX but FT_XXX arguments which are typecast to the
+	proper CID_XXX types within the function.
+	Update code accordingly.
+	(cid_point_size_reset): New wrapper function.
+
+	* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
+	Don't use CID_XXX but FT_XXX arguments which are typecast to the
+	proper CID_XXX types within the function.
+	Update code accordingly.
+
+	* src/cid/cidriver.c (cid_get_interface):
+	Don't use CID_XXX but FT_XXX arguments which are typecast to the
+	proper CID_XXX types within the function.
+	Update code accordingly.
+	Use FT_CALLBACK_DEF.
+	(t1cid_driver_class): Remove casts.
+
+	* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
+	* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
+	variables (this is done later).
+	(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
+	(TT_Get_MM_Var): Fix size for `fvar_fields'.
+	(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
+	correctly.
+
+	* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
+	current size is zero.
+
+2004-05-03  Steve Hartwell  <shspamsink@comcast.net>
+
+	* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
+	tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
+	tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
+	typecast to the proper TT_XXX types within the function.
+	Update code accordingly.
+
+	* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
+	Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
+	FT_XXX arguments which are typecast to the proper TT_XXX types
+	within the function.
+	Update code accordingly.
+	(tt_driver_class): Remove casts.
+
+2004-05-02  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'
+	is not NULL.  Reported by Gordon Childs <gchilds@quickcut.com.au>.
+
+2004-04-29  Werner Lemberg  <wl@gnu.org>
+
+	* docs/formats.txt: Add more information on PFR format.
+
+2004-04-28  Werner Lemberg  <wl@gnu.org>
+
+	* docs/formats.txt: New file.
+	* docs/CHANGES: Updated.
+
+2004-04-28  Masatake YAMATO  <jet@gyve.org>
+
+	* include/freetype/internal/tttypes.h (GX_BlendRec_)
+	[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Fix a typo.
+
+	* src/truetype/ttgxvar.h (GX_BlendRec_): Fix a typo.
+
+2004-04-27  Masatake YAMATO  <jet@gyve.org>
+
+	* src/truetype/ttgxvar.h: Use FT_LOCAL instead of FT_LOCAL_DEF
+	for function declarations.
+
+2004-04-25  George Williams  <gww@silcom.com>
+
+	* src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix typo.
+
+2004-04-25  Werner Lemberg  <wl@gnu.org>
+
+	* src/truetype/Jamfile, docs/CHANGES: Updated.
+
+2004-04-24  Werner Lemberg  <wl@gnu.org>
+
+	* src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
+	* src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
+	* src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
+	Use FT_BEGIN_HEADER and FT_END_HEADER.
+	Use FT_LOCAL.
+
+2004-04-24  George Williams  <gww@silcom.com>
+
+	Add support for Apple's distortable font technology (in GX fonts).
+
+	* devel/ftoption.h, include/freetype/config/ftoption.h
+	(TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro.
+
+	* include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style,
+	FT_MM_Var): New structures.
+	(FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
+	FT_Set_Var_Blend_Coordinates): New function declarations.
+
+	* include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func,
+	FT_Set_Var_Design_Func): New typedefs.
+	Update MultiMasters service.
+
+	* include/freetype/internal/tttypes.h
+	[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H.
+	(GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef.
+	(TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend'
+	and `blend'.
+
+	* include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New
+	macros.
+
+	* include/freetype/internal/fttrace.h: Add `ttgxvar'.
+
+	* src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
+	FT_Set_Var_Blend_Coordinates): New functions.
+
+	* src/sfnt/sfobjs.c (sfnt_load_face)
+	[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS
+	flag for GX var fonts.
+
+	* src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files.
+
+	* src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
+	ttgxvar.c.
+
+	* src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
+	FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h.
+	(tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
+	New service.
+	(tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
+
+	* src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
+	ttgxvar.h.
+	(TT_Process_Simple_Glyph, load_truetype_glyph)
+	[TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts.
+
+	* src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
+	ttgxvar.h.
+	(tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
+	tt_done_blend.
+
+	* src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
+	ttgxvar.h.
+	(tt_face_load_cvt)  [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
+	tt_face_vary_cvt.
+
+	* src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c.
+
+	* src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var
+	and T1_Set_Var_Design.
+
+	* src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros.
+	(T1_Get_MM_Var, T1_Set_Var_Design): New functions.
+
+	* src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
+	function declarations.
+
+2004-04-23  Werner Lemberg  <wl@gnu.org>
+
+	* include/freetype/ftcache.h (FT_Get_CharMap_Index): Rename
+	declaration and move to...
+	* include/freetype/freetype.h (FT_Get_Charmap_Index): Here.
+	(FREETYPE_PATCH): Set to 9.
+
+	* src/base/ftobjs.c (FT_Get_Charmap_Index): New function.
+
+	* builds/unix/configure.ac (version_info): Set to 9:7:3.
+	* builds/unix/configure: Updated.
+
+	* builds/win32/visualc/index.html,
+	builds/win32/visualc/freetype.dsp,
+	builds/win32/visualc/freetype.vcproj: s/218/219/.
+
+	* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
+	s/2.1.8/2.1.9/.
+
+	* docs/CHANGES, docs/VERSION.DLL: Updated.
+
+2004-04-21  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffparse.c (cff_parser_run), src/psaux/psobjs.c
+	(ps_parser_load_field): Use FT_CHAR_BIT.
+
+2004-04-21  David Turner  <david@freetype.org>
+
+
+	* Version 2.1.8 released.
+	=========================
+
+
+	* src/cff/cffobjs.c (cff_face_init): Fix a small memory leak.
+
+	* src/autofit/afloader.c (af_loader_load_g), src/autofit/afmodule.c
+	(af_autofitter_load_glyph), src/base/ftdebug.c (FT_Trace_Get_Name):
+	Remove compiler warnings.
+
+	* src/autofit/aftypes.h: Undefine AF_DEBUG.
+
+	* src/lzw/zopen.c (rmask), src/pcf/pcfdrivr.c (pcf_service_bdf,
+	pcf_services), src/pcf/pcfread.c (tableNames), src/psaux/psobjs.c
+	(ft_char_table), src/type42/t42drivr.c (t42_service_glyph_dict,
+	t42_service_ps_font_name): Decorate data arrays with `const' to
+	avoid populating the `.data' segment.
+
+	* src/lzw/Jamfile: New file.
 
 2004-04-20  Werner Lemberg  <wl@gnu.org>
 
@@ -32,7 +619,7 @@
 	* src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.
 
 	* src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
-	`static.'.
+	`static'.
 	Remove unused function `RepadBitmap'.
 	* src/pcf/pcfdrivr.c: Don't include pcfutil.h.
 
@@ -150,8 +737,8 @@
 	Handle broken FNT files which don't have a trailing NULL byte
 	in the face name string.
 
-	* src/winfnt/winfnt.h (FNT_FontRec): New member `family_name'.
-	* src/winfnt/winfnt.c (fnt_font_done): Free font->family_name.
+	* src/winfonts/winfnt.h (FNT_FontRec): New member `family_name'.
+	* src/winfonts/winfnt.c (fnt_font_done): Free font->family_name.
 	(FNT_Face_Init): Append a final zero byte to the font face name.
 
 2004-03-30  Werner Lemberg  <wl@gnu.org>
@@ -1237,7 +1824,7 @@
 	(FT_Load_Glyph): Update computation of linearHoriAdvance and
 	linearVertAdvance.
 
-	* src/true/type/ttinterp.c (Update_Max): Use FT_REALLOC.
+	* src/truetype/ttinterp.c (Update_Max): Use FT_REALLOC.
 
 2003-11-22  David Turner  <david@freetype.org>
 
@@ -6941,7 +7528,7 @@
 	(tt_driver_class): Add it.
 	* src/type1/t1driver.c (Get_Next_Char): New function.
 	(t1_driver_class): Add it.
-	* src/winfnt/winfnt.c (FNT_Get_Next_Char): New function.
+	* src/winfonts/winfnt.c (FNT_Get_Next_Char): New function.
 	(winfnt_driver_class): Add it.
 
 	* src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for

reactos/lib/freetype
Jamfile 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- Jamfile	10 May 2004 17:48:21 -0000	1.6
+++ Jamfile	18 Aug 2004 20:25:04 -0000	1.7
@@ -148,7 +148,7 @@
 
 actions RefDoc
 {
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.8 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
+  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.9 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
 }
 
 RefDoc  refdoc ;

reactos/lib/freetype
README 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- README	10 May 2004 17:48:22 -0000	1.6
+++ README	18 Aug 2004 20:25:04 -0000	1.7
@@ -9,7 +9,7 @@
   is called `libttf'.  They are *not* compatible!
 
 
-  FreeType 2.1.8
+  FreeType 2.1.9
   ==============
 
   Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION.
@@ -19,9 +19,9 @@
   Note  that  the FreeType  2  documentation  is  now available  as  a
   separate package from our sites.  See:
 
-    ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.bz2
-    ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.gz
-    ftp://ftp.freetype.org/pub/freetype2/ftdoc218.zip
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.bz2
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.gz
+    ftp://ftp.freetype.org/freetype/freetype2/ftdoc219.zip
 
 
   Bugs

reactos/lib/freetype
README.ROS 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- README.ROS	10 May 2004 17:48:22 -0000	1.5
+++ README.ROS	18 Aug 2004 20:25:04 -0000	1.6
@@ -1,7 +1,7 @@
 CREDITS
 
 The code in this tree is based (it is actually an exact copy with some
-ReactOS specific extra files) on the FreeType library, version 2.1.8.
+ReactOS specific extra files) on the FreeType library, version 2.1.9.
 It was written and is being maintained by the FreeType team. The projects
 website is http://www.freetype.org.
 
@@ -66,4 +66,4 @@
 After testing, you can commit the new/changed files to CVS. ALthough files
 config.mk and freetype.def are generated, they should be included in CVS.
 
-$Id: README.ROS,v 1.5 2004/05/10 17:48:22 gvg Exp $
+$Id: README.ROS,v 1.6 2004/08/18 20:25:04 gvg Exp $

reactos/lib/freetype
freetype.def 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- freetype.def	10 May 2004 17:48:22 -0000	1.6
+++ freetype.def	18 Aug 2004 20:25:04 -0000	1.7
@@ -31,6 +31,7 @@
 FT_FloorFix
 FT_Free
 FT_Get_Char_Index
+FT_Get_Charmap_Index
 FT_Get_CMap_Language_ID
 FT_Get_First_Char
 FT_Get_Glyph_Name
@@ -93,6 +94,8 @@
 FT_Outline_Reverse
 FT_Outline_Transform
 FT_Outline_Translate
+FT_QAlloc
+FT_QRealloc
 FT_Raccess_Get_DataOffsets
 FT_Raccess_Get_HeaderInfo
 FT_Raccess_Guess
@@ -161,9 +164,12 @@
 FT_Matrix_Invert
 FT_Matrix_Multiply
 ft_outline_glyph_class
+FT_Get_MM_Var
 FT_Get_Multi_Master
 FT_Set_MM_Blend_Coordinates
 FT_Set_MM_Design_Coordinates
+FT_Set_Var_Blend_Coordinates
+FT_Set_Var_Design_Coordinates
 FT_Get_PFR_Advance
 FT_Get_PFR_Kerning
 FT_Get_PFR_Metrics

reactos/lib/freetype/builds
freetype.mk 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- freetype.mk	10 May 2004 17:48:22 -0000	1.5
+++ freetype.mk	18 Aug 2004 20:25:04 -0000	1.6
@@ -254,7 +254,7 @@
 refdoc:
 	python $(SRC_DIR)/tools/docmaker/docmaker.py \
                --prefix=ft2                          \
-               --title=FreeType-2.1.8                \
+               --title=FreeType-2.1.9                \
                --output=$(DOC_DIR)                   \
                $(PUBLIC_DIR)/*.h                     \
                $(PUBLIC_DIR)/config/*.h              \

reactos/lib/freetype/builds/unix
configure 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- configure	10 May 2004 17:48:23 -0000	1.6
+++ configure	18 Aug 2004 20:25:04 -0000	1.7
@@ -1720,7 +1720,7 @@
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:6:3'
+version_info='9:7:3'
 
 ft_version=`echo $version_info | tr : .`
 

reactos/lib/freetype/builds/unix
configure.ac 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- configure.ac	10 May 2004 17:48:23 -0000	1.6
+++ configure.ac	18 Aug 2004 20:25:05 -0000	1.7
@@ -8,7 +8,7 @@
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:6:3'
+version_info='9:7:3'
 AC_SUBST([version_info])
 ft_version=`echo $version_info | tr : .`
 AC_SUBST([ft_version])

reactos/lib/freetype/builds/win32/visualc
freetype.dsp 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- freetype.dsp	10 May 2004 17:48:25 -0000	1.3
+++ freetype.dsp	18 Aug 2004 20:25:05 -0000	1.4
@@ -54,7 +54,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"
 
@@ -78,7 +78,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"
 
@@ -103,7 +103,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218MT_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"
 
@@ -127,7 +127,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218MT.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"
 
@@ -152,7 +152,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
-# ADD LIB32 /out:"..\..\..\objs\freetype218ST.lib"
+# ADD LIB32 /out:"..\..\..\objs\freetype219ST.lib"
 # SUBTRACT LIB32 /nologo
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
@@ -178,7 +178,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218ST_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219ST_D.lib"
 
 !ENDIF 
 

reactos/lib/freetype/builds/win32/visualc
freetype.vcproj 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- freetype.vcproj	10 May 2004 17:48:25 -0000	1.1
+++ freetype.vcproj	18 Aug 2004 20:25:05 -0000	1.2
@@ -41,7 +41,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218.lib"
+				OutputFile="..\..\..\objs\freetype219.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -94,7 +94,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218MT.lib"
+				OutputFile="..\..\..\objs\freetype219MT.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -147,7 +147,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218ST.lib"/>
+				OutputFile="..\..\..\objs\freetype219ST.lib"/>
 			<Tool
 				Name="VCMIDLTool"/>
 			<Tool
@@ -197,7 +197,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218_D.lib"
+				OutputFile="..\..\..\objs\freetype219_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -248,7 +248,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218ST_D.lib"
+				OutputFile="..\..\..\objs\freetype219ST_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -299,7 +299,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype218MT_D.lib"
+				OutputFile="..\..\..\objs\freetype219MT_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>

reactos/lib/freetype/builds/win32/visualc
index.html 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- index.html	10 May 2004 17:48:25 -0000	1.5
+++ index.html	18 Aug 2004 20:25:05 -0000	1.6
@@ -12,14 +12,14 @@
 
 <p>This directory contains a project files for Visual C++, named
 <tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-will compile the following libraries from the FreeType 2.1.8 sources:</p>
+will compile the following libraries from the FreeType 2.1.9 sources:</p>
 
 <ul>
   <pre>
-    freetype218.lib     - release build; single threaded
-    freetype218_D.lib   - debug build;   single threaded
-    freetype218MT.lib   - release build; multi-threaded
-    freetype218MT_D.lib - debug build;   multi-threaded</pre>
+    freetype219.lib     - release build; single threaded
+    freetype219_D.lib   - debug build;   single threaded
+    freetype219MT.lib   - release build; multi-threaded
+    freetype219MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP

reactos/lib/freetype/devel
ftoption.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- ftoption.h	10 May 2004 17:48:25 -0000	1.5
+++ ftoption.h	18 Aug 2004 20:25:05 -0000	1.6
@@ -484,6 +484,16 @@
 
 
   /*************************************************************************/
+  /*                                                                       */
+  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */
+  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */
+  /* and avar tables).  This has many similarities to Type 1 Multiple      */
+  /* Masters support.                                                      */
+  /*                                                                       */
+#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+
+  /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/

reactos/lib/freetype/docs
formats.txt added at 1.1
diff -N formats.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ formats.txt	18 Aug 2004 20:25:05 -0000	1.1
@@ -0,0 +1,139 @@
+This file contains a list of various font formats.  It gives the
+reference document and whether it is supported in FreeType 2.
+
+
+  file type:
+    The only special case is `MAC'; on older Mac OS versions, a `file'
+    is stored as a data and a resource fork, this is, within two
+    separate data chunks.  In all other cases, the font data is stored
+    in a single file.
+
+  wrapper format:
+    The format used to represent the font data.  In the table below it
+    is used only if the font format differs.  Possible values are
+    `SFNT' (binary), `PS' (a text header, followed by binary or text
+    data), and `LZW' (compressed with either `gzip' or `compress').
+
+  font format:
+    How the font is to be accessed, possibly after converting the file
+    type and wrapper format into a generic form.  Bitmap formats are
+    `BDF', `PCF', and one form of `WINFNT'; all others are vector
+    formats.
+
+  font type:
+    Sub-formats of the font format.  `SBIT' and `MACSBIT' are bitmap
+    formats, `MM' and `VAR' support optical axes.
+
+  glyph access:
+    If not specified, the glyph access is `standard' to the font
+    format.  Values are `CID' for CID-keyed fonts, `SYNTHETIC' for
+    fonts which are modified versions of other fonts by means of a
+    transformation matrix, `COLLECTION' for collecting multiple fonts
+    (sharing most of the data) into a single file, and `TYPE_0' for PS
+    fonts which are to be accessed in a tree-like structure.
+
+  FreeType driver:
+    The module in the FreeType library which handles the specific font
+    format.  A missing entry means that FreeType doesn't support the
+    font format (yet).
+
+
+Please send additions and/or corrections to wl@gnu.org or to the
+FreeType developer's list at devel@freetype (for subscribers only).  If
+you can provide a font example for a format which isn't supported yet
+please send a mail too.
+
+
+file wrapper font   font    glyph      FreeType reference
+type format  format type    access     driver   documents
+----------------------------------------------------------------------------
+
+---  ---     BDF    ---     ---        bdf      5005.BDF_Spec.pdf, X11
+
+
+---  SFNT    PS     TYPE_1  ---        ---      Type 1 GX Font Format
+                                                (for the Mac)
+MAC  SFNT    PS     TYPE_1  ---        ---      Type 1 GX Font Format
+                                                (for the Mac)
+---  SFNT    PS     TYPE_1  CID        ---      5180.sfnt.pdf (for the Mac)
+MAC  SFNT    PS     TYPE_1  CID        ---      5180.sfnt.pdf (for the Mac)
+---  SFNT    PS     CFF     ---        cff      OT spec, 5176.CFF.pdf
+                                                (`OTTO' format)
+MAC  SFNT    PS     CFF     ---        cff      OT spec, 5176.CFF.pdf
+                                                (`OTTO' format)
+---  SFNT    PS     CFF     CID        cff      OT spec, 5176.CFF.pdf
+MAC  SFNT    PS     CFF     CID        cff      OT spec, 5176.CFF.pdf
+---  SFNT    PS     CFF     SYNTHETIC  ---      OT spec, 5176.CFF.pdf
+MAC  SFNT    PS     CFF     SYNTHETIC  ---      OT spec, 5176.CFF.pdf
+---  SFNT    TT     SBIT    ---        ---      XFree86? (bitmaps only;
+                                                `head' table)
+---  SFNT    TT     MACSBIT ---        sfnt     OT spec (for the Mac;
+                                                bitmaps only; `bhed' table)
+MAC  SFNT    TT     MACSBIT ---        sfnt     OT spec (for the Mac;
+                                                bitmaps only; `bhed' table)
+---  SFNT    TT     ---     ---        truetype OT spec (`normal' TT font)
+MAC  SFNT    TT     ---     ---        truetype OT spec (`normal' TT font)
+MAC  SFNT    TT     VAR     ---        truetype GX spec (`?var' tables)
+---  SFNT    TT     ---     COLLECTION truetype OT spec (this can't be CFF)
+MAC  SFNT    TT     ---     COLLECTION truetype OT spec (this can't be CFF)
+
+
+---  ---     PS     TYPE_1  ---        type1    T1_SPEC.pdf
+                                                (`normal' Type 1 font)
+MAC  ---     PS     TYPE_1  ---        type1    T1_SPEC.pdf
+                                                (`normal' Type 1 font)
+---  ---     PS     TYPE_1  CID        cid      PLRM.pdf (CID Font Type 0;
+                                                Type 9 font)
+---  ---     PS     MM      ---        type1    5015.Type1_Supp.pdf
+                                                (Multiple Masters)
+---  ---     PS     CFF     ---        cff      5176.CFF.pdf (`pure' CFF)
+---  ---     PS     CFF     CID        cff      5176.CFF.pdf (`pure' CFF)
+---  ---     PS     CFF     SYNTHETIC  ---      5176.CFF.pdf (`pure' CFF)
+---  PS      PS     CFF     ---        ---      PLRM.pdf (Type 2) [1]
+---  PS      PS     CFF     CID        ---      PLRM.pdf (Type 2) [1]
+---  PS      PS     CFF     SYNTHETIC  ---      PLRM.pdf (Type 2) [1]
+---  ---     PS     ---     TYPE_0     ---      PLRM.pdf
+---  ---     PS     TYPE_3  ---        ---      PLRM.pdf (never supported)
+---  ---     PS     TYPE_3  CID        ---      PLRM.pdf (CID Font Type 1;
+                                                Type 10 font; never supported)
+---  PS      PS     TYPE_14 ---        ---      PLRM.pdf (Chameleon font;
+                                                Type 14 font; never supported?)
+---  ---     PS     TYPE_32 CID        ---      PLRM.pdf (CID Font Type 4;
+                                                Type 32 font; never supported?)
+---  PS      TT     ---     ---        type42   5012.Type42_Spec.pdf
+                                                (Type 42 font)
+---  PS      TT     ---     CID        ---      PLRM.pdf (CID Font Type 2;
+                                                Type 11 font)
+
+
+---  ?       ?      CEF     ?          cff      ?
+
+
+---  ---     PCF    ---     ---        pcf      X11
+---  LZW     PCF    ---     ---        pcf      X11
+
+
+---  ---     PFR    PFR0    ---        pfr      [2]
+---  ---     PFR    PFR1    ---        ---      (undocumented, proprietary;
+                                                probably never supported)
+
+
+---  ---     WINFNT ---     ---        winfonts MS Windows 3 Developer's Notes
+---  ---     WINFNT VECTOR  ---        ---      MS Windows 3 Developer's Notes
+
+
+[1] Support should be rather simple since this is identical to `CFF'
+    but in a PS wrapper.
+
+[2] Official PFR specification:
+
+      http://www.bitstream.com/categories/developer/truedoc/pfrspec.html
+      http://www.bitstream.com/categories/developer/truedoc/pfrspec1.2.pdf
+
+    The syntax of the auxiliary data is not defined there, but is partially
+    defined in MHP 1.0.3 (also called ETSI TS 101812 V1.3.1) section 7.4.
+
+      http://www.etsi.org/
+      http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=18799
+
+    (free registration required).

reactos/lib/freetype/docs
CHANGES 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- CHANGES	10 May 2004 17:48:26 -0000	1.6
+++ CHANGES	18 Aug 2004 20:25:05 -0000	1.7
@@ -1,4 +1,51 @@
 
+LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
+
+  I. IMPORTANT BUG FIXES
+
+    - The function  `FT_Get_CharMap_Index' was only declared,  without
+      any  real  code.   For  consistency,  it  has  been  renamed  to
+      `FT_Get_Charmap_Index'.   (This function is needed  to implement
+      cmap caches.)
+
+    - `FT_Outline_Get_BBox'  sometimes returned  incorrect values  for
+      conic outlines (e.g., for TrueType fonts).
+
+    - Handling of `bhed' table has been fixed.
+
+    - The TrueType driver with enabled byte code interpreter sometimes
+      returned artifacts due to incorrect rounding.  This bug has been
+      introduced after version 2.1.4.
+
+    - The BDF driver dropped the last glyph in the font.
+
+    - The BDF driver now uses the DEFAULT_CHAR property (if available)
+      to select a glyph shape for the undefined glyph.
+
+
+  II. IMPORTANT CHANGES
+
+    - George  Williams   contributed  code  to   handle  Apple's  font
+      distortion technology found in GX fonts (`avar', `cvar', `fvar',
+      and `gvar' tables;  the Multiple Masters  API has been  slightly
+      extended to cope with the new functionality).
+
+    - The `FT_GlyphSlotRec' structure has been extended:  The elements
+      `lsb_delta' and  `rsb_delta' give the difference  between hinted
+      and  unhinted  left and right  side bearings  if autohinting  is
+      active.  Using those values can improve the inter-letter spacing
+      considerably.   See the documentation of  `FT_GlyphSlotRec'  and
+      the `ftstring' demo program how to use it.
+
+
+  III. MISCELLANEOUS
+
+    - A new  documentation file  `formats.txt' describes various  font
+      formats supported (and not supported) by FreeType.
+
+
+======================================================================
+
 LATEST CHANGES BETWEEN 2.1.8 and 2.1.7
 
   I. IMPORTANT BUG FIXES

reactos/lib/freetype/docs
VERSION.DLL 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- VERSION.DLL	10 May 2004 17:48:26 -0000	1.6
+++ VERSION.DLL	18 Aug 2004 20:25:05 -0000	1.7
@@ -52,6 +52,7 @@
 
     release    libtool      so
   -------------------------------
+     2.1.9      9.7.3     6.3.7
      2.1.8      9.6.3     6.3.6
      2.1.7      9.5.3     6.3.5
      2.1.6      9.5.3     6.3.5

reactos/lib/freetype/include/freetype
freetype.h 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- freetype.h	10 May 2004 17:48:26 -0000	1.6
+++ freetype.h	18 Aug 2004 20:25:05 -0000	1.7
@@ -44,7 +44,7 @@
   /*                                                                       */
 #define FREETYPE_MAJOR 2
 #define FREETYPE_MINOR 1
-#define FREETYPE_PATCH 8
+#define FREETYPE_PATCH 9
 
 
 #include <ft2build.h>
@@ -172,6 +172,7 @@
   /*    FT_CharMapRec                                                      */
   /*    FT_Select_Charmap                                                  */
   /*    FT_Set_Charmap                                                     */
+  /*    FT_Get_Charmap_Index                                               */
   /*                                                                       */
   /*************************************************************************/
 
@@ -188,34 +189,42 @@
   /*    instead.                                                           */
   /*                                                                       */
   /* <Fields>                                                              */
-  /*    width        :: The glyph's width.                                 */
+  /*    width ::                                                           */
+  /*      The glyph's width.                                               */
   /*                                                                       */
-  /*    height       :: The glyph's height.                                */
+  /*    height ::                                                          */
+  /*      The glyph's height.                                              */
   /*                                                                       */
-  /*    horiBearingX :: Horizontal left side bearing.                      */
+  /*    horiBearingX ::                                                    */
+  /*      Left side bearing for horizontal layout.                         */
   /*                                                                       */
-  /*    horiBearingY :: Horizontal top side bearing.                       */
+  /*    horiBearingY ::                                                    */
+  /*      Top side bearing for horizontal layout.                          */
   /*                                                                       */
-  /*    horiAdvance  :: Horizontal advance width.                          */
+  /*    horiAdvance ::                                                     */
+  /*      Advance width for horizontal layout.                             */
   /*                                                                       */
-  /*    vertBearingX :: Vertical left side bearing.                        */
+  /*    vertBearingX ::                                                    */
+  /*      Left side bearing for vertical layout.                           */
   /*                                                                       */
-  /*    vertBearingY :: Vertical top side bearing.                         */
+  /*    vertBearingY ::                                                    */
+  /*      Top side bearing for vertical layout.                            */
   /*                                                                       */
-  /*    vertAdvance  :: Vertical advance height.                           */
+  /*    vertAdvance ::                                                     */
+  /*      Advance height for vertical layout.                              */
   /*                                                                       */
   typedef struct  FT_Glyph_Metrics_
   {
-    FT_Pos  width;         /* glyph width  */
-    FT_Pos  height;        /* glyph height */
+    FT_Pos  width;
+    FT_Pos  height;
 
-    FT_Pos  horiBearingX;  /* left side bearing in horizontal layouts */
-    FT_Pos  horiBearingY;  /* top side bearing in horizontal layouts  */
-    FT_Pos  horiAdvance;   /* advance width for horizontal layout     */
-
-    FT_Pos  vertBearingX;  /* left side bearing in vertical layouts */
-    FT_Pos  vertBearingY;  /* top side bearing in vertical layouts  */
-    FT_Pos  vertAdvance;   /* advance height for vertical layout    */
+    FT_Pos  horiBearingX;
+    FT_Pos  horiBearingY;
+    FT_Pos  horiAdvance;
+
+    FT_Pos  vertBearingX;
+    FT_Pos  vertBearingY;
+    FT_Pos  vertAdvance;
 
   } FT_Glyph_Metrics;
 
@@ -249,6 +258,7 @@
   /*    x_ppem :: The horizontal ppem value (in 26.6 fractional format).   */
   /*                                                                       */
   /*    y_ppem :: The vertical ppem value (in 26.6 fractional format).     */
+  /*              Usually, this is the `nominal' pixel height of the font. */
   /*                                                                       */
   /* <Note>                                                                */
   /*    The values in this structure are taken from the bitmap font.  If   */
@@ -262,10 +272,10 @@
   /*    where `size' is in points.                                         */
   /*                                                                       */
   /*    Windows FNT:                                                       */
-  /*      The `size', `x_ppem', and `y_ppem' parameters are not reliable:  */
-  /*      There exist fonts (e.g. app850.fon) which have a wrong size for  */
-  /*      some subfonts; since FNT files don't contain ppem but dpi values */
-  /*      the computed x_ppem and y_ppem numbers are thus wrong also.      */
+  /*      The `size' parameter is not reliable: There exist fonts (e.g.,   */
+  /*      app850.fon) which have a wrong size for some subfonts; x_ppem    */
+  /*      and y_ppem are thus set equal to pixel width and height given in */
+  /*      in the Windows FNT header.                                       */
   /*                                                                       */
   /*    TrueType embedded bitmaps:                                         */
   /*      `size', `width', and `height' values are not contained in the    */
@@ -1459,6 +1469,14 @@
   /*                         Note that the app will need to know about the */
   /*                         image format.                                 */
   /*                                                                       */
+  /*    lsb_delta         :: The difference between hinted and unhinted    */
+  /*                         left side bearing while autohinting is        */
+  /*                         active.  Zero otherwise.                      */
+  /*                                                                       */
+  /*    rsb_delta         :: The difference between hinted and unhinted    */
+  /*                         right side bearing while autohinting is       */
+  /*                         active.  Zero otherwise.                      */
+  /*                                                                       */
   /* <Note>                                                                */
   /*    If @FT_Load_Glyph is called with default flags (see                */
   /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */
@@ -1478,6 +1496,34 @@
   /*    position (e.g. coordinates [0,0] on the baseline).  Of course,     */
   /*    `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' .       */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    Here a small pseudo code fragment which shows how to use           */
+  /*    `lsb_delta' and `rsb_delta':                                       */
+  /*                                                                       */
+  /*    {                                                                  */
+  /*      FT_Pos  origin_x       = 0;                                      */
+  /*      FT_Pos  prev_rsb_delta = 0;                                      */
+  /*                                                                       */
+  /*                                                                       */
+  /*      for all glyphs do                                                */
+  /*        <compute kern between current and previous glyph and add it to */
+  /*         `origin_x'>                                                   */
+  /*                                                                       */
+  /*        <load glyph with `FT_Load_Glyph'>                              */
+  /*                                                                       */
+  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */
+  /*          origin_x -= 64;                                              */
+  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */
+  /*          origin_x += 64;                                              */
+  /*                                                                       */
+  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */
+  /*                                                                       */
+  /*        <save glyph image, or render glyph, or ...>                    */
+  /*                                                                       */
+  /*        origin_x += face->glyph->advance.x;                            */
+  /*      endfor                                                           */
+  /*    }                                                                  */
+  /*                                                                       */
   typedef struct  FT_GlyphSlotRec_
   {
     FT_Library        library;
@@ -1505,6 +1551,9 @@
     void*             control_data;
     long              control_len;
 
+    FT_Pos            lsb_delta;
+    FT_Pos            rsb_delta;
+
     void*             other;
 
     FT_Slot_Internal  internal;
@@ -2674,6 +2723,25 @@
 
   /*************************************************************************/
   /*                                                                       */
+  /* @function:                                                            */
+  /*    FT_Get_Charmap_Index                                               */
+  /*                                                                       */
+  /* @description:                                                         */
+  /*    Retrieve index of a given charmap.                                 */
+  /*                                                                       */
+  /* @input:                                                               */
+  /*    charmap :: A handle to a charmap.                                  */
+  /*                                                                       */
+  /* @return:                                                              */
+  /*    The index into the array of character maps within the face to      */
+  /*    which `charmap' belongs.                                           */
+  /*                                                                       */
+  FT_EXPORT( FT_Int )
+  FT_Get_Charmap_Index( FT_CharMap  charmap );
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* <Function>                                                            */
   /*    FT_Get_Char_Index                                                  */
   /*                                                                       */

reactos/lib/freetype/include/freetype
ftcache.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- ftcache.h	10 May 2004 17:48:26 -0000	1.5
+++ ftcache.h	18 Aug 2004 20:25:06 -0000	1.6
@@ -55,7 +55,7 @@
   /*                                                                       */
   /* <Description>                                                         */
   /*   This section describes the FreeType 2 cache sub-system which is     */
-  /*   stile in beta.                                                      */
+  /*   still in beta.                                                      */
   /*                                                                       */
   /* <Order>                                                               */
   /*   FTC_Manager                                                         */
@@ -63,11 +63,13 @@
   /*   FTC_Face_Requester                                                  */
   /*                                                                       */
   /*   FTC_Manager_New                                                     */
+  /*   FTC_Manager_Reset                                                   */
+  /*   FTC_Manager_Done                                                    */
   /*   FTC_Manager_LookupFace                                              */
   /*   FTC_Manager_LookupSize                                              */
+  /*   FTC_Manager_RemoveFaceID                                            */
   /*                                                                       */
   /*   FTC_Node                                                            */
-  /*   FTC_Node_Ref                                                        */
   /*   FTC_Node_Unref                                                      */
   /*                                                                       */
   /*   FTC_Font                                                            */
@@ -80,6 +82,10 @@
   /*   FTC_SBitCache_New                                                   */
   /*   FTC_SBitCache_Lookup                                                */
   /*                                                                       */
+  /*   FTC_CMapCache                                                       */
+  /*   FTC_CMapCache_New                                                   */
+  /*   FTC_CMapCache_Lookup                                                */
+  /*                                                                       */
   /*                                                                       */
   /*   FTC_Image_Desc                                                      */
   /*   FTC_Image_Cache                                                     */
@@ -502,11 +508,6 @@
                      FTC_CMapCache  *acache );
 
 
-  /* retrieve the index of a given charmap */
-  FT_EXPORT( FT_Int )
-  FT_Get_CharMap_Index( FT_CharMap  charmap );
-
-
   /*************************************************************************/
   /*                                                                       */
   /* @function:                                                            */
@@ -519,9 +520,9 @@
   /* @input:                                                               */
   /*    cache      :: A charmap cache handle.                              */
   /*                                                                       */
-  /*    face_id    :: source face id                                       */
+  /*    face_id    :: The source face ID.                                  */
   /*                                                                       */
-  /*    cmap_index :: index of charmap in source face                      */
+  /*    cmap_index :: The index of the charmap in the source face.         */
   /*                                                                       */
   /*    char_code  :: The character code (in the corresponding charmap).   */
   /*                                                                       */

reactos/lib/freetype/include/freetype
ftmm.h 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftmm.h	10 May 2004 17:48:26 -0000	1.4
+++ ftmm.h	18 Aug 2004 20:25:06 -0000	1.5
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Multiple Master font interface (specification).             */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
+/*  Copyright 1996-2001, 2003, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -43,6 +43,12 @@
   /*    Master fonts, i.e. the selection of specific design instances by   */
   /*    setting design axis coordinates.                                   */
   /*                                                                       */
+  /*    George Williams has extended this interface to make it work with   */
+  /*    both Type 1 Multiple Masters fonts, and GX distortable (var)       */
+  /*    fonts.  Some of these routines only work with MM fonts, others     */
+  /*    will work with both types.  They are similar enough that a         */
+  /*    consistent interface makes sense.                                  */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -55,6 +61,8 @@
   /*    A simple structure used to model a given axis in design space for  */
   /*    Multiple Masters fonts.                                            */
   /*                                                                       */
+  /*    This structure can't be used for GX var fonts.                     */
+  /*                                                                       */
   /* <Fields>                                                              */
   /*    name    :: The axis's name.                                        */
   /*                                                                       */
@@ -80,6 +88,8 @@
   /*    A structure used to model the axes and space of a Multiple Masters */
   /*    font.                                                              */
   /*                                                                       */
+  /*    This structure can't be used for GX var fonts.                     */
+  /*                                                                       */
   /* <Fields>                                                              */
   /*    num_axis    :: Number of axes.  Cannot exceed 4.                   */
   /*                                                                       */
@@ -98,8 +108,119 @@
 
   } FT_Multi_Master;
 
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Var_Axis                                                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A simple structure used to model a given axis in design space for  */
+  /*    Multiple Masters and GX var fonts.                                 */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    name    :: The axis's name.                                        */
+  /*               Not always meaningful for GX.                           */
+  /*                                                                       */
+  /*    minimum :: The axis's minimum design coordinate.                   */
+  /*                                                                       */
+  /*    def     :: The axis's default design coordinate.                   */
+  /*               FreeType computes meaningful default values for MM; it  */
+  /*               is then an integer value, not in 16.16 format.          */
+  /*                                                                       */
+  /*    maximum :: The axis's maximum design coordinate.                   */
+  /*                                                                       */
+  /*    tag     :: The axis's tag (the GX equivalent to `name').           */
+  /*               FreeType provides default values for MM if possible.    */
+  /*                                                                       */
+  /*    strid   :: The entry in `name' table (another GX version of        */
+  /*               `name').                                                */
+  /*               Not meaningful for MM.                                  */
+  /*                                                                       */
+  typedef struct  FT_Var_Axis_
+  {
+    FT_String*  name;
+
+    FT_Fixed    minimum;
+    FT_Fixed    def;
+    FT_Fixed    maximum;
+
+    FT_ULong    tag;
+    FT_UInt     strid;
+
+  } FT_Var_Axis;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Var_Named_Style                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A simple structure used to model a named style in a GX var font.   */
+  /*                                                                       */
+  /*    This structure can't be used for MM fonts.                         */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    coords :: The design coordinates for this style.                   */
+  /*              This is an array with one entry for each axis.           */
+  /*                                                                       */
+  /*    strid  :: The entry in `name' table identifying this style.        */
+  /*                                                                       */
+  typedef struct  FT_Var_Named_Style_
+  {
+    FT_Fixed*  coords;
+    FT_UInt    strid;
+
+  } FT_Var_Named_Style;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_MM_Var                                                          */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A structure used to model the axes and space of a Multiple Masters */
+  /*    or GX var distortable font.                                        */
+  /*                                                                       */
+  /*    Some fields are specific to one format and not to the other.       */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    num_axis        :: The number of axes.  The maximum value is 4 for */
+  /*                       MM; no limit in GX.                             */
+  /*                                                                       */
+  /*    num_designs     :: The number of designs; should be normally       */
+  /*                       2^num_axis for MM fonts.  Not meaningful for GX */
+  /*                       (where every glyph could have a different       */
+  /*                       number of designs).                             */
+  /*                                                                       */
+  /*    num_namedstyles :: The number of named styles; only meaningful for */
+  /*                       GX which allows certain design coordinates to   */
+  /*                       have a string ID (in the `name' table)          */
+  /*                       associated with them.  The font can tell the    */
+  /*                       user that, for example, Weight=1.5 is `Bold'.   */
+  /*                                                                       */
+  /*    axis            :: A table of axis descriptors.                    */
+  /*                       GX fonts contain slightly more data than MM.    */
+  /*                                                                       */
+  /*    namedstyles     :: A table of named styles.                        */
+  /*                       Only meaningful with GX.                        */
+  /*                                                                       */
+  typedef struct  FT_MM_Var_
+  {
+    FT_UInt              num_axis;
+    FT_UInt              num_designs;
+    FT_UInt              num_namedstyles;
+    FT_Var_Axis*         axis;
+    FT_Var_Named_Style*  namedstyle;
+
+  } FT_MM_Var;
+
+
   /* */
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -108,6 +229,8 @@
   /* <Description>                                                         */
   /*    Retrieves the Multiple Master descriptor of a given font.          */
   /*                                                                       */
+  /*    This function can't be used with GX fonts.                         */
+  /*                                                                       */
   /* <Input>                                                               */
   /*    face    :: A handle to the source face.                            */
   /*                                                                       */
@@ -125,12 +248,38 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
+  /*    FT_Get_MM_Var                                                      */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Retrieves the Multiple Master/GX var descriptor of a given font.   */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    face    :: A handle to the source face.                            */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    amaster :: The Multiple Masters descriptor.                        */
+  /*               Allocates a data structure, which the user must free    */
+  /*               (a single call to FT_FREE will do it).                  */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Get_MM_Var( FT_Face      face,
+                 FT_MM_Var*  *amaster );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
   /*    FT_Set_MM_Design_Coordinates                                       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    For Multiple Masters fonts, choose an interpolated font design     */
   /*    through design coordinates.                                        */
   /*                                                                       */
+  /*    This function can't be used with GX fonts.                         */
+  /*                                                                       */
   /* <InOut>                                                               */
   /*    face       :: A handle to the source face.                         */
   /*                                                                       */
@@ -152,11 +301,38 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
+  /*    FT_Set_Var_Design_Coordinates                                      */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */
+  /*    design through design coordinates.                                 */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face       :: A handle to the source face.                         */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    num_coords :: The number of design coordinates (must be equal to   */
+  /*                  the number of axes in the font).                     */
+  /*                                                                       */
+  /*    coords     :: An array of design coordinates.                      */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Set_Var_Design_Coordinates( FT_Face    face,
+                                 FT_UInt    num_coords,
+                                 FT_Fixed*  coords );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
   /*    FT_Set_MM_Blend_Coordinates                                        */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    For Multiple Masters fonts, choose an interpolated font design     */
-  /*    through normalized blend coordinates.                              */
+  /*    For Multiple Masters and GX var fonts, choose an interpolated font */
+  /*    design through normalized blend coordinates.                       */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    face       :: A handle to the source face.                         */
@@ -177,6 +353,20 @@
                                FT_Fixed*  coords );
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Set_Var_Blend_Coordinates                                       */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Set_Var_Blend_Coordinates( FT_Face    face,
+                                FT_UInt    num_coords,
+                                FT_Fixed*  coords );
+
+
   /* */
 
 

reactos/lib/freetype/include/freetype
t1tables.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- t1tables.h	10 May 2004 17:48:26 -0000	1.5
+++ t1tables.h	18 Aug 2004 20:25:06 -0000	1.6
@@ -226,7 +226,7 @@
   typedef struct  PS_DesignMap_
   {
     FT_Byte    num_points;
-    FT_Fixed*  design_points;
+    FT_Long*   design_points;
     FT_Fixed*  blend_points;
 
   } PS_DesignMapRec, *PS_DesignMap;

reactos/lib/freetype/include/freetype
tttables.h 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- tttables.h	10 May 2004 17:48:26 -0000	1.6
+++ tttables.h	18 Aug 2004 20:25:06 -0000	1.7
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType tables definitions and interface                 */
 /*    (specification only).                                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -516,12 +516,11 @@
   /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */
   /*                             used for glyph hinting.                   */
   /*                                                                       */
-  /*    maxComponentElements  :: An obscure value related to composite     */
-  /*                             glyphs definitions.                       */
+  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */
+  /*                             composite) glyphs in a composite glyph.   */
   /*                                                                       */
-  /*    maxComponentDepth     :: An obscure value related to composite     */
-  /*                             glyphs definitions.  Probably the maximum */
-  /*                             number of simple glyphs in a composite.   */
+  /*    maxComponentDepth     :: The maximum nesting depth of composite    */
+  /*                             glyphs.                                   */
   /*                                                                       */
   /* <Note>                                                                */
   /*    This structure is only used during font loading.                   */

reactos/lib/freetype/include/freetype
tttags.h 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- tttags.h	10 May 2004 17:48:26 -0000	1.4
+++ tttags.h	18 Aug 2004 20:25:06 -0000	1.5
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Tags for TrueType tables (specification only).                       */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
+/*  Copyright 1996-2001, 2004 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,13 +33,15 @@
 FT_BEGIN_HEADER
 
 
+#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
+#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )
+#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
+#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
+#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
 #define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
+#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
 #define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )
-#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
 #define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
-#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
-#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )
-#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
 #define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
 #define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
 #define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
@@ -48,6 +50,7 @@
 #define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )
 #define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
 #define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
+#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
 #define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
 #define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
 #define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
@@ -56,8 +59,8 @@
 #define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
 #define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
 #define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
-#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
 #define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
+#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
 #define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
 #define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )
 #define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )

reactos/lib/freetype/include/freetype/cache
ftcmru.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- ftcmru.h	10 May 2004 17:48:27 -0000	1.3
+++ ftcmru.h	18 Aug 2004 20:25:06 -0000	1.4
@@ -86,7 +86,7 @@
   typedef struct FTC_MruListClassRec_ const *  FTC_MruListClass;
 
 
-  typedef FT_Int
+  typedef FT_Bool
   (*FTC_MruNode_CompareFunc)( FTC_MruNode  node,
                               FT_Pointer   key );
 
@@ -154,7 +154,7 @@
   FTC_MruList_Lookup( FTC_MruList   list,
                       FT_Pointer    key,
                       FTC_MruNode  *pnode );
-                      
+
 
   FT_EXPORT( void )
   FTC_MruList_Remove( FTC_MruList  list,
@@ -208,7 +208,7 @@
 #else  /* !FTC_INLINE */
 
 #define FTC_MRULIST_LOOKUP( list, key, node, error ) \
-  error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) ) 
+  error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )
 
 #endif /* !FTC_INLINE */
 

reactos/lib/freetype/include/freetype/config
ftmodule.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ftmodule.h	1 Apr 2003 08:38:33 -0000	1.1
+++ ftmodule.h	18 Aug 2004 20:25:06 -0000	1.2
@@ -1,4 +1,6 @@
 FT_USE_MODULE(autohint_module_class)
+FT_USE_MODULE(tt_driver_class)
+FT_USE_MODULE(t1_driver_class)
 FT_USE_MODULE(cff_driver_class)
 FT_USE_MODULE(t1cid_driver_class)
 FT_USE_MODULE(pcf_driver_class)
@@ -11,8 +13,6 @@
 FT_USE_MODULE(ft_smooth_renderer_class)
 FT_USE_MODULE(ft_smooth_lcd_renderer_class)
 FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
-FT_USE_MODULE(tt_driver_class)
-FT_USE_MODULE(t1_driver_class)
 FT_USE_MODULE(t42_driver_class)
 FT_USE_MODULE(pfr_driver_class)
 FT_USE_MODULE(winfnt_driver_class)

reactos/lib/freetype/include/freetype/config
ftoption.h 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- ftoption.h	10 May 2004 17:48:27 -0000	1.8
+++ ftoption.h	18 Aug 2004 20:25:06 -0000	1.9
@@ -484,6 +484,16 @@
 
 
   /*************************************************************************/
+  /*                                                                       */
+  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */
+  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */
+  /* and avar tables).  This has many similarities to Type 1 Multiple      */
+  /* Masters support.                                                      */
+  /*                                                                       */
+#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+
+  /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/

reactos/lib/freetype/include/freetype/internal
ftmemory.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- ftmemory.h	10 May 2004 17:48:28 -0000	1.5
+++ ftmemory.h	18 Aug 2004 20:25:06 -0000	1.6
@@ -65,6 +65,13 @@
                   FT_Long      line_no );
 
   FT_BASE( FT_Error )
+  FT_QAlloc_Debug( FT_Memory    memory,
+                   FT_Long      size,
+                   void*       *P,
+                   const char*  file_name,
+                   FT_Long      line_no );
+
+  FT_BASE( FT_Error )
   FT_Realloc_Debug( FT_Memory    memory,
                     FT_Long      current,
                     FT_Long      size,
@@ -72,6 +79,14 @@
                     const char*  file_name,
                     FT_Long      line_no );
 
+  FT_BASE( FT_Error )
+  FT_QRealloc_Debug( FT_Memory    memory,
+                     FT_Long      current,
+                     FT_Long      size,
+                     void*       *P,
+                     const char*  file_name,
+                     FT_Long      line_no );
+
   FT_BASE( void )
   FT_Free_Debug( FT_Memory    memory,
                  FT_Pointer   block,
@@ -109,6 +124,12 @@
             void*     *P );
 
 
+  FT_BASE( FT_Error )
+  FT_QAlloc( FT_Memory  memory,
+             FT_Long    size,
+             void*     *p );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -144,6 +165,13 @@
               void*     *P );
 
 
+  FT_BASE( FT_Error )
+  FT_QRealloc( FT_Memory  memory,
+               FT_Long    current,
+               FT_Long    size,
+               void*     *p );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -204,6 +232,14 @@
           FT_Realloc_Debug( memory, _current_, _size_,                 \
                             (void**)&(_pointer_), __FILE__, __LINE__ )
 
+#define FT_MEM_QALLOC( _pointer_, _size_ )                            \
+          FT_QAlloc_Debug( memory, _size_,                            \
+                           (void**)&(_pointer_), __FILE__, __LINE__ )
+
+#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ )                 \
+          FT_QRealloc_Debug( memory, _current_, _size_,                 \
+                             (void**)&(_pointer_), __FILE__, __LINE__ )
+
 #define FT_MEM_FREE( _pointer_ )                                            \
           FT_Free_Debug( memory, (void**)&(_pointer_), __FILE__, __LINE__ )
 
@@ -220,6 +256,11 @@
 #define FT_MEM_REALLOC( _pointer_, _current_, _size_ )                  \
           FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) )
 
+#define FT_MEM_QALLOC( _pointer_, _size_ )                  \
+          FT_QAlloc( memory, _size_, (void**)&(_pointer_) )
+
+#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ )                  \
+          FT_QRealloc( memory, _current_, _size_, (void**)&(_pointer_) )
 
 #endif /* !FT_DEBUG_MEMORY */
 
@@ -240,6 +281,16 @@
           FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ),  \
                                      (_new_) * sizeof ( *(_pointer_) ) )
 
+#define FT_MEM_QNEW( _pointer_ )                               \
+          FT_MEM_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
+
+#define FT_MEM_QNEW_ARRAY( _pointer_, _count_ )                           \
+          FT_MEM_QALLOC( _pointer_, (_count_) * sizeof ( *(_pointer_) ) )
+
+#define FT_MEM_QRENEW_ARRAY( _pointer_, _old_, _new_ )                    \
+          FT_MEM_QREALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ),  \
+                                      (_new_) * sizeof ( *(_pointer_) ) )
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -270,6 +321,13 @@
 #define FT_FREE( _pointer_ )       \
           FT_MEM_FREE( _pointer_ )
 
+#define FT_QALLOC( _pointer_, _size_ )                       \
+          FT_SET_ERROR( FT_MEM_QALLOC( _pointer_, _size_ ) )
+
+#define FT_QREALLOC( _pointer_, _current_, _size_ )                       \
+          FT_SET_ERROR( FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) )
+
+
 #define FT_NEW( _pointer_ )  \
           FT_SET_ERROR( FT_MEM_NEW( _pointer_ ) )
 
@@ -279,6 +337,16 @@
 #define FT_RENEW_ARRAY( _pointer_, _old_, _new_ )   \
           FT_SET_ERROR( FT_MEM_RENEW_ARRAY( _pointer_, _old_, _new_ ) )
 
+#define FT_QNEW( _pointer_ )  \
+          FT_SET_ERROR( FT_MEM_QNEW( _pointer_ ) )
+
+#define FT_QNEW_ARRAY( _pointer_, _count_ )  \
+          FT_SET_ERROR( FT_MEM_QNEW_ARRAY( _pointer_, _count_ ) )
+
+#define FT_QRENEW_ARRAY( _pointer_, _old_, _new_ )   \
+          FT_SET_ERROR( FT_MEM_QRENEW_ARRAY( _pointer_, _old_, _new_ ) )
+
+
 #define FT_ALLOC_ARRAY( _pointer_, _count_, _type_ )                    \
           FT_SET_ERROR( FT_MEM_ALLOC( _pointer_,                        \
                                       (_count_) * sizeof ( _type_ ) ) )

reactos/lib/freetype/include/freetype/internal
ftstream.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ftstream.h	10 May 2004 17:48:28 -0000	1.2
+++ ftstream.h	18 Aug 2004 20:25:06 -0000	1.3
@@ -269,6 +269,25 @@
   /*                                                                       */
   /* Each GET_xxxx() macro uses an implicit `stream' variable.             */
   /*                                                                       */
+#if 0
+#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )
+
+#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )
+#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )
+#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )
+#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )
+#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )
+#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )
+#define FT_GET_LONG()       FT_GET_MACRO( LONG )
+#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )
+#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )
+
+#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )
+#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )
+#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )
+#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )
+
+#else
 #define FT_GET_MACRO( func, type )        ( (type)func( stream ) )
 
 #define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
@@ -285,6 +304,7 @@
 #define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )
 #define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )
 #define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )
+#endif
 
 #define FT_READ_MACRO( func, type, var )        \
           ( var = (type)func( stream, &error ), \

reactos/lib/freetype/include/freetype/internal
fttrace.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- fttrace.h	10 May 2004 17:48:28 -0000	1.2
+++ fttrace.h	18 Aug 2004 20:25:06 -0000	1.3
@@ -53,6 +53,7 @@
 FT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */
 FT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */
 FT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */
+FT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */
 
 /* Type 1 driver components */
 FT_TRACE_DEF( t1driver )

reactos/lib/freetype/include/freetype/internal
psaux.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- psaux.h	10 May 2004 17:48:28 -0000	1.5
+++ psaux.h	18 Aug 2004 20:25:06 -0000	1.6
@@ -5,7 +5,7 @@
 /*    Auxiliary functions and data structures related to PostScript fonts  */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -478,6 +478,17 @@
   } T1_Builder_FuncsRec;
 
 
+  /* an enumeration type to handle charstring parsing states */
+  typedef enum  T1_ParseState_
+  {
+    T1_Parse_Start,
+    T1_Parse_Have_Width,
+    T1_Parse_Have_Moveto,
+    T1_Parse_Have_Path
+
+  } T1_ParseState;
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Structure>                                                           */
@@ -519,15 +530,13 @@
   /*                                                                       */
   /*    bbox         :: Unused.                                            */
   /*                                                                       */
-  /*    path_begun   :: A flag which indicates that a new path has begun.  */
+  /*    parse_state  :: An enumeration which controls the charstring       */
+  /*                    parsing state.                                     */
   /*                                                                       */
   /*    load_points  :: If this flag is not set, no points are loaded.     */
   /*                                                                       */
   /*    no_recurse   :: Set but not used.                                  */
   /*                                                                       */
-  /*    error        :: An error code that is only used to report memory   */
-  /*                    allocation problems.                               */
-  /*                                                                       */
   /*    metrics_only :: A boolean indicating that we only want to compute  */
   /*                    the metrics of a given glyph, not load all of its  */
   /*                    points.                                            */
@@ -555,12 +564,11 @@
     FT_Vector       advance;
 
     FT_BBox         bbox;          /* bounding box */
-    FT_Bool         path_begun;
+    T1_ParseState   parse_state;
     FT_Bool         load_points;
     FT_Bool         no_recurse;
     FT_Bool         shift;
 
-    FT_Error        error;         /* only used for memory errors */
     FT_Bool         metrics_only;
 
     void*           hints_funcs;    /* hinter-specific */

reactos/lib/freetype/include/freetype/internal
tttypes.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- tttypes.h	10 May 2004 17:48:28 -0000	1.5
+++ tttypes.h	18 Aug 2004 20:25:06 -0000	1.6
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType type definitions and interface (specification    */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -25,6 +25,10 @@
 #include FT_TRUETYPE_TABLES_H
 #include FT_INTERNAL_OBJECTS_H
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#endif
+
 
 FT_BEGIN_HEADER
 
@@ -823,6 +827,24 @@
   /*************************************************************************/
   /***                                                                   ***/
   /***                                                                   ***/
+  /***                    GX VARIATION TABLE SUPPORT                     ***/
+  /***                                                                   ***/
+  /***                                                                   ***/
+  /*************************************************************************/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+  typedef struct GX_BlendRec_  *GX_Blend;
+#endif
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*************************************************************************/
+  /***                                                                   ***/
+  /***                                                                   ***/
   /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/
   /***                                                                   ***/
   /***                                                                   ***/
@@ -1152,8 +1174,18 @@
   /*    unpatented_hinting   :: If true, use only unpatented methods in    */
   /*                            the bytecode interpreter.                  */
   /*                                                                       */
+  /*    doblend              :: A boolean which is set if the font should  */
+  /*                            be blended (this is for GX var).           */
+  /*                                                                       */
+  /*    blend                :: Contains the data needed to control GX     */
+  /*                            variation tables (rather like Multiple     */
+  /*                            Master data).                              */
+  /*                                                                       */
   /*    extra                :: Reserved for third-party font drivers.     */
   /*                                                                       */
+  /*    postscript_name      :: The PS name of the font.  Used by the      */
+  /*                            postscript name service.                   */
+  /*                                                                       */
   typedef struct  TT_FaceRec_
   {
     FT_FaceRec            root;
@@ -1261,6 +1293,11 @@
     FT_Bool               unpatented_hinting;
 #endif
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+    FT_Bool               doblend;
+    GX_Blend              blend;
+#endif
+    
     /***********************************************************************/
     /*                                                                     */
     /* Other tables or fields. This is used by derivative formats like     */

reactos/lib/freetype/include/freetype/internal/services
svmm.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- svmm.h	10 May 2004 17:48:28 -0000	1.3
+++ svmm.h	18 Aug 2004 20:25:06 -0000	1.4
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  svmm.h                                                                 */
 /*                                                                         */
-/*    The FreeType Multiple Masters services (specification).              */
+/*    The FreeType Multiple Masters and GX var services (specification).   */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -40,11 +40,20 @@
                      FT_Multi_Master*  master );
 
   typedef FT_Error
+  (*FT_Get_MM_Var_Func)( FT_Face      face,
+                         FT_MM_Var*  *master );
+
+  typedef FT_Error
   (*FT_Set_MM_Design_Func)( FT_Face   face,
                             FT_UInt   num_coords,
                             FT_Long*  coords );
 
   typedef FT_Error
+  (*FT_Set_Var_Design_Func)( FT_Face    face,
+                             FT_UInt    num_coords,
+                             FT_Fixed*  coords );
+
+  typedef FT_Error
   (*FT_Set_MM_Blend_Func)( FT_Face   face,
                            FT_UInt   num_coords,
                            FT_Long*  coords );
@@ -52,9 +61,11 @@
 
   FT_DEFINE_SERVICE( MultiMasters )
   {
-    FT_Get_MM_Func         get_mm;
-    FT_Set_MM_Design_Func  set_mm_design;
-    FT_Set_MM_Blend_Func   set_mm_blend;
+    FT_Get_MM_Func          get_mm;
+    FT_Set_MM_Design_Func   set_mm_design;
+    FT_Set_MM_Blend_Func    set_mm_blend;
+    FT_Get_MM_Var_Func      get_mm_var;
+    FT_Set_Var_Design_Func  set_var_design;
   };
 
   /* */

reactos/lib/freetype/src/autofit
afangles.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afangles.c	10 May 2004 17:48:29 -0000	1.3
+++ afangles.c	18 Aug 2004 20:25:06 -0000	1.4
@@ -1,8 +1,57 @@
 #include "aftypes.h"
 
+/*
+ * a python script used to generate the following table
+ *
+
+import sys, math
+
+units  = 256
+scale  = units/math.pi
+comma  = ""
+
+print ""
+print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"
+
+r = [-1] + range(32)
+
+for n in r:
+
+    if n >= 0:
+        x = 1.0/(2.0**n)    # tangent value
+    else:
+        x = 2.0**(-n)
+
+    angle  = math.atan(x)    # arctangent
+    angle2 = angle*scale     # arctangent in FT_Angle units
+
+    # determine which integer value for angle gives the best tangent
+    lo  = int(angle2)
+    hi  = lo + 1
+    tlo = math.tan(lo/scale)
+    thi = math.tan(hi/scale)
+
+    errlo = abs( tlo - x )
+    errhi = abs( thi - x )
+
+    angle2 = hi
+    if errlo < errhi:
+        angle2 = lo
+
+    if angle2 <= 0:
+        break
+
+    sys.stdout.write( comma + repr( int(angle2) ) )
+    comma = ", "
+
+*
+* end of python script
+*/
+
+
   /* this table was generated for AF_ANGLE_PI = 256 */
 #define AF_ANGLE_MAX_ITERS  8
-#define AF_TRIG_MAX_ITERS   9
+#define AF_TRIG_MAX_ITERS   8
 
   static const FT_Fixed
   af_angle_arctan_table[9] =
@@ -69,7 +118,7 @@
     {
       x = -x;
       y = -y;
-      theta = 2 * AF_ANGLE_PI2;
+      theta = AF_ANGLE_PI;
     }
 
     if ( y > 0 )
@@ -115,11 +164,13 @@
       }
     } while ( ++i < AF_TRIG_MAX_ITERS );
 
+#if 0
     /* round theta */
     if ( theta >= 0 )
-      theta = FT_PAD_ROUND( theta, 4 );
+      theta =   FT_PAD_ROUND( theta, 2 );
     else
-      theta = - FT_PAD_ROUND( theta, 4 );
+      theta = - FT_PAD_ROUND( -theta, 2 );
+#endif
 
     vec->x = x;
     vec->y = theta;
@@ -212,3 +263,40 @@
       }
     }
   }
+
+
+#ifdef TEST
+#include <stdio.h>
+#include <math.h>
+
+int main( void )
+{
+  int  angle;
+  int  dist;
+
+  for ( dist = 100; dist < 1000; dist++ )
+  {
+    for ( angle = AF_ANGLE_PI; angle < AF_ANGLE_2PI*4; angle++ )
+    {
+      double a = (angle*3.1415926535)/(1.0*AF_ANGLE_PI);
+      int    dx, dy, angle1, angle2, delta;
+
+      dx = dist * cos(a);
+      dy = dist * sin(a);
+
+      angle1  = ((atan2(dy,dx)*AF_ANGLE_PI)/3.1415926535);
+      angle2  = af_angle_atan( dx, dy );
+      delta   = (angle2 - angle1) % AF_ANGLE_2PI;
+      if ( delta < 0 )
+        delta = -delta;
+
+      if ( delta >= 2 )
+      {
+        printf( "dist:%4d angle:%4d => (%4d,%4d) angle1:%4d angle2:%4d\n",
+                dist, angle, dx, dy, angle1, angle2 );
+      }
+    }
+  }
+  return 0;
+}
+#endif

reactos/lib/freetype/src/autofit
afdummy.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- afdummy.c	10 May 2004 17:48:29 -0000	1.1
+++ afdummy.c	18 Aug 2004 20:25:06 -0000	1.2
@@ -1,22 +1,24 @@
 #include "afdummy.h"
+#include "afhints.h"
 
 
   static FT_Error
   af_dummy_hints_init( AF_GlyphHints     hints,
-                       FT_Outline*       outline,
                        AF_ScriptMetrics  metrics )
   {
-    return af_glyph_hints_reset( hints,
-                                 &metrics->scaler,
-                                 metrics,
-                                 outline );
+    af_glyph_hints_rescale( hints,
+                            metrics );
+    return 0;
   }
 
   static FT_Error
   af_dummy_hints_apply( AF_GlyphHints  hints,
                         FT_Outline*    outline )
   {
-    af_glyph_hints_save( hints, outline );
+    FT_UNUSED( hints );
+    FT_UNUSED( outline );
+
+    return 0;
   }
 
 

reactos/lib/freetype/src/autofit
afglobal.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afglobal.c	10 May 2004 17:48:29 -0000	1.3
+++ afglobal.c	18 Aug 2004 20:25:06 -0000	1.4
@@ -12,7 +12,7 @@
     NULL  /* do not remove */
   };
 
-#define AF_SCRIPT_LIST_DEFAULT   0    /* index of default script in 'af_script_classes' */
+#define AF_SCRIPT_LIST_DEFAULT   1    /* index of default script in 'af_script_classes' */
 #define AF_SCRIPT_LIST_NONE      255  /* indicates an uncovered glyph                      */
 
  /*

reactos/lib/freetype/src/autofit
afhints.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afhints.c	10 May 2004 17:48:29 -0000	1.3
+++ afhints.c	18 Aug 2004 20:25:06 -0000	1.4
@@ -10,11 +10,11 @@
 
     switch (dir)
     {
-     case AF_DIR_UP: result = "up"; break;
-     case AF_DIR_DOWN: result = "down"; break;
-     case AF_DIR_LEFT: result = "left"; break;
+     case AF_DIR_UP:    result = "up";    break;
+     case AF_DIR_DOWN:  result = "down";  break;
+     case AF_DIR_LEFT:  result = "left";  break;
      case AF_DIR_RIGHT: result = "right"; break;
-     default: result = "none";
+     default:           result = "none";
     }
     return result;
   }
@@ -111,7 +111,7 @@
 
       for ( edge = edges; edge < limit; edge++ )
       {
-        printf ( "  [ %5d | %4d | %5s | %4d | %5d |  %c  | %5.2f | %5.2f ]\n",
+        printf ( "  [ %5d | %4d | %5s | %4d | %5d |   %c  | %5.2f | %5.2f ]\n",
                  edge - edges,
                  (int)edge->fpos,
                  af_dir_str( edge->dir ),
@@ -314,26 +314,29 @@
 
 
 
+  FT_LOCAL_DEF( void )
+  af_glyph_hints_rescale( AF_GlyphHints     hints,
+                          AF_ScriptMetrics  metrics )
+  {
+    hints->metrics = metrics;
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
-  af_glyph_hints_reset( AF_GlyphHints     hints,
-                        AF_Scaler         scaler,
-                        AF_ScriptMetrics  metrics,
-                        FT_Outline*       outline )
+  af_glyph_hints_reload( AF_GlyphHints     hints,
+                         FT_Outline*       outline )
   {
     FT_Error     error        = FT_Err_Ok;
     AF_Point     points;
     FT_UInt      old_max, new_max;
-    FT_Fixed     x_scale = scaler->x_scale;
-    FT_Fixed     y_scale = scaler->y_scale;
-    FT_Pos       x_delta = scaler->x_delta;
-    FT_Pos       y_delta = scaler->y_delta;
+    AF_Scaler    scaler  = &hints->metrics->scaler;
+    FT_Fixed     x_scale = hints->x_scale;
+    FT_Fixed     y_scale = hints->y_scale;
+    FT_Pos       x_delta = hints->x_delta;
+    FT_Pos       y_delta = hints->y_delta;
     FT_Memory    memory  = hints->memory;
 
-    hints->metrics = metrics;
-
-    hints->scaler_flags = scaler->flags;
-    hints->other_flags  = 0;
-
+    hints->scaler_flags  = scaler->flags;
     hints->num_points    = 0;
     hints->num_contours  = 0;
 

reactos/lib/freetype/src/autofit
afhints.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afhints.h	10 May 2004 17:48:29 -0000	1.3
+++ afhints.h	18 Aug 2004 20:25:07 -0000	1.4
@@ -214,11 +214,13 @@
  /*  recomputes all AF_Point in a AF_GlyphHints from the definitions
   *  in a source outline
   */
+  FT_LOCAL( void )
+  af_glyph_hints_rescale( AF_GlyphHints     hints,
+                          AF_ScriptMetrics  metrics );
+
   FT_LOCAL( FT_Error )
-  af_glyph_hints_reset( AF_GlyphHints     hints,
-                        AF_Scaler         scaler,
-                        AF_ScriptMetrics  metrics,
-                        FT_Outline*       outline );
+  af_glyph_hints_reload( AF_GlyphHints     hints,
+                         FT_Outline*       outline );
 
   FT_LOCAL( void )
   af_glyph_hints_save( AF_GlyphHints   hints,

reactos/lib/freetype/src/autofit
aflatin.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- aflatin.c	10 May 2004 17:48:29 -0000	1.3
+++ aflatin.c	18 Aug 2004 20:25:07 -0000	1.4
@@ -25,8 +25,8 @@
       FT_Error      error;
       FT_UInt       glyph_index;
       AF_Dimension  dim;
-      AF_ScalerRec  scaler[1];
-
+      AF_ScriptMetricsRec  dummy[1];
+      AF_Scaler            scaler = &dummy->scaler;
 
       glyph_index = FT_Get_Char_Index( face, 'o' );
       if ( glyph_index == 0 )
@@ -36,15 +36,17 @@
       if ( error || face->glyph->outline.n_points <= 0 )
         goto Exit;
 
+      FT_ZERO( dummy );
+
       scaler->x_scale     = scaler->y_scale = 0x10000L;
       scaler->x_delta     = scaler->y_delta = 0;
       scaler->face        = face;
       scaler->render_mode = 0;
       scaler->flags       = 0;
 
-      error = af_glyph_hints_reset( hints, scaler,
-                                    (AF_ScriptMetrics) metrics,
-                                    &face->glyph->outline );
+      af_glyph_hints_rescale( hints, dummy );
+
+      error = af_glyph_hints_reload( hints, &face->glyph->outline );
       if ( error )
         goto Exit;
 
@@ -324,6 +326,13 @@
       if ( AF_LATIN_IS_TOP_BLUE(bb) )
         blue->flags |= AF_LATIN_BLUE_TOP;
 
+     /* the following flags is used later to adjust the y and x scales
+      * in order to optimize the pixel grid alignment of the top of small
+      * letters.
+      */
+      if ( bb == AF_LATIN_BLUE_SMALL_TOP )
+        blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
+
       AF_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
     }
 
@@ -382,8 +391,44 @@
     axis->org_scale = scale;
     axis->org_delta = delta;
 
-   /* XXX: TODO: Correct Y and X scale according to Chester rules
+   /* correct X and Y scale to optimize the alignment of the top of small
+    * letters to the pixel grid
     */
+    {
+      AF_LatinAxis  axis  = &metrics->axis[ AF_DIMENSION_VERT ];
+      AF_LatinBlue  blue  = NULL;
+      FT_UInt       nn;
+
+      for ( nn = 0; nn < axis->blue_count; nn++ )
+      {
+        if ( axis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )
+        {
+          blue = &axis->blues[nn];
+          break;
+        }
+      }
+
+      if ( blue )
+      {
+        FT_Pos  scaled = FT_MulFix( blue->shoot.org, scaler->y_scale );
+        FT_Pos  fitted = FT_PIX_ROUND( scaled );
+
+
+        if ( scaled != fitted )
+        {
+          if ( dim == AF_DIMENSION_HORZ )
+          {
+            if ( fitted < scaled )
+              scale -= scale/50;  /* x_scale = x_scale*0.98 */
+          }
+          else
+          {
+            scale = FT_MulDiv( scale, fitted, scaled );
+          }
+        }
+      }
+    }
+
     axis->scale = scale;
     axis->delta = delta;
 
@@ -417,17 +462,41 @@
         AF_LatinBlue  blue  = & axis->blues[nn];
         FT_Pos        dist;
 
-        blue->ref.cur = FT_MulFix( blue->ref.org, scale ) + delta;
-        blue->ref.fit = blue->ref.cur;
-
+        blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;
+        blue->ref.fit   = blue->ref.cur;
         blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;
         blue->shoot.fit = blue->shoot.cur;
+        blue->flags    &= ~AF_LATIN_BLUE_ACTIVE;
 
        /* a blue zone is only active when it is less than 3/4 pixels tall
         */
         dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
-        if ( dist >= 48 || dist <= -48 )
-          blue->flags |= ~AF_LATIN_BLUE_ACTIVE;
+        if ( dist <= 48 && dist >= -48 )
+        {
+          FT_Pos  delta, delta2;
+
+          delta  = blue->shoot.org - blue->ref.org;
+          delta2 = delta;
+          if ( delta < 0 )
+            delta2 = -delta2;
+
+          delta2 = FT_MulFix( delta2, scale );
+
+          if ( delta2 < 32 )
+            delta2 = 0;
+          else if ( delta2 < 64 )
+            delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
+          else
+            delta2 = FT_PIX_ROUND( delta2 );
+
+          if ( delta < 0 )
+            delta2 = -delta2;
+
+          blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
+          blue->shoot.fit = blue->ref.fit + delta2;
+
+          blue->flags |= AF_LATIN_BLUE_ACTIVE;
+        }
       }
     }
   }
@@ -437,6 +506,9 @@
   af_latin_metrics_scale( AF_LatinMetrics  metrics,
                           AF_Scaler        scaler )
   {
+    if ( AF_SCALER_EQUAL_SCALES( scaler, &metrics->root.scaler ) )
+      return;
+
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
   }
@@ -791,6 +863,7 @@
                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis = &hints->axis[dim];
+    AF_LatinAxis  laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
     AF_Edge       edges = axis->edges;
     AF_Edge       edge, edge_limit;
 
@@ -825,7 +898,7 @@
     /*                                                                   */
     /*********************************************************************/
 
-    edge_distance_threshold = FT_MulFix( hints->edge_distance_threshold,
+    edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
                                          scale );
     if ( edge_distance_threshold > 64 / 4 )
       edge_distance_threshold = 64 / 4;
@@ -1138,18 +1211,19 @@
 
   static FT_Error
   af_latin_hints_init( AF_GlyphHints    hints,
-                       FT_Outline*      outline,
                        AF_LatinMetrics  metrics )
   {
-    FT_Error        error;
     FT_Render_Mode  mode;
 
-    error = af_glyph_hints_reset( hints, &metrics->root.scaler,
-                                  (AF_ScriptMetrics) metrics,
-                                  outline );
-    if (error)
-      goto Exit;
+    af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
 
+   /* correct x_scale and y_scale when needed, since they may have
+    * been modified af_latin_scale_dim above
+    */
+    hints->x_scale = metrics->axis[ AF_DIMENSION_HORZ ].scale;
+    hints->x_delta = metrics->axis[ AF_DIMENSION_HORZ ].delta;
+    hints->y_scale = metrics->axis[ AF_DIMENSION_VERT ].scale;
+    hints->y_delta = metrics->axis[ AF_DIMENSION_VERT ].delta;
 
    /* compute flags depending on render mode, etc...
     */
@@ -1176,20 +1250,10 @@
     if ( mode == FT_RENDER_MODE_MONO )
       hints->other_flags |= AF_LATIN_HINTS_MONO;
 
-   /* analyze glyph outline
-    */
-    if ( AF_HINTS_DO_HORIZONTAL(hints) )
-      af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ );
+    return 0;
+  }
 
-    if ( AF_HINTS_DO_VERTICAL(hints) )
-    {
-      af_latin_hints_detect_features( hints, AF_DIMENSION_VERT );
-      af_latin_hints_compute_blue_edges( hints, metrics );
-    }
 
- Exit:
-   return error;
-  }
 
  /***************************************************************************/
  /***************************************************************************/
@@ -1738,10 +1802,26 @@
                         FT_Outline*      outline,
                         AF_LatinMetrics  metrics )
   {
+    FT_Error      error;
     AF_Dimension  dim;
 
-    FT_UNUSED( metrics );
+    error = af_glyph_hints_reload( hints, outline );
+    if ( error )
+      goto Exit;
+
+   /* analyze glyph outline
+    */
+    if ( AF_HINTS_DO_HORIZONTAL(hints) )
+      af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ );
+
+    if ( AF_HINTS_DO_VERTICAL(hints) )
+    {
+      af_latin_hints_detect_features( hints, AF_DIMENSION_VERT );
+      af_latin_hints_compute_blue_edges( hints, metrics );
+    }
 
+   /* grid-fit the outline
+    */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
       if ( (dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL(hints)) ||
@@ -1755,7 +1835,8 @@
     }
     af_glyph_hints_save( hints, outline );
 
-    return 0;
+  Exit:
+    return error;
   }
 
  /***************************************************************************/
@@ -1768,11 +1849,12 @@
 
   static const AF_Script_UniRangeRec  af_latin_uniranges[] =
   {
-    { 32, 127 },    /* XXX: TODO: Add new Unicode ranges here !! */
+    { 32,  127 },    /* XXX: TODO: Add new Unicode ranges here !! */
     { 160, 255 },
-    { 0, 0 }
+    { 0,   0 }
   };
 
+
   FT_LOCAL_DEF( const AF_ScriptClassRec )  af_latin_script_class =
   {
     AF_SCRIPT_LATIN,

reactos/lib/freetype/src/autofit
aflatin.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- aflatin.h	10 May 2004 17:48:29 -0000	1.3
+++ aflatin.h	18 Aug 2004 20:25:07 -0000	1.4
@@ -51,9 +51,10 @@
 
   enum
   {
-    AF_LATIN_BLUE_ACTIVE = (1 << 0),
-    AF_LATIN_BLUE_TOP    = (1 << 1),
-
+    AF_LATIN_BLUE_ACTIVE     = (1 << 0),
+    AF_LATIN_BLUE_TOP        = (1 << 1),
+    AF_LATIN_BLUE_ADJUSTMENT = (1 << 2),  /* used for scale adjustment */
+                                          /* optimization              */
     AF_LATIN_BLUE_FLAG_MAX
   };
 

reactos/lib/freetype/src/autofit
afloader.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afloader.c	10 May 2004 17:48:29 -0000	1.3
+++ afloader.c	18 Aug 2004 20:25:07 -0000	1.4
@@ -105,16 +105,9 @@
         * is needed
         */
         if ( loader->transformed )
-        {
-          FT_Vector*  point = slot->outline.points;
-          FT_Vector*  limit = point + slot->outline.n_points;
-
-          for ( ; point < limit; point++ )
-          {
-            point->x += loader->trans_delta.x;
-            point->y += loader->trans_delta.y;
-          }
-        }
+          FT_Outline_Translate( &slot->outline,
+                                loader->trans_delta.x,
+                                loader->trans_delta.y );
 
         /* copy the outline points in the loader's current               */
         /* extra points which is used to keep original glyph coordinates */
@@ -157,38 +150,60 @@
 
         /* now load the slot image into the auto-outline and run the */
         /* automatic hinting process                                 */
-        error = metrics->clazz->script_hints_init( hints,
-                                                   &gloader->current.outline,
-                                                   metrics );
-        if ( error )
-          goto Exit;
-
-        /* apply the hints */
         metrics->clazz->script_hints_apply( hints,
                                             &gloader->current.outline,
                                             metrics );
+
         /* we now need to hint the metrics according to the change in */
         /* width/positioning that occured during the hinting process  */
         {
           FT_Pos        old_advance, old_rsb, old_lsb, new_lsb;
+          FT_Pos        pp1x_uh, pp2x_uh;
           AF_AxisHints  axis  = &hints->axis[ AF_DIMENSION_HORZ ];
-          AF_Edge       edge1 = axis->edges;    /* leftmost edge  */
-          AF_Edge       edge2 = edge1 + axis->num_edges - 1; /* rightmost edge */
+          AF_Edge       edge1 = axis->edges;         /* leftmost edge  */
+          AF_Edge       edge2 = edge1 +
+                                axis->num_edges - 1; /* rightmost edge */
+
+
+          if ( edge2 > edge1 )
+          {
+            old_advance = loader->pp2.x;
+            old_rsb     = old_advance - edge2->opos;
+            old_lsb     = edge1->opos;
+            new_lsb     = edge1->pos;
+
+            /* remember unhinted values to later account */
+            /* for rounding errors                       */
+
+            pp1x_uh = new_lsb    - old_lsb;
+            pp2x_uh = edge2->pos + old_rsb;
+
+            /* prefer too much space over too little space */
+            /* for very small sizes                        */
 
+            if ( old_lsb < 24 )
+              pp1x_uh -= 5;
 
-          old_advance = loader->pp2.x;
-          old_rsb     = old_advance - edge2->opos;
-          old_lsb     = edge1->opos;
-          new_lsb     = edge1->pos;
+            if ( old_rsb < 24 )
+              pp2x_uh += 5;
 
-          loader->pp1.x = FT_PIX_ROUND( new_lsb    - old_lsb );
-          loader->pp2.x = FT_PIX_ROUND( edge2->pos + old_rsb );
+            loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
+            loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
+
+            slot->lsb_delta = loader->pp1.x - pp1x_uh;
+            slot->rsb_delta = loader->pp2.x - pp2x_uh;
 
 #if 0
-          /* try to fix certain bad advance computations */
-          if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 )
-            loader->pp2.x += 64;
+            /* try to fix certain bad advance computations */
+            if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 )
+              loader->pp2.x += 64;
 #endif
+          }
+          else
+          {
+            loader->pp1.x = FT_PIX_ROUND( loader->pp1.x );
+            loader->pp2.x = FT_PIX_ROUND( loader->pp2.x );
+          }
         }
 
         /* good, we simply add the glyph to our loader's base */
@@ -366,7 +381,13 @@
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                x_scale );
 #else
-      slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
+      /* for mono-width fonts (like Andale, Courier, etc.) we need */
+      /* to keep the original rounded advance width                */
+      if ( !FT_IS_FIXED_WIDTH( slot->face ) )
+        slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
+      else
+        slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
+                                               metrics->scaler.x_scale );
 #endif
 
       slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
@@ -434,8 +455,13 @@
         load_flags |=  FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
         load_flags &= ~FT_LOAD_RENDER;
 
+        error = metrics->clazz->script_hints_init( &loader->hints, metrics );
+        if ( error )
+          goto Exit;
+
         error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );
       }
     }
+  Exit:
     return error;
   }

reactos/lib/freetype/src/autofit
afmodule.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- afmodule.c	10 May 2004 17:48:29 -0000	1.3
+++ afmodule.c	18 Aug 2004 20:25:07 -0000	1.4
@@ -31,7 +31,7 @@
                             FT_UInt        glyph_index,
                             FT_Int32       load_flags )
   {
-    FT_UNUSED(size);
+    FT_UNUSED( size );
 
     return af_loader_load_glyph( module->loader, slot->face,
                                  glyph_index, load_flags );

reactos/lib/freetype/src/autofit
aftypes.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- aftypes.h	10 May 2004 17:48:29 -0000	1.3
+++ aftypes.h	18 Aug 2004 20:25:07 -0000	1.4
@@ -1,3 +1,20 @@
+/***************************************************************************
+ *
+ *  FreeType auto-fitter
+ *
+ *  (c) 2004 David Turner
+ *
+ *  The auto-fitter is a complete rewrite of the old auto-hinter.
+ *  its main feature is the ability to differentiate between different
+ *  scripts in order to apply language-specific rules.
+ *
+ *  the code has also been compartimentized into several entities that
+ *  should make algorithmic experimentation easier than with the old
+ *  code.
+ *
+ *  finally, we get rid of the Catharon license, since this code is
+ *  released under the FreeType one.
+ */
 #ifndef __AFTYPES_H__
 #define __AFTYPES_H__
 
@@ -73,7 +90,7 @@
 
   typedef FT_Int    AF_Angle;
 
-#define  AF_ANGLE_PI     128
+#define  AF_ANGLE_PI     256
 #define  AF_ANGLE_2PI    (AF_ANGLE_PI*2)
 #define  AF_ANGLE_PI2    (AF_ANGLE_PI/2)
 #define  AF_ANGLE_PI4    (AF_ANGLE_PI/4)
@@ -164,6 +181,12 @@
   } AF_ScalerRec, *AF_Scaler;
 
 
+#define  AF_SCALER_EQUAL_SCALES(a,b)    \
+   ( (a)->x_scale == (b)->x_scale &&    \
+     (a)->y_scale == (b)->y_scale &&    \
+     (a)->x_delta == (b)->x_delta &&    \
+     (a)->y_delta == (b)->y_delta )
+
 
  /**************************************************************************/
  /**************************************************************************/
@@ -228,7 +251,6 @@
 
 
   typedef FT_Error  (*AF_Script_InitHintsFunc)( AF_GlyphHints     hints,
-                                                FT_Outline*       outline,
                                                 AF_ScriptMetrics  metrics );
 
   typedef void      (*AF_Script_ApplyHintsFunc)( AF_GlyphHints     hints,

reactos/lib/freetype/src/autohint
ahhint.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ahhint.c	10 May 2004 17:48:30 -0000	1.6
+++ ahhint.c	18 Aug 2004 20:25:07 -0000	1.7
@@ -1542,7 +1542,7 @@
       /* width/positioning that occured during the hinting process  */
       if ( outline->num_vedges > 0 )
       {
-        FT_Pos   old_advance, old_rsb, old_lsb, new_lsb;
+        FT_Pos   old_advance, old_rsb, old_lsb, new_lsb, pp1x_uh, pp2x_uh;
         AH_Edge  edge1 = outline->vert_edges;     /* leftmost edge  */
         AH_Edge  edge2 = edge1 +
                          outline->num_vedges - 1; /* rightmost edge */
@@ -1553,8 +1553,24 @@
         old_lsb     = edge1->opos;
         new_lsb     = edge1->pos;
 
-        hinter->pp1.x = FT_PIX_ROUND( new_lsb    - old_lsb );
-        hinter->pp2.x = FT_PIX_ROUND( edge2->pos + old_rsb );
+        /* remember unhinted values to later account for rounding errors */
+
+        pp1x_uh = new_lsb    - old_lsb;
+        pp2x_uh = edge2->pos + old_rsb;
+
+        /* prefer too much space over too little space for very small sizes */
+
+        if ( old_lsb < 24 )
+          pp1x_uh -= 5;
+
+        if ( old_rsb < 24 )
+          pp2x_uh += 5;
+
+        hinter->pp1.x = FT_PIX_ROUND( pp1x_uh );
+        hinter->pp2.x = FT_PIX_ROUND( pp2x_uh );
+
+        slot->lsb_delta = hinter->pp1.x - pp1x_uh;
+        slot->rsb_delta = hinter->pp2.x - pp2x_uh;
 
 #if 0
         /* try to fix certain bad advance computations */

reactos/lib/freetype/src/autohint
ahmodule.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ahmodule.c	21 Jan 2004 19:23:46 -0000	1.2
+++ ahmodule.c	18 Aug 2004 20:25:07 -0000	1.3
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-hinting module implementation (declaration).                    */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 Catharon Productions Inc.              */
+/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
 /*  Author: David Turner                                                   */
 /*                                                                         */
 /*  This file is part of the Catharon Typography Project and shall only    */
@@ -39,24 +39,30 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ft_autohinter_init( FT_AutoHinter  module )
+  ft_autohinter_init( FT_Module  module )       /* FT_AutoHinter */
   {
-    FT_Error  error;
+    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
+    FT_Error       error;
 
 
-    error = ah_hinter_new( module->root.library, &module->hinter );
+    error = ah_hinter_new( module->library, &autohinter->hinter );
+
 #ifdef DEBUG_HINTER
     if ( !error )
-      ah_debug_hinter = module->hinter;
+      ah_debug_hinter = autohinter->hinter;
 #endif
+
     return error;
   }
 
 
   FT_CALLBACK_DEF( void )
-  ft_autohinter_done( FT_AutoHinter  module )
+  ft_autohinter_done( FT_Module  module )
   {
-    ah_hinter_done( module->hinter );
+    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
+
+
+    ah_hinter_done( autohinter->hinter );
 
 #ifdef DEBUG_HINTER
     ah_debug_hinter = NULL;
@@ -128,9 +134,9 @@
 
     (const void*) &ft_autohinter_service,
 
-    (FT_Module_Constructor)ft_autohinter_init,
-    (FT_Module_Destructor) ft_autohinter_done,
-    (FT_Module_Requester)  0
+    ft_autohinter_init,
+    ft_autohinter_done,
+    0                       /* FT_Module_Requester */
   };
 
 

reactos/lib/freetype/src/base
ftbbox.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ftbbox.c	21 Jan 2004 19:23:46 -0000	1.2
+++ ftbbox.c	18 Aug 2004 20:25:08 -0000	1.3
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType bbox computation (body).                                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
@@ -48,7 +48,7 @@
   /*    This function is used as a `move_to' and `line_to' emitter during  */
   /*    FT_Outline_Decompose().  It simply records the destination point   */
   /*    in `user->last'; no further computations are necessary since we    */
-  /*    the cbox as the starting bbox which must be refined.               */
+  /*    use the cbox as the starting bbox which must be refined.           */
   /*                                                                       */
   /* <Input>                                                               */
   /*    to   :: A pointer to the destination vector.                       */
@@ -88,11 +88,14 @@
   /*                                                                       */
   /* <Input>                                                               */
   /*    y1  :: The start coordinate.                                       */
+  /*                                                                       */
   /*    y2  :: The coordinate of the control point.                        */
+  /*                                                                       */
   /*    y3  :: The end coordinate.                                         */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    min :: The address of the current minimum.                         */
+  /*                                                                       */
   /*    max :: The address of the current maximum.                         */
   /*                                                                       */
   static void
@@ -102,19 +105,17 @@
                     FT_Pos*  min,
                     FT_Pos*  max )
   {
-    if ( y1 <= y3 )
-    {
-      if ( y2 == y1 )               /* Flat arc */
-        goto Suite;
-    }
-    else if ( y1 < y3 )
+    if ( y1 <= y3 && y2 == y1 )     /* flat arc */
+      goto Suite;
+
+    if ( y1 < y3 )
     {
-      if ( y2 >= y1 && y2 <= y3 )   /* Ascending arc */
+      if ( y2 >= y1 && y2 <= y3 )   /* ascending arc */
         goto Suite;
     }
     else
     {
-      if ( y2 >= y3 && y2 <= y1 )   /* Descending arc */
+      if ( y2 >= y3 && y2 <= y1 )   /* descending arc */
       {
         y2 = y1;
         y1 = y3;
@@ -144,6 +145,7 @@
   /*                                                                       */
   /* <Input>                                                               */
   /*    control :: A pointer to a control point.                           */
+  /*                                                                       */
   /*    to      :: A pointer to the destination vector.                    */
   /*                                                                       */
   /* <InOut>                                                               */
@@ -165,7 +167,6 @@
     /* within the bbox                                                    */
 
     if ( CHECK_X( control, user->bbox ) )
-
       BBox_Conic_Check( user->last.x,
                         control->x,
                         to->x,
@@ -173,7 +174,6 @@
                         &user->bbox.xMax );
 
     if ( CHECK_Y( control, user->bbox ) )
-
       BBox_Conic_Check( user->last.y,
                         control->y,
                         to->y,
@@ -194,19 +194,25 @@
   /* <Description>                                                         */
   /*    Finds the extrema of a 1-dimensional cubic Bezier curve and        */
   /*    updates a bounding range.  This version uses splitting because we  */
-  /*    don't want to use square roots and extra accuracies.               */
+  /*    don't want to use square roots and extra accuracy.                 */
   /*                                                                       */
   /* <Input>                                                               */
   /*    p1  :: The start coordinate.                                       */
+  /*                                                                       */
   /*    p2  :: The coordinate of the first control point.                  */
+  /*                                                                       */
   /*    p3  :: The coordinate of the second control point.                 */
+  /*                                                                       */
   /*    p4  :: The end coordinate.                                         */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    min :: The address of the current minimum.                         */
+  /*                                                                       */
   /*    max :: The address of the current maximum.                         */
   /*                                                                       */
+
 #if 0
+
   static void
   BBox_Cubic_Check( FT_Pos   p1,
                     FT_Pos   p2,
@@ -235,17 +241,17 @@
 
       if ( y1 == y4 )
       {
-        if ( y1 == y2 && y1 == y3 )                         /* Flat */
+        if ( y1 == y2 && y1 == y3 )                         /* flat */
           goto Test;
       }
       else if ( y1 < y4 )
       {
-        if ( y2 >= y1 && y2 <= y4 && y3 >= y1 && y3 <= y4 ) /* Ascending */
+        if ( y2 >= y1 && y2 <= y4 && y3 >= y1 && y3 <= y4 ) /* ascending */
           goto Test;
       }
       else
       {
-        if ( y2 >= y4 && y2 <= y1 && y3 >= y4 && y3 <= y1 ) /* Descending */
+        if ( y2 >= y4 && y2 <= y1 && y3 >= y4 && y3 <= y1 ) /* descending */
         {
           y2 = y1;
           y1 = y4;
@@ -254,7 +260,7 @@
         }
       }
 
-      /* Unknown direction -- split the arc in two */
+      /* unknown direction -- split the arc in two */
       arc[6] = y4;
       arc[1] = y1 = ( y1 + y2 ) / 2;
       arc[5] = y4 = ( y4 + y3 ) / 2;
@@ -275,6 +281,7 @@
       ;
     } while ( arc >= stack );
   }
+
 #else
 
   static void
@@ -296,17 +303,19 @@
     FT_UNUSED ( y4 );
 
 
-    /* The polynom is                       */
-    /*                                      */
-    /*   a*x^3 + 3b*x^2 + 3c*x + d      .   */
-    /*                                      */
-    /* However, we also have                */
-    /*                                      */
-    /*   dP/dx(u) = 0       ,               */
-    /*                                      */
-    /* which implies that                   */
-    /*                                      */
-    /*   P(u) = b*u^2 + 2c*u + d            */
+    /* The polynom is                         */
+    /*                                        */
+    /*    P(x) = a*x^3 + 3b*x^2 + 3c*x + d  , */
+    /*                                        */
+    /*   dP/dx = 3a*x^2 + 6b*x + 3c         . */
+    /*                                        */
+    /* However, we also have                  */
+    /*                                        */
+    /*   dP/dx(u) = 0                       , */
+    /*                                        */
+    /* which implies by subtraction that      */
+    /*                                        */
+    /*   P(u) = b*u^2 + 2c*u + d            . */
 
     if ( u > 0 && u < 0x10000L )
     {
@@ -357,72 +366,67 @@
       FT_Fixed  t;
 
 
-      /* We need to solve "ax^2+2bx+c" here, without floating points!      */
+      /* We need to solve `ax^2+2bx+c' here, without floating points!      */
       /* The trick is to normalize to a different representation in order  */
       /* to use our 16.16 fixed point routines.                            */
       /*                                                                   */
-      /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after the            */
-      /* the normalization.  These values must fit into a single 16.16     */
-      /* value.                                                            */
-      /*                                                                   */
-      /* We normalize a, b, and c to "8.16" fixed float values to ensure   */
-      /* that their product is held in a "16.16" value.                    */
+      /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after normalization. */
+      /* These values must fit into a single 16.16 value.                  */
       /*                                                                   */
+      /* We normalize a, b, and c to `8.16' fixed float values to ensure   */
+      /* that its product is held in a `16.16' value.                      */
+
       {
         FT_ULong  t1, t2;
         int       shift = 0;
 
 
-        /* Technical explanation of what's happening there.            */
-        /*                                                             */
-        /*   The following computation is based on the fact that for   */
-        /*   any value "y", if "n" is the position of the most         */
-        /*   significant bit of "abs(y)" (starting from 0 for the      */
-        /*   least significant bit), then y is in the range            */
-        /*                                                             */
-        /*                  "-2^n..2^n-1"                              */
-        /*                                                             */
-        /*   We want to shift "a", "b" and "c" concurrently in order   */
-        /*   to ensure that they all fit in 8.16 values, which maps    */
-        /*   to the integer range "-2^23..2^23-1".                     */
-        /*                                                             */
-        /*   Necessarily, we need to shift "a", "b" and "c" so that    */
-        /*   the most significant bit of their absolute values is at   */
-        /*   _most_ at position 23.                                    */
-        /*                                                             */
-        /*   We begin by computing "t1" as the bitwise "or" of the     */
-        /*   absolute values of "a", "b", "c".                         */
-        /*                                                             */
-        t1  = (FT_ULong)((a >= 0) ? a : -a );
-        t2  = (FT_ULong)((b >= 0) ? b : -b );
+        /* The following computation is based on the fact that for   */
+        /* any value `y', if `n' is the position of the most         */
+        /* significant bit of `abs(y)' (starting from 0 for the      */
+        /* least significant bit), then `y' is in the range          */
+        /*                                                           */
+        /*   -2^n..2^n-1                                             */
+        /*                                                           */
+        /* We want to shift `a', `b', and `c' concurrently in order  */
+        /* to ensure that they all fit in 8.16 values, which maps    */
+        /* to the integer range `-2^23..2^23-1'.                     */
+        /*                                                           */
+        /* Necessarily, we need to shift `a', `b', and `c' so that   */
+        /* the most significant bit of its absolute values is at     */
+        /* _most_ at position 23.                                    */
+        /*                                                           */
+        /* We begin by computing `t1' as the bitwise `OR' of the     */
+        /* absolute values of `a', `b', `c'.                         */
+
+        t1  = (FT_ULong)( ( a >= 0 ) ? a : -a );
+        t2  = (FT_ULong)( ( b >= 0 ) ? b : -b );
         t1 |= t2;
-        t2  = (FT_ULong)((c >= 0) ? c : -c );
+        t2  = (FT_ULong)( ( c >= 0 ) ? c : -c );
         t1 |= t2;
 
-        /*   Now, the most significant bit of "t1" is sure to be the   */
-        /*   msb of one of "a", "b", "c", depending on which one is    */
-        /*   expressed in the greatest integer range.                  */
-        /*                                                             */
-        /*   We now compute the "shift", by shifting "t1" as many      */
-        /*   times as necessary to move its msb to position 23.        */
-        /*                                                             */
-        /*   This corresponds to a value of t1 that is in the range    */
-        /*   0x40_0000..0x7F_FFFF.                                     */
-        /*                                                             */
-        /*   Finally, we shift "a", "b" and "c" by the same amount.    */
-        /*   This ensures that all values are now in the range         */
-        /*   -2^23..2^23, i.e. that they are now expressed as 8.16     */
-        /*   fixed float numbers.                                      */
-        /*                                                             */
-        /*   This also means that we are using 24 bits of precision    */
-        /*   to compute the zeros, independently of the range of       */
-        /*   the original polynom coefficients.                        */
-        /*                                                             */
-        /*   This should ensure reasonably accurate values for the     */
-        /*   zeros.  Note that the latter are only expressed with      */
-        /*   16 bits when computing the extrema (the zeros need to     */
-        /*   be in 0..1 exclusive to be considered part of the arc).   */
-        /*                                                             */
+        /* Now we can be sure that the most significant bit of `t1'  */
+        /* is the most significant bit of either `a', `b', or `c',   */
+        /* depending on the greatest integer range of the particular */
+        /* variable.                                                 */
+        /*                                                           */
+        /* Next, we compute the `shift', by shifting `t1' as many    */
+        /* times as necessary to move its MSB to position 23.  This  */
+        /* corresponds to a value of `t1' that is in the range       */
+        /* 0x40_0000..0x7F_FFFF.                                     */
+        /*                                                           */
+        /* Finally, we shift `a', `b', and `c' by the same amount.   */
+        /* This ensures that all values are now in the range         */
+        /* -2^23..2^23, i.e., they are now expressed as 8.16         */
+        /* fixed-float numbers.  This also means that we are using   */
+        /* 24 bits of precision to compute the zeros, independently  */
+        /* of the range of the original polynomial coefficients.     */
+        /*                                                           */
+        /* This algorithm should ensure reasonably accurate values   */
+        /* for the zeros.  Note that they are only expressed with    */
+        /* 16 bits when computing the extrema (the zeros need to     */
+        /* be in 0..1 exclusive to be considered part of the arc).   */
+
         if ( t1 == 0 )  /* all coefficients are 0! */
           return;
 
@@ -432,10 +436,11 @@
           {
             shift++;
             t1 >>= 1;
+
           } while ( t1 > 0x7FFFFFUL );
 
-          /* losing some bits of precision, but we use 24 of them */
-          /* for the computation anyway.                          */
+          /* this loses some bits of precision, but we use 24 of them */
+          /* for the computation anyway                               */
           a >>= shift;
           b >>= shift;
           c >>= shift;
@@ -446,6 +451,7 @@
           {
             shift++;
             t1 <<= 1;
+
           } while ( t1 < 0x400000UL );
 
           a <<= shift;
@@ -478,7 +484,7 @@
         }
         else
         {
-          /* there are two solutions; we need to filter them though */
+          /* there are two solutions; we need to filter them */
           d = FT_SqrtFixed( (FT_Int32)d );
           t = - FT_DivFix( b - d, a );
           test_cubic_extrema( y1, y2, y3, y4, t, min, max );
@@ -506,7 +512,9 @@
   /*                                                                       */
   /* <Input>                                                               */
   /*    control1 :: A pointer to the first control point.                  */
+  /*                                                                       */
   /*    control2 :: A pointer to the second control point.                 */
+  /*                                                                       */
   /*    to       :: A pointer to the destination vector.                   */
   /*                                                                       */
   /* <InOut>                                                               */
@@ -517,7 +525,7 @@
   /*                                                                       */
   /* <Note>                                                                */
   /*    In the case of a non-monotonous arc, we don't compute directly     */
-  /*    extremum coordinates, we subdivise instead.                        */
+  /*    extremum coordinates, we subdivide instead.                        */
   /*                                                                       */
   static int
   BBox_Cubic_To( FT_Vector*  control1,
@@ -530,23 +538,21 @@
 
     if ( CHECK_X( control1, user->bbox ) ||
          CHECK_X( control2, user->bbox ) )
-
-        BBox_Cubic_Check( user->last.x,
-                          control1->x,
-                          control2->x,
-                          to->x,
-                          &user->bbox.xMin,
-                          &user->bbox.xMax );
+      BBox_Cubic_Check( user->last.x,
+                        control1->x,
+                        control2->x,
+                        to->x,
+                        &user->bbox.xMin,
+                        &user->bbox.xMax );
 
     if ( CHECK_Y( control1, user->bbox ) ||
          CHECK_Y( control2, user->bbox ) )
-
-        BBox_Cubic_Check( user->last.y,
-                          control1->y,
-                          control2->y,
-                          to->y,
-                          &user->bbox.yMin,
-                          &user->bbox.yMax );
+      BBox_Cubic_Check( user->last.y,
+                        control1->y,
+                        control2->y,
+                        to->y,
+                        &user->bbox.yMin,
+                        &user->bbox.yMax );
 
     user->last = *to;
 

reactos/lib/freetype/src/base
ftdbgmem.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftdbgmem.c	10 May 2004 17:48:30 -0000	1.6
+++ ftdbgmem.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -540,10 +540,15 @@
     FT_Long      line_no   = table->line_no;
 
 
+    /* the following is valid according to ANSI C */
+#if 0
     if ( block == NULL || cur_size == 0 )
       ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
-                           file_name, line_no );
+                          file_name, line_no );
+#endif
 
+    /* while the following is allowed in ANSI C also, we abort since */
+    /* such code shouldn't be in FreeType...                         */
     if ( new_size <= 0 )
       ft_mem_debug_panic(
         "trying to reallocate %p to size 0 (current is %ld) in (%s:%ld)",
@@ -689,6 +694,46 @@
   }
 
 
+  FT_BASE_DEF( FT_Error )
+  FT_QAlloc_Debug( FT_Memory    memory,
+                   FT_Long      size,
+                   void*       *P,
+                   const char*  file_name,
+                   FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    return FT_QAlloc( memory, size, P );
+  }
+
+
+  FT_BASE_DEF( FT_Error )
+  FT_QRealloc_Debug( FT_Memory    memory,
+                     FT_Long      current,
+                     FT_Long      size,
+                     void*       *P,
+                     const char*  file_name,
+                     FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+    return FT_QRealloc( memory, current, size, P );
+  }
+
+  
   FT_BASE_DEF( void )
   FT_Free_Debug( FT_Memory    memory,
                  FT_Pointer   block,

reactos/lib/freetype/src/base
ftgloadr.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftgloadr.c	10 May 2004 17:48:30 -0000	1.4
+++ ftgloadr.c	18 Aug 2004 20:25:08 -0000	1.5
@@ -182,14 +182,14 @@
   }
 
 
-  /* Ensure that we can add `n_points' and `n_contours' to our glyph. this */
-  /* function reallocates its outline tables if necessary.  Note that it   */
-  /* DOESN'T change the number of points within the loader!                */
+  /* Ensure that we can add `n_points' and `n_contours' to our glyph.      */
+  /* This function reallocates its outline tables if necessary.  Note that */
+  /* it DOESN'T change the number of points within the loader!             */
   /*                                                                       */
   FT_BASE_DEF( FT_Error )
   FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,
-                               FT_UInt        n_points,
-                               FT_UInt        n_contours )
+                              FT_UInt         n_points,
+                              FT_UInt         n_contours )
   {
     FT_Memory    memory  = loader->memory;
     FT_Error     error   = FT_Err_Ok;

reactos/lib/freetype/src/base
ftglyph.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftglyph.c	10 May 2004 17:48:30 -0000	1.6
+++ ftglyph.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -138,13 +138,14 @@
   }
 
 
-  static FT_Error
-  ft_bitmap_glyph_init( FT_BitmapGlyph  glyph,
-                        FT_GlyphSlot    slot )
-  {
-    FT_Error    error   = FT_Err_Ok;
-    FT_Library  library = FT_GLYPH(glyph)->library;
-    FT_Memory   memory  = library->memory;
+  FT_CALLBACK_DEF( FT_Error )
+  ft_bitmap_glyph_init( FT_Glyph      bitmap_glyph,
+                        FT_GlyphSlot  slot )
+  {
+    FT_BitmapGlyph  glyph   = (FT_BitmapGlyph)bitmap_glyph;
+    FT_Error        error   = FT_Err_Ok;
+    FT_Library      library = FT_GLYPH( glyph )->library;
+    FT_Memory       memory  = library->memory;
 
 
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
@@ -171,11 +172,13 @@
   }
 
 
-  static FT_Error
-  ft_bitmap_glyph_copy( FT_BitmapGlyph  source,
-                        FT_BitmapGlyph  target )
-  {
-    FT_Memory  memory = source->root.library->memory;
+  FT_CALLBACK_DEF( FT_Error )
+  ft_bitmap_glyph_copy( FT_Glyph  bitmap_source,
+                        FT_Glyph  bitmap_target )
+  {
+    FT_BitmapGlyph  source = (FT_BitmapGlyph)bitmap_source;
+    FT_BitmapGlyph  target = (FT_BitmapGlyph)bitmap_target;
+    FT_Memory       memory = bitmap_source->library->memory;
 
 
     target->left = source->left;
@@ -185,20 +188,24 @@
   }
 
 
-  static void
-  ft_bitmap_glyph_done( FT_BitmapGlyph  glyph )
+  FT_CALLBACK_DEF( void )
+  ft_bitmap_glyph_done( FT_Glyph  bitmap_glyph )
   {
-    FT_Memory  memory = FT_GLYPH(glyph)->library->memory;
+    FT_BitmapGlyph  glyph  = (FT_BitmapGlyph)bitmap_glyph;
+    FT_Memory       memory = FT_GLYPH( glyph )->library->memory;
 
 
     FT_FREE( glyph->bitmap.buffer );
   }
 
 
-  static void
-  ft_bitmap_glyph_bbox( FT_BitmapGlyph  glyph,
-                        FT_BBox*        cbox )
+  FT_CALLBACK_DEF( void )
+  ft_bitmap_glyph_bbox( FT_Glyph  bitmap_glyph,
+                        FT_BBox*  cbox )
   {
+    FT_BitmapGlyph  glyph = (FT_BitmapGlyph)bitmap_glyph;
+
+
     cbox->xMin = glyph->left << 6;
     cbox->xMax = cbox->xMin + ( glyph->bitmap.width << 6 );
     cbox->yMax = glyph->top << 6;
@@ -209,15 +216,15 @@
   FT_CALLBACK_TABLE_DEF
   const FT_Glyph_Class  ft_bitmap_glyph_class =
   {
-    sizeof( FT_BitmapGlyphRec ),
+    sizeof ( FT_BitmapGlyphRec ),
     FT_GLYPH_FORMAT_BITMAP,
 
-    (FT_Glyph_InitFunc)     ft_bitmap_glyph_init,
-    (FT_Glyph_DoneFunc)     ft_bitmap_glyph_done,
-    (FT_Glyph_CopyFunc)     ft_bitmap_glyph_copy,
-    (FT_Glyph_TransformFunc)0,
-    (FT_Glyph_GetBBoxFunc)  ft_bitmap_glyph_bbox,
-    (FT_Glyph_PrepareFunc)  0
+    ft_bitmap_glyph_init,
+    ft_bitmap_glyph_done,
+    ft_bitmap_glyph_copy,
+    0,                          /* FT_Glyph_TransformFunc */
+    ft_bitmap_glyph_bbox,
+    0                           /* FT_Glyph_PrepareFunc   */
   };
 
 
@@ -230,14 +237,15 @@
   /*************************************************************************/
 
 
-  static FT_Error
-  ft_outline_glyph_init( FT_OutlineGlyph  glyph,
-                         FT_GlyphSlot     slot )
-  {
-    FT_Error     error   = FT_Err_Ok;
-    FT_Library   library = FT_GLYPH(glyph)->library;
-    FT_Outline*  source  = &slot->outline;
-    FT_Outline*  target  = &glyph->outline;
+  FT_CALLBACK_DEF( FT_Error )
+  ft_outline_glyph_init( FT_Glyph      outline_glyph,
+                         FT_GlyphSlot  slot )
+  {
+    FT_OutlineGlyph  glyph   = (FT_OutlineGlyph)outline_glyph;
+    FT_Error         error   = FT_Err_Ok;
+    FT_Library       library = FT_GLYPH( glyph )->library;
+    FT_Outline*      source  = &slot->outline;
+    FT_Outline*      target  = &glyph->outline;
 
 
     /* check format in glyph slot */
@@ -268,19 +276,24 @@
   }
 
 
-  static void
-  ft_outline_glyph_done( FT_OutlineGlyph  glyph )
+  FT_CALLBACK_DEF( void )
+  ft_outline_glyph_done( FT_Glyph  outline_glyph )
   {
+    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;
+
+
     FT_Outline_Done( FT_GLYPH( glyph )->library, &glyph->outline );
   }
 
 
-  static FT_Error
-  ft_outline_glyph_copy( FT_OutlineGlyph  source,
-                         FT_OutlineGlyph  target )
-  {
-    FT_Error    error;
-    FT_Library  library = FT_GLYPH( source )->library;
+  FT_CALLBACK_DEF( FT_Error )
+  ft_outline_glyph_copy( FT_Glyph  outline_source,
+                         FT_Glyph  outline_target )
+  {
+    FT_OutlineGlyph  source  = (FT_OutlineGlyph)outline_source;
+    FT_OutlineGlyph  target  = (FT_OutlineGlyph)outline_target;
+    FT_Error         error;
+    FT_Library       library = FT_GLYPH( source )->library;
 
 
     error = FT_Outline_New( library, source->outline.n_points,
@@ -292,11 +305,14 @@
   }
 
 
-  static void
-  ft_outline_glyph_transform( FT_OutlineGlyph  glyph,
-                              FT_Matrix*       matrix,
-                              FT_Vector*       delta )
+  FT_CALLBACK_DEF( void )
+  ft_outline_glyph_transform( FT_Glyph    outline_glyph,
+                              FT_Matrix*  matrix,
+                              FT_Vector*  delta )
   {
+    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;
+
+
     if ( matrix )
       FT_Outline_Transform( &glyph->outline, matrix );
 
@@ -305,18 +321,24 @@
   }
 
 
-  static void
-  ft_outline_glyph_bbox( FT_OutlineGlyph  glyph,
-                         FT_BBox*         bbox )
+  FT_CALLBACK_DEF( void )
+  ft_outline_glyph_bbox( FT_Glyph  outline_glyph,
+                         FT_BBox*  bbox )
   {
+    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;
+
+
     FT_Outline_Get_CBox( &glyph->outline, bbox );
   }
 
 
-  static FT_Error
-  ft_outline_glyph_prepare( FT_OutlineGlyph  glyph,
-                            FT_GlyphSlot     slot )
+  FT_CALLBACK_DEF( FT_Error )
+  ft_outline_glyph_prepare( FT_Glyph      outline_glyph,
+                            FT_GlyphSlot  slot )
   {
+    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;
+
+
     slot->format         = FT_GLYPH_FORMAT_OUTLINE;
     slot->outline        = glyph->outline;
     slot->outline.flags &= ~FT_OUTLINE_OWNER;
@@ -328,15 +350,15 @@
   FT_CALLBACK_TABLE_DEF
   const FT_Glyph_Class  ft_outline_glyph_class =
   {
-    sizeof( FT_OutlineGlyphRec ),
+    sizeof ( FT_OutlineGlyphRec ),
     FT_GLYPH_FORMAT_OUTLINE,
 
-    (FT_Glyph_InitFunc)     ft_outline_glyph_init,
-    (FT_Glyph_DoneFunc)     ft_outline_glyph_done,
-    (FT_Glyph_CopyFunc)     ft_outline_glyph_copy,
-    (FT_Glyph_TransformFunc)ft_outline_glyph_transform,
-    (FT_Glyph_GetBBoxFunc)  ft_outline_glyph_bbox,
-    (FT_Glyph_PrepareFunc)  ft_outline_glyph_prepare
+    ft_outline_glyph_init,
+    ft_outline_glyph_done,
+    ft_outline_glyph_copy,
+    ft_outline_glyph_transform,
+    ft_outline_glyph_bbox,
+    ft_outline_glyph_prepare
   };
 
 
@@ -644,7 +666,7 @@
       goto Exit;
 
     /* in case of success, copy the bitmap to the glyph bitmap */
-    error = ft_bitmap_glyph_init( bitmap, &dummy );
+    error = ft_bitmap_glyph_init( (FT_Glyph)bitmap, &dummy );
     if ( error )
       goto Exit;
 

reactos/lib/freetype/src/base
ftmm.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftmm.c	10 May 2004 17:48:30 -0000	1.4
+++ ftmm.c	18 Aug 2004 20:25:08 -0000	1.5
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Multiple Master font support (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003 by                                           */
+/*  Copyright 1996-2001, 2003, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -85,6 +85,28 @@
   /* documentation is in ftmm.h */
 
   FT_EXPORT_DEF( FT_Error )
+  FT_Get_MM_Var( FT_Face      face,
+                 FT_MM_Var*  *amaster )
+  {
+    FT_Error                 error;
+    FT_Service_MultiMasters  service;
+
+
+    error = ft_face_get_mm_service( face, &service );
+    if ( !error )
+    {
+      error = FT_Err_Invalid_Argument;
+      if ( service->get_mm_var )
+        error = service->get_mm_var( face, amaster );
+    }
+
+    return error;
+  }
+
+
+  /* documentation is in ftmm.h */
+
+  FT_EXPORT_DEF( FT_Error )
   FT_Set_MM_Design_Coordinates( FT_Face   face,
                                 FT_UInt   num_coords,
                                 FT_Long*  coords )
@@ -108,6 +130,29 @@
   /* documentation is in ftmm.h */
 
   FT_EXPORT_DEF( FT_Error )
+  FT_Set_Var_Design_Coordinates( FT_Face    face,
+                                 FT_UInt    num_coords,
+                                 FT_Fixed*  coords )
+  {
+    FT_Error                 error;
+    FT_Service_MultiMasters  service;
+
+
+    error = ft_face_get_mm_service( face, &service );
+    if ( !error )
+    {
+      error = FT_Err_Invalid_Argument;
+      if ( service->set_var_design )
+        error = service->set_var_design( face, num_coords, coords );
+    }
+
+    return error;
+  }
+
+
+  /* documentation is in ftmm.h */
+
+  FT_EXPORT_DEF( FT_Error )
   FT_Set_MM_Blend_Coordinates( FT_Face    face,
                                FT_UInt    num_coords,
                                FT_Fixed*  coords )
@@ -128,4 +173,30 @@
   }
 
 
+  /* documentation is in ftmm.h */
+  
+  /* This is exactly the same as the previous function.  It exists for */
+  /* orthogonality.                                                    */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Set_Var_Blend_Coordinates( FT_Face    face,
+                                FT_UInt    num_coords,
+                                FT_Fixed*  coords )
+  {
+    FT_Error                 error;
+    FT_Service_MultiMasters  service;
+
+
+    error = ft_face_get_mm_service( face, &service );
+    if ( !error )
+    {
+      error = FT_Err_Invalid_Argument;
+      if ( service->set_mm_blend )
+         error = service->set_mm_blend( face, num_coords, coords );
+    }
+
+    return error;
+  }
+
+
 /* END */

reactos/lib/freetype/src/base
ftobjs.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftobjs.c	10 May 2004 17:48:30 -0000	1.6
+++ ftobjs.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -1999,7 +1999,7 @@
     if ( char_height < 1 * 64 )
       char_height = 1 * 64;
 
-    /* Compute pixel sizes in 26.6 units with rounding */
+    /* Compute pixel sizes in 26.6 units */
     dim_x = ( char_width  * horz_resolution + 36 ) / 72;
     dim_y = ( char_height * vert_resolution + 36 ) / 72;
 
@@ -2007,7 +2007,6 @@
       FT_UShort  x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 );
       FT_UShort  y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 );
 
-
       if ( x_ppem == metrics->x_ppem && y_ppem == metrics->y_ppem )
         return FT_Err_Ok;
 
@@ -2215,6 +2214,24 @@
   }
 
 
+  /* documentation is in freetype.h */
+
+  FT_EXPORT_DEF( FT_Int )
+  FT_Get_Charmap_Index( FT_CharMap  charmap )
+  {
+    FT_Int  i;
+
+
+    for ( i = 0; i < charmap->face->num_charmaps; i++ )
+      if ( charmap->face->charmaps[i] == charmap )
+        break;
+
+    FT_ASSERT( i < charmap->face->num_charmaps );
+
+    return i;
+  }
+
+
   FT_BASE_DEF( void )
   FT_CMap_Done( FT_CMap  cmap )
   {

reactos/lib/freetype/src/base
ftstream.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ftstream.c	10 May 2004 17:48:31 -0000	1.2
+++ ftstream.c	18 Aug 2004 20:25:08 -0000	1.3
@@ -210,7 +210,7 @@
       FT_Memory  memory = stream->memory;
 
 
-      if ( FT_ALLOC( stream->base, count ) )
+      if ( FT_QALLOC( stream->base, count ) )
         goto Exit;
 
       /* read it */

reactos/lib/freetype/src/base
ftutil.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ftutil.c	1 Apr 2003 08:38:21 -0000	1.1
+++ ftutil.c	18 Aug 2004 20:25:08 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for memory and list management (body).         */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -77,6 +77,36 @@
   }
 
 
+  FT_BASE_DEF( FT_Error )
+  FT_QAlloc( FT_Memory  memory,
+             FT_Long    size,
+             void*     *P )
+  {
+    FT_ASSERT( P != 0 );
+
+    if ( size > 0 )
+    {
+      *P = memory->alloc( memory, size );
+      if ( !*P )
+      {
+        FT_ERROR(( "FT_QAlloc:" ));
+        FT_ERROR(( " Out of memory? (%ld requested)\n",
+                   size ));
+
+        return FT_Err_Out_Of_Memory;
+      }
+    }
+    else
+      *P = NULL;
+
+    FT_TRACE7(( "FT_QAlloc:" ));
+    FT_TRACE7(( " size = %ld, block = 0x%08p, ref = 0x%08p\n",
+                size, *P, P ));
+
+    return FT_Err_Ok;
+  }
+
+
   /* documentation is in ftmemory.h */
 
   FT_BASE_DEF( FT_Error )
@@ -119,6 +149,43 @@
   }
 
 
+  FT_BASE_DEF( FT_Error )
+  FT_QRealloc( FT_Memory  memory,
+               FT_Long    current,
+               FT_Long    size,
+               void**     P )
+  {
+    void*  Q;
+
+
+    FT_ASSERT( P != 0 );
+
+    /* if the original pointer is NULL, call FT_QAlloc() */
+    if ( !*P )
+      return FT_QAlloc( memory, size, P );
+
+    /* if the new block if zero-sized, clear the current one */
+    if ( size <= 0 )
+    {
+      FT_Free( memory, P );
+      return FT_Err_Ok;
+    }
+
+    Q = memory->realloc( memory, current, size, *P );
+    if ( !Q )
+      goto Fail;
+
+    *P = Q;
+    return FT_Err_Ok;
+
+  Fail:
+    FT_ERROR(( "FT_QRealloc:" ));
+    FT_ERROR(( " Failed (current %ld, requested %ld)\n",
+               current, size ));
+    return FT_Err_Out_Of_Memory;
+  }
+
+
   /* documentation is in ftmemory.h */
 
   FT_BASE_DEF( void )

reactos/lib/freetype/src/base
ftexcept.c removed after 1.1
diff -N ftexcept.c
--- ftexcept.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,197 +0,0 @@
-#include <ft2build.h>
-#include FT_EXCEPT_H
-
-
-  FT_BASE_DEF( void )
-  ft_cleanup_stack_init( FT_CleanupStack  stack,
-                         FT_Memory        memory )
-  {
-    stack->chunk = &stack->chunk_0;
-    stack->top   = stack->chunk->items;
-    stack->limit = stack->top + FT_CLEANUP_CHUNK_SIZE;
-    stack->chunk_0.link = NULL;
-
-    stack->memory = memory;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_cleanup_stack_done( FT_CleanupStack  stack )
-  {
-    FT_Memory        memory = stack->memory;
-    FT_CleanupChunk  chunk, next;
-
-    for (;;)
-    {
-      chunk = stack->chunk;
-      if ( chunk == &stack->chunk_0 )
-        break;
-
-      stack->chunk = chunk->link;
-
-      FT_Free( chunk, memory );
-    }
-
-    stack->memory = NULL;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_cleanup_stack_push( FT_CleanupStack  stack,
-                         FT_Pointer       item,
-                         FT_CleanupFunc   item_func,
-                         FT_Pointer       item_data )
-  {
-    FT_CleanupItem  top;
-
-
-    FT_ASSERT( stack && stack->chunk && stack->top );
-    FT_ASSERT( item  && item_func );
-
-    top = stack->top;
-
-    top->item      = item;
-    top->item_func = item_func;
-    top->item_data = item_data;
-
-    top ++;
-
-    if ( top == stack->limit )
-    {
-      FT_CleanupChunk  chunk;
-
-      chunk = FT_QAlloc( sizeof(*chunk), stack->memory );
-
-      chunk->link  = stack->chunk;
-      stack->chunk = chunk;
-      stack->limit = chunk->items + FT_CLEANUP_CHUNK_SIZE;
-      top          = chunk->items;
-    }
-
-    stack->top = top;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_cleanup_stack_pop( FT_CleanupStack   stack,
-                        FT_Int            destroy )
-  {
-    FT_CleanupItem  top;
-
-
-    FT_ASSERT( stack && stack->chunk && stack->top );
-    top = stack->top;
-
-    if ( top == stack->chunk->items )
-    {
-      FT_CleanupChunk  chunk;
-
-      chunk = stack->chunk;
-
-      if ( chunk == &stack->chunk_0 )
-      {
-        FT_ERROR(( "cleanup.pop: empty cleanup stack !!\n" ));
-        ft_cleanup_throw( stack, FT_Err_EmptyCleanupStack );
-      }
-
-      chunk = chunk->link;
-      FT_QFree( stack->chunk, stack->memory );
-
-      stack->chunk = chunk;
-      stack->limit = chunk->items + FT_CLEANUP_CHUNK_SIZE;
-      top          = stack->limit;
-    }
-
-    top --;
-
-    if ( destroy )
-      top->item_func( top->item, top->item_data );
-
-    top->item      = NULL;
-    top->item_func = NULL;
-    top->item_data = NULL;
-
-    stack->top = top;
-  }
-
-
-
-  FT_BASE_DEF( FT_CleanupItem )
-  ft_cleanup_stack_peek( FT_CleanupStack  stack )
-  {
-    FT_CleanupItem   top;
-    FT_CleanupChunk  chunk;
-
-
-    FT_ASSERT( stack && stack->chunk && stack->top );
-
-    top   = stack->top;
-    chunk = stack->chunk;
-
-    if ( top > chunk->items )
-      top--;
-    else
-    {
-      chunk = chunk->link;
-      top   = NULL;
-      if ( chunk != NULL )
-        top = chunk->items + FT_CLEANUP_CHUNK_SIZE - 1;
-    }
-    return top;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_xhandler_enter( FT_XHandler  xhandler,
-                     FT_Memory    memory )
-  {
-    FT_CleanupStack  stack = FT_MEMORY__CLEANUP(memory);
-
-    xhandler->previous = stack->xhandler;
-    xhandler->cleanup  = stack->top;
-    xhandler->error    = 0;
-    stack->xhandler    = xhandler;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_xhandler_exit( FT_XHandler  xhandler )
-  {
-    FT_CleanupStack  stack = FT_MEMORY__CLEANUP(memory);
-
-    stack->xhandler    = xhandler->previous;
-    xhandler->previous = NULL;
-    xhandler->error    = error;
-    xhandler->cleanup  = NULL;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_cleanup_throw( FT_CleanupStack  stack,
-                    FT_Error         error )
-  {
-    FT_XHandler  xhandler = stack->xhandler;
-
-    if ( xhandler == NULL )
-    {
-      /* no exception handler was registered. this  */
-      /* means that we have an un-handled exception */
-      /* the only thing we can do is _PANIC_ and    */
-      /* halt the current program..                 */
-      /*                                            */
-      FT_ERROR(( "FREETYPE PANIC: An un-handled exception occured. Program aborted" ));
-      ft_exit(1);
-    }
-
-    /* cleanup the stack until we reach the handler's */
-    /* starting stack location..                      */
-
-    xhandler->error = error;
-    longmp( xhandler->jump_buffer, 1 );
-  }                    
\ No newline at end of file

reactos/lib/freetype/src/base
fthash.c removed after 1.1
diff -N fthash.c
--- fthash.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,246 +0,0 @@
-#include <ft2build.h>
-#include FT_TYPES_H
-#include FT_INTERNAL_HASH_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_DEBUG_H
-
-#define  FT_HASH_MAX_LOAD  2
-#define  FT_HASH_MIN_LOAD  1
-#define  FT_HASH_SUB_LOAD  (FT_HASH_MAX_LOAD-FT_HASH_MIN_LOAD)
-
-/* this one _must_ be a power of 2 !! */
-#define  FT_HASH_INITIAL_SIZE  8
-
-
-  FT_BASE_DEF( void )
-  ft_hash_done( FT_Hash              table,
-                FT_Hash_ForeachFunc  node_func,
-                const FT_Pointer     node_data )
-  {
-    if ( table )
-    {
-      FT_Memory  memory = table->memory;
-
-      if ( node_func )
-        ft_hash_foreach( table, node_func, node_data );
-
-      FT_FREE( table->buckets );
-      table->p     = 0;
-      table->mask  = 0;
-      table->slack = 0;
-
-      table->node_equal = NULL;
-    }
-  }
-
-
-  FT_BASE_DEF( FT_UInt )
-  ft_hash_get_size( FT_Hash  table )
-  {
-    FT_UInt  result = 0;
-
-    if ( table )
-      result = (table->p + table->mask + 1)*FT_HASH_MAX_LOAD - table->slack;
-
-    return result;
-  }
-
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_hash_init( FT_Hash            table,
-                FT_Hash_EqualFunc  equal,
-                FT_Memory          memory )
-  {
-    FT_Error  error;
-
-    table->memory     = memory;
-    table->p          = 0;
-    table->mask       = FT_HASH_INITIAL_SIZE-1;
-    table->slack      = FT_HASH_INITIAL_SIZE*FT_HASH_MAX_LOAD;
-    table->node_equal = equal;
-
-    (void)FT_NEW_ARRAY( table->buckets, FT_HASH_INITIAL_SIZE*2 );
-
-    return error;
-  }
-
-
-
-  FT_BASE_DEF( void )
-  ft_hash_foreach( FT_Hash              table,
-                   FT_Hash_ForeachFunc  foreach_func,
-                   const FT_Pointer     foreach_data )
-  {
-    FT_UInt       count = table->p + table->mask + 1;
-    FT_HashNode*  pnode = table->buckets;
-    FT_HashNode   node, next;
-
-    for ( ; count > 0; count--, pnode++ )
-    {
-      node = *pnode;
-      while ( node )
-      {
-        next = node->link;
-        foreach_func( node, foreach_data );
-        node = next;
-      }
-    }
-  }
-
-
-
-  FT_BASE_DEF( FT_HashLookup )
-  ft_hash_lookup( FT_Hash      table,
-                  FT_HashNode  keynode )
-  {
-    FT_UInt       index;
-    FT_UInt32     hash = keynode->hash;
-    FT_HashNode   node, *pnode;
-
-    index = (FT_UInt)(hash & table->mask);
-    if ( index < table->p )
-      index = (FT_UInt)(hash & (2*table->mask+1));
-
-    pnode = &table->buckets[index];
-    for (;;)
-    {
-      node = *pnode;
-      if ( node == NULL )
-        break;
-
-      if ( node->hash == hash && table->node_equal( node, keynode ) )
-        break;
-
-      pnode = &node->link;
-    }
-
-    return pnode;
-  }
-
-
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_hash_add( FT_Hash        table,
-               FT_HashLookup  lookup,
-               FT_HashNode    new_node )
-  {
-    FT_Error     error = 0;
-
-    /* add it to the hash table */
-    new_node->link = *lookup;
-    *lookup        = new_node;
-
-    if ( --table->slack < 0 )
-    {
-      FT_UInt       p     = table->p;
-      FT_UInt       mask  = table->mask;
-      FT_HashNode   new_list, node, *pnode;
-
-      /* split a single bucket */
-      new_list = NULL;
-      pnode    = table->buckets + p;
-      for (;;)
-      {
-        node = *pnode;
-        if ( node == NULL )
-          break;
-
-        if ( node->hash & mask )
-        {
-          *pnode     = node->link;
-          node->link = new_list;
-          new_list   = node;
-        }
-        else
-          pnode = &node->link;
-      }
-
-      table->buckets[ p + mask + 1 ] = new_list;
-
-      table->slack += FT_HASH_MAX_LOAD;
-
-      if ( p >= mask )
-      {
-        FT_Memory  memory = table->memory;
-
-
-        if (FT_RENEW_ARRAY( table->buckets, (mask+1)*2, (mask+1)*4 ))
-          goto Exit;
-
-        table->mask = 2*mask + 1;
-        table->p    = 0;
-      }
-      else
-        table->p = p + 1;
-    }
-  Exit:
-    return error;
-  }
-
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_hash_remove( FT_Hash        table,
-                  FT_HashLookup  lookup )
-  {
-    FT_HashNode  node;
-    FT_UInt      num_buckets;
-    FT_Error     error = 0;
-
-    FT_ASSERT( pnode != NULL && node != NULL );
-
-    node       = *lookup;
-    *lookup    = node->link;
-    node->link = NULL;
-
-    num_buckets = ( table->p + table->mask + 1) ;
-
-    if ( ++ table->slack > (FT_Long)num_buckets*FT_HASH_SUB_LOAD )
-    {
-      FT_UInt       p         = table->p;
-      FT_UInt       mask      = table->mask;
-      FT_UInt       old_index = p + mask;
-      FT_HashNode*  pnode;
-      FT_HashNode*  pold;
-
-      if ( old_index < FT_HASH_INITIAL_SIZE )
-        goto Exit;
-
-      if ( p == 0 )
-      {
-        FT_Memory  memory = table->memory;
-
-        table->mask >>= 1;
-        p             = table->mask;
-
-        if ( FT_RENEW_ARRAY( table->buckets, (mask+1)*2, (mask+1) ) )
-        {
-          /* this should never happen normally, but who knows :-)   */
-          /* we need to re-inject the node in the hash table before */
-          /* returning there, since it's safer                      */
-          pnode      = table->buckets;
-          node->link = *pnode;
-          *pnode     = node;
-
-          goto Exit;
-        }
-      }
-      else
-        p--;
-
-      pnode = table->buckets + p;
-      while ( *pnode )
-        pnode = &(*pnode)->link;
-
-      pold   = table->buckets + old_index;
-      *pnode = *pold;
-      *pold  = NULL;
-
-      table->slack -= FT_HASH_MAX_LOAD;
-      table->p      = p;
-    }
-  Exit:
-    return error;
-  }

reactos/lib/freetype/src/base
ftlist.c removed after 1.1
diff -N ftlist.c
--- ftlist.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,217 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftlist.c                                                               */
-/*                                                                         */
-/*    Generic list support for FreeType (body).                            */
-/*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-  /*************************************************************************/
-  /*                                                                       */
-  /*  This file implements functions relative to list processing.  Its     */
-  /*  data structures are defined in `freetype/internal/ftlist.h'.         */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_LIST_H
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_OBJECTS_H
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
-  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
-  /* messages during execution.                                            */
-  /*                                                                       */
-#undef  FT_COMPONENT
-#define FT_COMPONENT  trace_list
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( FT_ListNode )
-  FT_List_Find( FT_List  list,
-                void*    data )
-  {
-    FT_ListNode  cur;
-
-
-    cur = list->head;
-    while ( cur )
-    {
-      if ( cur->data == data )
-        return cur;
-
-      cur = cur->next;
-    }
-
-    return (FT_ListNode)0;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( void )
-  FT_List_Add( FT_List      list,
-               FT_ListNode  node )
-  {
-    FT_ListNode  before = list->tail;
-
-
-    node->next = 0;
-    node->prev = before;
-
-    if ( before )
-      before->next = node;
-    else
-      list->head = node;
-
-    list->tail = node;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( void )
-  FT_List_Insert( FT_List      list,
-                  FT_ListNode  node )
-  {
-    FT_ListNode  after = list->head;
-
-
-    node->next = after;
-    node->prev = 0;
-
-    if ( !after )
-      list->tail = node;
-    else
-      after->prev = node;
-
-    list->head = node;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( void )
-  FT_List_Remove( FT_List      list,
-                  FT_ListNode  node )
-  {
-    FT_ListNode  before, after;
-
-
-    before = node->prev;
-    after  = node->next;
-
-    if ( before )
-      before->next = after;
-    else
-      list->head = after;
-
-    if ( after )
-      after->prev = before;
-    else
-      list->tail = before;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( void )
-  FT_List_Up( FT_List      list,
-              FT_ListNode  node )
-  {
-    FT_ListNode  before, after;
-
-
-    before = node->prev;
-    after  = node->next;
-
-    /* check whether we are already on top of the list */
-    if ( !before )
-      return;
-
-    before->next = after;
-
-    if ( after )
-      after->prev = before;
-    else
-      list->tail = before;
-
-    node->prev       = 0;
-    node->next       = list->head;
-    list->head->prev = node;
-    list->head       = node;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( FT_Error )
-  FT_List_Iterate( FT_List            list,
-                   FT_List_Iterator   iterator,
-                   void*              user )
-  {
-    FT_ListNode  cur   = list->head;
-    FT_Error     error = FT_Err_Ok;
-
-
-    while ( cur )
-    {
-      FT_ListNode  next = cur->next;
-
-
-      error = iterator( cur, user );
-      if ( error )
-        break;
-
-      cur = next;
-    }
-
-    return error;
-  }
-
-
-  /* documentation is in ftlist.h */
-
-  FT_EXPORT_DEF( void )
-  FT_List_Finalize( FT_List             list,
-                    FT_List_Destructor  destroy,
-                    FT_Memory           memory,
-                    void*               user )
-  {
-    FT_ListNode  cur;
-
-
-    cur = list->head;
-    while ( cur )
-    {
-      FT_ListNode  next = cur->next;
-      void*        data = cur->data;
-
-
-      if ( destroy )
-        destroy( memory, data, user );
-
-      FT_FREE( cur );
-      cur = next;
-    }
-
-    list->head = 0;
-    list->tail = 0;
-  }
-
-
-/* END */

reactos/lib/freetype/src/base
ftobject.c removed after 1.1
diff -N ftobject.c
--- ftobject.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,396 +0,0 @@
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECT_H
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_OBJECTS_H
-
-#define  FT_MAGIC_DEATH   0xDEADdead
-#define  FT_MAGIC_CLASS   0x12345678
-
-#define  FT_TYPE_HASH(x)  (( (FT_UInt32)(x) >> 2 )^( (FT_UInt32)(x) >> 10 ))
-
-#define  FT_OBJECT_CHECK(o)                                  \
-           ( FT_OBJECT(o)               != NULL           && \
-             FT_OBJECT(o)->clazz        != NULL           && \
-             FT_OBJECT(o)->ref_count    >= 1              && \
-             FT_OBJECT(o)->clazz->magic == FT_MAGIC_CLASS )
-
-#define  FT_CLASS_CHECK(c)  \
-           ( FT_CLASS(c) != NULL && FT_CLASS(c)->magic == FT_MAGIC_CLASS )
-
-#define  FT_ASSERT_IS_CLASS(c)  FT_ASSERT( FT_CLASS_CHECK(c) )
-
- /*******************************************************************/
- /*******************************************************************/
- /*****                                                         *****/
- /*****                                                         *****/
- /*****                  M E T A - C L A S S                    *****/
- /*****                                                         *****/
- /*****                                                         *****/
- /*******************************************************************/
- /*******************************************************************/
-
- /* forward declaration */
-  FT_BASE_DEF( FT_Error )
-  ft_metaclass_init( FT_MetaClass  meta,
-                     FT_Library    library );
-
-  /* forward declaration */
-  FT_BASE_DEF( void )
-  ft_metaclass_done( FT_MetaClass  meta );
-
-
-  /* class type for the meta-class itself */
-  static const FT_TypeRec  ft_meta_class_type =
-  {
-    "FT2.MetaClass",
-    NULL,
-
-    sizeof( FT_MetaClassRec ),
-    (FT_Object_InitFunc)  ft_metaclass_init,
-    (FT_Object_DoneFunc)  ft_metaclass_done,
-
-    sizeof( FT_ClassRec ),
-    (FT_Object_InitFunc)  NULL,
-    (FT_Object_DoneFunc)  NULL
-  };
-
-
-
-
- /* destroy a given class */
-  static void
-  ft_class_hnode_destroy( FT_ClassHNode  node )
-  {
-    FT_Class   clazz  = node->clazz;
-    FT_Memory  memory = clazz->memory;
-
-    if ( clazz->class_done )
-      clazz->class_done( (FT_Object) clazz );
-
-    FT_FREE( clazz );
-
-    node->clazz = NULL;
-    node->type  = NULL;
-
-    FT_FREE( node );
-  }
-
-
-  static FT_Int
-  ft_type_equal( FT_Type  type1,
-                 FT_Type  type2 )
-  {
-    if ( type1 == type2 )
-      goto Ok;
-
-    if ( type1 == NULL || type2 == NULL )
-      goto Fail;
-
-    /* compare parent types */
-    if ( type1->super != type2->super )
-    {
-      if ( type1->super == NULL           ||
-           type2->super == NULL           ||
-           !ft_type_equal( type1, type2 ) )
-        goto Fail;
-    }
-
-    /* compare type names */
-    if ( type1->name != type2->name )
-    {
-      if ( type1->name == NULL                        ||
-           type2->name == NULL                        ||
-           ft_strcmp( type1->name, type2->name ) != 0 )
-        goto Fail;
-    }
-
-    /* compare the other type fields */
-    if ( type1->class_size != type2->class_size ||
-         type1->class_init != type2->class_init ||
-         type1->class_done != type2->class_done ||
-         type1->obj_size   != type2->obj_size   ||
-         type1->obj_init   != type2->obj_init   ||
-         type1->obj_done   != type2->obj_done   )
-      goto Fail;
-
-  Ok:
-    return 1;
-
-  Fail:
-    return 0;
-  }
-
-
-  static FT_Int
-  ft_class_hnode_equal( const FT_ClassHNode  node1,
-                        const FT_ClassHNode  node2 )
-  {
-    FT_Type  type1 = node1->type;
-    FT_Type  type2 = node2->type;
-
-    /* comparing the pointers should work in 99% of cases */
-    return ( type1 == type2 ) ? 1 : ft_type_equal( type1, type2 );
-  }
-
-
-  FT_BASE_DEF( void )
-  ft_metaclass_done( FT_MetaClass  meta )
-  {
-    /* clear all classes */
-    ft_hash_done( &meta->type_to_class,
-                  (FT_Hash_ForeachFunc) ft_class_hnode_destroy,
-                   NULL );
-
-    meta->clazz.object.clazz     = NULL;
-    meta->clazz.object.ref_count = 0;
-    meta->clazz.magic            = FT_MAGIC_DEATH;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_metaclass_init( FT_MetaClass  meta,
-                     FT_Library    library )
-  {
-    FT_ClassRec*  clazz = (FT_ClassRec*) &meta->clazz;
-
-    /* the meta-class is its OWN class !! */
-    clazz->object.clazz     = (FT_Class) clazz;
-    clazz->object.ref_count = 1;
-    clazz->magic            = FT_MAGIC_CLASS;
-    clazz->library          = library;
-    clazz->memory           = library->memory;
-    clazz->type             = &ft_meta_class_type;
-    clazz->info             = NULL;
-
-    clazz->class_done       = (FT_Object_DoneFunc) ft_metaclass_done;
-
-    clazz->obj_size         = sizeof( FT_ClassRec );
-    clazz->obj_init         = NULL;
-    clazz->obj_done         = NULL;
-
-    return ft_hash_init( &meta->type_to_class,
-                        (FT_Hash_EqualFunc) ft_class_hnode_equal,
-                        library->memory );
-  }
-
-
- /* find or create the class corresponding to a given type */
- /* note that this function will retunr NULL in case of    */
- /* memory overflow                                        */
- /*                                                        */
-  static FT_Class
-  ft_metaclass_get_class( FT_MetaClass  meta,
-                          FT_Type       ctype )
-  {
-    FT_ClassHNodeRec   keynode, *node, **pnode;
-    FT_Memory          memory;
-    FT_ClassRec*       clazz;
-    FT_Class           parent;
-    FT_Error           error;
-
-    keynode.hnode.hash = FT_TYPE_HASH( ctype );
-    keynode.type       = ctype;
-
-    pnode = (FT_ClassHNode*) ft_hash_lookup( &meta->type_to_class,
-                                             (FT_HashNode) &keynode );
-    node  = *pnode;
-    if ( node != NULL )
-    {
-      clazz = (FT_ClassRec*) node->clazz;
-      goto Exit;
-    }
-
-    memory = FT_CLASS__MEMORY(meta);
-    clazz  = NULL;
-    parent = NULL;
-    if ( ctype->super != NULL )
-    {
-      FT_ASSERT( ctype->super->class_size <= ctype->class_size );
-      FT_ASSERT( ctype->super->obj_size   <= ctype->obj_size   );
-
-      parent = ft_metaclass_get_class( meta, ctype->super );
-    }
-
-    if ( !FT_NEW( node ) )
-    {
-      if ( !FT_ALLOC( clazz, ctype->class_size ) )
-      {
-        if ( parent )
-          FT_MEM_COPY( (FT_ClassRec*)clazz, parent, parent->type->class_size );
-
-        clazz->object.clazz     = (FT_Class) meta;
-        clazz->object.ref_count = 1;
-
-        clazz->memory  = memory;
-        clazz->library = FT_CLASS__LIBRARY(meta);
-        clazz->super   = parent;
-        clazz->type    = ctype;
-        clazz->info    = NULL;
-        clazz->magic   = FT_MAGIC_CLASS;
-
-        clazz->class_done = ctype->class_done;
-        clazz->obj_size   = ctype->obj_size;
-        clazz->obj_init   = ctype->obj_init;
-        clazz->obj_done   = ctype->obj_done;
-
-        if ( parent )
-        {
-          if ( clazz->class_done == NULL )
-            clazz->class_done = parent->class_done;
-
-          if ( clazz->obj_init == NULL )
-            clazz->obj_init = parent->obj_init;
-
-          if ( clazz->obj_done == NULL )
-            clazz->obj_done = parent->obj_done;
-        }
-
-        /* find class initializer, if any */
-        {
-          FT_Type             ztype = ctype;
-          FT_Object_InitFunc  cinit = NULL;
-
-          do
-          {
-            cinit = ztype->class_init;
-            if ( cinit != NULL )
-              break;
-
-            ztype = ztype->super;
-          }
-          while ( ztype != NULL );
-
-          /* then call it when needed */
-          if ( cinit != NULL )
-            error = cinit( (FT_Object) clazz, NULL );
-        }
-      }
-
-      if (error)
-      {
-        if ( clazz )
-        {
-          /* we always call the class destructor when    */
-          /* an error was detected in the constructor !! */
-          if ( clazz->class_done )
-            clazz->class_done( (FT_Object) clazz );
-
-          FT_FREE( clazz );
-        }
-        FT_FREE( node );
-      }
-    }
-
-  Exit:
-    return  (FT_Class) clazz;
-  }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  FT_BASE_DEF( FT_Int )
-  ft_object_check( FT_Pointer  obj )
-  {
-    return FT_OBJECT_CHECK(obj);
-  }
-
-
-  FT_BASE_DEF( FT_Int )
-  ft_object_is_a( FT_Pointer  obj,
-                  FT_Class    clazz )
-  {
-    if ( FT_OBJECT_CHECK(obj) )
-    {
-      FT_Class   c = FT_OBJECT__CLASS(obj);
-
-      do
-      {
-        if ( c == clazz )
-          return 1;
-
-        c = c->super;
-      }
-      while ( c == NULL );
-
-      return (clazz == NULL);
-    }
-    return 0;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_object_create( FT_Object  *pobject,
-                    FT_Class    clazz,
-                    FT_Pointer  init_data )
-  {
-    FT_Memory  memory;
-    FT_Error   error;
-    FT_Object  obj;
-
-    FT_ASSERT_IS_CLASS(clazz);
-
-    memory = FT_CLASS__MEMORY(clazz);
-    if ( !FT_ALLOC( obj, clazz->obj_size ) )
-    {
-      obj->clazz     = clazz;
-      obj->ref_count = 1;
-
-      if ( clazz->obj_init )
-      {
-        error = clazz->obj_init( obj, init_data );
-        if ( error )
-        {
-          /* IMPORTANT: call the destructor when an error  */
-          /*            was detected in the constructor !! */
-          if ( clazz->obj_done )
-            clazz->obj_done( obj );
-
-          FT_FREE( obj );
-        }
-      }
-    }
-    *pobject = obj;
-    return error;
-  }
-
-
-  FT_BASE_DEF( FT_Class )
-  ft_class_find_by_type( FT_Type     type,
-                         FT_Library  library )
-  {
-    FT_MetaClass  meta = &library->meta_class;
-
-    return ft_metaclass_get_class( meta, type );
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_object_create_from_type( FT_Object  *pobject,
-                              FT_Type     type,
-                              FT_Pointer  init_data,
-                              FT_Library  library )
-  {
-    FT_Class  clazz;
-    FT_Error  error;
-
-    clazz = ft_class_find_by_type( type, library );
-    if ( clazz )
-      error = ft_object_create( pobject, clazz, init_data );
-    else
-    {
-      *pobject = NULL;
-      error    = FT_Err_Out_Of_Memory;
-    }
-
-    return error;
-  }

reactos/lib/freetype/src/base
ftsysio.c removed after 1.1
diff -N ftsysio.c
--- ftsysio.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,131 +0,0 @@
-#include <ft2build.h>
-#include FT_SYSTEM_STREAM_H
-
-#include <stdio.h>
-
- /* the ISO/ANSI standard stream object */
-  typedef struct FT_StdStreamRec_
-  {
-    FT_StreamRec  stream;
-    FILE*         file;
-    const char*   pathname;
-  
-  } FT_StdStreamRec, *FT_StdStream;
-
-
-
- /* read bytes from a standard stream */
-  static FT_ULong
-  ft_std_stream_read( FT_StdStream   stream,
-                      FT_Byte*       buffer,
-                      FT_ULong       size )
-  {
-    long   read_bytes;
-    
-    read_bytes = fread( buffer, 1, size, stream->file );
-    if ( read_bytes < 0 )
-      read_bytes = 0;
-      
-    return (FT_ULong) read_bytes;
-  }
-
-
- /* seek the standard stream to a new position */
-  static FT_Error
-  ft_std_stream_seek( FT_StdStream   stream,
-                      FT_ULong       pos )
-  {
-    return ( fseek( stream->file, pos, SEEK_SET ) < 0 )
-         ? FT_Err_Stream_Seek
-         : FT_Err_Ok;
-  }
-  
-  
- /* close a standard stream */  
-  static void
-  ft_std_stream_done( FT_StdStream  stream )
-  {
-    fclose( stream->file );
-    stream->file     = NULL;
-    stream->pathname = NULL;
-  }
-
-
- /* open a standard stream from a given pathname */
-  static void
-  ft_std_stream_init( FT_StdStream  stream,
-                      const char*   pathname )
-  {
-    FT_ASSERT( pathname != NULL );
-
-    stream->file = fopen( pathname, "rb" );
-    if ( stream->file == NULL )
-    {
-      FT_ERROR(( "iso.stream.init: could not open '%s'\n", pathname ));
-      FT_XTHROW( FT_Err_Stream_Open );
-    }
-    
-    /* compute total size in bytes */
-    fseek( file, 0, SEEK_END );
-    FT_STREAM__SIZE(stream) = ftell( file );
-    fseek( file, 0, SEEK_SET );
-    
-    stream->pathname = pathname;
-    stream->pos      = 0;
-    
-    FT_TRACE1(( "iso.stream.init: opened '%s' (%ld bytes) succesfully\n",
-                 pathname, FT_STREAM__SIZE(stream) ));
-  }                 
-
-
-  static void
-  ft_std_stream_class_init( FT_ClassRec*  _clazz )
-  {
-    FT_StreamClassRec*  clazz = FT_STREAM_CLASS(_clazz);
-    
-    clazz->stream_read = (FT_Stream_ReadFunc) ft_std_stream_read;
-    clazz->stream_seek = (FT_Stream_SeekFunc) ft_std_stream_seek;
-  }
-
-
-  static const FT_TypeRec  ft_std_stream_type;
-  {
-    "StreamClass",
-    NULL,
-    
-    sizeof( FT_ClassRec ),
-    ft_stream_class_init,
-    NULL,
-    
-    sizeof( FT_StdStreamRec ),
-    ft_std_stream_init,
-    ft_std_stream_done,
-    NULL,
-  };
-  
-
-
-  FT_EXPORT_DEF( FT_Stream )
-  ft_std_stream_new( FT_Memory    memory,
-                     const char*  pathname )
-  {
-    FT_Class  clazz;
-    
-    clazz = ft_class_from_type( memory, &ft_std_stream_type );
-    
-    return (FT_Stream) ft_object_new( clazz, pathname );
-  }                     
-
-
-  FT_EXPORT_DEF( void )
-  ft_std_stream_create( FT_Memory    memory,
-                        const char*  pathname,
-                        FT_Stream*   astream )
-  {
-    FT_Class  clazz;
-    
-    clazz = ft_class_from_type( memory, &ft_std_stream_type );
-    
-    ft_object_create( clazz, pathname, FT_OBJECT_P(astream) );
-  }                        
-

reactos/lib/freetype/src/base
ftsysmem.c removed after 1.1
diff -N ftsysmem.c
--- ftsysmem.c	1 Apr 2003 08:38:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-#include <ft2build.h>
-#include FT_SYSTEM_MEMORY_H
-
-  static FT_Memory
-  ft_memory_new_default( FT_ULong  size )
-  {
-    return (FT_Memory) ft_malloc( size );
-  }
-  
-  static void
-  ft_memory_destroy_default( FT_Memory  memory )
-  {
-    ft_free( memory );
-  }
-
-  
- /* notice that in normal builds, we use the ISO C library functions */
- /* 'malloc', 'free' and 'realloc' directly..                        */
- /*                                                                  */
-  static const FT_Memory_FuncsRec  ft_memory_funcs_default_rec = 
-  {
-    (FT_Memory_CreateFunc)  ft_memory_new_iso,
-    (FT_Memory_DestroyFunc) ft_memory_destroy_iso,
-    (FT_Memory_AllocFunc)   ft_malloc,
-    (FT_Memory_FreeFunc)    ft_free,
-    (FT_Memory_ReallocFunc) ft_realloc
-  };
-  
-  FT_APIVAR_DEF( const FT_Memory_Funcs )
-  ft_memory_funcs_default = &ft_memory_funcs_defaults_rec;

reactos/lib/freetype/src/bdf
bdf.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- bdf.h	21 Jan 2004 19:23:46 -0000	1.2
+++ bdf.h	18 Aug 2004 20:25:08 -0000	1.3
@@ -1,6 +1,6 @@
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
- * Copyright 2001, 2002, 2003 Francesco Zappa Nardelli
+ * Copyright 2001, 2002, 2003, 2004 Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -202,7 +202,7 @@
 
     unsigned short   monowidth;      /* Logical width for monowidth font.   */
 
-    long             default_glyph;  /* Encoding of the default glyph.      */
+    long             default_char;   /* Encoding of the default glyph.      */
 
     long             font_ascent;    /* Font ascent.                        */
     long             font_descent;   /* Font descent.                       */

reactos/lib/freetype/src/bdf
bdfdrivr.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- bdfdrivr.c	10 May 2004 17:48:31 -0000	1.6
+++ bdfdrivr.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -60,9 +60,12 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  bdf_cmap_init( BDF_CMap  cmap )
+  bdf_cmap_init( FT_CMap     bdfcmap,
+                 FT_Pointer  init_data )
   {
+    BDF_CMap  cmap = (BDF_CMap)bdfcmap;
     BDF_Face  face = (BDF_Face)FT_CMAP_FACE( cmap );
+    FT_UNUSED( init_data );
 
 
     cmap->num_encodings = face->bdffont->glyphs_used;
@@ -73,20 +76,24 @@
 
 
   FT_CALLBACK_DEF( void )
-  bdf_cmap_done( BDF_CMap  cmap )
+  bdf_cmap_done( FT_CMap  bdfcmap )
   {
+    BDF_CMap  cmap = (BDF_CMap)bdfcmap;
+
+
     cmap->encodings     = NULL;
     cmap->num_encodings = 0;
   }
 
 
   FT_CALLBACK_DEF( FT_UInt )
-  bdf_cmap_char_index( BDF_CMap   cmap,
+  bdf_cmap_char_index( FT_CMap    bdfcmap,
                        FT_UInt32  charcode )
   {
+    BDF_CMap          cmap      = (BDF_CMap)bdfcmap;
     BDF_encoding_el*  encodings = cmap->encodings;
     FT_UInt           min, max, mid;
-    FT_UInt           result = 0;
+    FT_UInt           result    = 0;
 
 
     min = 0;
@@ -102,6 +109,8 @@
 
       if ( charcode == code )
       {
+        /* increase glyph index by 1 --              */
+        /* we reserve slot 0 for the undefined glyph */
         result = encodings[mid].glyph + 1;
         break;
       }
@@ -117,9 +126,10 @@
 
 
   FT_CALLBACK_DEF( FT_UInt )
-  bdf_cmap_char_next( BDF_CMap    cmap,
+  bdf_cmap_char_next( FT_CMap     bdfcmap,
                       FT_UInt32  *acharcode )
   {
+    BDF_CMap          cmap      = (BDF_CMap)bdfcmap;
     BDF_encoding_el*  encodings = cmap->encodings;
     FT_UInt           min, max, mid;
     FT_UInt32         charcode = *acharcode + 1;
@@ -139,6 +149,8 @@
 
       if ( charcode == code )
       {
+        /* increase glyph index by 1 --              */
+        /* we reserve slot 0 for the undefined glyph */
         result = encodings[mid].glyph + 1;
         goto Exit;
       }
@@ -162,13 +174,14 @@
   }
 
 
-  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec  bdf_cmap_class =
+  FT_CALLBACK_TABLE_DEF
+  const FT_CMap_ClassRec  bdf_cmap_class =
   {
-    sizeof( BDF_CMapRec ),
-    (FT_CMap_InitFunc)     bdf_cmap_init,
-    (FT_CMap_DoneFunc)     bdf_cmap_done,
-    (FT_CMap_CharIndexFunc)bdf_cmap_char_index,
-    (FT_CMap_CharNextFunc) bdf_cmap_char_next
+    sizeof ( BDF_CMapRec ),
+    bdf_cmap_init,
+    bdf_cmap_done,
+    bdf_cmap_char_index,
+    bdf_cmap_char_next
   };
 
 
@@ -284,9 +297,10 @@
   }
 
 
-  FT_CALLBACK_DEF( FT_Error )
-  BDF_Face_Done( BDF_Face  face )
+  FT_CALLBACK_DEF( void )
+  BDF_Face_Done( FT_Face  bdfface )         /* BDF_Face */
   {
+    BDF_Face   face   = (BDF_Face)bdfface;
     FT_Memory  memory = FT_FACE_MEMORY( face );
 
 
@@ -296,26 +310,25 @@
 
     FT_FREE( face->charset_encoding );
     FT_FREE( face->charset_registry );
-    FT_FREE( face->root.family_name );
+    FT_FREE( bdfface->family_name );
 
-    FT_FREE( face->root.available_sizes );
+    FT_FREE( bdfface->available_sizes );
 
     FT_FREE( face->bdffont );
 
     FT_TRACE4(( "BDF_Face_Done: done face\n" ));
-
-    return BDF_Err_Ok;
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
   BDF_Face_Init( FT_Stream      stream,
-                 BDF_Face       face,
+                 FT_Face        bdfface,        /* BDF_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
     FT_Error       error  = BDF_Err_Ok;
+    BDF_Face       face   = (BDF_Face)bdfface;
     FT_Memory      memory = FT_FACE_MEMORY( face );
 
     bdf_font_t*    font;
@@ -346,7 +359,6 @@
     /* we have a bdf font: let's construct the face object */
     face->bdffont = font;
     {
-      FT_Face          root = FT_FACE( face );
       bdf_property_t*  prop = NULL;
 
 
@@ -357,18 +369,18 @@
                   font->unencoded_size,
                   font->unencoded_used ));
 
-      root->num_faces  = 1;
-      root->face_index = 0;
-      root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                         FT_FACE_FLAG_HORIZONTAL  |
-                         FT_FACE_FLAG_FAST_GLYPHS;
+      bdfface->num_faces  = 1;
+      bdfface->face_index = 0;
+      bdfface->face_flags = FT_FACE_FLAG_FIXED_SIZES |
+                            FT_FACE_FLAG_HORIZONTAL  |
+                            FT_FACE_FLAG_FAST_GLYPHS;
 
       prop = bdf_get_font_property( font, "SPACING" );
       if ( prop && prop->format == BDF_ATOM                             &&
            prop->value.atom                                             &&
            ( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' ||
              *(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) )
-        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
+        bdfface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
       /* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL   */
       /* FZ XXX: I need a font to implement this */
@@ -379,24 +391,26 @@
         int  l = ft_strlen( prop->value.atom ) + 1;
 
 
-        if ( FT_NEW_ARRAY( root->family_name, l ) )
+        if ( FT_NEW_ARRAY( bdfface->family_name, l ) )
           goto Exit;
-        ft_strcpy( root->family_name, prop->value.atom );
+        ft_strcpy( bdfface->family_name, prop->value.atom );
       }
       else
-        root->family_name = 0;
+        bdfface->family_name = 0;
 
       if ( ( error = bdf_interpret_style( face ) ) != 0 )
         goto Exit;
 
-      root->num_glyphs = font->glyphs_size;     /* unencoded included */
+      /* the number of glyphs (with one slot for the undefined glyph */
+      /* at position 0 and all unencoded glyphs)                     */
+      bdfface->num_glyphs = font->glyphs_size + 1;
 
-      root->num_fixed_sizes = 1;
-      if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
+      bdfface->num_fixed_sizes = 1;
+      if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )
         goto Exit;
 
       {
-        FT_Bitmap_Size*  bsize = root->available_sizes;
+        FT_Bitmap_Size*  bsize = bdfface->available_sizes;
         FT_Short         resolution_x = 0, resolution_y = 0;
 
 
@@ -449,11 +463,15 @@
         if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )
           goto Exit;
 
+        face->default_glyph = 0;
         for ( n = 0; n < font->glyphs_size; n++ )
         {
           (face->en_table[n]).enc = cur[n].encoding;
           FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
           (face->en_table[n]).glyph = (FT_Short)n;
+  
+          if ( cur[n].encoding == font->default_char )
+            face->default_glyph = n;
         }
       }
 
@@ -521,8 +539,8 @@
 
 #if 0
               /* Select default charmap */
-              if (root->num_charmaps)
-                root->charmap = root->charmaps[0];
+              if ( bdfface->num_charmaps )
+                bdfface->charmap = bdfface->charmaps[0];
 #endif
             }
 
@@ -544,8 +562,8 @@
           error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
 
           /* Select default charmap */
-          if (root->num_charmaps)
-            root->charmap = root->charmaps[0];
+          if ( bdfface->num_charmaps )
+            bdfface->charmap = bdfface->charmaps[0];
         }
       }
     }
@@ -554,17 +572,22 @@
     return error;
 
   Fail:
-    BDF_Face_Done( face );
+    BDF_Face_Done( bdfface );
     return BDF_Err_Unknown_File_Format;
   }
 
 
-  static FT_Error
-  BDF_Set_Pixel_Size( FT_Size  size )
+  FT_CALLBACK_DEF( FT_Error )
+  BDF_Set_Pixel_Size( FT_Size  size,
+                      FT_UInt  char_width,
+                      FT_UInt  char_height )
   {
     BDF_Face  face = (BDF_Face)FT_SIZE_FACE( size );
     FT_Face   root = FT_FACE( face );
 
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+
 
     FT_TRACE4(( "rec %d - pres %d\n",
                 size->metrics.y_ppem, root->available_sizes->y_ppem ));
@@ -584,7 +607,23 @@
   }
 
 
-  static FT_Error
+  FT_CALLBACK_DEF( FT_Error )
+  BDF_Set_Point_Size( FT_Size     size,
+                      FT_F26Dot6  char_width,
+                      FT_F26Dot6  char_height,
+                      FT_UInt     horz_resolution,
+                      FT_UInt     vert_resolution )
+  {
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+    FT_UNUSED( horz_resolution );
+    FT_UNUSED( vert_resolution );
+
+    return BDF_Set_Pixel_Size( size, 0, 0 );
+  }
+
+
+  FT_CALLBACK_DEF( FT_Error )
   BDF_Glyph_Load( FT_GlyphSlot  slot,
                   FT_Size       size,
                   FT_UInt       glyph_index,
@@ -607,7 +646,10 @@
       goto Exit;
     }
 
-    if ( glyph_index > 0 )
+    /* index 0 is the undefined glyph */
+    if ( glyph_index == 0 )
+      glyph_index = face->default_glyph;
+    else
       glyph_index--;
 
     /* slot, bitmap => freetype, glyph => bdflib */
@@ -784,6 +826,7 @@
     return BDF_Err_Invalid_Argument;
   }
 
+
   static FT_Error
   bdf_get_charset_id( BDF_Face      face,
                       const char*  *acharset_encoding,
@@ -817,7 +860,7 @@
   };
 
 
-  static FT_Module_Interface
+  FT_CALLBACK_DEF( FT_Module_Interface )
   bdf_driver_requester( FT_Module    module,
                         const char*  name )
   {
@@ -851,21 +894,21 @@
     sizeof ( FT_SizeRec ),
     sizeof ( FT_GlyphSlotRec ),
 
-    (FT_Face_InitFunc)        BDF_Face_Init,
-    (FT_Face_DoneFunc)        BDF_Face_Done,
-    (FT_Size_InitFunc)        0,
-    (FT_Size_DoneFunc)        0,
-    (FT_Slot_InitFunc)        0,
-    (FT_Slot_DoneFunc)        0,
-
-    (FT_Size_ResetPointsFunc) BDF_Set_Pixel_Size,
-    (FT_Size_ResetPixelsFunc) BDF_Set_Pixel_Size,
-
-    (FT_Slot_LoadFunc)        BDF_Glyph_Load,
-
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
-    (FT_Face_GetAdvancesFunc) 0
+    BDF_Face_Init,
+    BDF_Face_Done,
+    0,                          /* FT_Size_InitFunc */
+    0,                          /* FT_Size_DoneFunc */
+    0,                          /* FT_Slot_InitFunc */
+    0,                          /* FT_Slot_DoneFunc */
+
+    BDF_Set_Point_Size,
+    BDF_Set_Pixel_Size,
+
+    BDF_Glyph_Load,
+
+    0,                          /* FT_Face_GetKerningFunc   */
+    0,                          /* FT_Face_AttachFunc       */
+    0,                          /* FT_Face_GetAdvancesFunc  */
   };
 
 

reactos/lib/freetype/src/bdf
bdfdrivr.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- bdfdrivr.h	10 May 2004 17:48:31 -0000	1.5
+++ bdfdrivr.h	18 Aug 2004 20:25:08 -0000	1.6
@@ -2,7 +2,7 @@
 
     FreeType font driver for bdf fonts
 
-  Copyright (C) 2001, 2002, 2003 by
+  Copyright (C) 2001, 2002, 2003, 2004 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -59,6 +59,8 @@
     FT_CharMap        charmap_handle;
     FT_CharMapRec     charmap;  /* a single charmap per face */
 
+    FT_UInt           default_glyph;
+
   } BDF_FaceRec, *BDF_Face;
 
 

reactos/lib/freetype/src/bdf
bdflib.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- bdflib.c	10 May 2004 17:48:31 -0000	1.5
+++ bdflib.c	18 Aug 2004 20:25:08 -0000	1.6
@@ -1404,7 +1404,7 @@
     /* present, and the SPACING property should override the default       */
     /* spacing.                                                            */
     if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
-      font->default_glyph = fp->value.int32;
+      font->default_char = fp->value.int32;
     else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
       font->font_ascent = fp->value.int32;
     else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
@@ -2048,8 +2048,8 @@
       error = hash_init( (hashtable *)p->font->internal,memory );
       if ( error )
         goto Exit;
-      p->font->spacing       = p->opts->font_spacing;
-      p->font->default_glyph = -1;
+      p->font->spacing      = p->opts->font_spacing;
+      p->font->default_char = -1;
 
       goto Exit;
     }

reactos/lib/freetype/src/cache
ftcbasic.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- ftcbasic.c	10 May 2004 17:48:31 -0000	1.3
+++ ftcbasic.c	18 Aug 2004 20:25:08 -0000	1.4
@@ -63,18 +63,27 @@
 
 
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_basic_family_compare( FTC_BasicFamily  family,
-                            FTC_BasicQuery   query )
+  ftc_basic_family_compare( FTC_MruNode  ftcfamily,
+                            FT_Pointer   ftcquery )
   {
-    return FT_BOOL( FTC_BASIC_ATTR_COMPARE( &family->attrs, &query->attrs ) );
+    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;
+    FTC_BasicQuery   query  = (FTC_BasicQuery)ftcquery;
+
+
+    return FTC_BASIC_ATTR_COMPARE( &family->attrs, &query->attrs );
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_basic_family_init( FTC_BasicFamily  family,
-                         FTC_BasicQuery   query,
-                         FTC_Cache        cache )
-  {
+  ftc_basic_family_init( FTC_MruNode  ftcfamily,
+                         FT_Pointer   ftcquery,
+                         FT_Pointer   ftccache )
+  {
+    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;
+    FTC_BasicQuery   query  = (FTC_BasicQuery)ftcquery;
+    FTC_Cache        cache  = (FTC_Cache)ftccache;
+
+
     FTC_Family_Init( FTC_FAMILY( family ), cache );
     family->attrs = query->attrs;
     return 0;
@@ -82,12 +91,13 @@
 
 
   FT_CALLBACK_DEF( FT_UInt )
-  ftc_basic_family_get_count( FTC_BasicFamily  family,
-                              FTC_Manager      manager )
+  ftc_basic_family_get_count( FTC_Family   ftcfamily,
+                              FTC_Manager  manager )
   {
-    FT_Error  error;
-    FT_Face   face;
-    FT_UInt   result = 0;
+    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;
+    FT_Error         error;
+    FT_Face          face;
+    FT_UInt          result = 0;
 
 
     error = FTC_Manager_LookupFace( manager, family->attrs.scaler.face_id,
@@ -100,13 +110,14 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_basic_family_load_bitmap( FTC_BasicFamily  family,
-                                FT_UInt          gindex,
-                                FTC_Manager      manager,
-                                FT_Face         *aface )
-  {
-    FT_Error  error;
-    FT_Size   size;
+  ftc_basic_family_load_bitmap( FTC_Family   ftcfamily,
+                                FT_UInt      gindex,
+                                FTC_Manager  manager,
+                                FT_Face     *aface )
+  {
+    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;
+    FT_Error         error;
+    FT_Size          size;
 
 
     error = FTC_Manager_LookupSize( manager, &family->attrs.scaler, &size );
@@ -126,15 +137,16 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_basic_family_load_glyph( FTC_BasicFamily  family,
-                               FT_UInt          gindex,
-                               FTC_Cache        cache,
-                               FT_Glyph        *aglyph )
-  {
-    FT_Error    error;
-    FTC_Scaler  scaler = &family->attrs.scaler;
-    FT_Face     face;
-    FT_Size     size;
+  ftc_basic_family_load_glyph( FTC_Family  ftcfamily,
+                               FT_UInt     gindex,
+                               FTC_Cache   cache,
+                               FT_Glyph   *aglyph )
+  {
+    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;
+    FT_Error         error;
+    FTC_Scaler       scaler = &family->attrs.scaler;
+    FT_Face          face;
+    FT_Size          size;
 
 
     /* we will now load the glyph image */
@@ -173,11 +185,13 @@
 
 
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_basic_gnode_compare_faceid( FTC_GNode   gnode,
-                                  FTC_FaceID  face_id,
+  ftc_basic_gnode_compare_faceid( FTC_Node    ftcgnode,
+                                  FT_Pointer  ftcface_id,
                                   FTC_Cache   cache )
   {
-    FTC_BasicFamily  family = (FTC_BasicFamily)gnode->family;
+    FTC_GNode        gnode   = (FTC_GNode)ftcgnode;
+    FTC_FaceID       face_id = (FTC_FaceID)ftcface_id;
+    FTC_BasicFamily  family  = (FTC_BasicFamily)gnode->family;
     FT_Bool          result;
 
 
@@ -203,13 +217,13 @@
   const FTC_IFamilyClassRec  ftc_basic_image_family_class =
   {
     {
-      sizeof( FTC_BasicFamilyRec ),
-      (FTC_MruNode_CompareFunc)ftc_basic_family_compare,
-      (FTC_MruNode_InitFunc)   ftc_basic_family_init,
-      (FTC_MruNode_ResetFunc)  NULL,
-      (FTC_MruNode_DoneFunc)   NULL
+      sizeof ( FTC_BasicFamilyRec ),
+      ftc_basic_family_compare,
+      ftc_basic_family_init,
+      0,                        /* FTC_MruNode_ResetFunc */
+      0                         /* FTC_MruNode_DoneFunc  */
     },
-    (FTC_IFamily_LoadGlyphFunc)ftc_basic_family_load_glyph
+    ftc_basic_family_load_glyph
   };
 
 
@@ -217,20 +231,22 @@
   const FTC_GCacheClassRec  ftc_basic_image_cache_class =
   {
     {
-      (FTC_Node_NewFunc)    ftc_inode_new,
-      (FTC_Node_WeightFunc) ftc_inode_weight,
-      (FTC_Node_CompareFunc)ftc_gnode_compare,
-      (FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid,
-      (FTC_Node_FreeFunc)   ftc_inode_free,
-
-      sizeof( FTC_GCacheRec ),
-      (FTC_Cache_InitFunc)  ftc_gcache_init,
-      (FTC_Cache_DoneFunc)  ftc_gcache_done
+      ftc_inode_new,
+      ftc_inode_weight,
+      ftc_gnode_compare,
+      ftc_basic_gnode_compare_faceid,
+      ftc_inode_free,
+
+      sizeof ( FTC_GCacheRec ),
+      ftc_gcache_init,
+      ftc_gcache_done
     },
     (FTC_MruListClass)&ftc_basic_image_family_class
   };
 
 
+  /* documentation is in ftcache.h */
+
   FT_EXPORT_DEF( FT_Error )
   FTC_ImageCache_New( FTC_Manager      manager,
                       FTC_ImageCache  *acache )
@@ -240,7 +256,7 @@
   }
 
 
-  /* documentation is in ftcimage.h */
+  /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( FT_Error )
   FTC_ImageCache_Lookup( FTC_ImageCache  cache,
@@ -319,13 +335,13 @@
   {
     {
       sizeof( FTC_BasicFamilyRec ),
-      (FTC_MruNode_CompareFunc)ftc_basic_family_compare,
-      (FTC_MruNode_InitFunc)   ftc_basic_family_init,
-      (FTC_MruNode_ResetFunc)  NULL,
-      (FTC_MruNode_DoneFunc)   NULL
+      ftc_basic_family_compare,
+      ftc_basic_family_init,
+      0,                            /* FTC_MruNode_ResetFunc */
+      0                             /* FTC_MruNode_DoneFunc  */
     },
-    (FTC_SFamily_GetCountFunc) ftc_basic_family_get_count,
-    (FTC_SFamily_LoadGlyphFunc)ftc_basic_family_load_bitmap
+    ftc_basic_family_get_count,
+    ftc_basic_family_load_bitmap
   };
 
 
@@ -333,20 +349,22 @@
   const FTC_GCacheClassRec  ftc_basic_sbit_cache_class =
   {
     {
-      (FTC_Node_NewFunc)    ftc_snode_new,
-      (FTC_Node_WeightFunc) ftc_snode_weight,
-      (FTC_Node_CompareFunc)ftc_snode_compare,
-      (FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid,
-      (FTC_Node_FreeFunc)   ftc_snode_free,
-
-      sizeof( FTC_GCacheRec ),
-      (FTC_Cache_InitFunc)  ftc_gcache_init,
-      (FTC_Cache_DoneFunc)  ftc_gcache_done
+      ftc_snode_new,
+      ftc_snode_weight,
+      ftc_snode_compare,
+      ftc_basic_gnode_compare_faceid,
+      ftc_snode_free,
+
+      sizeof ( FTC_GCacheRec ),
+      ftc_gcache_init,
+      ftc_gcache_done
     },
     (FTC_MruListClass)&ftc_basic_sbit_family_class
   };
 
 
+  /* documentation is in ftcache.h */
+
   FT_EXPORT_DEF( FT_Error )
   FTC_SBitCache_New( FTC_Manager     manager,
                      FTC_SBitCache  *acache )
@@ -356,6 +374,8 @@
   }
 
 
+  /* documentation is in ftcache.h */
+
   FT_EXPORT_DEF( FT_Error )
   FTC_SBitCache_Lookup( FTC_SBitCache  cache,
                         FTC_ImageType  type,

reactos/lib/freetype/src/cache
ftccache.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftccache.c	10 May 2004 17:48:31 -0000	1.6
+++ ftccache.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -304,6 +304,13 @@
   FT_EXPORT_DEF( FT_Error )
   FTC_Cache_Init( FTC_Cache  cache )
   {
+    return ftc_cache_init( cache );
+  }
+
+
+  FT_LOCAL_DEF( FT_Error )
+  ftc_cache_init( FTC_Cache  cache )
+  {
     FT_Memory  memory = cache->memory;
 
 
@@ -315,13 +322,6 @@
   }
 
 
-  FT_LOCAL_DEF( FT_Error )
-  ftc_cache_init( FTC_Cache  cache )
-  {
-    return FTC_Cache_Init( cache );
-  }
-
-
   FT_EXPORT_DEF( void )
   FTC_Cache_Clear( FTC_Cache  cache )
   {
@@ -360,8 +360,8 @@
   }
 
 
-  FT_EXPORT_DEF( void )
-  FTC_Cache_Done( FTC_Cache  cache )
+  FT_LOCAL_DEF( void )
+  ftc_cache_done( FTC_Cache  cache )
   {
     if ( cache->memory )
     {
@@ -380,10 +380,10 @@
   }
 
 
-  FT_LOCAL_DEF( void )
-  ftc_cache_done( FTC_Cache  cache )
+  FT_EXPORT_DEF( void )
+  FTC_Cache_Done( FTC_Cache  cache )
   {
-    FTC_Cache_Done( cache );
+    ftc_cache_done( cache );
   }
 
 

reactos/lib/freetype/src/cache
ftccback.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ftccback.h	10 May 2004 17:48:31 -0000	1.1
+++ ftccback.h	18 Aug 2004 20:25:08 -0000	1.2
@@ -28,46 +28,49 @@
 
 
   FT_LOCAL( void )
-  ftc_inode_free( FTC_INode  inode,
+  ftc_inode_free( FTC_Node   inode,
                   FTC_Cache  cache );
 
   FT_LOCAL( FT_Error )
-  ftc_inode_new( FTC_INode   *pinode,
-                 FTC_GQuery   gquery,
-                 FTC_Cache    cache );
+  ftc_inode_new( FTC_Node   *pinode,
+                 FT_Pointer  gquery,
+                 FTC_Cache   cache );
 
   FT_LOCAL( FT_ULong )
-  ftc_inode_weight( FTC_INode  inode );
+  ftc_inode_weight( FTC_Node   inode,
+                    FTC_Cache  cache );
 
 
   FT_LOCAL( void )
-  ftc_snode_free( FTC_SNode  snode,
+  ftc_snode_free( FTC_Node   snode,
                   FTC_Cache  cache );
 
   FT_LOCAL( FT_Error )
-  ftc_snode_new( FTC_SNode  *psnode,
-                 FTC_GQuery  gquery,
+  ftc_snode_new( FTC_Node   *psnode,
+                 FT_Pointer  gquery,
                  FTC_Cache   cache );
 
   FT_LOCAL( FT_ULong )
-  ftc_snode_weight( FTC_SNode  snode );
+  ftc_snode_weight( FTC_Node   snode,
+                    FTC_Cache  cache );
 
   FT_LOCAL( FT_Bool )
-  ftc_snode_compare( FTC_SNode   snode,
-                     FTC_GQuery  gquery,
+  ftc_snode_compare( FTC_Node    snode,
+                     FT_Pointer  gquery,
                      FTC_Cache   cache );
 
 
   FT_LOCAL( FT_Bool )
-  ftc_gnode_compare( FTC_GNode   gnode,
-                     FTC_GQuery  gquery );
+  ftc_gnode_compare( FTC_Node    gnode,
+                     FT_Pointer  gquery,
+                     FTC_Cache   cache );
 
 
   FT_LOCAL( FT_Error )
-  ftc_gcache_init( FTC_GCache  cache );
+  ftc_gcache_init( FTC_Cache  cache );
 
   FT_LOCAL( void )
-  ftc_gcache_done( FTC_GCache  cache );
+  ftc_gcache_done( FTC_Cache  cache );
 
 
   FT_LOCAL( FT_Error )

reactos/lib/freetype/src/cache
ftccmap.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftccmap.c	10 May 2004 17:48:31 -0000	1.6
+++ ftccmap.c	18 Aug 2004 20:25:08 -0000	1.7
@@ -98,10 +98,11 @@
   /* no need for specific finalizer; we use `ftc_node_done' directly */
 
   FT_CALLBACK_DEF( void )
-  ftc_cmap_node_free( FTC_CMapNode  node,
-                      FTC_Cache     cache )
+  ftc_cmap_node_free( FTC_Node   ftcnode,
+                      FTC_Cache  cache )
   {
-    FT_Memory  memory = cache->memory;
+    FTC_CMapNode  node   = (FTC_CMapNode)ftcnode;
+    FT_Memory     memory = cache->memory;
 
 
     FT_FREE( node );
@@ -110,14 +111,16 @@
 
   /* initialize a new cmap node */
   FT_CALLBACK_DEF( FT_Error )
-  ftc_cmap_node_new( FTC_CMapNode  *anode,
-                     FTC_CMapQuery  query,
-                     FTC_Cache      cache )
-  {
-    FT_Error      error;
-    FT_Memory     memory  = cache->memory;
-    FTC_CMapNode  node;
-    FT_UInt       nn;
+  ftc_cmap_node_new( FTC_Node   *ftcanode,
+                     FT_Pointer  ftcquery,
+                     FTC_Cache   cache )
+  {
+    FTC_CMapNode  *anode  = (FTC_CMapNode*)ftcanode;
+    FTC_CMapQuery  query  = (FTC_CMapQuery)ftcquery;
+    FT_Error       error;
+    FT_Memory      memory = cache->memory;
+    FTC_CMapNode   node;
+    FT_UInt        nn;
 
 
     if ( !FT_NEW( node ) )
@@ -138,9 +141,11 @@
 
   /* compute the weight of a given cmap node */
   FT_CALLBACK_DEF( FT_ULong )
-  ftc_cmap_node_weight( FTC_CMapNode  cnode )
+  ftc_cmap_node_weight( FTC_Node   cnode,
+                        FTC_Cache  cache )
   {
     FT_UNUSED( cnode );
+    FT_UNUSED( cache );
 
     return sizeof ( *cnode );
   }
@@ -148,9 +153,15 @@
 
   /* compare a cmap node to a given query */
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_cmap_node_compare( FTC_CMapNode   node,
-                         FTC_CMapQuery  query )
-  {
+  ftc_cmap_node_compare( FTC_Node    ftcnode,
+                         FT_Pointer  ftcquery,
+                         FTC_Cache   cache )
+  {
+    FTC_CMapNode   node  = (FTC_CMapNode)ftcnode;
+    FTC_CMapQuery  query = (FTC_CMapQuery)ftcquery;
+    FT_UNUSED( cache );
+
+
     if ( node->face_id    == query->face_id    &&
          node->cmap_index == query->cmap_index )
     {
@@ -165,9 +176,14 @@
 
 
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_cmap_node_remove_faceid( FTC_CMapNode  node,
-                               FTC_FaceID    face_id )
-  {
+  ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,
+                               FT_Pointer  ftcface_id,
+                               FTC_Cache   cache )
+  {
+    FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;
+    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
+    FT_UNUSED( cache );
+
     return FT_BOOL( node->face_id == face_id );
   }
 
@@ -184,19 +200,19 @@
   FT_CALLBACK_TABLE_DEF
   const FTC_CacheClassRec  ftc_cmap_cache_class =
   {
-    (FTC_Node_NewFunc)    ftc_cmap_node_new,
-    (FTC_Node_WeightFunc) ftc_cmap_node_weight,
-    (FTC_Node_CompareFunc)ftc_cmap_node_compare,
-    (FTC_Node_CompareFunc)ftc_cmap_node_remove_faceid,
-    (FTC_Node_FreeFunc)   ftc_cmap_node_free,
+    ftc_cmap_node_new,
+    ftc_cmap_node_weight,
+    ftc_cmap_node_compare,
+    ftc_cmap_node_remove_faceid,
+    ftc_cmap_node_free,
 
     sizeof ( FTC_CacheRec ),
-    (FTC_Cache_InitFunc)  ftc_cache_init,
-    (FTC_Cache_DoneFunc)  ftc_cache_done,
+    ftc_cache_init,
+    ftc_cache_done,
   };
 
 
-  /* documentation is in ftccmap.h */
+  /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( FT_Error )
   FTC_CMapCache_New( FTC_Manager     manager,
@@ -208,7 +224,7 @@
   }
 
 
-  /* documentation is in ftccmap.h */
+  /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( FT_UInt )
   FTC_CMapCache_Lookup( FTC_CMapCache  cmap_cache,

reactos/lib/freetype/src/cache
ftcglyph.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftcglyph.c	10 May 2004 17:48:31 -0000	1.4
+++ ftcglyph.c	18 Aug 2004 20:25:08 -0000	1.5
@@ -64,20 +64,26 @@
   }
 
 
-  FT_EXPORT_DEF( FT_Bool )
-  FTC_GNode_Compare( FTC_GNode   gnode,
-                     FTC_GQuery  gquery )
-  {
+  FT_LOCAL_DEF( FT_Bool )
+  ftc_gnode_compare( FTC_Node    ftcgnode,
+                     FT_Pointer  ftcgquery,
+                     FTC_Cache   cache )
+  {
+    FTC_GNode   gnode  = (FTC_GNode)ftcgnode;
+    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
+    FT_UNUSED( cache );
+
+
     return FT_BOOL(  gnode->family == gquery->family &&
                      gnode->gindex == gquery->gindex );
   }
 
 
-  FT_LOCAL_DEF( FT_Bool )
-  ftc_gnode_compare( FTC_GNode   gnode,
+  FT_EXPORT_DEF( FT_Bool )
+  FTC_GNode_Compare( FTC_GNode   gnode,
                      FTC_GQuery  gquery )
   {
-    return FTC_GNode_Compare( gnode, gquery );
+    return ftc_gnode_compare( FTC_NODE( gnode ), gquery, NULL );
   }
 
 
@@ -102,10 +108,12 @@
   }
 
 
-  FT_EXPORT_DEF( FT_Error )
-  FTC_GCache_Init( FTC_GCache  cache )
+  FT_LOCAL_DEF( FT_Error )
+  ftc_gcache_init( FTC_Cache  ftccache )
   {
-    FT_Error error;
+    FTC_GCache  cache = (FTC_GCache)ftccache;
+    FT_Error    error;
+
 
     error = FTC_Cache_Init( FTC_CACHE( cache ) );
     if ( !error )
@@ -123,25 +131,28 @@
   }
 
 
-  FT_LOCAL_DEF( FT_Error )
-  ftc_gcache_init( FTC_GCache  cache )
+  FT_EXPORT_DEF( FT_Error )
+  FTC_GCache_Init( FTC_GCache  cache )
   {
-    return FTC_GCache_Init( cache );
+    return ftc_gcache_init( FTC_CACHE( cache ) );
   }
 
 
-  FT_EXPORT_DEF( void )
-  FTC_GCache_Done( FTC_GCache  cache )
+  FT_LOCAL_DEF( void )
+  ftc_gcache_done( FTC_Cache  ftccache )
   {
+    FTC_GCache  cache = (FTC_GCache)ftccache;
+
+
     FTC_Cache_Done( (FTC_Cache)cache );
     FTC_MruList_Done( &cache->families );
   }
 
 
-  FT_LOCAL_DEF( void )
-  ftc_gcache_done( FTC_GCache  cache )
+  FT_EXPORT_DEF( void )
+  FTC_GCache_Done( FTC_GCache  cache )
   {
-    FTC_GCache_Done( cache );
+    ftc_gcache_done( FTC_CACHE( cache ) );
   }
 
 

reactos/lib/freetype/src/cache
ftcimage.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftcimage.c	10 May 2004 17:48:31 -0000	1.4
+++ ftcimage.c	18 Aug 2004 20:25:08 -0000	1.5
@@ -26,10 +26,11 @@
 
 
   /* finalize a given glyph image node */
-  FT_EXPORT_DEF( void )
-  FTC_INode_Free( FTC_INode  inode,
+  FT_LOCAL_DEF( void )
+  ftc_inode_free( FTC_Node   ftcinode,
                   FTC_Cache  cache )
   {
+    FTC_INode  inode = (FTC_INode)ftcinode;
     FT_Memory  memory = cache->memory;
 
 
@@ -44,11 +45,11 @@
   }
 
 
-  FT_LOCAL_DEF( void )
-  ftc_inode_free( FTC_INode  inode,
+  FT_EXPORT_DEF( void )
+  FTC_INode_Free( FTC_INode  inode,
                   FTC_Cache  cache )
   {
-    FTC_INode_Free( inode, cache );
+    ftc_inode_free( FTC_NODE( inode ), cache );
   }
 
 
@@ -85,19 +86,27 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  ftc_inode_new( FTC_INode   *pinode,
-                 FTC_GQuery   gquery,
-                 FTC_Cache    cache )
+  ftc_inode_new( FTC_Node   *ftcpinode,
+                 FT_Pointer  ftcgquery,
+                 FTC_Cache   cache )
   {
+    FTC_INode  *pinode = (FTC_INode*)ftcpinode;
+    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
+
+
     return FTC_INode_New( pinode, gquery, cache );
   }
 
 
-  FT_EXPORT_DEF( FT_ULong )
-  FTC_INode_Weight( FTC_INode  inode )
+  FT_LOCAL_DEF( FT_ULong )
+  ftc_inode_weight( FTC_Node   ftcinode,
+                    FTC_Cache  ftccache )
   {
-    FT_ULong  size  = 0;
-    FT_Glyph  glyph = inode->glyph;
+    FTC_INode  inode = (FTC_INode)ftcinode;
+    FT_ULong   size  = 0;
+    FT_Glyph   glyph = inode->glyph;
+
+    FT_UNUSED( ftccache );
 
 
     switch ( glyph->format )
@@ -135,10 +144,10 @@
   }
 
 
-  FT_LOCAL_DEF( FT_ULong )
-  ftc_inode_weight( FTC_INode  inode )
+  FT_EXPORT_DEF( FT_ULong )
+  FTC_INode_Weight( FTC_INode  inode )
   {
-    return FTC_INode_Weight( inode );
+    return ftc_inode_weight( FTC_NODE( inode ), NULL );
   }
 
 

reactos/lib/freetype/src/cache
ftcmanag.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftcmanag.c	10 May 2004 17:48:31 -0000	1.4
+++ ftcmanag.c	18 Aug 2004 20:25:09 -0000	1.5
@@ -79,9 +79,12 @@
 
 
   FT_CALLBACK_DEF( void )
-  ftc_size_node_done( FTC_SizeNode  node )
+  ftc_size_node_done( FTC_MruNode  ftcnode,
+                      FT_Pointer   data )
   {
-    FT_Size  size = node->size;
+    FTC_SizeNode  node = (FTC_SizeNode)ftcnode;
+    FT_Size       size = node->size;
+    FT_UNUSED( data );
 
 
     if ( size )
@@ -90,10 +93,12 @@
 
 
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_size_node_compare( FTC_SizeNode  node,
-                         FTC_Scaler    scaler )
+  ftc_size_node_compare( FTC_MruNode  ftcnode,
+                         FT_Pointer   ftcscaler )
   {
-    FTC_Scaler  scaler0 = &node->scaler;
+    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;
+    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;
+    FTC_Scaler    scaler0 = &node->scaler;
 
 
     if ( FTC_SCALER_COMPARE( scaler0, scaler ) )
@@ -106,10 +111,15 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_size_node_init( FTC_SizeNode  node,
-                      FTC_Scaler    scaler,
-                      FTC_Manager   manager )
-  {
+  ftc_size_node_init( FTC_MruNode  ftcnode,
+                      FT_Pointer   ftcscaler,
+                      FT_Pointer   ftcmanager )
+  {
+    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;
+    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;
+    FTC_Manager   manager = (FTC_Manager)ftcmanager;
+
+
     node->scaler = scaler[0];
 
     return ftc_scaler_lookup_size( manager, scaler, &node->size );
@@ -117,10 +127,15 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_size_node_reset( FTC_SizeNode  node,
-                       FTC_Scaler    scaler,
-                       FTC_Manager   manager )
-  {
+  ftc_size_node_reset( FTC_MruNode  ftcnode,
+                       FT_Pointer   ftcscaler,
+                       FT_Pointer   ftcmanager )
+  {
+    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;
+    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;
+    FTC_Manager   manager = (FTC_Manager)ftcmanager;
+
+
     FT_Done_Size( node->size );
 
     node->scaler = scaler[0];
@@ -132,23 +147,29 @@
   FT_CALLBACK_TABLE_DEF
   const FTC_MruListClassRec  ftc_size_list_class =
   {
-    sizeof( FTC_SizeNodeRec ),
-    (FTC_MruNode_CompareFunc)ftc_size_node_compare,
-    (FTC_MruNode_InitFunc)   ftc_size_node_init,
-    (FTC_MruNode_ResetFunc)  ftc_size_node_reset,
-    (FTC_MruNode_DoneFunc)   ftc_size_node_done
+    sizeof ( FTC_SizeNodeRec ),
+    ftc_size_node_compare,
+    ftc_size_node_init,
+    ftc_size_node_reset,
+    ftc_size_node_done
   };
 
 
   /* helper function used by ftc_face_node_done */
   static FT_Bool
-  ftc_size_node_compare_faceid( FTC_SizeNode  node,
-                                FTC_FaceID    face_id )
+  ftc_size_node_compare_faceid( FTC_MruNode  ftcnode,
+                                FT_Pointer   ftcface_id )
   {
-    return FT_BOOL( node->scaler.face_id == face_id );
+    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;
+    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
+
+
+    return node->scaler.face_id == face_id;
   }
 
 
+  /* documentation is in ftcache.h */
+
   FT_EXPORT_DEF( FT_Error )
   FTC_Manager_LookupSize( FTC_Manager  manager,
                           FTC_Scaler   scaler,
@@ -200,11 +221,14 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  ftc_face_node_init( FTC_FaceNode  node,
-                      FTC_FaceID    face_id,
-                      FTC_Manager   manager )
-  {
-    FT_Error  error;
+  ftc_face_node_init( FTC_MruNode  ftcnode,
+                      FT_Pointer   ftcface_id,
+                      FT_Pointer   ftcmanager )
+  {
+    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;
+    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
+    FTC_Manager   manager = (FTC_Manager)ftcmanager;
+    FT_Error      error;
 
 
     node->face_id = face_id;
@@ -225,15 +249,18 @@
 
 
   FT_CALLBACK_DEF( void )
-  ftc_face_node_done( FTC_FaceNode  node,
-                      FTC_Manager   manager )
+  ftc_face_node_done( FTC_MruNode  ftcnode,
+                      FT_Pointer   ftcmanager )
   {
+    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;
+    FTC_Manager   manager = (FTC_Manager)ftcmanager;
+
+
     /* we must begin by removing all scalers for the target face */
     /* from the manager's list                                   */
-    FTC_MruList_RemoveSelection(
-      & manager->sizes,
-      (FTC_MruNode_CompareFunc)ftc_size_node_compare_faceid,
-      node->face_id );
+    FTC_MruList_RemoveSelection( &manager->sizes,
+                                 ftc_size_node_compare_faceid,
+                                 node->face_id );
 
     /* all right, we can discard the face now */
     FT_Done_Face( node->face );
@@ -243,9 +270,13 @@
 
 
   FT_CALLBACK_DEF( FT_Bool )
-  ftc_face_node_compare( FTC_FaceNode  node,
-                         FTC_FaceID    face_id )
+  ftc_face_node_compare( FTC_MruNode  ftcnode,
+                         FT_Pointer   ftcface_id )
   {
+    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;
+    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
+
+
     return FT_BOOL( node->face_id == face_id );
   }
 
@@ -253,12 +284,12 @@
   FT_CALLBACK_TABLE_DEF
   const FTC_MruListClassRec  ftc_face_list_class =
   {
-    sizeof( FTC_FaceNodeRec),
+    sizeof ( FTC_FaceNodeRec),
 
-    (FTC_MruNode_CompareFunc)ftc_face_node_compare,
-    (FTC_MruNode_InitFunc)   ftc_face_node_init,
-    (FTC_MruNode_ResetFunc)  NULL,
-    (FTC_MruNode_DoneFunc)   ftc_face_node_done
+    ftc_face_node_compare,
+    ftc_face_node_init,
+    0,                          /* FTC_MruNode_ResetFunc */
+    ftc_face_node_done
   };
 
 
@@ -617,6 +648,8 @@
   }
 
 
+  /* documentation is in ftcache.h */
+
   FT_EXPORT_DEF( void )
   FTC_Manager_RemoveFaceID( FTC_Manager  manager,
                             FTC_FaceID   face_id )
@@ -633,7 +666,7 @@
   }
 
 
-  /* documentation is in ftcmanag.h */
+  /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( void )
   FTC_Node_Unref( FTC_Node     node,

reactos/lib/freetype/src/cache
ftcsbits.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ftcsbits.c	10 May 2004 17:48:31 -0000	1.6
+++ ftcsbits.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -58,10 +58,11 @@
   }
 
 
-  FT_EXPORT_DEF( void )
-  FTC_SNode_Free( FTC_SNode  snode,
+  FT_LOCAL_DEF( void )
+  ftc_snode_free( FTC_Node   ftcsnode,
                   FTC_Cache  cache )
   {
+    FTC_SNode  snode  = (FTC_SNode)ftcsnode;
     FTC_SBit   sbit   = snode->sbits;
     FT_UInt    count  = snode->count;
     FT_Memory  memory = cache->memory;
@@ -76,11 +77,11 @@
   }
 
 
-  FT_LOCAL_DEF( void )
-  ftc_snode_free( FTC_SNode  snode,
+  FT_EXPORT_DEF( void )
+  FTC_SNode_Free( FTC_SNode  snode,
                   FTC_Cache  cache )
   {
-    FTC_SNode_Free( snode, cache );
+    ftc_snode_free( FTC_NODE( snode ), cache );
   }
 
 
@@ -240,22 +241,30 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  ftc_snode_new( FTC_SNode  *psnode,
-                 FTC_GQuery  gquery,
+  ftc_snode_new( FTC_Node   *ftcpsnode,
+                 FT_Pointer  ftcgquery,
                  FTC_Cache   cache )
   {
+    FTC_SNode  *psnode = (FTC_SNode*)ftcpsnode;
+    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
+
+
     return FTC_SNode_New( psnode, gquery, cache );
   }
 
 
-  FT_EXPORT_DEF( FT_ULong )
-  FTC_SNode_Weight( FTC_SNode  snode )
+  FT_LOCAL_DEF( FT_ULong )
+  ftc_snode_weight( FTC_Node   ftcsnode,
+                    FTC_Cache  cache )
   {
+    FTC_SNode  snode = (FTC_SNode)ftcsnode;
     FT_UInt    count = snode->count;
     FTC_SBit   sbit  = snode->sbits;
     FT_Int     pitch;
     FT_ULong   size;
 
+    FT_UNUSED( cache );
+
 
     FT_ASSERT( snode->count <= FTC_SBIT_ITEMS_PER_NODE );
 
@@ -279,21 +288,23 @@
   }
 
 
-  FT_LOCAL_DEF( FT_ULong )
-  ftc_snode_weight( FTC_SNode  snode )
+  FT_EXPORT_DEF( FT_ULong )
+  FTC_SNode_Weight( FTC_SNode  snode )
   {
-    return FTC_SNode_Weight( snode );
+    return ftc_snode_weight( FTC_NODE( snode ), NULL );
   }
 
 
-  FT_EXPORT_DEF( FT_Bool )
-  FTC_SNode_Compare( FTC_SNode   snode,
-                     FTC_GQuery  gquery,
+  FT_LOCAL_DEF( FT_Bool )
+  ftc_snode_compare( FTC_Node    ftcsnode,
+                     FT_Pointer  ftcgquery,
                      FTC_Cache   cache )
   {
-    FTC_GNode  gnode  = FTC_GNODE( snode );
-    FT_UInt    gindex = gquery->gindex;
-    FT_Bool    result;
+    FTC_SNode   snode  = (FTC_SNode)ftcsnode;
+    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
+    FTC_GNode   gnode  = FTC_GNODE( snode );
+    FT_UInt     gindex = gquery->gindex;
+    FT_Bool     result;
 
 
     result = FT_BOOL( gnode->family == gquery->family                    &&
@@ -321,12 +332,12 @@
   }
 
 
-  FT_LOCAL_DEF( FT_Bool )
-  ftc_snode_compare( FTC_SNode   snode,
+  FT_EXPORT_DEF( FT_Bool )
+  FTC_SNode_Compare( FTC_SNode   snode,
                      FTC_GQuery  gquery,
                      FTC_Cache   cache )
   {
-    return FTC_SNode_Compare( snode, gquery, cache );
+    return ftc_snode_compare( FTC_NODE( snode ), gquery, cache );
   }
 
 

reactos/lib/freetype/src/cff
cffdrivr.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- cffdrivr.c	10 May 2004 17:48:32 -0000	1.5
+++ cffdrivr.c	18 Aug 2004 20:25:09 -0000	1.6
@@ -96,12 +96,13 @@
   /*                                                                       */
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
-  static FT_Error
-  Get_Kerning( TT_Face     face,
+  FT_CALLBACK_DEF( FT_Error )
+  Get_Kerning( FT_Face     ttface,          /* TT_Face */
                FT_UInt     left_glyph,
                FT_UInt     right_glyph,
                FT_Vector*  kerning )
   {
+    TT_Face        face = (TT_Face)ttface;
     TT_Kern0_Pair  pair;
 
 
@@ -178,13 +179,15 @@
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
-  static FT_Error
-  Load_Glyph( CFF_GlyphSlot  slot,
-              CFF_Size       size,
-              FT_UShort      glyph_index,
-              FT_Int32       load_flags )
+  FT_CALLBACK_DEF( FT_Error )
+  Load_Glyph( FT_GlyphSlot  cffslot,        /* CFF_GlyphSlot */
+              FT_Size       cffsize,        /* CFF_Size      */
+              FT_UInt       glyph_index,
+              FT_Int32      load_flags )
   {
     FT_Error  error;
+    CFF_GlyphSlot  slot = (CFF_GlyphSlot)cffslot;
+    CFF_Size       size = (CFF_Size)cffsize;
 
 
     if ( !slot )
@@ -200,8 +203,8 @@
     /* reset the size object if necessary */
     if ( size )
     {
-      /* these two object must have the same parent */
-      if ( size->root.face != slot->root.face )
+      /* these two objects must have the same parent */
+      if ( cffsize->face != cffslot->face )
         return CFF_Err_Invalid_Face_Handle;
     }
 
@@ -409,8 +412,8 @@
   };
 
 
-  static FT_Module_Interface
-  cff_get_interface( CFF_Driver   driver,
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  cff_get_interface( FT_Module    driver,       /* CFF_Driver */
                      const char*  module_interface )
   {
     FT_Module            sfnt;
@@ -422,7 +425,7 @@
       return  result;
 
     /* we pass our request to the `sfnt' module */
-    sfnt = FT_Get_Module( driver->root.root.library, "sfnt" );
+    sfnt = FT_Get_Module( driver->library, "sfnt" );
 
     return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
   }
@@ -446,9 +449,9 @@
 
       0,   /* module-specific interface */
 
-      (FT_Module_Constructor)cff_driver_init,
-      (FT_Module_Destructor) cff_driver_done,
-      (FT_Module_Requester)  cff_get_interface,
+      cff_driver_init,
+      cff_driver_done,
+      cff_get_interface,
     },
 
     /* now the specific driver fields */
@@ -456,21 +459,21 @@
     sizeof( CFF_SizeRec ),
     sizeof( CFF_GlyphSlotRec ),
 
-    (FT_Face_InitFunc)       cff_face_init,
-    (FT_Face_DoneFunc)       cff_face_done,
-    (FT_Size_InitFunc)       cff_size_init,
-    (FT_Size_DoneFunc)       cff_size_done,
-    (FT_Slot_InitFunc)       cff_slot_init,
-    (FT_Slot_DoneFunc)       cff_slot_done,
-
-    (FT_Size_ResetPointsFunc)cff_size_reset,
-    (FT_Size_ResetPixelsFunc)cff_size_reset,
-
-    (FT_Slot_LoadFunc)       Load_Glyph,
-
-    (FT_Face_GetKerningFunc) Get_Kerning,
-    (FT_Face_AttachFunc)     0,
-    (FT_Face_GetAdvancesFunc)0,
+    cff_face_init,
+    cff_face_done,
+    cff_size_init,
+    cff_size_done,
+    cff_slot_init,
+    cff_slot_done,
+
+    cff_point_size_reset,
+    cff_size_reset,
+
+    Load_Glyph,
+
+    Get_Kerning,
+    0,                      /* FT_Face_AttachFunc      */
+    0                       /* FT_Face_GetAdvancesFunc */
   };
 
 

reactos/lib/freetype/src/cff
cffgload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- cffgload.c	10 May 2004 17:48:32 -0000	1.6
+++ cffgload.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -825,7 +825,7 @@
     zone          = decoder->zones;
     stack         = decoder->top;
 
-    hinter = (T2_Hints_Funcs) builder->hints_funcs;
+    hinter = (T2_Hints_Funcs)builder->hints_funcs;
 
     builder->path_begun = 0;
 
@@ -842,7 +842,7 @@
     if ( hinter )
       hinter->open( hinter->hints );
 
-    /* now, execute loop */
+    /* now execute loop */
     while ( ip < limit )
     {
       CFF_Operator  op;
@@ -1266,7 +1266,7 @@
 
           if ( cff_builder_start_point ( builder, x, y ) ||
                check_points( builder, num_args / 2 )     )
-            goto Memory_Error;
+            goto Fail;
 
           if ( num_args < 2 || num_args & 1 )
             goto Stack_Underflow;
@@ -1291,9 +1291,9 @@
             FT_TRACE4(( op == cff_op_hlineto ? " hlineto"
                                              : " vlineto" ));
 
-            if ( cff_builder_start_point ( builder, x, y )     ||
-                 check_points( builder, num_args ) )
-              goto Memory_Error;
+            if ( cff_builder_start_point ( builder, x, y ) ||
+                 check_points( builder, num_args )         )
+              goto Fail;
 
             args = stack;
             while (args < decoder->top )
@@ -1304,7 +1304,7 @@
                 y += args[0];
 
               if ( cff_builder_add_point1( builder, x, y ) )
-                goto Memory_Error;
+                goto Fail;
 
               args++;
               phase ^= 1;
@@ -1322,7 +1322,7 @@
 
           if ( cff_builder_start_point ( builder, x, y ) ||
                check_points( builder, num_args / 2 )     )
-            goto Memory_Error;
+            goto Fail;
 
           args = stack;
           while ( args < decoder->top )
@@ -1344,8 +1344,8 @@
         case cff_op_vvcurveto:
           FT_TRACE4(( " vvcurveto" ));
 
-          if ( cff_builder_start_point ( builder, x, y ) )
-            goto Memory_Error;
+          if ( cff_builder_start_point( builder, x, y ) )
+            goto Fail;
 
           args = stack;
           if ( num_args & 1 )
@@ -1359,7 +1359,7 @@
             goto Stack_Underflow;
 
           if ( check_points( builder, 3 * ( num_args / 4 ) ) )
-            goto Memory_Error;
+            goto Fail;
 
           while ( args < decoder->top )
           {
@@ -1378,8 +1378,8 @@
         case cff_op_hhcurveto:
           FT_TRACE4(( " hhcurveto" ));
 
-          if ( cff_builder_start_point ( builder, x, y ) )
-            goto Memory_Error;
+          if ( cff_builder_start_point( builder, x, y ) )
+            goto Fail;
 
           args = stack;
           if ( num_args & 1 )
@@ -1393,7 +1393,7 @@
             goto Stack_Underflow;
 
           if ( check_points( builder, 3 * ( num_args / 4 ) ) )
-            goto Memory_Error;
+            goto Fail;
 
           while ( args < decoder->top )
           {
@@ -1418,8 +1418,8 @@
             FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto"
                                                : " hvcurveto" ));
 
-            if ( cff_builder_start_point ( builder, x, y ) )
-              goto Memory_Error;
+            if ( cff_builder_start_point( builder, x, y ) )
+              goto Fail;
 
             args = stack;
             if (num_args < 4 || ( num_args % 4 ) > 1 )
@@ -1476,7 +1476,7 @@
 
             if ( cff_builder_start_point( builder, x, y ) ||
                  check_points( builder, num_lines + 3 )   )
-              goto Memory_Error;
+              goto Fail;
 
             args = stack;
 
@@ -1516,7 +1516,7 @@
 
             if ( cff_builder_start_point ( builder, x, y ) ||
                  check_points( builder, num_curves*3 + 2 ) )
-              goto Memory_Error;
+              goto Fail;
 
             args = stack;
 
@@ -1555,10 +1555,10 @@
 
             /* adding five more points; 4 control points, 1 on-curve point */
             /* make sure we have enough space for the start point if it    */
-            /* needs to be added..                                         */
+            /* needs to be added                                           */
             if ( cff_builder_start_point( builder, x, y ) ||
                  check_points( builder, 6 )               )
-              goto Memory_Error;
+              goto Fail;
 
             /* Record the starting point's y postion for later use */
             start_y = y;
@@ -1608,8 +1608,8 @@
 
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points ( builder, 6 )              )
-              goto Memory_Error;
+                 check_points( builder, 6 )               )
+              goto Fail;
 
             /* record the starting point's y-position for later use */
             start_y = y;
@@ -1661,7 +1661,7 @@
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
                  check_points( builder, 6 )               )
-               goto Memory_Error;
+              goto Fail;
 
             /* record the starting point's x, y postion for later use */
             start_x = x;
@@ -1724,7 +1724,7 @@
 
             if ( cff_builder_start_point( builder, x, y ) ||
                  check_points( builder, 6 )               )
-              goto Memory_Error;
+              goto Fail;
 
             args = stack;
             for ( count = 6; count > 0; count-- )
@@ -2175,6 +2175,7 @@
 
     FT_TRACE4(( "..end..\n\n" ));
 
+  Fail:
     return error;
 
   Syntax_Error:
@@ -2188,9 +2189,6 @@
   Stack_Overflow:
     FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow!" ));
     return CFF_Err_Stack_Overflow;
-
-  Memory_Error:
-    return builder->error;
   }
 
 

reactos/lib/freetype/src/cff
cffgload.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- cffgload.h	21 Jan 2004 19:23:46 -0000	1.2
+++ cffgload.h	18 Aug 2004 20:25:09 -0000	1.3
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -75,9 +75,6 @@
   /*                                                                       */
   /*    no_recurse    :: Set but not used.                                 */
   /*                                                                       */
-  /*    error         :: An error code that is only used to report memory  */
-  /*                     allocation problems.                              */
-  /*                                                                       */
   /*    metrics_only  :: A boolean indicating that we only want to compute */
   /*                     the metrics of a given glyph, not load all of its */
   /*                     points.                                           */
@@ -111,7 +108,6 @@
     FT_Bool         load_points;
     FT_Bool         no_recurse;
 
-    FT_Error        error;         /* only used for memory errors */
     FT_Bool         metrics_only;
 
     void*           hints_funcs;    /* hinter-specific */

reactos/lib/freetype/src/cff
cffload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- cffload.c	10 May 2004 17:48:32 -0000	1.6
+++ cffload.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -1095,7 +1095,7 @@
 
     idx->stream = stream;
     if ( !FT_READ_USHORT( count ) &&
-         count > 0             )
+         count > 0                )
     {
       FT_Byte*   p;
       FT_Byte    offsize;

reactos/lib/freetype/src/cff
cffobjs.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- cffobjs.c	10 May 2004 17:48:32 -0000	1.5
+++ cffobjs.c	18 Aug 2004 20:25:09 -0000	1.6
@@ -46,7 +46,7 @@
   /*                                                                       */
   /*                            SIZE FUNCTIONS                             */
   /*                                                                       */
-  /*  Note that we store the global hints in the size's "internal" root    */
+  /*  Note that we store the global hints in the size's `internal' root    */
   /*  field.                                                               */
   /*                                                                       */
   /*************************************************************************/
@@ -135,25 +135,29 @@
 
 
   FT_LOCAL_DEF( void )
-  cff_size_done( CFF_Size  size )
+  cff_size_done( FT_Size  cffsize )        /* CFF_Size */
   {
-    if ( size->root.internal )
+    CFF_Size  size = (CFF_Size)cffsize;
+
+
+    if ( cffsize->internal )
     {
       PSH_Globals_Funcs  funcs;
 
 
       funcs = cff_size_get_globals_funcs( size );
       if ( funcs )
-        funcs->destroy( (PSH_Globals)size->root.internal );
+        funcs->destroy( (PSH_Globals)cffsize->internal );
 
-      size->root.internal = 0;
+      cffsize->internal = 0;
     }
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  cff_size_init( CFF_Size  size )
+  cff_size_init( FT_Size  cffsize )         /* CFF_Size */
   {
+    CFF_Size           size  = (CFF_Size)cffsize;
     FT_Error           error = CFF_Err_Ok;
     PSH_Globals_Funcs  funcs = cff_size_get_globals_funcs( size );
 
@@ -161,7 +165,7 @@
     if ( funcs )
     {
       PSH_Globals    globals;
-      CFF_Face       face    = (CFF_Face)size->root.face;
+      CFF_Face       face    = (CFF_Face)cffsize->face;
       CFF_Font       font    = (CFF_FontRec *)face->extra.data;
       CFF_SubFont    subfont = &font->top_font;
 
@@ -215,9 +219,9 @@
         priv.lenIV          = cpriv->lenIV;
       }
 
-      error = funcs->create( size->root.face->memory, &priv, &globals );
+      error = funcs->create( cffsize->face->memory, &priv, &globals );
       if ( !error )
-        size->root.internal = (FT_Size_Internal)(void*)globals;
+        cffsize->internal = (FT_Size_Internal)(void*)globals;
     }
 
     return error;
@@ -225,17 +229,23 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  cff_size_reset( CFF_Size  size )
+  cff_size_reset( FT_Size  cffsize,         /* CFF_Size */
+                  FT_UInt  char_width,
+                  FT_UInt  char_height )
   {
+    CFF_Size           size  = (CFF_Size)cffsize;
     PSH_Globals_Funcs  funcs = cff_size_get_globals_funcs( size );
     FT_Error           error = CFF_Err_Ok;
-    FT_Face            face  = size->root.face;
+    FT_Face            face  = cffsize->face;
+
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
 
 
     if ( funcs )
-      error = funcs->set_scale( (PSH_Globals)size->root.internal,
-                                 size->root.metrics.x_scale,
-                                 size->root.metrics.y_scale,
+      error = funcs->set_scale( (PSH_Globals)cffsize->internal,
+                                 cffsize->metrics.x_scale,
+                                 cffsize->metrics.y_scale,
                                  0, 0 );
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
@@ -245,7 +255,7 @@
       error = sbit_size_reset( size );
 
       if ( !error && !( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
-        size->root.metrics = size->strike_metrics;
+        cffsize->metrics = size->strike_metrics;
     }
 
 #endif
@@ -257,6 +267,22 @@
   }
 
 
+  FT_LOCAL_DEF( FT_Error )
+  cff_point_size_reset( FT_Size     cffsize,
+                        FT_F26Dot6  char_width,
+                        FT_F26Dot6  char_height,
+                        FT_UInt     horz_resolution,
+                        FT_UInt     vert_resolution )
+  {
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+    FT_UNUSED( horz_resolution );
+    FT_UNUSED( vert_resolution );
+
+    return cff_size_reset( cffsize, 0, 0 );
+  }
+
+
   /*************************************************************************/
   /*                                                                       */
   /*                            SLOT  FUNCTIONS                            */
@@ -264,16 +290,16 @@
   /*************************************************************************/
 
   FT_LOCAL_DEF( void )
-  cff_slot_done( CFF_GlyphSlot  slot )
+  cff_slot_done( FT_GlyphSlot  slot )
   {
-    slot->root.internal->glyph_hints = 0;
+    slot->internal->glyph_hints = 0;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  cff_slot_init( CFF_GlyphSlot  slot )
+  cff_slot_init( FT_GlyphSlot  slot )
   {
-    CFF_Face          face     = (CFF_Face)slot->root.face;
+    CFF_Face          face     = (CFF_Face)slot->face;
     CFF_Font          font     = (CFF_FontRec *)face->extra.data;
     PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
 
@@ -283,7 +309,7 @@
       FT_Module  module;
 
 
-      module = FT_Get_Module( slot->root.face->driver->root.library,
+      module = FT_Get_Module( slot->face->driver->root.library,
                               "pshinter" );
       if ( module )
       {
@@ -291,7 +317,7 @@
 
 
         funcs = pshinter->get_t2_funcs( module );
-        slot->root.internal->glyph_hints = (void*)funcs;
+        slot->internal->glyph_hints = (void*)funcs;
       }
     }
 
@@ -328,11 +354,12 @@
 
   FT_LOCAL_DEF( FT_Error )
   cff_face_init( FT_Stream      stream,
-                 CFF_Face       face,
+                 FT_Face        cffface,        /* CFF_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    CFF_Face            face = (CFF_Face)cffface;
     FT_Error            error;
     SFNT_Service        sfnt;
     FT_Service_PsCMaps  psnames;
@@ -349,14 +376,14 @@
       goto Bad_Format;
 #else
     sfnt = (SFNT_Service)FT_Get_Module_Interface(
-             face->root.driver->root.library, "sfnt" );
+             cffface->driver->root.library, "sfnt" );
     if ( !sfnt )
       goto Bad_Format;
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
 
     pshinter = (PSHinter_Service)FT_Get_Module_Interface(
-                 face->root.driver->root.library, "pshinter" );
+                 cffface->driver->root.library, "pshinter" );
 #endif
 
     /* create input stream from resource */
@@ -421,8 +448,7 @@
     {
       CFF_Font         cff;
       CFF_FontRecDict  dict;
-      FT_Memory        memory = face->root.memory;
-      FT_Face          root;
+      FT_Memory        memory = cffface->memory;
       FT_Int32         flags;
 
 
@@ -440,8 +466,7 @@
       /* Complement the root flags with some interesting information. */
       /* Note that this is only necessary for pure CFF and CEF fonts. */
 
-      root             = &face->root;
-      root->num_glyphs = cff->num_glyphs;
+      cffface->num_glyphs = cff->num_glyphs;
 
       dict = &cff->top_font.font_dict;
 
@@ -462,57 +487,54 @@
 
 
         /* Set up num_faces. */
-        root->num_faces = cff->num_faces;
+        cffface->num_faces = cff->num_faces;
 
         /* compute number of glyphs */
         if ( dict->cid_registry != 0xFFFFU )
-          root->num_glyphs = dict->cid_count;
+          cffface->num_glyphs = dict->cid_count;
         else
-          root->num_glyphs = cff->charstrings_index.count;
+          cffface->num_glyphs = cff->charstrings_index.count;
 
         /* set global bbox, as well as EM size */
-        root->bbox.xMin =   dict->font_bbox.xMin             >> 16;
-        root->bbox.yMin =   dict->font_bbox.yMin             >> 16;
-        root->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFFU ) >> 16;
-        root->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFFU ) >> 16;
-
-        root->ascender  = (FT_Short)( root->bbox.yMax );
-        root->descender = (FT_Short)( root->bbox.yMin );
-        root->height    = (FT_Short)(
-          ( ( root->ascender - root->descender ) * 12 ) / 10 );
+        cffface->bbox.xMin =   dict->font_bbox.xMin             >> 16;
+        cffface->bbox.yMin =   dict->font_bbox.yMin             >> 16;
+        cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFFU ) >> 16;
+        cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFFU ) >> 16;
+
+        cffface->ascender  = (FT_Short)( cffface->bbox.yMax );
+        cffface->descender = (FT_Short)( cffface->bbox.yMin );
+        cffface->height    = (FT_Short)(
+          ( ( cffface->ascender - cffface->descender ) * 12 ) / 10 );
 
         if ( dict->units_per_em )
-          root->units_per_EM = dict->units_per_em;
+          cffface->units_per_EM = dict->units_per_em;
         else
-          root->units_per_EM = 1000;
+          cffface->units_per_EM = 1000;
 
-        root->underline_position  =
+        cffface->underline_position  =
           (FT_Short)( dict->underline_position >> 16 );
-        root->underline_thickness =
+        cffface->underline_thickness =
           (FT_Short)( dict->underline_thickness >> 16 );
 
         /* retrieve font family & style name */
-        root->family_name = cff_index_get_name( &cff->name_index,
-                                                face_index );
+        cffface->family_name = cff_index_get_name( &cff->name_index,
+                                                   face_index );
 
-        if ( root->family_name )
+        if ( cffface->family_name )
         {
           char*  full   = cff_index_get_sid_string( &cff->string_index,
                                                     dict->full_name,
                                                     psnames );
           char*  fullp  = full;
-          char*  family = root->family_name;
+          char*  family = cffface->family_name;
 
-         /* we're going to try to extract the style name from the
-          * full name. We need to ignore spaces and dashes during
-          * the search.
-          */
+          /* We try to extract the style name from the full name.   */
+          /* We need to ignore spaces and dashes during the search. */
           if ( full )
           {
             while ( *fullp )
             {
-             /* skip common characters at the start of both strings
-              */
+              /* skip common characters at the start of both strings */
               if ( *fullp == *family )
               {
                 family++;
@@ -520,15 +542,14 @@
                 continue;
               }
 
-             /* ignore spaces or dashes in full name during comparison
-              */
+              /* ignore spaces and dashes in full name during comparison */
               if ( *fullp == ' ' || *fullp == '-' )
               {
                 fullp++;
                 continue;
               }
-             /* ignore spaces and dashes in family name during comparison
-              */
+
+              /* ignore spaces and dashes in family name during comparison */
               if ( *family == ' ' || *family == '-' )
               {
                 family++;
@@ -537,11 +558,10 @@
 
               if ( !*family && *fullp )
               {
-               /* the full name begins with the same characters than the
-                * family name, with spaces and dashes removed. In this
-                * case, the remaining string in "fullp" will be used
-                * as the style name
-                */
+                /* Rhe full name begins with the same characters as the  */
+                /* family name, with spaces and dashes removed.  In this */
+                /* case, the remaining string in `fullp' will be used as */
+                /* the style name.                                       */
                 style_name = cff_strcpy( memory, fullp );
               }
               break;
@@ -559,14 +579,14 @@
 
           /* do we have a `/FontName' for a CID-keyed font? */
           if ( cid_font_name )
-            root->family_name = cid_font_name;
+            cffface->family_name = cid_font_name;
         }
 
         if ( style_name )
-          root->style_name = style_name;
+          cffface->style_name = style_name;
         else
           /* assume "Regular" style if we don't know better */
-          root->style_name = cff_strcpy( memory, (char *)"Regular" );
+          cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
 
         /*******************************************************************/
         /*                                                                 */
@@ -589,7 +609,7 @@
           flags |= FT_FACE_FLAG_KERNING;
 #endif
 
-        root->face_flags = flags;
+        cffface->face_flags = flags;
 
         /*******************************************************************/
         /*                                                                 */
@@ -613,14 +633,14 @@
           FT_FREE( weight );
         }
 
-        root->style_flags = flags;
+        cffface->style_flags = flags;
       }
 
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
       /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
       /* has unset this flag because of the 3.0 `post' table           */
       if ( dict->cid_registry == 0xFFFFU )
-        root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
+        cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
 #endif
 
       /*******************************************************************/
@@ -638,9 +658,9 @@
         CFF_Encoding   encoding = &cff->encoding;
 
 
-        for ( nn = 0; nn < (FT_UInt)root->num_charmaps; nn++ )
+        for ( nn = 0; nn < (FT_UInt)cffface->num_charmaps; nn++ )
         {
-          cmap = root->charmaps[nn];
+          cmap = cffface->charmaps[nn];
 
           /* Windows Unicode (3,1)? */
           if ( cmap->platform_id == 3 && cmap->encoding_id == 1 )
@@ -657,18 +677,18 @@
           goto Exit;
 
         /* we didn't find a Unicode charmap -- synthetize one */
-        cmaprec.face        = root;
+        cmaprec.face        = cffface;
         cmaprec.platform_id = 3;
         cmaprec.encoding_id = 1;
         cmaprec.encoding    = FT_ENCODING_UNICODE;
 
-        nn = (FT_UInt)root->num_charmaps;
+        nn = (FT_UInt)cffface->num_charmaps;
 
         FT_CMap_New( &cff_cmap_unicode_class_rec, NULL, &cmaprec, NULL );
 
         /* if no Unicode charmap was previously selected, select this one */
-        if ( root->charmap == NULL && nn != (FT_UInt)root->num_charmaps )
-          root->charmap = root->charmaps[nn];
+        if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )
+          cffface->charmap = cffface->charmaps[nn];
 
       Skip_Unicode:
         if ( encoding->count > 0 )
@@ -676,7 +696,7 @@
           FT_CMap_Class  clazz;
 
 
-          cmaprec.face        = root;
+          cmaprec.face        = cffface;
           cmaprec.platform_id = 7;  /* Adobe platform id */
 
           if ( encoding->offset == 0 )
@@ -713,9 +733,10 @@
 
 
   FT_LOCAL_DEF( void )
-  cff_face_done( CFF_Face  face )
+  cff_face_done( FT_Face  cffface )         /* CFF_Face */
   {
-    FT_Memory     memory = face->root.memory;
+    CFF_Face      face   = (CFF_Face)cffface;
+    FT_Memory     memory = cffface->memory;
     SFNT_Service  sfnt   = (SFNT_Service)face->sfnt;
 
 
@@ -736,18 +757,18 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  cff_driver_init( CFF_Driver  driver )
+  cff_driver_init( FT_Module  module )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return CFF_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( void )
-  cff_driver_done( CFF_Driver  driver )
+  cff_driver_done( FT_Module  module )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
   }
 
 

reactos/lib/freetype/src/cff
cffobjs.h 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- cffobjs.h	10 May 2004 17:48:32 -0000	1.4
+++ cffobjs.h	18 Aug 2004 20:25:09 -0000	1.5
@@ -113,19 +113,28 @@
 
 
   FT_LOCAL( FT_Error )
-  cff_size_init( CFF_Size  size );
+  cff_size_init( FT_Size  size );           /* CFF_Size */
 
   FT_LOCAL( void )
-  cff_size_done( CFF_Size  size );
+  cff_size_done( FT_Size  size );           /* CFF_Size */
 
   FT_LOCAL( FT_Error )
-  cff_size_reset( CFF_Size  size );
+  cff_size_reset( FT_Size  size,            /* CFF_Size */
+                  FT_UInt  char_width,
+                  FT_UInt  char_height );
+
+  FT_LOCAL( FT_Error )
+  cff_point_size_reset( FT_Size     cffsize,
+                        FT_F26Dot6  char_width,
+                        FT_F26Dot6  char_height,
+                        FT_UInt     horz_resolution,
+                        FT_UInt     vert_resolution );
 
   FT_LOCAL( void )
-  cff_slot_done( CFF_GlyphSlot  slot );
+  cff_slot_done( FT_GlyphSlot  slot );
 
   FT_LOCAL( FT_Error )
-  cff_slot_init( CFF_GlyphSlot   slot );
+  cff_slot_init( FT_GlyphSlot  slot );
 
 
   /*************************************************************************/
@@ -134,13 +143,13 @@
   /*                                                                       */
   FT_LOCAL( FT_Error )
   cff_face_init( FT_Stream      stream,
-                 CFF_Face       face,
+                 FT_Face        face,           /* CFF_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params );
 
   FT_LOCAL( void )
-  cff_face_done( CFF_Face  face );
+  cff_face_done( FT_Face  face );               /* CFF_Face */
 
 
   /*************************************************************************/
@@ -148,10 +157,10 @@
   /* Driver functions                                                      */
   /*                                                                       */
   FT_LOCAL( FT_Error )
-  cff_driver_init( CFF_Driver  driver );
+  cff_driver_init( FT_Module  module );
 
   FT_LOCAL( void )
-  cff_driver_done( CFF_Driver  driver );
+  cff_driver_done( FT_Module  module );
 
 
 FT_END_HEADER

reactos/lib/freetype/src/cff
cffparse.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- cffparse.c	10 May 2004 17:48:32 -0000	1.3
+++ cffparse.c	18 Aug 2004 20:25:09 -0000	1.4
@@ -590,19 +590,19 @@
             Store_Number:
               switch ( field->size )
               {
-              case 1:
+              case (8 / FT_CHAR_BIT):
                 *(FT_Byte*)q = (FT_Byte)val;
                 break;
 
-              case 2:
+              case (16 / FT_CHAR_BIT):
                 *(FT_Short*)q = (FT_Short)val;
                 break;
 
-              case 4:
+              case (32 / FT_CHAR_BIT):
                 *(FT_Int32*)q = (FT_Int)val;
                 break;
 
-              default:  /* for 64-bit systems where long is 8 bytes */
+              default:  /* for 64-bit systems */
                 *(FT_Long*)q = val;
               }
               break;
@@ -627,15 +627,15 @@
                   val += cff_parse_num( data++ );
                   switch ( field->size )
                   {
-                  case 1:
+                  case (8 / FT_CHAR_BIT):
                     *(FT_Byte*)q = (FT_Byte)val;
                     break;
 
-                  case 2:
+                  case (16 / FT_CHAR_BIT):
                     *(FT_Short*)q = (FT_Short)val;
                     break;
 
-                  case 4:
+                  case (32 / FT_CHAR_BIT):
                     *(FT_Int32*)q = (FT_Int)val;
                     break;
 

reactos/lib/freetype/src/cid
cidgload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- cidgload.c	10 May 2004 17:48:32 -0000	1.6
+++ cidgload.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -269,14 +269,16 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  cid_slot_load_glyph( CID_GlyphSlot  glyph,
-                       CID_Size       size,
-                       FT_Int         glyph_index,
-                       FT_Int32       load_flags )
+  cid_slot_load_glyph( FT_GlyphSlot  cidglyph,      /* CID_GlyphSlot */
+                       FT_Size       cidsize,       /* CID_Size      */
+                       FT_UInt       glyph_index,
+                       FT_Int32      load_flags )
   {
+    CID_GlyphSlot  glyph = (CID_GlyphSlot)cidglyph;
+    CID_Size       size  = (CID_Size)cidsize;
     FT_Error       error;
     T1_DecoderRec  decoder;
-    CID_Face       face = (CID_Face)glyph->root.face;
+    CID_Face       face = (CID_Face)cidglyph->face;
     FT_Bool        hinting;
 
     PSAux_Service  psaux = (PSAux_Service)face->psaux;
@@ -287,22 +289,22 @@
     if ( load_flags & FT_LOAD_NO_RECURSE )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
 
-    glyph->x_scale = size->root.metrics.x_scale;
-    glyph->y_scale = size->root.metrics.y_scale;
+    glyph->x_scale = cidsize->metrics.x_scale;
+    glyph->y_scale = cidsize->metrics.y_scale;
 
-    glyph->root.outline.n_points   = 0;
-    glyph->root.outline.n_contours = 0;
+    cidglyph->outline.n_points   = 0;
+    cidglyph->outline.n_contours = 0;
 
     hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&
                        ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
 
-    glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+    cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;
 
     {
       error = psaux->t1_decoder_funcs->init( &decoder,
-                                             (FT_Face)face,
-                                             (FT_Size)size,
-                                             (FT_GlyphSlot)glyph,
+                                             cidglyph->face,
+                                             cidsize,
+                                             cidglyph,
                                              0, /* glyph names -- XXX */
                                              0, /* blend == 0 */
                                              hinting,
@@ -327,18 +329,18 @@
     /* bearing the yMax                                    */
     if ( !error )
     {
-      glyph->root.outline.flags &= FT_OUTLINE_OWNER;
-      glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;
+      cidglyph->outline.flags &= FT_OUTLINE_OWNER;
+      cidglyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
 
       /* for composite glyphs, return only left side bearing and */
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
       {
-        FT_Slot_Internal  internal = glyph->root.internal;
+        FT_Slot_Internal  internal = cidglyph->internal;
 
 
-        glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x;
-        glyph->root.metrics.horiAdvance  = decoder.builder.advance.x;
+        cidglyph->metrics.horiBearingX = decoder.builder.left_bearing.x;
+        cidglyph->metrics.horiAdvance  = decoder.builder.advance.x;
 
         internal->glyph_matrix         = font_matrix;
         internal->glyph_delta          = font_offset;
@@ -347,30 +349,30 @@
       else
       {
         FT_BBox            cbox;
-        FT_Glyph_Metrics*  metrics = &glyph->root.metrics;
+        FT_Glyph_Metrics*  metrics = &cidglyph->metrics;
         FT_Vector          advance;
 
 
         /* copy the _unscaled_ advance width */
-        metrics->horiAdvance          = decoder.builder.advance.x;
-        glyph->root.linearHoriAdvance = decoder.builder.advance.x;
-        glyph->root.internal->glyph_transformed = 0;
+        metrics->horiAdvance                  = decoder.builder.advance.x;
+        cidglyph->linearHoriAdvance           = decoder.builder.advance.x;
+        cidglyph->internal->glyph_transformed = 0;
 
         /* make up vertical metrics */
         metrics->vertBearingX = 0;
         metrics->vertBearingY = 0;
         metrics->vertAdvance  = 0;
 
-        glyph->root.linearVertAdvance = 0;
-        glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+        cidglyph->linearVertAdvance = 0;
+        cidglyph->format            = FT_GLYPH_FORMAT_OUTLINE;
 
-        if ( size && size->root.metrics.y_ppem < 24 )
-          glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+        if ( size && cidsize->metrics.y_ppem < 24 )
+          cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
 
         /* apply the font matrix */
-        FT_Outline_Transform( &glyph->root.outline, &font_matrix );
+        FT_Outline_Transform( &cidglyph->outline, &font_matrix );
 
-        FT_Outline_Translate( &glyph->root.outline,
+        FT_Outline_Translate( &cidglyph->outline,
                               font_offset.x,
                               font_offset.y );
 
@@ -401,7 +403,7 @@
               vec->y = FT_MulFix( vec->y, y_scale );
             }
 
-          FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
+          FT_Outline_Get_CBox( &cidglyph->outline, &cbox );
 
           /* Then scale the metrics */
           metrics->horiAdvance  = FT_MulFix( metrics->horiAdvance,  x_scale );
@@ -421,7 +423,7 @@
         }
 
         /* compute the other metrics */
-        FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
+        FT_Outline_Get_CBox( &cidglyph->outline, &cbox );
 
         /* grid fit the bounding box if necessary */
         if ( hinting )
@@ -439,6 +441,7 @@
         metrics->horiBearingY = cbox.yMax;
       }
     }
+
     return error;
   }
 

reactos/lib/freetype/src/cid
cidgload.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- cidgload.h	1 Apr 2003 08:38:20 -0000	1.1
+++ cidgload.h	18 Aug 2004 20:25:09 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,10 +37,10 @@
 #endif /* 0 */
 
   FT_LOCAL( FT_Error )
-  cid_slot_load_glyph( CID_GlyphSlot  glyph,
-                       CID_Size       size,
-                       FT_Int         glyph_index,
-                       FT_Int32       load_flags );
+  cid_slot_load_glyph( FT_GlyphSlot  glyph,         /* CID_Glyph_Slot */
+                       FT_Size       size,          /* CID_Size       */
+                       FT_UInt       glyph_index,
+                       FT_Int32      load_flags );
 
 
 FT_END_HEADER

reactos/lib/freetype/src/cid
cidobjs.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- cidobjs.c	10 May 2004 17:48:32 -0000	1.5
+++ cidobjs.c	18 Aug 2004 20:25:09 -0000	1.6
@@ -47,20 +47,20 @@
   /*************************************************************************/
 
   FT_LOCAL_DEF( void )
-  cid_slot_done( CID_GlyphSlot  slot )
+  cid_slot_done( FT_GlyphSlot  slot )
   {
-    slot->root.internal->glyph_hints = 0;
+    slot->internal->glyph_hints = 0;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  cid_slot_init( CID_GlyphSlot  slot )
+  cid_slot_init( FT_GlyphSlot  slot )
   {
     CID_Face          face;
     PSHinter_Service  pshinter;
 
 
-    face     = (CID_Face)slot->root.face;
+    face     = (CID_Face)slot->face;
     pshinter = (PSHinter_Service)face->pshinter;
 
     if ( pshinter )
@@ -68,7 +68,7 @@
       FT_Module  module;
 
 
-      module = FT_Get_Module( slot->root.face->driver->root.library,
+      module = FT_Get_Module( slot->face->driver->root.library,
                               "pshinter" );
       if ( module )
       {
@@ -76,7 +76,7 @@
 
 
         funcs = pshinter->get_t1_funcs( module );
-        slot->root.internal->glyph_hints = (void*)funcs;
+        slot->internal->glyph_hints = (void*)funcs;
       }
     }
 
@@ -108,25 +108,29 @@
 
 
   FT_LOCAL_DEF( void )
-  cid_size_done( CID_Size  size )
+  cid_size_done( FT_Size  cidsize )         /* CID_Size */
   {
-    if ( size->root.internal )
+    CID_Size  size = (CID_Size)cidsize;
+
+
+    if ( cidsize->internal )
     {
       PSH_Globals_Funcs  funcs;
 
 
       funcs = cid_size_get_globals_funcs( size );
       if ( funcs )
-        funcs->destroy( (PSH_Globals)size->root.internal );
+        funcs->destroy( (PSH_Globals)cidsize->internal );
 
-      size->root.internal = 0;
+      cidsize->internal = 0;
     }
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  cid_size_init( CID_Size  size )
+  cid_size_init( FT_Size  cidsize )     /* CID_Size */
   {
+    CID_Size           size  = (CID_Size)cidsize;
     FT_Error           error = 0;
     PSH_Globals_Funcs  funcs = cid_size_get_globals_funcs( size );
 
@@ -134,14 +138,14 @@
     if ( funcs )
     {
       PSH_Globals   globals;
-      CID_Face      face = (CID_Face)size->root.face;
+      CID_Face      face = (CID_Face)cidsize->face;
       CID_FaceDict  dict = face->cid.font_dicts + face->root.face_index;
       PS_Private    priv = &dict->private_dict;
 
 
-      error = funcs->create( size->root.face->memory, priv, &globals );
+      error = funcs->create( cidsize->face->memory, priv, &globals );
       if ( !error )
-        size->root.internal = (FT_Size_Internal)(void*)globals;
+        cidsize->internal = (FT_Size_Internal)(void*)globals;
     }
 
     return error;
@@ -149,21 +153,43 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  cid_size_reset( CID_Size  size )
+  cid_size_reset( FT_Size  cidsize,             /* CID_Size */
+                  FT_UInt  char_width,
+                  FT_UInt  char_height )
   {
+    CID_Size           size  = (CID_Size)cidsize;
     PSH_Globals_Funcs  funcs = cid_size_get_globals_funcs( size );
     FT_Error           error = 0;
 
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+
 
     if ( funcs )
-      error = funcs->set_scale( (PSH_Globals)size->root.internal,
-                                 size->root.metrics.x_scale,
-                                 size->root.metrics.y_scale,
+      error = funcs->set_scale( (PSH_Globals)cidsize->internal,
+                                 cidsize->metrics.x_scale,
+                                 cidsize->metrics.y_scale,
                                  0, 0 );
     return error;
   }
 
 
+  FT_LOCAL_DEF( FT_Error )
+  cid_point_size_reset( FT_Size     size,
+                        FT_F26Dot6  char_width,
+                        FT_F26Dot6  char_height,
+                        FT_UInt     horz_resolution,
+                        FT_UInt     vert_resolution )
+  {
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+    FT_UNUSED( horz_resolution );
+    FT_UNUSED( vert_resolution );
+
+    return cid_size_reset( size, 0, 0 );
+  }
+
+
   /*************************************************************************/
   /*                                                                       */
   /*                           FACE  FUNCTIONS                             */
@@ -182,8 +208,9 @@
   /*    face :: A pointer to the face object to destroy.                   */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  cid_face_done( CID_Face  face )
+  cid_face_done( FT_Face  cidface )         /* CID_Face */
   {
+    CID_Face   face = (CID_Face)cidface;
     FT_Memory  memory;
 
 
@@ -193,7 +220,7 @@
       PS_FontInfo   info = &cid->font_info;
 
 
-      memory = face->root.memory;
+      memory = cidface->memory;
 
       /* release subrs */
       if ( face->subrs )
@@ -232,8 +259,8 @@
       FT_FREE( cid->registry );
       FT_FREE( cid->ordering );
 
-      face->root.family_name = 0;
-      face->root.style_name  = 0;
+      cidface->family_name = 0;
+      cidface->style_name  = 0;
 
       FT_FREE( face->binary_data );
       FT_FREE( face->cid_stream );
@@ -266,11 +293,12 @@
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   cid_face_init( FT_Stream      stream,
-                 CID_Face       face,
+                 FT_Face        cidface,        /* CID_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    CID_Face            face = (CID_Face)cidface;
     FT_Error            error;
     FT_Service_PsCMaps  psnames;
     PSAux_Service       psaux;
@@ -281,7 +309,7 @@
     FT_UNUSED( stream );
 
 
-    face->root.num_faces = 1;
+    cidface->num_faces = 1;
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
 
@@ -329,33 +357,32 @@
 
     /* set up root face fields */
     {
-      FT_Face       root = (FT_Face)&face->root;
       CID_FaceInfo  cid  = &face->cid;
       PS_FontInfo   info = &cid->font_info;
 
 
-      root->num_glyphs   = cid->cid_count;
-      root->num_charmaps = 0;
+      cidface->num_glyphs   = cid->cid_count;
+      cidface->num_charmaps = 0;
 
-      root->face_index = face_index;
-      root->face_flags = FT_FACE_FLAG_SCALABLE;
+      cidface->face_index = face_index;
+      cidface->face_flags = FT_FACE_FLAG_SCALABLE;
 
-      root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
+      cidface->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
       if ( info->is_fixed_pitch )
-        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
+        cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
       /* XXX: TODO: add kerning with .afm support */
 
       /* get style name -- be careful, some broken fonts only */
       /* have a /FontName dictionary entry!                   */
-      root->family_name = info->family_name;
+      cidface->family_name = info->family_name;
       /* assume "Regular" style if we don't know better */
-      root->style_name = (char *)"Regular";
-      if ( root->family_name )
+      cidface->style_name = (char *)"Regular";
+      if ( cidface->family_name )
       {
         char*  full   = info->full_name;
-        char*  family = root->family_name;
+        char*  family = cidface->family_name;
 
 
         if ( full )
@@ -376,7 +403,7 @@
               else
               {
                 if ( !*family )
-                  root->style_name = full;
+                  cidface->style_name = full;
                 break;
               }
             }
@@ -387,42 +414,42 @@
       {
         /* do we have a `/FontName'? */
         if ( cid->cid_font_name )
-          root->family_name = cid->cid_font_name;
+          cidface->family_name = cid->cid_font_name;
       }
 
       /* compute style flags */
-      root->style_flags = 0;
+      cidface->style_flags = 0;
       if ( info->italic_angle )
-        root->style_flags |= FT_STYLE_FLAG_ITALIC;
+        cidface->style_flags |= FT_STYLE_FLAG_ITALIC;
       if ( info->weight )
       {
         if ( !ft_strcmp( info->weight, "Bold"  ) ||
              !ft_strcmp( info->weight, "Black" ) )
-          root->style_flags |= FT_STYLE_FLAG_BOLD;
+          cidface->style_flags |= FT_STYLE_FLAG_BOLD;
       }
 
       /* no embedded bitmap support */
-      root->num_fixed_sizes = 0;
-      root->available_sizes = 0;
+      cidface->num_fixed_sizes = 0;
+      cidface->available_sizes = 0;
 
-      root->bbox.xMin =   cid->font_bbox.xMin             >> 16;
-      root->bbox.yMin =   cid->font_bbox.yMin             >> 16;
-      root->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFFU ) >> 16;
-      root->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFFU ) >> 16;
-
-      if ( !root->units_per_EM )
-        root->units_per_EM = 1000;
-
-      root->ascender  = (FT_Short)( root->bbox.yMax );
-      root->descender = (FT_Short)( root->bbox.yMin );
-      root->height    = (FT_Short)(
-        ( ( root->ascender - root->descender ) * 12 ) / 10 );
+      cidface->bbox.xMin =   cid->font_bbox.xMin             >> 16;
+      cidface->bbox.yMin =   cid->font_bbox.yMin             >> 16;
+      cidface->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFFU ) >> 16;
+      cidface->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFFU ) >> 16;
+
+      if ( !cidface->units_per_EM )
+        cidface->units_per_EM = 1000;
+
+      cidface->ascender  = (FT_Short)( cidface->bbox.yMax );
+      cidface->descender = (FT_Short)( cidface->bbox.yMin );
+      cidface->height    = (FT_Short)(
+        ( ( cidface->ascender - cidface->descender ) * 12 ) / 10 );
 
-      root->underline_position  = (FT_Short)info->underline_position;
-      root->underline_thickness = (FT_Short)info->underline_thickness;
+      cidface->underline_position  = (FT_Short)info->underline_position;
+      cidface->underline_thickness = (FT_Short)info->underline_thickness;
 
-      root->internal->max_points   = 0;
-      root->internal->max_contours = 0;
+      cidface->internal->max_points   = 0;
+      cidface->internal->max_contours = 0;
     }
 
   Exit:
@@ -445,7 +472,7 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  cid_driver_init( CID_Driver  driver )
+  cid_driver_init( FT_Module  driver )
   {
     FT_UNUSED( driver );
 
@@ -465,7 +492,7 @@
   /*    driver :: A handle to the target CID driver.                       */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  cid_driver_done( CID_Driver  driver )
+  cid_driver_done( FT_Module  driver )
   {
     FT_UNUSED( driver );
   }

reactos/lib/freetype/src/cid
cidobjs.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- cidobjs.h	1 Apr 2003 08:38:20 -0000	1.1
+++ cidobjs.h	18 Aug 2004 20:25:09 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID objects manager (specification).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -112,42 +112,47 @@
 
 
   FT_LOCAL( void )
-  cid_slot_done( CID_GlyphSlot  slot );
+  cid_slot_done( FT_GlyphSlot  slot );
 
   FT_LOCAL( FT_Error )
-  cid_slot_init( CID_GlyphSlot   slot );
+  cid_slot_init( FT_GlyphSlot  slot );
 
 
   FT_LOCAL( void )
-  cid_size_done( CID_Size  size );
-
+  cid_size_done( FT_Size  size );       /* CID_Size */
 
   FT_LOCAL( FT_Error )
-  cid_size_init( CID_Size  size );
+  cid_size_init( FT_Size  size );       /* CID_Size */
 
+  FT_LOCAL( FT_Error )
+  cid_size_reset( FT_Size  size,        /* CID_Size */
+                  FT_UInt  char_width,
+                  FT_UInt  char_height );
 
   FT_LOCAL( FT_Error )
-  cid_size_reset( CID_Size  size );
+  cid_point_size_reset( FT_Size     size,
+                        FT_F26Dot6  char_width,
+                        FT_F26Dot6  char_height,
+                        FT_UInt     horz_resolution,
+                        FT_UInt     vert_resolution );
 
 
   FT_LOCAL( FT_Error )
   cid_face_init( FT_Stream      stream,
-                 CID_Face       face,
+                 FT_Face        face,           /* CID_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params );
 
-
   FT_LOCAL( void )
-  cid_face_done( CID_Face  face );
+  cid_face_done( FT_Face  face );               /* CID_Face */
 
 
   FT_LOCAL( FT_Error )
-  cid_driver_init( CID_Driver  driver );
-
+  cid_driver_init( FT_Module  driver );
 
   FT_LOCAL( void )
-  cid_driver_done( CID_Driver  driver );
+  cid_driver_done( FT_Module  driver );
 
 
 FT_END_HEADER

reactos/lib/freetype/src/cid
cidriver.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- cidriver.c	10 May 2004 17:48:32 -0000	1.5
+++ cidriver.c	18 Aug 2004 20:25:09 -0000	1.6
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID driver interface (body).                                         */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -97,12 +97,11 @@
   };
 
 
-  static FT_Module_Interface
-  cid_get_interface( FT_Driver         driver,
-                     const FT_String*  cid_interface )
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  cid_get_interface( FT_Module    module,
+                     const char*  cid_interface )
   {
-    FT_UNUSED( driver );
-    FT_UNUSED( cid_interface );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( cid_services, cid_interface );
   }
@@ -125,9 +124,9 @@
 
       0,
 
-      (FT_Module_Constructor)cid_driver_init,
-      (FT_Module_Destructor) cid_driver_done,
-      (FT_Module_Requester)  cid_get_interface
+      cid_driver_init,
+      cid_driver_done,
+      cid_get_interface
     },
 
     /* then the other font drivers fields */
@@ -135,23 +134,23 @@
     sizeof( CID_SizeRec ),
     sizeof( CID_GlyphSlotRec ),
 
-    (FT_Face_InitFunc)       cid_face_init,
-    (FT_Face_DoneFunc)       cid_face_done,
+    cid_face_init,
+    cid_face_done,
 
-    (FT_Size_InitFunc)       cid_size_init,
-    (FT_Size_DoneFunc)       cid_size_done,
-    (FT_Slot_InitFunc)       cid_slot_init,
-    (FT_Slot_DoneFunc)       cid_slot_done,
+    cid_size_init,
+    cid_size_done,
+    cid_slot_init,
+    cid_slot_done,
 
-    (FT_Size_ResetPointsFunc)cid_size_reset,
-    (FT_Size_ResetPixelsFunc)cid_size_reset,
+    cid_point_size_reset,
+    cid_size_reset,
 
-    (FT_Slot_LoadFunc)       cid_slot_load_glyph,
+    cid_slot_load_glyph,
 
-    (FT_Face_GetKerningFunc) 0,
-    (FT_Face_AttachFunc)     0,
+    0,                      /* FT_Face_GetKerningFunc  */
+    0,                      /* FT_Face_AttachFunc      */
 
-    (FT_Face_GetAdvancesFunc)0,
+    0                       /* FT_Face_GetAdvancesFunc */
   };
 
 

reactos/lib/freetype/src/gzip
adler32.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- adler32.c	10 May 2004 17:48:32 -0000	1.6
+++ adler32.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-/* @(#) $Id: adler32.c,v 1.6 2004/05/10 17:48:32 gvg Exp $ */
+/* @(#) $Id: adler32.c,v 1.7 2004/08/18 20:25:09 gvg Exp $ */
 
 #include "zlib.h"
 

reactos/lib/freetype/src/gzip
ftgzip.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ftgzip.c	10 May 2004 17:48:32 -0000	1.4
+++ ftgzip.c	18 Aug 2004 20:25:09 -0000	1.5
@@ -565,7 +565,7 @@
     FT_ZERO( stream );
     stream->memory = memory;
 
-    if ( !FT_NEW( zip ) )
+    if ( !FT_QNEW( zip ) )
     {
       error = ft_gzip_file_init( zip, stream, source );
       if ( error )

reactos/lib/freetype/src/gzip
zconf.h 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- zconf.h	10 May 2004 17:48:32 -0000	1.6
+++ zconf.h	18 Aug 2004 20:25:09 -0000	1.7
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-/* @(#) $Id: zconf.h,v 1.6 2004/05/10 17:48:32 gvg Exp $ */
+/* @(#) $Id: zconf.h,v 1.7 2004/08/18 20:25:09 gvg Exp $ */
 
 #ifndef _ZCONF_H
 #define _ZCONF_H

reactos/lib/freetype/src/gzip
zutil.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- zutil.c	10 May 2004 17:48:32 -0000	1.6
+++ zutil.c	18 Aug 2004 20:25:09 -0000	1.7
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-/* @(#) $Id: zutil.c,v 1.6 2004/05/10 17:48:32 gvg Exp $ */
+/* @(#) $Id: zutil.c,v 1.7 2004/08/18 20:25:09 gvg Exp $ */
 
 #include "zutil.h"
 

reactos/lib/freetype/src/gzip
zutil.h 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- zutil.h	10 May 2004 17:48:32 -0000	1.6
+++ zutil.h	18 Aug 2004 20:25:09 -0000	1.7
@@ -8,7 +8,7 @@
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: zutil.h,v 1.6 2004/05/10 17:48:32 gvg Exp $ */
+/* @(#) $Id: zutil.h,v 1.7 2004/08/18 20:25:09 gvg Exp $ */
 
 #ifndef _Z_UTIL_H
 #define _Z_UTIL_H

reactos/lib/freetype/src/lzw
zopen.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- zopen.c	10 May 2004 17:48:33 -0000	1.1
+++ zopen.c	18 Aug 2004 20:25:09 -0000	1.2
@@ -66,10 +66,14 @@
  */
 
 #include <ctype.h>
+#if 0
 #include <signal.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
+#if 0
 #include <unistd.h>
+#endif
 
 #if 0
 static char_type magic_header[] =

reactos/lib/freetype/src/pcf
pcfdrivr.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- pcfdrivr.c	10 May 2004 17:48:33 -0000	1.4
+++ pcfdrivr.c	18 Aug 2004 20:25:10 -0000	1.5
@@ -40,6 +40,7 @@
 #include "pcfread.h"
 
 #include "pcferror.h"
+#include "pcfutil.h"
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_pcfread
@@ -47,9 +48,20 @@
 #include FT_SERVICE_BDF_H
 #include FT_SERVICE_XFREE86_NAME_H
 
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_pcfdriver
+
+
   typedef struct  PCF_CMapRec_
   {
-    FT_CMapRec    cmap;
+    FT_CMapRec    root;
     FT_UInt       num_encodings;
     PCF_Encoding  encodings;
 
@@ -57,9 +69,13 @@
 
 
   FT_CALLBACK_DEF( FT_Error )
-  pcf_cmap_init( PCF_CMap  cmap )
+  pcf_cmap_init( FT_CMap     pcfcmap,   /* PCF_CMap */
+                 FT_Pointer  init_data )
   {
-    PCF_Face  face = (PCF_Face)FT_CMAP_FACE( cmap );
+    PCF_CMap  cmap = (PCF_CMap)pcfcmap;
+    PCF_Face  face = (PCF_Face)FT_CMAP_FACE( pcfcmap );
+
+    FT_UNUSED( init_data );
 
 
     cmap->num_encodings = (FT_UInt)face->nencodings;
@@ -70,20 +86,24 @@
 
 
   FT_CALLBACK_DEF( void )
-  pcf_cmap_done( PCF_CMap  cmap )
+  pcf_cmap_done( FT_CMap  pcfcmap )         /* PCF_CMap */
   {
+    PCF_CMap  cmap = (PCF_CMap)pcfcmap;
+
+
     cmap->encodings     = NULL;
     cmap->num_encodings = 0;
   }
 
 
   FT_CALLBACK_DEF( FT_UInt )
-  pcf_cmap_char_index( PCF_CMap   cmap,
+  pcf_cmap_char_index( FT_CMap    pcfcmap,  /* PCF_CMap */
                        FT_UInt32  charcode )
   {
+    PCF_CMap      cmap      = (PCF_CMap)pcfcmap;
     PCF_Encoding  encodings = cmap->encodings;
     FT_UInt       min, max, mid;
-    FT_UInt       result = 0;
+    FT_UInt       result    = 0;
 
 
     min = 0;
@@ -114,13 +134,14 @@
 
 
   FT_CALLBACK_DEF( FT_UInt )
-  pcf_cmap_char_next( PCF_CMap    cmap,
+  pcf_cmap_char_next( FT_CMap    pcfcmap,   /* PCF_CMap */
                       FT_UInt32  *acharcode )
   {
+    PCF_CMap      cmap      = (PCF_CMap)pcfcmap;
     PCF_Encoding  encodings = cmap->encodings;
     FT_UInt       min, max, mid;
-    FT_UInt32     charcode = *acharcode + 1;
-    FT_UInt       result   = 0;
+    FT_UInt32     charcode  = *acharcode + 1;
+    FT_UInt       result    = 0;
 
 
     min = 0;
@@ -159,29 +180,21 @@
   }
 
 
-  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec  pcf_cmap_class =
+  FT_CALLBACK_TABLE_DEF
+  const FT_CMap_ClassRec  pcf_cmap_class =
   {
-    sizeof( PCF_CMapRec ),
-    (FT_CMap_InitFunc)     pcf_cmap_init,
-    (FT_CMap_DoneFunc)     pcf_cmap_done,
-    (FT_CMap_CharIndexFunc)pcf_cmap_char_index,
-    (FT_CMap_CharNextFunc) pcf_cmap_char_next
+    sizeof ( PCF_CMapRec ),
+    pcf_cmap_init,
+    pcf_cmap_done,
+    pcf_cmap_char_index,
+    pcf_cmap_char_next
   };
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
-  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
-  /* messages during execution.                                            */
-  /*                                                                       */
-#undef  FT_COMPONENT
-#define FT_COMPONENT  trace_pcfdriver
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  PCF_Face_Done( PCF_Face  face )
+  FT_CALLBACK_DEF( void )
+  PCF_Face_Done( FT_Face  pcfface )         /* PCF_Face */
   {
+    PCF_Face   face   = (PCF_Face)pcfface;
     FT_Memory  memory = FT_FACE_MEMORY( face );
 
 
@@ -207,31 +220,30 @@
     }
 
     FT_FREE( face->toc.tables );
-    FT_FREE( face->root.family_name );
-    FT_FREE( face->root.available_sizes );
+    FT_FREE( pcfface->family_name );
+    FT_FREE( pcfface->available_sizes );
     FT_FREE( face->charset_encoding );
     FT_FREE( face->charset_registry );
 
     FT_TRACE4(( "PCF_Face_Done: done face\n" ));
 
     /* close gzip/LZW stream if any */
-    if ( face->root.stream == &face->gzip_stream )
+    if ( pcfface->stream == &face->gzip_stream )
     {
       FT_Stream_Close( &face->gzip_stream );
-      face->root.stream = face->gzip_source;
+      pcfface->stream = face->gzip_source;
     }
-
-    return PCF_Err_Ok;
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
   PCF_Face_Init( FT_Stream      stream,
-                 PCF_Face       face,
+                 FT_Face        pcfface,        /* PCF_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    PCF_Face  face  = (PCF_Face)pcfface;
     FT_Error  error = PCF_Err_Ok;
 
     FT_UNUSED( num_params );
@@ -266,9 +278,9 @@
           goto Fail;
 
         face->gzip_source = stream;
-        face->root.stream = &face->gzip_stream;
+        pcfface->stream   = &face->gzip_stream;
 
-        stream = face->root.stream;
+        stream = pcfface->stream;
 
         error = pcf_load_font( stream, face );
         if ( error )
@@ -277,9 +289,9 @@
       else
       {
         face->gzip_source = stream;
-        face->root.stream = &face->gzip_stream;
+        pcfface->stream   = &face->gzip_stream;
 
-        stream = face->root.stream;
+        stream = pcfface->stream;
 
         error = pcf_load_font( stream, face );
         if ( error )
@@ -287,19 +299,16 @@
       }
     }
 
-    /* set-up charmap */
+    /* set up charmap */
     {
-      FT_String  *charset_registry, *charset_encoding;
+      FT_String  *charset_registry = face->charset_registry;
+      FT_String  *charset_encoding = face->charset_encoding;
       FT_Bool     unicode_charmap  = 0;
 
 
-      charset_registry = face->charset_registry;
-      charset_encoding = face->charset_encoding;
-
-      if ( ( charset_registry != NULL ) &&
-           ( charset_encoding != NULL ) )
+      if ( charset_registry && charset_encoding )
       {
-        char*  s = face->charset_registry;
+        char*  s = charset_registry;
 
 
         /* Uh, oh, compare first letters manually to avoid dependency
@@ -336,8 +345,8 @@
 
 #if 0
         /* Select default charmap */
-        if (face->root.num_charmaps)
-          face->root.charmap = face->root.charmaps[0];
+        if ( pcfface->num_charmaps )
+          pcfface->charmap = pcfface->charmaps[0];
 #endif
       }
     }
@@ -352,10 +361,15 @@
   }
 
 
-  static FT_Error
-  PCF_Set_Pixel_Size( FT_Size  size )
+  FT_CALLBACK_DEF( FT_Error )
+  PCF_Set_Pixel_Size( FT_Size  size,
+                      FT_UInt  pixel_width,
+                      FT_UInt  pixel_height )
   {
-    PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
+    PCF_Face  face = (PCF_Face)FT_SIZE_FACE( size );
+
+    FT_UNUSED( pixel_width );
+    FT_UNUSED( pixel_height );
 
 
     FT_TRACE4(( "rec %d - pres %d\n", size->metrics.y_ppem,
@@ -383,7 +397,23 @@
   }
 
 
-  static FT_Error
+  FT_CALLBACK_DEF( FT_Error )
+  PCF_Set_Point_Size( FT_Size     size,
+                      FT_F26Dot6  char_width,
+                      FT_F26Dot6  char_height,
+                      FT_UInt     horz_resolution,
+                      FT_UInt     vert_resolution )
+  {
+    FT_UNUSED( char_width );
+    FT_UNUSED( char_height );
+    FT_UNUSED( horz_resolution );
+    FT_UNUSED( vert_resolution );
+
+    return PCF_Set_Pixel_Size( size, 0, 0 );
+  }
+
+
+  FT_CALLBACK_DEF( FT_Error )
   PCF_Glyph_Load( FT_GlyphSlot  slot,
                   FT_Size       size,
                   FT_UInt       glyph_index,
@@ -567,7 +597,7 @@
   };
 
 
-  static FT_Module_Interface
+  FT_CALLBACK_DEF( FT_Module_Interface )
   pcf_driver_requester( FT_Module    module,
                         const char*  name )
   {
@@ -591,30 +621,30 @@
 
       0,
 
-      (FT_Module_Constructor)0,
-      (FT_Module_Destructor) 0,
-      (FT_Module_Requester)  pcf_driver_requester
+      0,
+      0,
+      pcf_driver_requester
     },
 
-    sizeof( PCF_FaceRec ),
-    sizeof( FT_SizeRec ),
-    sizeof( FT_GlyphSlotRec ),
-
-    (FT_Face_InitFunc)        PCF_Face_Init,
-    (FT_Face_DoneFunc)        PCF_Face_Done,
-    (FT_Size_InitFunc)        0,
-    (FT_Size_DoneFunc)        0,
-    (FT_Slot_InitFunc)        0,
-    (FT_Slot_DoneFunc)        0,
-
-    (FT_Size_ResetPointsFunc) PCF_Set_Pixel_Size,
-    (FT_Size_ResetPixelsFunc) PCF_Set_Pixel_Size,
-
-    (FT_Slot_LoadFunc)        PCF_Glyph_Load,
-
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
-    (FT_Face_GetAdvancesFunc) 0
+    sizeof ( PCF_FaceRec ),
+    sizeof ( FT_SizeRec ),
+    sizeof ( FT_GlyphSlotRec ),
+
+    PCF_Face_Init,
+    PCF_Face_Done,
+    0,                      /* FT_Size_InitFunc */
+    0,                      /* FT_Size_DoneFunc */
+    0,                      /* FT_Slot_InitFunc */
+    0,                      /* FT_Slot_DoneFunc */
+
+    PCF_Set_Point_Size,
+    PCF_Set_Pixel_Size,
+
+    PCF_Glyph_Load,
+
+    0,                      /* FT_Face_GetKerningFunc  */
+    0,                      /* FT_Face_AttachFunc      */
+    0                       /* FT_Face_GetAdvancesFunc */
   };
 
 

reactos/lib/freetype/src/pcf
pcfread.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- pcfread.c	10 May 2004 17:48:33 -0000	1.6
+++ pcfread.c	18 Aug 2004 20:25:10 -0000	1.7
@@ -122,7 +122,10 @@
       const char*  name = "?";
 
 
-      FT_TRACE4(( "Tables count: %ld\n", face->toc.count ));
+      FT_TRACE4(( "pcf_read_TOC:\n" ));
+
+      FT_TRACE4(( "  number of tables: %ld\n", face->toc.count ));
+
       tables = face->toc.tables;
       for ( i = 0; i < toc->count; i++ )
       {
@@ -130,12 +133,12 @@
           if ( tables[i].type == (FT_UInt)( 1 << j ) )
             name = tableNames[j];
 
-        FT_TRACE4(( "Table %d: type=%-6s format=0x%04lX "
-                    "size=0x%06lX (%8ld) offset=0x%04lX\n",
+        FT_TRACE4(( "  %d: type=%s, format=0x%X, "
+                    "size=%ld (0x%lX), offset=%ld (0x%lX)\n",
                     i, name,
                     tables[i].format,
                     tables[i].size, tables[i].size,
-                    tables[i].offset ));
+                    tables[i].offset, tables[i].offset ));
       }
     }
 
@@ -370,7 +373,9 @@
     if ( FT_READ_ULONG_LE( format ) )
       goto Bail;
 
-    FT_TRACE4(( "get_prop: format = %ld\n", format ));
+    FT_TRACE4(( "pcf_get_properties:\n" ));
+
+    FT_TRACE4(( "  format = %ld\n", format ));
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
       goto Bail;
@@ -382,7 +387,7 @@
     if ( error )
       goto Bail;
 
-    FT_TRACE4(( "get_prop: nprop = %d\n", nprops ));
+    FT_TRACE4(( "  nprop = %d\n", nprops ));
 
     if ( FT_NEW_ARRAY( props, nprops ) )
       goto Bail;
@@ -419,7 +424,7 @@
     if ( error )
       goto Bail;
 
-    FT_TRACE4(( "get_prop: string_size = %ld\n", string_size ));
+    FT_TRACE4(( "  string_size = %ld\n", string_size ));
 
     if ( FT_NEW_ARRAY( strings, string_size ) )
       goto Bail;
@@ -437,7 +442,9 @@
       if ( FT_NEW_ARRAY( properties[i].name,
                          ft_strlen( strings + props[i].name ) + 1 ) )
         goto Bail;
-      ft_strcpy( properties[i].name,strings + props[i].name );
+      ft_strcpy( properties[i].name, strings + props[i].name );
+
+      FT_TRACE4(( "  %s:", properties[i].name ));
 
       properties[i].isString = props[i].isString;
 
@@ -447,9 +454,15 @@
                            ft_strlen( strings + props[i].value ) + 1 ) )
           goto Bail;
         ft_strcpy( properties[i].value.atom, strings + props[i].value );
+
+        FT_TRACE4(( " `%s'\n", properties[i].value.atom ));
       }
       else
+      {
         properties[i].value.integer = props[i].value;
+
+        FT_TRACE4(( " %d\n", properties[i].value.integer ));
+      }
     }
 
     face->properties = properties;
@@ -518,6 +531,8 @@
     if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )
       return PCF_Err_Out_Of_Memory;
 
+    FT_TRACE4(( "pcf_get_metrics:\n" ));
+
     metrics = face->metrics;
     for ( i = 0; i < nmetrics; i++ )
     {
@@ -525,7 +540,7 @@
 
       metrics[i].bits = 0;
 
-      FT_TRACE4(( "%d : width=%d, "
+      FT_TRACE4(( "  idx %d: width=%d, "
                   "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n",
                   i,
                   ( metrics + i )->characterWidth,
@@ -588,6 +603,8 @@
     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
       return error;
 
+    FT_TRACE4(( "pcf_get_bitmaps:\n" ));
+
     for ( i = 0; i < nbitmaps; i++ )
     {
       if ( PCF_BYTE_ORDER( format ) == MSBFirst )
@@ -595,7 +612,8 @@
       else
         (void)FT_READ_LONG_LE( offsets[i] );
 
-      FT_TRACE4(( "bitmap %d is at offset %ld\n", i, offsets[i] ));
+      FT_TRACE4(( "  bitmap %d: offset %ld (0x%lX)\n",
+                  i, offsets[i], offsets[i] ));
     }
     if ( error )
       goto Bail;
@@ -611,13 +629,13 @@
 
       sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
 
-      FT_TRACE4(( "padding %d implies a size of %ld\n", i, bitmapSizes[i] ));
+      FT_TRACE4(( "  padding %d implies a size of %ld\n", i, bitmapSizes[i] ));
     }
 
     FT_TRACE4(( "  %d bitmaps, padding index %ld\n",
                 nbitmaps,
                 PCF_GLYPH_PAD_INDEX( format ) ));
-    FT_TRACE4(( "bitmap size = %d\n", sizebitmaps ));
+    FT_TRACE4(( "  bitmap size = %d\n", sizebitmaps ));
 
     FT_UNUSED( sizebitmaps );       /* only used for debugging */
 
@@ -640,8 +658,8 @@
   pcf_get_encodings( FT_Stream  stream,
                      PCF_Face   face )
   {
-    FT_Error      error   = PCF_Err_Ok;
-    FT_Memory     memory  = FT_FACE(face)->memory;
+    FT_Error      error  = PCF_Err_Ok;
+    FT_Memory     memory = FT_FACE(face)->memory;
     FT_ULong      format, size;
     int           firstCol, lastCol;
     int           firstRow, lastRow;
@@ -687,7 +705,9 @@
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
       return PCF_Err_Invalid_File_Format;
 
-    FT_TRACE4(( "enc: firstCol %d, lastCol %d, firstRow %d, lastRow %d\n",
+    FT_TRACE4(( "pdf_get_encodings:\n" ));
+
+    FT_TRACE4(( "  firstCol %d, lastCol %d, firstRow %d, lastRow %d\n",
                 firstCol, lastCol, firstRow, lastRow ));
 
     nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 );
@@ -714,11 +734,13 @@
                                  firstCol );
 
         tmpEncoding[j].glyph = (FT_Short)encodingOffset;
+
+        FT_TRACE4(( "  code %d (0x%04X): idx %d\n",
+                    tmpEncoding[j].enc, tmpEncoding[j].enc,
+                    tmpEncoding[j].glyph ));
+
         j++;
       }
-
-      FT_TRACE4(( "enc n. %d ; Uni %ld ; Glyph %d\n",
-                  i, tmpEncoding[j - 1].enc, encodingOffset ));
     }
     FT_Stream_ExitFrame( stream );
 

reactos/lib/freetype/src/pcf
pcfutil.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- pcfutil.c	10 May 2004 17:48:33 -0000	1.2
+++ pcfutil.c	18 Aug 2004 20:25:10 -0000	1.3
@@ -74,7 +74,7 @@
    *  Invert bit order within each BYTE of an array.
    */
 
-  static void
+  FT_LOCAL_DEF( void )
   BitOrderInvert( unsigned char*  buf,
                   int             nbytes )
   {
@@ -90,7 +90,7 @@
    *  Invert byte order within each 16-bits of an array.
    */
 
-  static void
+  FT_LOCAL_DEF( void )
   TwoByteSwap( unsigned char*  buf,
                int             nbytes )
   {
@@ -109,7 +109,7 @@
    *  Invert byte order within each 32-bits of an array.
    */
 
-  static void
+  FT_LOCAL_DEF( void )
   FourByteSwap( unsigned char*  buf,
                 int             nbytes )
   {

reactos/lib/freetype/src/pcf
pcfutil.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- pcfutil.h	10 May 2004 17:48:33 -0000	1.2
+++ pcfutil.h	18 Aug 2004 20:25:10 -0000	1.3
@@ -30,20 +30,24 @@
 
 
 #include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
 
 
-  static void
+FT_BEGIN_HEADER
+
+  FT_LOCAL( void )
   BitOrderInvert( unsigned char*  buf,
-                  int             nbytes);
+                  int             nbytes );
 
-  static void
+  FT_LOCAL( void )
   TwoByteSwap( unsigned char*  buf,
-               int             nbytes);
+               int             nbytes );
 
-  static void
+  FT_LOCAL( void )
   FourByteSwap( unsigned char*  buf,
-                int             nbytes);
+                int             nbytes );
 
+FT_END_HEADER
 
 #endif /* __PCFUTIL_H__ */
 

reactos/lib/freetype/src/pfr
pfrdrivr.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- pfrdrivr.c	10 May 2004 17:48:33 -0000	1.5
+++ pfrdrivr.c	18 Aug 2004 20:25:10 -0000	1.6
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,16 +27,17 @@
 #include "pfrerror.h"
 
 
-  static FT_Error
-  pfr_get_kerning( PFR_Face    face,
+  FT_CALLBACK_DEF( FT_Error )
+  pfr_get_kerning( FT_Face     pfrface,     /* PFR_Face */
                    FT_UInt     left,
                    FT_UInt     right,
                    FT_Vector  *avector )
   {
+    PFR_Face     face = (PFR_Face)pfrface;
     PFR_PhyFont  phys = &face->phy_font;
 
 
-    pfr_face_get_kerning( face, left, right, avector );
+    pfr_face_get_kerning( pfrface, left, right, avector );
 
     /* convert from metrics to outline units when necessary */
     if ( phys->outline_resolution != phys->metrics_resolution )
@@ -59,11 +60,12 @@
   *
   */
 
-  static FT_Error
-  pfr_get_advance( PFR_Face  face,
+  FT_CALLBACK_DEF( FT_Error )
+  pfr_get_advance( FT_Face   pfrface,       /* PFR_Face */
                    FT_UInt   gindex,
                    FT_Pos   *anadvance )
   {
+    PFR_Face  face  = (PFR_Face)pfrface;
     FT_Error  error = PFR_Err_Bad_Argument;
 
 
@@ -84,13 +86,14 @@
   }
 
 
-  static FT_Error
-  pfr_get_metrics( PFR_Face   face,
+  FT_CALLBACK_DEF( FT_Error )
+  pfr_get_metrics( FT_Face    pfrface,      /* PFR_Face */
                    FT_UInt   *anoutline_resolution,
                    FT_UInt   *ametrics_resolution,
                    FT_Fixed  *ametrics_x_scale,
                    FT_Fixed  *ametrics_y_scale )
   {
+    PFR_Face     face = (PFR_Face)pfrface;
     PFR_PhyFont  phys = &face->phy_font;
     FT_Fixed     x_scale, y_scale;
     FT_Size      size = face->root.size;
@@ -127,9 +130,9 @@
   FT_CALLBACK_TABLE_DEF
   const FT_Service_PfrMetricsRec  pfr_metrics_service_rec =
   {
-    (FT_PFR_GetMetricsFunc)pfr_get_metrics,
-    (FT_PFR_GetKerningFunc)pfr_face_get_kerning,
-    (FT_PFR_GetAdvanceFunc)pfr_get_advance
+    pfr_get_metrics,
+    pfr_face_get_kerning,
+    pfr_get_advance
   };
 
 
@@ -146,11 +149,11 @@
   };
 
 
-  static FT_Module_Interface
-  pfr_get_service( FT_Driver         driver,
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  pfr_get_service( FT_Module         module,
                    const FT_String*  service_id )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( pfr_services, service_id );
   }
@@ -171,29 +174,29 @@
 
       NULL,
 
-      (FT_Module_Constructor)NULL,
-      (FT_Module_Destructor) NULL,
-      (FT_Module_Requester)  pfr_get_service
+      0,
+      0,
+      pfr_get_service
     },
 
     sizeof( PFR_FaceRec ),
     sizeof( PFR_SizeRec ),
     sizeof( PFR_SlotRec ),
 
-    (FT_Face_InitFunc)       pfr_face_init,
-    (FT_Face_DoneFunc)       pfr_face_done,
-    (FT_Size_InitFunc)       NULL,
-    (FT_Size_DoneFunc)       NULL,
-    (FT_Slot_InitFunc)       pfr_slot_init,
-    (FT_Slot_DoneFunc)       pfr_slot_done,
-
-    (FT_Size_ResetPointsFunc)NULL,
-    (FT_Size_ResetPixelsFunc)NULL,
-    (FT_Slot_LoadFunc)       pfr_slot_load,
-
-    (FT_Face_GetKerningFunc) pfr_get_kerning,
-    (FT_Face_AttachFunc)     0,
-    (FT_Face_GetAdvancesFunc)0
+    pfr_face_init,
+    pfr_face_done,
+    0,                  /* FT_Size_InitFunc */
+    0,                  /* FT_Size_DoneFunc */
+    pfr_slot_init,
+    pfr_slot_done,
+
+    0,                  /* FT_Size_ResetPointsFunc */
+    0,                  /* FT_Size_ResetPixelsFunc */
+    pfr_slot_load,
+
+    pfr_get_kerning,
+    0,                  /* FT_Face_AttachFunc      */
+    0                   /* FT_Face_GetAdvancesFunc */
   };
 
 

reactos/lib/freetype/src/pfr
pfrobjs.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- pfrobjs.c	10 May 2004 17:48:33 -0000	1.6
+++ pfrobjs.c	18 Aug 2004 20:25:10 -0000	1.7
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -39,30 +39,32 @@
   /*************************************************************************/
 
   FT_LOCAL_DEF( void )
-  pfr_face_done( PFR_Face  face )
+  pfr_face_done( FT_Face  pfrface )     /* PFR_Face */
   {
-    FT_Memory  memory = face->root.driver->root.memory;
+    PFR_Face   face   = (PFR_Face)pfrface;
+    FT_Memory  memory = pfrface->driver->root.memory;
 
 
     /* we don't want dangling pointers */
-    face->root.family_name = NULL;
-    face->root.style_name  = NULL;
+    pfrface->family_name = NULL;
+    pfrface->style_name  = NULL;
     
     /* finalize the physical font record */
     pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );
 
     /* no need to finalize the logical font or the header */
-    FT_FREE( face->root.available_sizes );
+    FT_FREE( pfrface->available_sizes );
   }
 
 
   FT_LOCAL_DEF( FT_Error )
   pfr_face_init( FT_Stream      stream,
-                 PFR_Face       face,
+                 FT_Face        pfrface,
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    PFR_Face  face = (PFR_Face)pfrface;
     FT_Error  error;
 
     FT_UNUSED( num_params );
@@ -92,13 +94,13 @@
       if ( error )
         goto Exit;
 
-      face->root.num_faces = num_faces;
+      pfrface->num_faces = num_faces;
     }
 
     if ( face_index < 0 )
       goto Exit;
 
-    if ( face_index >= face->root.num_faces )
+    if ( face_index >= pfrface->num_faces )
     {
       FT_ERROR(( "pfr_face_init: invalid face index\n" ));
       error = PFR_Err_Invalid_Argument;
@@ -122,75 +124,74 @@
 
     /* now, set-up all root face fields */
     {
-      FT_Face      root     = FT_FACE( face );
       PFR_PhyFont  phy_font = &face->phy_font;
 
 
-      root->face_index = face_index;
-      root->num_glyphs = phy_font->num_chars;
-      root->face_flags = FT_FACE_FLAG_SCALABLE;
+      pfrface->face_index = face_index;
+      pfrface->num_glyphs = phy_font->num_chars;
+      pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
 
       if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
-        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
+        pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
       if ( phy_font->flags & PFR_PHY_VERTICAL )
-        root->face_flags |= FT_FACE_FLAG_VERTICAL;
+        pfrface->face_flags |= FT_FACE_FLAG_VERTICAL;
       else
-        root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
+        pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
       if ( phy_font->num_strikes > 0 )
-        root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
+        pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
 
       if ( phy_font->num_kern_pairs > 0 )
-        root->face_flags |= FT_FACE_FLAG_KERNING;
+        pfrface->face_flags |= FT_FACE_FLAG_KERNING;
 
       /* If no family name was found in the "undocumented" auxiliary
        * data, use the font ID instead.  This sucks but is better than
        * nothing.
        */
-      root->family_name = phy_font->family_name;
-      if ( root->family_name == NULL )
-        root->family_name = phy_font->font_id;
+      pfrface->family_name = phy_font->family_name;
+      if ( pfrface->family_name == NULL )
+        pfrface->family_name = phy_font->font_id;
 
       /* note that the style name can be NULL in certain PFR fonts,
        * probably meaning "Regular"
        */
-      root->style_name = phy_font->style_name;
+      pfrface->style_name = phy_font->style_name;
 
-      root->num_fixed_sizes = 0;
-      root->available_sizes = 0;
+      pfrface->num_fixed_sizes = 0;
+      pfrface->available_sizes = 0;
 
-      root->bbox         = phy_font->bbox;
-      root->units_per_EM = (FT_UShort)phy_font->outline_resolution;
-      root->ascender     = (FT_Short) phy_font->bbox.yMax;
-      root->descender    = (FT_Short) phy_font->bbox.yMin;
-      root->height       = (FT_Short)(
-        ( ( root->ascender - root->descender ) * 12 ) / 10 );
+      pfrface->bbox         = phy_font->bbox;
+      pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution;
+      pfrface->ascender     = (FT_Short) phy_font->bbox.yMax;
+      pfrface->descender    = (FT_Short) phy_font->bbox.yMin;
+      pfrface->height       = (FT_Short)(
+        ( ( pfrface->ascender - pfrface->descender ) * 12 ) / 10 );
 
       if ( phy_font->num_strikes > 0 )
       {
         FT_UInt          n, count = phy_font->num_strikes;
         FT_Bitmap_Size*  size;
         PFR_Strike       strike;
-        FT_Memory        memory = root->stream->memory;
+        FT_Memory        memory = pfrface->stream->memory;
          
          
-        if ( FT_NEW_ARRAY( root->available_sizes, count ) )
+        if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) )
           goto Exit;
          
-        size   = root->available_sizes;
+        size   = pfrface->available_sizes;
         strike = phy_font->strikes;
         for ( n = 0; n < count; n++, size++, strike++ )
         {
           size->height = (FT_UShort)strike->y_ppm;
           size->width  = (FT_UShort)strike->x_ppm;
         }
-        root->num_fixed_sizes = count;
+        pfrface->num_fixed_sizes = count;
       }
 
       /* now compute maximum advance width */
       if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
-        root->max_advance_width = (FT_Short)phy_font->standard_advance;
+        pfrface->max_advance_width = (FT_Short)phy_font->standard_advance;
       else
       {
         FT_Int    max = 0;
@@ -204,20 +205,20 @@
             max = gchar->advance;
         }
 
-        root->max_advance_width = (FT_Short)max;
+        pfrface->max_advance_width = (FT_Short)max;
       }
 
-      root->max_advance_height = root->height;
+      pfrface->max_advance_height = pfrface->height;
 
-      root->underline_position  = (FT_Short)( - root->units_per_EM / 10 );
-      root->underline_thickness = (FT_Short)(   root->units_per_EM / 30 );
+      pfrface->underline_position  = (FT_Short)( -pfrface->units_per_EM / 10 );
+      pfrface->underline_thickness = (FT_Short)(  pfrface->units_per_EM / 30 );
 
       /* create charmap */
       {
         FT_CharMapRec  charmap;
 
 
-        charmap.face        = root;
+        charmap.face        = pfrface;
         charmap.platform_id = 3;
         charmap.encoding_id = 1;
         charmap.encoding    = FT_ENCODING_UNICODE;
@@ -226,14 +227,14 @@
 
 #if 0
         /* Select default charmap */
-        if (root->num_charmaps)
-          root->charmap = root->charmaps[0];
+        if ( pfrface->num_charmaps )
+          pfrface->charmap = pfrface->charmaps[0];
 #endif
       }
 
       /* check whether we've loaded any kerning pairs */
       if ( phy_font->num_kern_pairs )
-        root->face_flags |= FT_FACE_FLAG_KERNING;
+        pfrface->face_flags |= FT_FACE_FLAG_KERNING;
     }
 
   Exit:
@@ -250,9 +251,11 @@
   /*************************************************************************/
 
   FT_LOCAL_DEF( FT_Error )
-  pfr_slot_init( PFR_Slot  slot )
+  pfr_slot_init( FT_GlyphSlot  pfrslot )        /* PFR_Slot */
   {
-    FT_GlyphLoader  loader = slot->root.internal->loader;
+    PFR_Slot        slot   = (PFR_Slot)pfrslot;
+    FT_GlyphLoader  loader = pfrslot->internal->loader;
+
 
     pfr_glyph_init( &slot->glyph, loader );
 
@@ -261,22 +264,27 @@
 
 
   FT_LOCAL_DEF( void )
-  pfr_slot_done( PFR_Slot  slot )
+  pfr_slot_done( FT_GlyphSlot  pfrslot )        /* PFR_Slot */
   {
+    PFR_Slot  slot = (PFR_Slot)pfrslot;
+
+
     pfr_glyph_done( &slot->glyph );
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  pfr_slot_load( PFR_Slot  slot,
-                 PFR_Size  size,
-                 FT_UInt   gindex,
-                 FT_Int32  load_flags )
+  pfr_slot_load( FT_GlyphSlot  pfrslot,         /* PFR_Slot */
+                 FT_Size       pfrsize,         /* PFR_Size */
+                 FT_UInt       gindex,
+                 FT_Int32      load_flags )
   {
+    PFR_Slot     slot    = (PFR_Slot)pfrslot;
+    PFR_Size     size    = (PFR_Size)pfrsize;
     FT_Error     error;
-    PFR_Face     face    = (PFR_Face)slot->root.face;
+    PFR_Face     face    = (PFR_Face)pfrslot->face;
     PFR_Char     gchar;
-    FT_Outline*  outline = &slot->root.outline;
+    FT_Outline*  outline = &pfrslot->outline;
     FT_ULong     gps_offset;
 
 
@@ -301,7 +309,7 @@
     }
 
     gchar               = face->phy_font.chars + gindex;
-    slot->root.format   = FT_GLYPH_FORMAT_OUTLINE;
+    pfrslot->format     = FT_GLYPH_FORMAT_OUTLINE;
     outline->n_points   = 0;
     outline->n_contours = 0;
     gps_offset          = face->header.gps_section_offset;
@@ -313,7 +321,7 @@
     if ( !error )
     {
       FT_BBox            cbox;
-      FT_Glyph_Metrics*  metrics = &slot->root.metrics;
+      FT_Glyph_Metrics*  metrics = &pfrslot->metrics;
       FT_Pos             advance;
       FT_Int             em_metrics, em_outline;
       FT_Bool            scaling;
@@ -327,7 +335,7 @@
       outline->flags &= ~FT_OUTLINE_OWNER;
       outline->flags |= FT_OUTLINE_REVERSE_FILL;
 
-      if ( size && size->root.metrics.y_ppem < 24 )
+      if ( size && pfrsize->metrics.y_ppem < 24 )
         outline->flags |= FT_OUTLINE_HIGH_PRECISION;
 
       /* compute the advance vector */
@@ -346,8 +354,8 @@
       else
         metrics->horiAdvance = advance;
 
-      slot->root.linearHoriAdvance = metrics->horiAdvance;
-      slot->root.linearVertAdvance = metrics->vertAdvance;
+      pfrslot->linearHoriAdvance = metrics->horiAdvance;
+      pfrslot->linearVertAdvance = metrics->vertAdvance;
 
       /* make-up vertical metrics(?) */
       metrics->vertBearingX = 0;
@@ -372,8 +380,8 @@
       if ( scaling )
       {
         FT_Int      n;
-        FT_Fixed    x_scale = size->root.metrics.x_scale;
-        FT_Fixed    y_scale = size->root.metrics.y_scale;
+        FT_Fixed    x_scale = pfrsize->metrics.x_scale;
+        FT_Fixed    y_scale = pfrsize->metrics.y_scale;
         FT_Vector*  vec     = outline->points;
 
 
@@ -411,20 +419,19 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  FT_LOCAL_DEF( void )
-  pfr_face_get_kerning( PFR_Face    face,
+  FT_LOCAL_DEF( FT_Error )
+  pfr_face_get_kerning( FT_Face     pfrface,        /* PFR_Face */
                         FT_UInt     glyph1,
                         FT_UInt     glyph2,
                         FT_Vector*  kerning )
   {
+    PFR_Face      face     = (PFR_Face)pfrface;
     FT_Error      error    = PFR_Err_Ok;
     PFR_PhyFont   phy_font = &face->phy_font;
     PFR_KernPair  pairs    = phy_font->kern_pairs;
     FT_UInt32     idx      = PFR_KERN_INDEX( glyph1, glyph2 );
     FT_UInt       min, max;
 
-    FT_UNUSED( error ); /* just needed as syntactical sugar */
-
 
     kerning->x = 0;
     kerning->y = 0;
@@ -450,6 +457,8 @@
       else
         max = mid;
     }
+
+    return error;
   }
 
 

reactos/lib/freetype/src/pfr
pfrobjs.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- pfrobjs.h	21 Jan 2004 19:23:46 -0000	1.2
+++ pfrobjs.h	18 Aug 2004 20:25:10 -0000	1.3
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (specification).                         */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2004 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -58,34 +58,34 @@
 
   FT_LOCAL( FT_Error )
   pfr_face_init( FT_Stream      stream,
-                 PFR_Face       face,
+                 FT_Face        face,           /* PFR_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params );
 
   FT_LOCAL( void )
-  pfr_face_done( PFR_Face  face );
+  pfr_face_done( FT_Face  face );               /* PFR_Face */
 
 
-  FT_LOCAL( void )
-  pfr_face_get_kerning( PFR_Face    face,
+  FT_LOCAL( FT_Error )
+  pfr_face_get_kerning( FT_Face     face,       /* PFR_Face */
                         FT_UInt     glyph1,
                         FT_UInt     glyph2,
                         FT_Vector*  kerning );
 
 
   FT_LOCAL( FT_Error )
-  pfr_slot_init( PFR_Slot  slot );
+  pfr_slot_init( FT_GlyphSlot  slot );          /* PFR_Slot */
 
   FT_LOCAL( void )
-  pfr_slot_done( PFR_Slot  slot );
+  pfr_slot_done( FT_GlyphSlot  slot );          /* PFR_Slot */
 
 
   FT_LOCAL( FT_Error )
-  pfr_slot_load( PFR_Slot  slot,
-                 PFR_Size  size,
-                 FT_UInt   gindex,
-                 FT_Int32  load_flags );
+  pfr_slot_load( FT_GlyphSlot  slot,            /* PFR_Slot */
+                 FT_Size       size,            /* PFR_Size */
+                 FT_UInt       gindex,
+                 FT_Int32      load_flags );
 
 
 FT_END_HEADER

reactos/lib/freetype/src/psaux
psobjs.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- psobjs.c	10 May 2004 17:48:33 -0000	1.6
+++ psobjs.c	18 Aug 2004 20:25:10 -0000	1.7
@@ -285,7 +285,7 @@
 #if 'A' == 65
   /* ASCII */
 
-  static const char ft_char_table[128] =
+  static const char  ft_char_table[128] =
   {
     /* 0x00 */
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -306,7 +306,7 @@
 #if 'A' == 193
   /* EBCDIC */
 
-  static const char ft_char_table[128] =
+  static const char  ft_char_table[128] =
   {
     /* 0x80 */
     -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1,
@@ -1255,15 +1255,15 @@
       Store_Integer:
         switch ( field->size )
         {
-        case 1:
+        case (8 / FT_CHAR_BIT):
           *(FT_Byte*)q = (FT_Byte)val;
           break;
 
-        case 2:
+        case (16 / FT_CHAR_BIT):
           *(FT_UShort*)q = (FT_UShort)val;
           break;
 
-        case 4:
+        case (32 / FT_CHAR_BIT):
           *(FT_UInt32*)q = (FT_UInt32)val;
           break;
 
@@ -1543,7 +1543,7 @@
                    FT_GlyphSlot  glyph,
                    FT_Bool       hinting )
   {
-    builder->path_begun  = 0;
+    builder->parse_state = T1_Parse_Start;
     builder->load_points = 1;
 
     builder->face   = face;
@@ -1700,17 +1700,21 @@
                           FT_Pos      x,
                           FT_Pos      y )
   {
-    FT_Error  error = 0;
+    FT_Error  error = PSaux_Err_Invalid_File_Format;
 
 
     /* test whether we are building a new contour */
-    if ( !builder->path_begun )
+
+    if ( builder->parse_state == T1_Parse_Have_Path )
+      error = PSaux_Err_Ok;
+    else if ( builder->parse_state == T1_Parse_Have_Moveto )
     {
-      builder->path_begun = 1;
+      builder->parse_state = T1_Parse_Have_Path;
       error = t1_builder_add_contour( builder );
       if ( !error )
         error = t1_builder_add_point1( builder, x, y );
     }
+
     return error;
   }
 

reactos/lib/freetype/src/psaux
t1decode.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- t1decode.c	10 May 2004 17:48:33 -0000	1.5
+++ t1decode.c	18 Aug 2004 20:25:10 -0000	1.6
@@ -340,7 +340,7 @@
     decoder->zone = decoder->zones;
     zone          = decoder->zones;
 
-    builder->path_begun  = 0;
+    builder->parse_state = T1_Parse_Start;
 
     hinter = (T1_Hints_Funcs)builder->hints_funcs;
 
@@ -556,7 +556,7 @@
           decoder->num_flex_vectors  = 0;
           if ( start_point( builder, x, y ) ||
                check_points( builder, 6 )   )
-            goto Memory_Error;
+            goto Fail;
           break;
 
         case 2:                     /* add flex vectors */
@@ -747,6 +747,8 @@
         case op_hsbw:
           FT_TRACE4(( " hsbw" ));
 
+          builder->parse_state = T1_Parse_Have_Width;
+
           builder->left_bearing.x += top[0];
           builder->advance.x       = top[1];
           builder->advance.y       = 0;
@@ -772,6 +774,8 @@
         case op_sbw:
           FT_TRACE4(( " sbw" ));
 
+          builder->parse_state = T1_Parse_Have_Width;
+
           builder->left_bearing.x += top[0];
           builder->left_bearing.y += top[1];
           builder->advance.x       = top[2];
@@ -792,14 +796,16 @@
           FT_TRACE4(( " closepath" ));
 
           close_contour( builder );
-          builder->path_begun = 0;
+          if ( builder->parse_state != T1_Parse_Have_Path )
+            goto Syntax_Error;
+          builder->parse_state = T1_Parse_Have_Width;
           break;
 
         case op_hlineto:
           FT_TRACE4(( " hlineto" ));
 
           if ( start_point( builder, x, y ) )
-            goto Memory_Error;
+            goto Fail;
 
           x += top[0];
           goto Add_Line;
@@ -809,7 +815,11 @@
 
           x += top[0];
           if ( !decoder->flex_state )
-            builder->path_begun = 0;
+          {
+            if ( builder->parse_state == T1_Parse_Start )
+              goto Syntax_Error;
+            builder->parse_state = T1_Parse_Have_Moveto;
+          }
           break;
 
         case op_hvcurveto:
@@ -817,7 +827,7 @@
 
           if ( start_point( builder, x, y ) ||
                check_points( builder, 3 )   )
-            goto Memory_Error;
+            goto Fail;
 
           x += top[0];
           add_point( builder, x, y, 0 );
@@ -832,14 +842,14 @@
           FT_TRACE4(( " rlineto" ));
 
           if ( start_point( builder, x, y ) )
-            goto Memory_Error;
+            goto Fail;
 
           x += top[0];
           y += top[1];
 
         Add_Line:
           if ( add_point1( builder, x, y ) )
-            goto Memory_Error;
+            goto Fail;
           break;
 
         case op_rmoveto:
@@ -848,7 +858,11 @@
           x += top[0];
           y += top[1];
           if ( !decoder->flex_state )
-            builder->path_begun = 0;
+          {
+            if ( builder->parse_state == T1_Parse_Start )
+              goto Syntax_Error;
+            builder->parse_state = T1_Parse_Have_Moveto;
+          }
           break;
 
         case op_rrcurveto:
@@ -856,7 +870,7 @@
 
           if ( start_point( builder, x, y ) ||
                check_points( builder, 3 )   )
-            goto Memory_Error;
+            goto Fail;
 
           x += top[0];
           y += top[1];
@@ -876,7 +890,7 @@
 
           if ( start_point( builder, x, y ) ||
                check_points( builder, 3 )   )
-            goto Memory_Error;
+            goto Fail;
 
           y += top[0];
           add_point( builder, x, y, 0 );
@@ -891,7 +905,7 @@
           FT_TRACE4(( " vlineto" ));
 
           if ( start_point( builder, x, y ) )
-            goto Memory_Error;
+            goto Fail;
 
           y += top[0];
           goto Add_Line;
@@ -901,7 +915,11 @@
 
           y += top[0];
           if ( !decoder->flex_state )
-            builder->path_begun = 0;
+          {
+            if ( builder->parse_state == T1_Parse_Start )
+              goto Syntax_Error;
+            builder->parse_state = T1_Parse_Have_Moveto;
+          }
           break;
 
         case op_div:
@@ -1072,6 +1090,7 @@
 
     FT_TRACE4(( "..end..\n\n" ));
 
+  Fail:
     return error;
 
   Syntax_Error:
@@ -1079,9 +1098,6 @@
 
   Stack_Underflow:
     return PSaux_Err_Stack_Underflow;
-
-  Memory_Error:
-    return builder->error;
   }
 
 

reactos/lib/freetype/src/raster
ftraster.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ftraster.c	21 Jan 2004 19:23:47 -0000	1.2
+++ ftraster.c	18 Aug 2004 20:25:10 -0000	1.3
@@ -251,6 +251,16 @@
   typedef unsigned char   Byte, *PByte;
   typedef char            Bool;
 
+
+  typedef union  Alignment_
+  {
+    long    l;
+    void*   p;
+    void  (*f)(void);
+
+  } Alignment, *PAlignment;
+
+
   typedef struct  TPoint_
   {
     Long  x;
@@ -313,7 +323,7 @@
 
 
 #define AlignProfileSize \
-          ( ( sizeof ( TProfile ) + sizeof ( long ) - 1 ) / sizeof ( long ) )
+  ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
 
 
 #ifdef TT_STATIC_RASTER

reactos/lib/freetype/src/sfnt
sfobjs.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- sfobjs.c	10 May 2004 17:48:35 -0000	1.5
+++ sfobjs.c	18 Aug 2004 20:25:10 -0000	1.6
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -160,6 +160,8 @@
     FT_Int            found_win     = -1;
     FT_Int            found_unicode = -1;
 
+    FT_Bool           is_english = 0;
+
     TT_NameEntry_ConvertFunc  convert;
 
 
@@ -205,7 +207,8 @@
             case TT_MS_ID_SYMBOL_CS:
             case TT_MS_ID_UNICODE_CS:
             case TT_MS_ID_UCS_4:
-              found_win = n;
+              is_english = ( rec->languageID & 0x3FF ) == 0x009;
+              found_win  = n;
               break;
 
             default:
@@ -222,9 +225,10 @@
 
     /* some fonts contain invalid Unicode or Macintosh formatted entries; */
     /* we will thus favor names encoded in Windows formats if available   */
+    /* (provided it is an English name)                                   */
     /*                                                                    */
     convert = NULL;
-    if ( found_win >= 0 )
+    if ( found_win >= 0 && !( found_apple >= 0 && !is_english ) )
     {
       rec = face->name_table.names + found_win;
       switch ( rec->encodingID )
@@ -263,7 +267,7 @@
         FT_UNUSED( error );
 
 
-        if ( FT_NEW_ARRAY  ( rec->string, rec->stringLength ) ||
+        if ( FT_QNEW_ARRAY ( rec->string, rec->stringLength ) ||
              FT_STREAM_SEEK( rec->stringOffset )              ||
              FT_STREAM_READ( rec->string, rec->stringLength ) )
         {
@@ -431,11 +435,11 @@
     /* do we have outlines in there? */
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     has_outline   = FT_BOOL( face->root.internal->incremental_interface != 0 ||
-                             tt_face_lookup_table( face, TTAG_glyf ) != 0         ||
-                             tt_face_lookup_table( face, TTAG_CFF ) != 0          );
+                             tt_face_lookup_table( face, TTAG_glyf )    != 0 ||
+                             tt_face_lookup_table( face, TTAG_CFF )     != 0 );
 #else
     has_outline   = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
-                             tt_face_lookup_table( face, TTAG_CFF ) != 0  );
+                             tt_face_lookup_table( face, TTAG_CFF )  != 0 );
 #endif
 
     is_apple_sbit = 0;
@@ -546,6 +550,15 @@
       if ( face->kern_pairs )
         flags |= FT_FACE_FLAG_KERNING;
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+      /* Don't bother to load the tables unless somebody asks for them. */
+      /* No need to do work which will (probably) not be used.          */
+      if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 &&
+           tt_face_lookup_table( face, TTAG_fvar ) != 0 &&
+           tt_face_lookup_table( face, TTAG_gvar ) != 0 )
+        flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
+#endif
+
       root->face_flags = flags;
 
       /*********************************************************************/
@@ -829,9 +842,10 @@
     FT_FREE( face->root.style_name );
 
     /* freeing sbit size table */
+    FT_FREE( face->root.available_sizes );
     face->root.num_fixed_sizes = 0;
-    if ( face->root.available_sizes )
-      FT_FREE( face->root.available_sizes );
+
+    FT_FREE( face->postscript_name );
 
     face->sfnt = 0;
   }

reactos/lib/freetype/src/sfnt
ttload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ttload.c	10 May 2004 17:48:35 -0000	1.6
+++ ttload.c	18 Aug 2004 20:25:10 -0000	1.7
@@ -207,6 +207,10 @@
         FT_UInt32  magic;
 
 
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+      head_retry:
+#endif  /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
+
         has_head = 1;
 
         /* The table length should be 0x36, but certain font tools
@@ -225,6 +229,10 @@
         if ( FT_STREAM_SEEK( offset + 28 + 16*nn ) )
           goto Bad_Format;
       }
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+      else if ( table.Tag == TTAG_bhed )
+        goto head_retry;
+#endif  /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */      
     }
 
     if ( has_head == 0 )
@@ -425,7 +433,7 @@
 
     face->num_tables = sfnt->num_tables;
 
-    if ( FT_NEW_ARRAY( face->dir_tables, face->num_tables ) )
+    if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) )
       goto Exit;
 
     if ( FT_STREAM_SEEK( sfnt->offset + 12 )      ||
@@ -715,6 +723,8 @@
     if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )
       goto Exit;
 
+    face->root.num_glyphs = maxProfile->numGlyphs;
+
     maxProfile->maxPoints             = 0;
     maxProfile->maxContours           = 0;
     maxProfile->maxCompositePoints    = 0;
@@ -743,8 +753,6 @@
       if ( maxProfile->maxFunctionDefs == 0 )
         maxProfile->maxFunctionDefs = 64;
 
-      face->root.num_glyphs = maxProfile->numGlyphs;
-
       face->root.internal->max_points =
         (FT_UShort)FT_MAX( maxProfile->maxCompositePoints,
                            maxProfile->maxPoints );
@@ -880,8 +888,8 @@
       goto Exit;
     }
 
-    if ( FT_NEW_ARRAY( *longs,  num_longs  ) ||
-         FT_NEW_ARRAY( *shorts, num_shorts ) )
+    if ( FT_QNEW_ARRAY( *longs,  num_longs  ) ||
+         FT_QNEW_ARRAY( *shorts, num_shorts ) )
       goto Exit;
 
     if ( FT_FRAME_ENTER( table_len ) )
@@ -1198,14 +1206,17 @@
     FT_UInt       count  = table->numNameRecords;
 
 
-    for ( ; count > 0; count--, entry++ )
+    if ( table->names )
     {
-      FT_FREE( entry->string );
-      entry->stringLength = 0;
-    }
+      for ( ; count > 0; count--, entry++ )
+      {
+        FT_FREE( entry->string );
+        entry->stringLength = 0;
+      }
 
-    /* free strings table */
-    FT_FREE( table->names );
+      /* free strings table */
+      FT_FREE( table->names );
+    }
 
     table->numNameRecords = 0;
     table->format         = 0;
@@ -1575,7 +1586,7 @@
     num_ranges = face->gasp.numRanges;
     FT_TRACE3(( "number of ranges = %d\n", num_ranges ));
 
-    if ( FT_NEW_ARRAY( gaspranges, num_ranges ) ||
+    if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) ||
          FT_FRAME_ENTER( num_ranges * 4L )      )
       goto Exit;
 
@@ -1624,6 +1635,11 @@
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
+  
+#undef  TT_KERN_INDEX
+#define TT_KERN_INDEX( g1, g2 )  ( ( (FT_ULong)g1 << 16 ) | g2 )
+
+
   FT_LOCAL_DEF( FT_Error )
   tt_face_load_kern( TT_Face    face,
                      FT_Stream  stream )
@@ -1680,8 +1696,8 @@
         FT_FRAME_EXIT();
 
         /* allocate array of kerning pairs */
-        if ( FT_NEW_ARRAY( face->kern_pairs, num_pairs ) ||
-             FT_FRAME_ENTER( 6L * num_pairs )            )
+        if ( FT_QNEW_ARRAY( face->kern_pairs, num_pairs ) ||
+             FT_FRAME_ENTER( 6L * num_pairs )             )
           goto Exit;
 
         pair  = face->kern_pairs;
@@ -1700,12 +1716,35 @@
 
         /* ensure that the kerning pair table is sorted (yes, some */
         /* fonts have unsorted tables!)                            */
+
+#if 1
+        if ( num_pairs > 0 )     
         {
-          FT_UInt        i;
-          TT_Kern0_Pair  pair0;
+          TT_Kern0_Pair  pair0 = face->kern_pairs;
+          FT_ULong       prev  = TT_KERN_INDEX( pair0->left, pair0->right );
+          
 
+          for ( pair0++; pair0 < limit; pair0++ )
+          {
+            FT_ULong  next = TT_KERN_INDEX( pair0->left, pair0->right );
+            
 
-          pair0 = face->kern_pairs;
+            if ( next < prev )
+              goto SortIt;
+              
+            prev = next;
+          }
+          goto Exit;
+          
+        SortIt:
+          ft_qsort( (void*)face->kern_pairs, (int)num_pairs,
+                    sizeof ( TT_Kern0_PairRec ), tt_kern_pair_compare );
+        }
+#else        
+        {
+          TT_Kern0_Pair  pair0    = face->kern_pairs;
+          FT_UInt        i;
+          
 
           for ( i = 1; i < num_pairs; i++, pair0++ )
           {
@@ -1717,6 +1756,7 @@
             }
           }
         }
+#endif
 
         goto Exit;
       }
@@ -1735,10 +1775,6 @@
   }
 
 
-#undef  TT_KERN_INDEX
-#define TT_KERN_INDEX( g1, g2 )  ( ( (FT_ULong)g1 << 16 ) | g2 )
-
-
   FT_CALLBACK_DEF( int )
   tt_kern_pair_compare( const void*  a,
                         const void*  b )
@@ -1756,6 +1792,7 @@
 
 
 #undef TT_KERN_INDEX
+  
 
 
   /*************************************************************************/
@@ -1809,7 +1846,7 @@
     if ( hdmx->version != 0 )
       goto Exit;
 
-    if ( FT_NEW_ARRAY( hdmx->records, num_records ) )
+    if ( FT_QNEW_ARRAY( hdmx->records, num_records ) )
       goto Exit;
 
     hdmx->num_records = num_records;
@@ -1828,7 +1865,7 @@
              FT_READ_BYTE( cur->max_width ) )
           goto Exit;
 
-        if ( FT_ALLOC( cur->widths, num_glyphs )       ||
+        if ( FT_QALLOC( cur->widths, num_glyphs )       ||
              FT_STREAM_READ( cur->widths, num_glyphs ) )
           goto Exit;
 

reactos/lib/freetype/src/tools
cordic.py 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- cordic.py	1 Apr 2003 08:38:23 -0000	1.1
+++ cordic.py	18 Aug 2004 20:25:11 -0000	1.2
@@ -1,7 +1,8 @@
 # compute arctangent table for CORDIC computations in fttrigon.c
 import sys, math
 
-units  = 64*65536.0   # don't change !!
+#units  = 64*65536.0   # don't change !!
+units  = 256
 scale  = units/math.pi
 shrink = 1.0
 comma  = ""
@@ -23,7 +24,7 @@
 
     errlo = abs( alo - ax )
     errhi = abs( ahi - ax )
-    
+
     if ( errlo < errhi ):
       hi = lo
 
@@ -44,8 +45,8 @@
         x = 1.0/(2.0**n)    # tangent value
     else:
         x = 2.0**(-n)
-      
-    angle  = math.atan(x)    # arctangent 
+
+    angle  = math.atan(x)    # arctangent
     angle2 = angle*scale     # arctangent in FT_Angle units
 
     # determine which integer value for angle gives the best tangent
@@ -63,12 +64,12 @@
 
     if angle2 <= 0:
         break
-    
+
     sys.stdout.write( comma + repr( int(angle2) ) )
     comma = ", "
-    
+
     shrink = shrink * math.cos( angle2/scale)
-      
+
 
 print
 print "shrink factor    = " + repr( shrink )

reactos/lib/freetype/src/truetype
ttgxvar.c added at 1.1
diff -N ttgxvar.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ttgxvar.c	18 Aug 2004 20:25:11 -0000	1.1
@@ -0,0 +1,1520 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ttgxvar.c                                                              */
+/*                                                                         */
+/*    TrueType GX Font Variation loader                                    */
+/*                                                                         */
+/*  Copyright 2004 by                                                      */
+/*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/*                                                                         */
+/* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at        */
+/*                                                                         */
+/*   http://developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html    */
+/*                                                                         */
+/* The documentation for `fvar' is inconsistant.  At one point it says     */
+/* that `countSizePairs' should be 3, at another point 2.  It should be 2. */
+/*                                                                         */
+/* The documentation for `gvar' is not intelligible; `cvar' refers you to  */
+/* `gvar' and is thus also incomprehensible.                               */
+/*                                                                         */
+/* The documentation for `avar' appears correct, but Apple has no fonts    */
+/* with an `avar' table, so it is hard to test.                            */
+/*                                                                         */
+/* Many thanks to John Jenkins (at Apple) in figuring this out.            */
+/*                                                                         */
+/*                                                                         */
+/* Apple's `kern' table has some references to tuple indices, but as there */
+/* is no indication where these indices are defined, nor how to            */
+/* interpolate the kerning values (different tuples have different         */
+/* classes) this issue is ignored.                                         */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_CONFIG_CONFIG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_SFNT_H
+#include FT_TRUETYPE_IDS_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_MULTIPLE_MASTERS_H
+
+#include "ttdriver.h"
+#include "ttpload.h"
+#include "ttgxvar.h"
+
+#include "tterrors.h"
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+
+#define FT_Stream_FTell( stream )  \
+          ( (stream)->cursor - (stream)->base )
+#define FT_Stream_SeekSet( stream, off ) \
+              ( (stream)->cursor = (stream)->base+(off) )
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_ttgxvar
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                       Internal Routines                       *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro ALL_POINTS is used in `ft_var_readpackedpoints'.  It        */
+  /* indicates that there is a delta for every point without needing to    */
+  /* enumerate all of them.                                                */
+  /*                                                                       */
+#define ALL_POINTS  (FT_UShort*)(-1)
+
+
+  enum
+  {
+    GX_PT_POINTS_ARE_WORDS     = 0x80,
+    GX_PT_POINT_RUN_COUNT_MASK = 0x7F
+  };
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    ft_var_readpackedpoints                                            */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Read a set of points to which the following deltas will apply.     */
+  /*    Points are packed with a run length encoding.                      */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    stream    :: The data stream.                                      */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    point_cnt :: The number of points read.  A zero value means that   */
+  /*                 all points in the glyph will be affected, without     */
+  /*                 enumerating them individually.                        */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    An array of FT_UShort containing the affected points or the        */
+  /*    special value ALL_POINTS.                                          */
+  /*                                                                       */
+  static FT_UShort*
+  ft_var_readpackedpoints( FT_Stream  stream,
+                           FT_UInt   *point_cnt )
+  {
+    FT_UShort *points;
+    FT_Int     n;
+    FT_Int     runcnt;
+    FT_Int     i;
+    FT_Int     j;
+    FT_Int     first;
+    FT_Memory  memory = stream->memory;
+    FT_Error   error;
+
+
+    *point_cnt = n = FT_GET_BYTE();
+    if ( n == 0 )
+      return ALL_POINTS;
+
+    if ( n & GX_PT_POINTS_ARE_WORDS )
+      n = FT_GET_BYTE() | ( ( n & GX_PT_POINT_RUN_COUNT_MASK ) << 8 );
+
+    if ( FT_NEW_ARRAY( points, n ) )
+      return NULL;
+
+    i = 0;
+    while ( i < n )
+    {
+      runcnt = FT_GET_BYTE();
+      if ( runcnt & GX_PT_POINTS_ARE_WORDS )
+      {
+        runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
+        points[i++] = first = FT_GET_USHORT();
+
+        /* first point not included in runcount */
+        for ( j = 0; j < runcnt; ++j )
+          points[i++] = ( first += FT_GET_USHORT() );
+      }
+      else
+      {
+        points[i++] = first = FT_GET_BYTE();
+
+        for ( j = 0; j < runcnt; ++j )
+          points[i++] = ( first += FT_GET_BYTE() );
+      }
+    }
+
+    return points;
+  }
+
+
+  enum
+  {
+    GX_DT_DELTAS_ARE_ZERO      = 0x80,
+    GX_DT_DELTAS_ARE_WORDS     = 0x40,
+    GX_DT_DELTA_RUN_COUNT_MASK = 0x3F
+  };
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    ft_var_readpackeddeltas                                            */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Read a set of deltas.  These are packed slightly differently than  */
+  /*    points.  In particular there is no overall count.                  */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    stream    :: The data stream.                                      */
+  /*                                                                       */
+  /*    delta_cnt :: The number of to be read.                             */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    An array of FT_Short containing the deltas for the affected        */
+  /*    points.  (This only gets the deltas for one dimension.  It will    */
+  /*    generally be called twice, once for x, once for y.  When used in   */
+  /*    cvt table, it will only be called once.)                           */
+  /*                                                                       */
+  static FT_Short*
+  ft_var_readpackeddeltas( FT_Stream  stream,
+                           FT_Int     delta_cnt )
+  {
+    FT_Short  *deltas;
+    FT_Int     runcnt;
+    FT_Int     i;
+    FT_Int     j;
+    FT_Memory  memory = stream->memory;
+    FT_Error   error;
+
+
+    if ( FT_NEW_ARRAY( deltas, delta_cnt ) )
+      return NULL;
+
+    i = 0;
+    while ( i < delta_cnt )
+    {
+      runcnt = FT_GET_BYTE();
+      if ( runcnt & GX_DT_DELTAS_ARE_ZERO )
+      {
+        /* runcnt zeroes get added */
+        for ( j = 0;
+              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
+              ++j )
+          deltas[i++] = 0;
+      }
+      else if ( runcnt & GX_DT_DELTAS_ARE_WORDS )
+      {
+        /* runcnt shorts from the stack */
+        for ( j = 0;
+              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
+              ++j )
+          deltas[i++] = FT_GET_SHORT();
+      }
+      else
+      {
+        /* runcnt signed bytes from the stack */
+        for ( j = 0;
+              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
+              ++j )
+          deltas[i++] = FT_GET_CHAR();
+      }
+
+      if ( j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) )
+      {
+        /* Bad format */
+        FT_FREE( deltas );
+        return NULL;
+      }
+    }
+
+    return deltas;
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    ft_var_load_avar                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Parse the `avar' table if present.  It need not be, so we return   */
+  /*    nothing.                                                           */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face :: The font face.                                             */
+  /*                                                                       */
+  static void
+  ft_var_load_avar( TT_Face  face )
+  {
+    FT_Stream       stream = FT_FACE_STREAM(face);
+    FT_Memory       memory = stream->memory;
+    GX_Blend        blend  = face->blend;
+    GX_AVarSegment  segment;
+    FT_Error        error;
+    FT_ULong        version;
+    FT_Long         axisCount;
+    FT_Int          i, j;
+    FT_ULong        table_len;
+
+
+    blend->avar_checked = TRUE;
+    if ( ( error = face->goto_table( face, TTAG_avar, stream, &table_len ) ) )
+      return;
+    if ( FT_FRAME_ENTER( table_len ) )
+      return;
+
+    version   = FT_GET_LONG();
+    axisCount = FT_GET_LONG();
+
+    if ( version != 0x00010000L                       ||
+         axisCount != (FT_Long)blend->mmvar->num_axis )
+      goto Exit;
+
+    if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) )
+      goto Exit;
+
+    segment = &blend->avar_segment[0];
+    for ( i = 0; i < axisCount; ++i, ++segment )
+    {
+      segment->pairCount = FT_GET_USHORT();
+      if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) )
+      {
+        /* Failure.  Free everything we have done so far.  We must do */
+        /* it right now since loading the `avar' table is optional.   */
+
+        for ( j = i - 1; j >= 0; --j )
+          FT_FREE( blend->avar_segment[j].correspondence );
+
+        FT_FREE( blend->avar_segment );
+        blend->avar_segment = NULL;
+        goto Exit;
+      }
+
+      for ( j = 0; j < segment->pairCount; ++j )
+      {
+        segment->correspondence[j].fromCoord =
+          FT_GET_SHORT() << 2;    /* convert to Fixed */
+        segment->correspondence[j].toCoord =
+          FT_GET_SHORT()<<2;    /* convert to Fixed */
+      }
+    }
+
+  Exit:
+    FT_FRAME_EXIT();
+  }
+
+
+  typedef struct  GX_GVar_Head_ {
+    FT_Long    version;
+    FT_UShort  axisCount;
+    FT_UShort  globalCoordCount;
+    FT_ULong   offsetToCoord;
+    FT_UShort  glyphCount;
+    FT_UShort  flags;
+    FT_ULong   offsetToData;
+
+  } GX_GVar_Head;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    ft_var_load_gvar                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Parses the `gvar' table if present.  If `fvar' is there, `gvar'    */
+  /*    had better be there too.                                           */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face :: The font face.                                             */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  static FT_Error
+  ft_var_load_gvar( TT_Face  face )
+  {
+    FT_Stream     stream = FT_FACE_STREAM(face);
+    FT_Memory     memory = stream->memory;
+    GX_Blend      blend  = face->blend;
+    FT_Error      error;
+    FT_UInt       i, j;
+    FT_ULong      table_len;
+    FT_ULong      gvar_start;
+    FT_ULong      offsetToData;
+    GX_GVar_Head  gvar_head;
+
+    static const FT_Frame_Field  gvar_fields[] =
+    {
+
+#undef  FT_STRUCTURE
+#define FT_STRUCTURE  GX_GVar_Head
+
+      FT_FRAME_START( 20 ),
+        FT_FRAME_LONG  ( version ),
+        FT_FRAME_USHORT( axisCount ),
+        FT_FRAME_USHORT( globalCoordCount ),
+        FT_FRAME_ULONG ( offsetToCoord ),
+        FT_FRAME_USHORT( glyphCount ),
+        FT_FRAME_USHORT( flags ),
+        FT_FRAME_ULONG ( offsetToData ),
+      FT_FRAME_END
+    };
+
+    if ( ( error = face->goto_table( face, TTAG_gvar, stream, &table_len ) ) )
+      goto Exit;
+
+    gvar_start = FT_STREAM_POS( );
+    if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) )
+      goto Exit;
+
+    blend->tuplecount  = gvar_head.globalCoordCount;
+    blend->gv_glyphcnt = gvar_head.glyphCount;
+    offsetToData       = gvar_start + gvar_head.offsetToData;
+
+    if ( gvar_head.version != 0x00010000L              ||
+         gvar_head.axisCount != blend->mmvar->num_axis )
+    {
+      error = TT_Err_Invalid_Table;
+      goto Exit;
+    }
+
+    if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) )
+      goto Exit;
+
+    if ( gvar_head.flags & 1 )
+    {
+      /* long offsets (one more offset than glyphs, to mark size of last) */
+      if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) )
+        goto Exit;
+
+      for ( i = 0; i <= blend->gv_glyphcnt; ++i )
+        blend->glyphoffsets[i] = offsetToData + FT_GET_LONG();
+
+      FT_FRAME_EXIT();
+    }
+    else
+    {
+      /* short offsets (one more offset than glyphs, to mark size of last) */
+      if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) )
+        goto Exit;
+
+      for ( i = 0; i <= blend->gv_glyphcnt; ++i )
+        blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;
+                                              /* XXX: Undocumented: `*2'! */
+
+      FT_FRAME_EXIT();
+    }
+
+    if ( blend->tuplecount != 0 )
+    {
+      if ( FT_NEW_ARRAY( blend->tuplecoords,
+                         gvar_head.axisCount * blend->tuplecount ) )
+        goto Exit;
+
+      if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord )       ||
+           FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L )                   )
+        goto Exit;
+
+      for ( i = 0; i < blend->tuplecount; ++i )
+        for ( j = 0 ; j < gvar_head.axisCount; ++j )
+          blend->tuplecoords[i * gvar_head.axisCount + j] =
+            FT_GET_SHORT() << 2;                /* convert to FT_Fixed */
+
+      FT_FRAME_EXIT();
+    }
+
+  Exit:
+    return error;
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    ft_var_apply_tuple                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Figure out whether a given tuple (design) applies to the current   */
+  /*    blend, and if so, what is the scaling factor.                      */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    blend           :: The current blend of the font.                  */
+  /*                                                                       */
+  /*    tupleIndex      :: A flag saying whether this is an intermediate   */
+  /*                       tuple or not.                                   */
+  /*                                                                       */
+  /*    tuple_coords    :: The coordinates of the tuple in normalized axis */
+  /*                       units.                                          */
+  /*                                                                       */
+  /*    im_start_coords :: The initial coordinates where this tuple starts */
+  /*                       to apply (for intermediate coordinates).        */
+  /*                                                                       */
+  /*    im_end_coords   :: The final coordinates after which this tuple no */
+  /*                       longer applies (for intermediate coordinates).  */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    An FT_Fixed value containing the scaling factor.                   */
+  /*                                                                       */
+  static FT_Fixed
+  ft_var_apply_tuple( GX_Blend   blend,
+                      FT_UShort  tupleIndex,
+                      FT_Fixed*  tuple_coords,
+                      FT_Fixed*  im_start_coords,
+                      FT_Fixed*  im_end_coords )
+  {
+    FT_UInt   i;
+    FT_Fixed  apply;
+    FT_Fixed  temp;
+
+
+    apply = 0x10000L;
+    for ( i = 0; i < blend->num_axis; ++i )
+    {
+      if ( tuple_coords[i] == 0 )
+        /* It's not clear why (for intermediate tuples) we don't need     */
+        /* to check against start/end -- the documentation says we don't. */
+        /* Similarly, it's unclear why we don't need to scale along the   */
+        /* axis.                                                          */
+        continue;
+
+      else if ( blend->normalizedcoords[i] == 0                           ||
+                ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) ||
+                ( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) )
+      {
+        apply = 0;
+        break;
+      }
+
+      else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
+        /* not an intermediate tuple */
+        apply = FT_MulDiv( apply,
+                           blend->normalizedcoords[i] > 0
+                             ? blend->normalizedcoords[i]
+                             : -blend->normalizedcoords[i],
+                           0x10000L );
+
+      else if ( blend->normalizedcoords[i] <= im_start_coords[i] ||
+                blend->normalizedcoords[i] >= im_end_coords[i]   )
+      {
+        apply = 0;
+        break;
+      }
+
+      else if ( blend->normalizedcoords[i] < tuple_coords[i] )
+      {
+        temp = FT_MulDiv( blend->normalizedcoords[i] - im_start_coords[i],
+                          0x10000L,
+                          tuple_coords[i] - im_start_coords[i]);
+        apply = FT_MulDiv( apply, temp, 0x10000L );
+      }
+
+      else
+      {
+        temp = FT_MulDiv( im_end_coords[i] - blend->normalizedcoords[i],
+                          0x10000L,
+                          im_end_coords[i] - tuple_coords[i] );
+        apply = FT_MulDiv( apply, temp, 0x10000L );
+      }
+    }
+
+    return apply;
+  }
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****               MULTIPLE MASTERS SERVICE FUNCTIONS              *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+  typedef struct  GX_FVar_Head_ {
+    FT_Long    version;
+    FT_UShort  offsetToData;
+    FT_UShort  countSizePairs;
+    FT_UShort  axisCount;
+    FT_UShort  axisSize;
+    FT_UShort  instanceCount;
+    FT_UShort  instanceSize;
+
+  } GX_FVar_Head;
+
+
+  typedef struct  fvar_axis {
+    FT_ULong   axisTag;
+    FT_ULong   minValue;
+    FT_ULong   defaultValue;
+    FT_ULong   maxValue;
+    FT_UShort  flags;
+    FT_UShort  nameID;
+
+  } GX_FVar_Axis;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    TT_Get_MM_Var                                                      */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Check that the font's `fvar' table is valid, parse it, and return  */
+  /*    those data.                                                        */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face   :: The font face.                                           */
+  /*              TT_Get_MM_Var initializes the blend structure.           */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    master :: The `fvar' data (must be freed by caller).               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  TT_Get_MM_Var( TT_Face      face,
+                 FT_MM_Var*  *master )
+  {
+    FT_Stream            stream = face->root.stream;
+    FT_Memory            memory = face->root.memory;
+    FT_ULong             table_len;
+    FT_Error             error  = TT_Err_Ok;
+    FT_ULong             fvar_start;
+    FT_Int               i, j;
+    FT_MM_Var*           mmvar;
+    FT_Fixed*            next_coords;
+    FT_String*           next_name;
+    FT_Var_Axis*         a;
+    FT_Var_Named_Style*  ns;
+    GX_FVar_Head         fvar_head;
+
+    static const FT_Frame_Field  fvar_fields[] =
+    {
+
+#undef  FT_STRUCTURE
+#define FT_STRUCTURE  GX_FVar_Head
+
+      FT_FRAME_START( 16 ),
+        FT_FRAME_LONG  ( version ),
+        FT_FRAME_USHORT( offsetToData ),
+        FT_FRAME_USHORT( countSizePairs ),
+        FT_FRAME_USHORT( axisCount ),
+        FT_FRAME_USHORT( axisSize ),
+        FT_FRAME_USHORT( instanceCount ),
+        FT_FRAME_USHORT( instanceSize ),
+      FT_FRAME_END
+    };
+
+    static const FT_Frame_Field  fvaraxis_fields[] =
+    {
+
+#undef  FT_STRUCTURE
+#define FT_STRUCTURE  GX_FVar_Axis
+
+      FT_FRAME_START( 20 ),
+        FT_FRAME_ULONG ( axisTag ),
+        FT_FRAME_ULONG ( minValue ),
+        FT_FRAME_ULONG ( defaultValue ),
+        FT_FRAME_ULONG ( maxValue ),
+        FT_FRAME_USHORT( flags ),
+        FT_FRAME_USHORT( nameID ),
+      FT_FRAME_END
+    };
+
+
+    if ( face->blend == NULL )
+    {
+      /* both `fvar' and `gvar' must be present */
+      if ( ( error = face->goto_table( face, TTAG_gvar,
+                                       stream, &table_len ) ) )
+        goto Exit;
+      if ( ( error = face->goto_table( face, TTAG_fvar,
+                                       stream, &table_len ) ) )
+        goto Exit;
+
+      fvar_start = FT_STREAM_POS( );
+
+      if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) )
+        goto Exit;
+
+      if ( fvar_head.version != 0x00010000UL                              ||
+           fvar_head.countSizePairs != 2                                  ||
+           fvar_head.axisSize != 20                                       ||
+           fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount          ||
+           fvar_head.offsetToData + fvar_head.axisCount * 20U +
+             fvar_head.instanceCount * fvar_head.instanceSize > table_len )
+      {
+        error = TT_Err_Invalid_Table;
+        goto Exit;
+      }
+
+      if ( FT_ALLOC( face->blend, sizeof ( GX_BlendRec ) ) )
+        goto Exit;
+
+      face->blend->mmvar_len =
+        sizeof ( FT_MM_Var ) +
+        fvar_head.axisCount * sizeof ( FT_Var_Axis ) +
+        fvar_head.instanceCount * sizeof ( FT_Var_Named_Style ) +
+        fvar_head.instanceCount * fvar_head.axisCount * sizeof ( FT_Fixed ) +
+        5 * fvar_head.axisCount;
+      if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )
+        goto Exit;
+      face->blend->mmvar = mmvar;
+
+      mmvar->num_axis =
+        fvar_head.axisCount;
+      mmvar->num_designs =
+        (FT_UInt)-1;           /* meaningless in this context; each glyph */
+                               /* may have a different number of designs  */
+                               /* (or tuples, as called by Apple)         */
+      mmvar->num_namedstyles =
+        fvar_head.instanceCount;
+      mmvar->axis =
+        (FT_Var_Axis*)&(mmvar[1]);
+      mmvar->namedstyle =
+        (FT_Var_Named_Style*)&(mmvar->axis[fvar_head.axisCount]);
+
+      next_coords =
+        (FT_Fixed*)&(mmvar->namedstyle[fvar_head.instanceCount]);
+      for ( i = 0; i < fvar_head.instanceCount; ++i )
+      {
+        mmvar->namedstyle[i].coords  = next_coords;
+        next_coords                 += fvar_head.axisCount;
+      }
+
+      next_name = (FT_String*)next_coords;
+      for ( i = 0; i < fvar_head.axisCount; ++i )
+      {
+        mmvar->axis[i].name  = next_name;
+        next_name           += 5;
+      }
+
+      if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) )
+        goto Exit;
+
+      a = mmvar->axis;
+      for ( i = 0; i < fvar_head.axisCount; ++i )
+      {
+        GX_FVar_Axis  axis_rec;
+
+
+        if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
+          goto Exit;
+        a->tag     = axis_rec.axisTag;
+        a->minimum = axis_rec.minValue;     /* A Fixed */
+        a->def     = axis_rec.defaultValue; /* A Fixed */
+        a->maximum = axis_rec.maxValue;     /* A Fixed */
+        a->strid   = axis_rec.nameID;
+
+        a->name[0] =   a->tag >> 24;
+        a->name[1] = ( a->tag >> 16 ) & 0xFF;
+        a->name[2] = ( a->tag >>  8 ) & 0xFF;
+        a->name[3] = ( a->tag       ) & 0xFF;
+        a->name[4] = 0;
+
+        ++a;
+      }
+
+      ns = mmvar->namedstyle;
+      for ( i = 0; i < fvar_head.instanceCount; ++i )
+      {
+        if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) )
+          goto Exit;
+
+        ns->strid       =    FT_GET_USHORT();
+        (void) /* flags = */ FT_GET_USHORT();
+
+        for ( j = 0; j < fvar_head.axisCount; ++j )
+          ns->coords[j] = FT_GET_ULONG();     /* A Fixed */
+
+        FT_FRAME_EXIT();
+      }
+    }
+
+    if ( master != NULL )
+    {
+      FT_UInt  n;
+
+
+      if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )
+        goto Exit;
+      FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len );
+
+      mmvar->axis =
+        (FT_Var_Axis*)&(mmvar[1]);
+      mmvar->namedstyle =
+        (FT_Var_Named_Style*)&(mmvar->axis[mmvar->num_axis]);
+      next_coords =
+        (FT_Fixed*)&(mmvar->namedstyle[mmvar->num_namedstyles]);
+
+      for ( n = 0; n < mmvar->num_namedstyles; ++n )
+      {
+        mmvar->namedstyle[n].coords  = next_coords;
+        next_coords                 += mmvar->num_axis;
+      }
+
+      a = mmvar->axis;
+      next_name = (FT_String*)next_coords;
+      for ( n = 0; n < mmvar->num_axis; ++n )
+      {
+        a->name = next_name;
+
+        /* standard PostScript names for some standard apple tags */
+        if ( a->tag == TTAG_wght )
+          a->name = (char *)"Weight";
+        else if ( a->tag == TTAG_wdth )
+          a->name = (char *)"Width";
+        else if ( a->tag == TTAG_opsz )
+          a->name = (char *)"OpticalSize";
+        else if ( a->tag == TTAG_slnt )
+          a->name = (char *)"Slant";
+
+        next_name += 5;
+        ++a;
+      }
+
+      *master = mmvar;
+    }
+
+  Exit:
+    return error;
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    TT_Set_MM_Blend                                                    */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Set the blend (normalized) coordinates for this instance of the    */
+  /*    font.  Check that the `gvar' table is reasonable and does some     */
+  /*    initial preparation.                                               */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face       :: The font.                                            */
+  /*                  Initialize the blend structure with `gvar' data.     */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    num_coords :: Must be the axis count of the font.                  */
+  /*                                                                       */
+  /*    coords     :: An array of num_coords, each between [-1,1].         */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  TT_Set_MM_Blend( TT_Face    face,
+                   FT_UInt    num_coords,
+                   FT_Fixed*  coords )
+  {
+    FT_Error    error = TT_Err_Ok;
+    GX_Blend    blend;
+    FT_MM_Var*  mmvar;
+    FT_UInt     i;
+    FT_Memory   memory = face->root.memory;
+
+    enum
+    {
+      mcvt_retain,
+      mcvt_modify,
+      mcvt_load
+
+    } manageCvt;
+
+
+    face->doblend = FALSE;
+
+    if ( face->blend == NULL )
+    {
+      if ( ( error = TT_Get_MM_Var( face, NULL) ) )
+        goto Exit;
+    }
+
+    blend = face->blend;
+    mmvar = blend->mmvar;
+
+    if ( num_coords != mmvar->num_axis )
+    {
+      error = TT_Err_Invalid_Argument;
+      goto Exit;
+    }
+
+    for ( i = 0; i < num_coords; ++i )
+      if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
+      {
+        error = TT_Err_Invalid_Argument;
+        goto Exit;
+      }
+
+    if ( blend->glyphoffsets == NULL )
+      if ( ( error = ft_var_load_gvar( face ) ) )
+        goto Exit;
+
+    if ( blend->normalizedcoords == NULL )
+    {
+      if ( FT_NEW_ARRAY( blend->normalizedcoords, num_coords ) )
+        goto Exit;
+
+      manageCvt = mcvt_modify;
+
+      /* If we have not set the blend coordinates before this, then the  */
+      /* cvt table will still be what we read from the `cvt ' table and  */
+      /* we don't need to reload it.  We may need to change it though... */
+    }
+    else
+    {
+      for ( i = 0;
+            i < num_coords && blend->normalizedcoords[i] == coords[i];
+            ++i );
+        if ( i == num_coords )
+          manageCvt = mcvt_retain;
+        else
+          manageCvt = mcvt_load;
+
+      /* If we don't change the blend coords then we don't need to do  */
+      /* anything to the cvt table.  It will be correct.  Otherwise we */
+      /* no longer have the original cvt (it was modified when we set  */
+      /* the blend last time), so we must reload and then modify it.   */
+    }
+
+    blend->num_axis = num_coords;
+    FT_MEM_COPY( blend->normalizedcoords,
+                 coords,
+                 num_coords * sizeof ( FT_Fixed ) );
+
+    face->doblend = TRUE;
+
+    if ( face->cvt != NULL )
+    {
+      switch ( manageCvt )
+      {
+      case mcvt_load:
+        /* The cvt table has been loaded already; every time we change the */
+        /* blend we may need to reload and remodify the cvt table.         */
+        FT_FREE( face->cvt );
+        face->cvt = NULL;
+
+        tt_face_load_cvt( face, face->root.stream );
+        break;
+
+      case mcvt_modify:
+        /* The original cvt table is in memory.  All we need to do is */
+        /* apply the `cvar' table (if any).                           */
+        tt_face_vary_cvt( face, face->root.stream );
+        break;
+
+      case mcvt_retain:
+        /* The cvt table is correct for this set of coordinates. */
+        break;
+      }
+    }
+
+  Exit:
+    return error;
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    TT_Set_Var_Design                                                  */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Set the coordinates for the instance, measured in the user         */
+  /*    coordinate system.  Parse the `avar' table (if present) to convert */
+  /*    from user to normalized coordinates.                               */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face       :: The font face.                                       */
+  /*                  Initialize the blend struct with `gvar' data.        */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    num_coords :: This must be the axis count of the font.             */
+  /*                                                                       */
+  /*    coords     :: A coordinate array with `num_coords' elements.       */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  TT_Set_Var_Design( TT_Face    face,
+                     FT_UInt    num_coords,
+                     FT_Fixed*  coords )
+  {
+    FT_Error        error      = TT_Err_Ok;
+    FT_Fixed*       normalized = NULL;
+    GX_Blend        blend;
+    FT_MM_Var*      mmvar;
+    FT_UInt         i, j;
+    FT_Var_Axis*    a;
+    GX_AVarSegment  av;
+    FT_Memory       memory = face->root.memory;
+
+
+    if ( face->blend == NULL )
+    {
+      if ( ( error = TT_Get_MM_Var( face, NULL ) ) )
+        goto Exit;
+    }
+
+    blend = face->blend;
+    mmvar = blend->mmvar;
+
+    if ( num_coords != mmvar->num_axis )
+    {
+      error = TT_Err_Invalid_Argument;
+      goto Exit;
+    }
[truncated at 1000 lines; 524 more skipped]

reactos/lib/freetype/src/truetype
ttgxvar.h added at 1.1
diff -N ttgxvar.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ttgxvar.h	18 Aug 2004 20:25:11 -0000	1.1
@@ -0,0 +1,182 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ttgxvar.h                                                              */
+/*                                                                         */
+/*    TrueType GX Font Variation loader (specification)                    */
+/*                                                                         */
+/*  Copyright 2004 by                                                      */
+/*  David Turner, Robert Wilhelm, Werner Lemberg and George Williams.      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __TTGXVAR_H__
+#define __TTGXVAR_H__
+
+
+#include <ft2build.h>
+#include "ttobjs.h"
+
+
+FT_BEGIN_HEADER
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    GX_AVarCorrespondenceRec                                           */
+  /*                                                                       */
+  /* <Description>                                                         */  
+  /*    A data structure representing `shortFracCorrespondence' in `avar'  */
+  /*    table according to the specifications from Apple.                  */
+  /*                                                                       */
+  typedef struct  GX_AVarCorrespondenceRec_
+  {
+    FT_Fixed  fromCoord;
+    FT_Fixed  toCoord;
+
+  } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    GX_AVarRec                                                         */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Data from the segment field of `avar' table.                       */
+  /*    There is one of these for each axis.                               */
+  /*                                                                       */
+  typedef struct  GX_AVarSegmentRec_
+  {
+    FT_UShort              pairCount;
+    GX_AVarCorrespondence  correspondence; /* array with pairCount entries */
+
+  } GX_AVarSegmentRec, *GX_AVarSegment;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    GX_BlendRec                                                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Data for interpolating a font from a distortable font specified    */
+  /*    by the GX *var tables ([fgca]var).                                 */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    num_axis         :: The number of axes along which interpolation   */
+  /*                         may happen                                    */
+  /*                                                                       */
+  /*    normalizedcoords :: A normalized value (between [-1,1]) indicating */
+  /*                        the contribution along each axis to the final  */
+  /*                        interpolated font.                             */
+  /*                                                                       */
+  typedef struct  GX_BlendRec_
+  {
+    FT_UInt         num_axis;
+    FT_Fixed*       normalizedcoords;
+
+    FT_MM_Var*      mmvar;
+    FT_Int          mmvar_len;
+
+    FT_Bool         avar_checked;
+    GX_AVarSegment  avar_segment;
+
+    FT_UInt         tuplecount;      /* shared tuples in `gvar'           */
+    FT_Fixed*       tuplecoords;     /* tuplecoords[tuplecount][num_axis] */
+
+    FT_UInt         gv_glyphcnt;
+    FT_ULong*       glyphoffsets;
+    
+  } GX_BlendRec;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <enum>                                                                */
+  /*    GX_TupleCountFlags                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Flags used within the `TupleCount' field of the `gvar' table.      */
+  /*                                                                       */
+  typedef enum  GX_TupleCountFlags_
+  {
+    GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000,
+    GX_TC_RESERVED_TUPLE_FLAGS       = 0x7000,
+    GX_TC_TUPLE_COUNT_MASK           = 0x0FFF
+
+  } GX_TupleCountFlags;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <enum>                                                                */
+  /*    GX_TupleIndexFlags                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Flags used within the `TupleIndex' field of the `gvar' and `cvar'  */
+  /*    tables.                                                            */
+  /*                                                                       */
+  typedef enum  GX_TupleIndexFlags_
+  {
+    GX_TI_EMBEDDED_TUPLE_COORD  = 0x8000,
+    GX_TI_INTERMEDIATE_TUPLE    = 0x4000,
+    GX_TI_PRIVATE_POINT_NUMBERS = 0x2000,
+    GX_TI_RESERVED_TUPLE_FLAG   = 0x1000,
+    GX_TI_TUPLE_INDEX_MASK      = 0x0FFF
+
+  } GX_TupleIndexFlags;
+
+
+#define TTAG_wght  FT_MAKE_TAG( 'w', 'g', 'h', 't' )
+#define TTAG_wdth  FT_MAKE_TAG( 'w', 'd', 't', 'h' )
+#define TTAG_opsz  FT_MAKE_TAG( 'o', 'p', 's', 'z' )
+#define TTAG_slnt  FT_MAKE_TAG( 's', 'l', 'n', 't' )
+
+
+  FT_LOCAL( FT_Error )
+  TT_Set_MM_Blend( TT_Face    face,
+                   FT_UInt    num_coords,
+                   FT_Fixed*  coords );
+
+  FT_LOCAL( FT_Error )
+  TT_Set_Var_Design( TT_Face    face,
+                     FT_UInt    num_coords,
+                     FT_Fixed*  coords );
+
+  FT_LOCAL( FT_Error )
+  TT_Get_MM_Var( TT_Face      face,
+                 FT_MM_Var*  *master );
+
+
+  FT_LOCAL( FT_Error )
+  tt_face_vary_cvt( TT_Face    face,
+                    FT_Stream  stream );
+
+
+  FT_LOCAL( FT_Error )
+  TT_Vary_Get_Glyph_Deltas( TT_Face      face,
+                            FT_UInt      glyph_index,
+                            FT_Vector*  *deltas,
+                            FT_UInt      n_points );
+
+
+  FT_LOCAL( void )
+  tt_done_blend( FT_Memory  memory,
+                 GX_Blend   blend );
+
+
+FT_END_HEADER
+
+
+#endif /* __TTGXVAR_H__ */
+
+
+/* END */

reactos/lib/freetype/src/truetype
Jamfile 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Jamfile	1 Apr 2003 08:38:24 -0000	1.1
+++ Jamfile	18 Aug 2004 20:25:11 -0000	1.2
@@ -1,4 +1,4 @@
-# FreeType 2 src/truetype Jamfile (c) 2001 David Turner
+# FreeType 2 src/truetype Jamfile (c) 2001, 2004 David Turner
 #
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) truetype ;
@@ -8,7 +8,7 @@
 
   if $(FT2_MULTI)
   {
-    _sources = ttdriver ttobjs ttpload ttgload ttinterp ;
+    _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ;
   }
   else
   {

reactos/lib/freetype/src/truetype
rules.mk 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- rules.mk	21 Jan 2004 19:23:47 -0000	1.2
+++ rules.mk	18 Aug 2004 20:25:11 -0000	1.3
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2000, 2001, 2003, 2004 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -29,6 +29,7 @@
               $(TT_DIR)/ttpload.c  \
               $(TT_DIR)/ttgload.c  \
               $(TT_DIR)/ttinterp.c \
+              $(TT_DIR)/ttgxvar.c \
               $(TT_DIR)/ttdriver.c
 
 # TrueType driver headers

reactos/lib/freetype/src/truetype
truetype.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- truetype.c	1 Apr 2003 08:38:25 -0000	1.1
+++ truetype.c	18 Aug 2004 20:25:11 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType TrueType driver component (body only).                      */
 /*                                                                         */
-/*  Copyright 1996-2001 by                                                 */
+/*  Copyright 1996-2001, 2004 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -19,14 +19,18 @@
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ft2build.h>
-#include "ttdriver.c"   /* driver interface */
-#include "ttpload.c"    /* tables loader    */
-#include "ttgload.c"    /* glyph loader     */
-#include "ttobjs.c"     /* object manager   */
+#include "ttdriver.c"   /* driver interface    */
+#include "ttpload.c"    /* tables loader       */
+#include "ttgload.c"    /* glyph loader        */
+#include "ttobjs.c"     /* object manager      */
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 #include "ttinterp.c"
 #endif
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.c"    /* gx distortable font */
+#endif
+
 
 /* END */

reactos/lib/freetype/src/truetype
ttdriver.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ttdriver.c	10 May 2004 17:48:35 -0000	1.6
+++ ttdriver.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -23,9 +23,18 @@
 #include FT_TRUETYPE_IDS_H
 #include FT_SERVICE_XFREE86_NAME_H
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#endif
+
 #include "ttdriver.h"
 #include "ttgload.h"
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.h"
+#endif
+
 #include "tterrors.h"
 
 
@@ -90,11 +99,12 @@
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
   static FT_Error
-  Get_Kerning( TT_Face     face,
+  Get_Kerning( FT_Face     ttface,          /* TT_Face */
                FT_UInt     left_glyph,
                FT_UInt     right_glyph,
                FT_Vector*  kerning )
   {
+    TT_Face        face = (TT_Face)ttface;
     TT_Kern0_Pair  pair;
 
 
@@ -185,12 +195,13 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   static FT_Error
-  Set_Char_Sizes( TT_Size     size,
+  Set_Char_Sizes( FT_Size     ttsize,       /* TT_Size */
                   FT_F26Dot6  char_width,
                   FT_F26Dot6  char_height,
                   FT_UInt     horz_resolution,
                   FT_UInt     vert_resolution )
   {
+    TT_Size           size     = (TT_Size)ttsize;
     FT_Size_Metrics*  metrics  = &size->root.metrics;
     FT_Size_Metrics*  metrics2 = &size->metrics;
     TT_Face           face     = (TT_Face)size->root.face;
@@ -250,8 +261,16 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   static FT_Error
-  Set_Pixel_Sizes( TT_Size  size )
+  Set_Pixel_Sizes( FT_Size  ttsize,         /* TT_Size */
+                   FT_UInt  pixel_width,
+                   FT_UInt  pixel_height )
   {
+    TT_Size  size = (TT_Size)ttsize;
+
+    FT_UNUSED( pixel_width );
+    FT_UNUSED( pixel_height );
+
+
     /* many things have been pre-computed by the base layer */
 
     size->metrics         = size->root.metrics;
@@ -291,12 +310,14 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   static FT_Error
-  Load_Glyph( TT_GlyphSlot  slot,
-              TT_Size       size,
+  Load_Glyph( FT_GlyphSlot  ttslot,         /* TT_GlyphSlot */
+              FT_Size       ttsize,         /* TT_Size      */
               FT_UInt       glyph_index,
               FT_Int32      load_flags )
   {
-    FT_Error  error;
+    TT_GlyphSlot  slot = (TT_GlyphSlot)ttslot;
+    TT_Size       size = (TT_Size)ttsize;
+    FT_Error      error;
 
 
     if ( !slot )
@@ -345,14 +366,30 @@
   /*************************************************************************/
   /*************************************************************************/
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+  static const FT_Service_MultiMastersRec  tt_service_gx_multi_masters =
+  {
+    (FT_Get_MM_Func)        NULL,
+    (FT_Set_MM_Design_Func) NULL,
+    (FT_Set_MM_Blend_Func)  TT_Set_MM_Blend,
+    (FT_Get_MM_Var_Func)    TT_Get_MM_Var,
+    (FT_Set_Var_Design_Func)TT_Set_Var_Design
+  };
+#endif
+
+
   static const FT_ServiceDescRec  tt_services[] =
   {
-    { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE },
+    { FT_SERVICE_ID_XF86_NAME,     FT_XF86_FORMAT_TRUETYPE },
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+    { FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters },
+#endif
     { NULL, NULL }
   };
 
-  static FT_Module_Interface
-  tt_get_interface( TT_Driver    driver,
+
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  tt_get_interface( FT_Module    driver,    /* TT_Driver */
                     const char*  tt_interface )
   {
     FT_Module_Interface  result;
@@ -365,12 +402,12 @@
       return result;
 
     /* only return the default interface from the SFNT module */
-    sfntd = FT_Get_Module( driver->root.root.library, "sfnt" );
+    sfntd = FT_Get_Module( driver->library, "sfnt" );
     if ( sfntd )
     {
       sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
       if ( sfnt )
-        return sfnt->get_interface( FT_MODULE( driver ), tt_interface );
+        return sfnt->get_interface( driver, tt_interface );
     }
 
     return 0;
@@ -399,30 +436,29 @@
 
       (void*)0,        /* driver specific interface */
 
-      (FT_Module_Constructor)tt_driver_init,
-      (FT_Module_Destructor) tt_driver_done,
-      (FT_Module_Requester)  tt_get_interface,
+      tt_driver_init,
+      tt_driver_done,
+      tt_get_interface,
     },
 
     sizeof ( TT_FaceRec ),
     sizeof ( TT_SizeRec ),
     sizeof ( FT_GlyphSlotRec ),
 
-
-    (FT_Face_InitFunc)       tt_face_init,
-    (FT_Face_DoneFunc)       tt_face_done,
-    (FT_Size_InitFunc)       tt_size_init,
-    (FT_Size_DoneFunc)       tt_size_done,
-    (FT_Slot_InitFunc)       0,
-    (FT_Slot_DoneFunc)       0,
-
-    (FT_Size_ResetPointsFunc)Set_Char_Sizes,
-    (FT_Size_ResetPixelsFunc)Set_Pixel_Sizes,
-    (FT_Slot_LoadFunc)       Load_Glyph,
-
-    (FT_Face_GetKerningFunc) Get_Kerning,
-    (FT_Face_AttachFunc)     0,
-    (FT_Face_GetAdvancesFunc)0
+    tt_face_init,
+    tt_face_done,
+    tt_size_init,
+    tt_size_done,
+    0,                      /* FT_Slot_InitFunc        */
+    0,                      /* FT_Slot_DoneFunc        */
+
+    Set_Char_Sizes,
+    Set_Pixel_Sizes,
+    Load_Glyph,
+
+    Get_Kerning,
+    0,                      /* FT_Face_AttachFunc      */
+    0                       /* FT_Face_GetAdvancesFunc */
   };
 
 

reactos/lib/freetype/src/truetype
ttgload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ttgload.c	10 May 2004 17:48:35 -0000	1.6
+++ ttgload.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -26,6 +26,10 @@
 
 #include "ttgload.h"
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.h"
+#endif
+
 #include "tterrors.h"
 
 
@@ -202,7 +206,7 @@
       *tsb = face->os2.sTypoAscender;
       *ah  = face->os2.sTypoAscender - face->os2.sTypoDescender;
     }
-    else 
+    else
     {
       *tsb = face->horizontal.Ascender;
       *ah  = face->horizontal.Ascender - face->horizontal.Descender;
@@ -352,7 +356,7 @@
     FT_Short        *cont, *cont_limit;
 
 
-    /* reading the contours endpoints & number of points */
+    /* reading the contours' endpoints & number of points */
     cont       = gloader->current.outline.contours;
     cont_limit = cont + n_contours;
 
@@ -724,11 +728,48 @@
       outline->tags[n_points + 3] = 0;
     }
 
-    /* Note that we return two more points that are not */
-    /* part of the glyph outline.                       */
+    /* Note that we return four more points that are not */
+    /* part of the glyph outline.                        */
 
     n_points += 4;
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+    if ( ((TT_Face)load->face)->doblend )
+    {
+      /* Deltas apply to the unscaled data. */
+      FT_Vector*    deltas;
+      FT_Memory     memory       = load->face->memory;
+      FT_StreamRec  saved_stream = *(load->stream);
+      FT_UInt       i;
+
+
+      /* TT_Vary_Get_Glyph_Deltas uses a frame, thus we have to save */
+      /* (and restore) the current one                               */
+      load->stream->cursor = 0;
+      load->stream->limit  = 0;
+
+      error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(load->face),
+                                        load->glyph_index,
+                                        &deltas,
+                                        n_points );
+
+      *(load->stream) = saved_stream;
+
+      if ( error )
+        goto Exit;
+
+      for ( i = 0; i < n_points; ++i )
+      {
+        outline->points[i].x += deltas[i].x;
+        outline->points[i].y += deltas[i].y;
+      }
+
+      FT_FREE( deltas );
+    }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
     /* set up zone for hinting */
     tt_prepare_zone( zone, &gloader->current, 0, 0 );
 
@@ -737,9 +778,8 @@
     {
       FT_Vector*  vec     = zone->cur;
       FT_Vector*  limit   = vec + n_points;
-      FT_Fixed    x_scale = load->size->metrics.x_scale;
-      FT_Fixed    y_scale = load->size->metrics.y_scale;
-
+      FT_Fixed    x_scale = ((TT_Size)load->size)->metrics.x_scale;
+      FT_Fixed    y_scale = ((TT_Size)load->size)->metrics.y_scale;
 
       /* first scale the glyph points */
       for ( ; vec < limit; vec++ )
@@ -803,9 +843,11 @@
       load->pp4 = zone->cur[n_points - 1];
     }
 
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+#if defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER ) || \
+    defined( TT_CONFIG_OPTION_GX_VAR_SUPPORT )
   Exit:
 #endif
+
     return error;
   }
 
@@ -830,7 +872,7 @@
 #endif
 
     FT_Error        error;
-    TT_Face         face   = (TT_Face)loader->face;
+    TT_Face         face = (TT_Face)loader->face;
     FT_ULong        offset;
     FT_Int          contours_count;
     FT_UInt         num_points, count;
@@ -839,9 +881,13 @@
     FT_Bool         opened_frame = 0;
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-    struct FT_StreamRec_  inc_stream;
-    FT_Data               glyph_data;
-    FT_Bool               glyph_data_loaded = 0;
+    FT_StreamRec    inc_stream;
+    FT_Data         glyph_data;
+    FT_Bool         glyph_data_loaded = 0;
+#endif
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+    FT_Vector      *deltas;
 #endif
 
 
@@ -865,8 +911,8 @@
     y_scale = 0x10000L;
     if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
     {
-      x_scale = loader->size->metrics.x_scale;
-      y_scale = loader->size->metrics.y_scale;
+      x_scale = ((TT_Size)loader->size)->metrics.x_scale;
+      y_scale = ((TT_Size)loader->size)->metrics.y_scale;
     }
 
     /* get metrics, horizontal and vertical */
@@ -997,6 +1043,28 @@
       loader->pp3.y = 0;
       loader->pp4.y = loader->pp3.y-loader->vadvance;
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+      if ( ((TT_Face)(loader->face))->doblend )
+      {
+        /* this must be done before scaling */
+        FT_Memory  memory = loader->face->memory;
+
+
+        if ( (error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
+                                                glyph_index,
+                                                &deltas,
+                                                4 ) ) )
+          goto Exit;
+
+        loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y;
+        loader->pp2.x += deltas[1].x; loader->pp2.y += deltas[1].y;
+        loader->pp3.x += deltas[2].x; loader->pp3.y += deltas[2].y;
+        loader->pp4.x += deltas[3].x; loader->pp4.y += deltas[3].y;
+
+        FT_FREE( deltas );
+      }
+#endif
+
       if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
       {
         loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
@@ -1044,14 +1112,6 @@
     loader->pp4.x = 0;
     loader->pp4.y = loader->pp3.y - loader->vadvance;
 
-    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-    {
-      loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
-      loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
-      loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
-      loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
-    }
-
     /***********************************************************************/
     /***********************************************************************/
     /***********************************************************************/
@@ -1125,6 +1185,56 @@
       face->forget_glyph_frame( loader );
       opened_frame = 0;
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+      if ( face->doblend )
+      {
+        FT_Int       i, limit;
+        FT_SubGlyph  subglyph;
+        FT_Memory    memory = face->root.memory;
+
+
+        /* this provides additional offsets */
+        /* for each component's translation */
+
+        if ( (error = TT_Vary_Get_Glyph_Deltas(
+                        face,
+                        glyph_index,
+                        &deltas,
+                        gloader->current.num_subglyphs + 4 ) ) )
+          goto Exit;
+
+        /* Note: No subglyph reallocation here, our pointers are stable. */
+        subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;
+        limit    = gloader->current.num_subglyphs;
+
+        for ( i = 0; i < limit; ++i, ++subglyph )
+        {
+          if ( subglyph->flags & ARGS_ARE_XY_VALUES )
+          {
+            subglyph->arg1 += deltas[i].x;
+            subglyph->arg2 += deltas[i].y;
+          }
+        }
+
+        loader->pp1.x += deltas[i + 0].x; loader->pp1.y += deltas[i + 0].y;
+        loader->pp2.x += deltas[i + 1].x; loader->pp2.y += deltas[i + 1].y;
+        loader->pp3.x += deltas[i + 2].x; loader->pp3.y += deltas[i + 2].y;
+        loader->pp4.x += deltas[i + 3].x; loader->pp4.y += deltas[i + 3].y;
+
+        FT_FREE( deltas );
+      }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
+      if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
+      {
+        loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
+        loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
+        loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
+        loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
+      }
+
       /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */
       /* `as is' in the glyph slot (the client application will be     */
       /* responsible for interpreting these data)...                   */
@@ -1566,13 +1676,13 @@
       FT_Pos     top;      /* scaled vertical top side bearing  */
       FT_Pos     advance;  /* scaled vertical advance height    */
 
+
       /* Get the unscaled top bearing and advance height. */
       if ( face->vertical_info &&
            face->vertical.number_Of_VMetrics > 0 )
       {
-        advance_height = loader->pp4.y - loader->pp3.y;
-        top_bearing    = loader->pp3.y - bbox.yMax;
-
+        advance_height = (FT_UShort)( loader->pp4.y - loader->pp3.y );
+        top_bearing    = (FT_Short)( loader->pp3.y - bbox.yMax );
       }
       else
       {

reactos/lib/freetype/src/truetype
ttobjs.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- ttobjs.c	10 May 2004 17:48:36 -0000	1.6
+++ ttobjs.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,6 +37,10 @@
 #include FT_TRUETYPE_UNPATENTED_H
 #endif
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.h"
+#endif
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
@@ -161,7 +165,7 @@
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   tt_face_init( FT_Stream      stream,
-                TT_Face        face,
+                FT_Face        ttface,      /* TT_Face */
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params )
@@ -169,6 +173,7 @@
     FT_Error      error;
     FT_Library    library;
     SFNT_Service  sfnt;
+    TT_Face       face = (TT_Face)ttface;
 
 
     library = face->root.driver->root.library;
@@ -265,8 +270,9 @@
   /*    face :: A pointer to the face object to destroy.                   */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  tt_face_done( TT_Face  face )
+  tt_face_done( FT_Face  ttface )           /* TT_Face */
   {
+    TT_Face       face   = (TT_Face)ttface;
     FT_Memory     memory = face->root.memory;
     FT_Stream     stream = face->root.stream;
 
@@ -293,6 +299,11 @@
     FT_FRAME_RELEASE( face->cvt_program );
     face->font_program_size = 0;
     face->cvt_program_size  = 0;
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+    tt_done_blend( memory, face->blend );
+    face->blend = NULL;
+#endif
   }
 
 
@@ -318,8 +329,9 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  tt_size_init( TT_Size  size )
+  tt_size_init( FT_Size  ttsize )           /* TT_Size */
   {
+    TT_Size   size  = (TT_Size)ttsize;
     FT_Error  error = TT_Err_Ok;
 
 
@@ -476,7 +488,7 @@
 
   Fail_Memory:
 
-    tt_size_done( size );
+    tt_size_done( ttsize );
     return error;
 
 #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
@@ -496,8 +508,9 @@
   /*    size :: A handle to the target size object.                        */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  tt_size_done( TT_Size  size )
+  tt_size_done( FT_Size  ttsize )           /* TT_Size */
   {
+    TT_Size    size = (TT_Size)ttsize;
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
@@ -842,7 +855,7 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  tt_driver_init( TT_Driver  driver )
+  tt_driver_init( FT_Module  driver )       /* TT_Driver */
   {
     FT_Error  error;
 
@@ -866,9 +879,11 @@
   /*    driver :: A handle to the target TrueType driver.                  */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  tt_driver_done( TT_Driver  driver )
+  tt_driver_done( FT_Module  ttdriver )     /* TT_Driver */
   {
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+    TT_Driver  driver = (TT_Driver)ttdriver;
+
 
     /* destroy the execution context */
     if ( driver->context )
@@ -877,7 +892,7 @@
       driver->context = NULL;
     }
 #else
-    FT_UNUSED( driver );
+    FT_UNUSED( ttdriver );
 #endif
 
   }

reactos/lib/freetype/src/truetype
ttobjs.h 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ttobjs.h	10 May 2004 17:48:36 -0000	1.4
+++ ttobjs.h	18 Aug 2004 20:25:11 -0000	1.5
@@ -380,19 +380,28 @@
   } TT_DriverRec;
 
 
+  /* Note: All of the functions below (except tt_size_reset()) are used    */
+  /* as function pointers in a FT_Driver_ClassRec.  Therefore their        */
+  /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face,  */
+  /* TT_Size, etc., so that the compiler can confirm that the types and    */
+  /* number of parameters are correct.  In all cases the FT_xxx types are  */
+  /* cast to their TT_xxx counterparts inside the functions since FreeType */
+  /* will always use the TT driver to create them.                         */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* Face functions                                                        */
   /*                                                                       */
   FT_LOCAL( FT_Error )
   tt_face_init( FT_Stream      stream,
-                TT_Face        face,
+                FT_Face        ttface,      /* TT_Face */
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params );
 
   FT_LOCAL( void )
-  tt_face_done( TT_Face  face );
+  tt_face_done( FT_Face  ttface );          /* TT_Face */
 
 
   /*************************************************************************/
@@ -400,10 +409,10 @@
   /* Size functions                                                        */
   /*                                                                       */
   FT_LOCAL( FT_Error )
-  tt_size_init( TT_Size  size );
+  tt_size_init( FT_Size  ttsize );          /* TT_Size */
 
   FT_LOCAL( void )
-  tt_size_done( TT_Size  size );
+  tt_size_done( FT_Size  ttsize );          /* TT_Size */
 
   FT_LOCAL( FT_Error )
   tt_size_reset( TT_Size  size );
@@ -414,10 +423,10 @@
   /* Driver functions                                                      */
   /*                                                                       */
   FT_LOCAL( FT_Error )
-  tt_driver_init( TT_Driver  driver );
+  tt_driver_init( FT_Module  ttdriver );    /* TT_Driver */
 
   FT_LOCAL( void )
-  tt_driver_done( TT_Driver  driver );
+  tt_driver_done( FT_Module  ttdriver );    /* TT_Driver */
 
 
 FT_END_HEADER

reactos/lib/freetype/src/truetype
ttpload.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ttpload.c	1 Apr 2003 08:38:25 -0000	1.1
+++ ttpload.c	18 Aug 2004 20:25:11 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType glyph data/program tables loader (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,6 +24,10 @@
 
 #include "ttpload.h"
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include "ttgxvar.h"
+#endif
+
 #include "tterrors.h"
 
 
@@ -186,6 +190,11 @@
     FT_FRAME_EXIT();
     FT_TRACE2(( "loaded\n" ));
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+    if ( face->doblend )
+      error = tt_face_vary_cvt( face, stream );
+#endif
+
   Exit:
     return error;
   }

reactos/lib/freetype/src/type1
t1driver.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- t1driver.c	10 May 2004 17:48:36 -0000	1.5
+++ t1driver.c	18 Aug 2004 20:25:11 -0000	1.6
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 driver interface (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -129,9 +129,11 @@
 #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
   static const FT_Service_MultiMastersRec  t1_service_multi_masters =
   {
-    (FT_Get_MM_Func)       T1_Get_Multi_Master,
-    (FT_Set_MM_Design_Func)T1_Set_MM_Design,
-    (FT_Set_MM_Blend_Func) T1_Set_MM_Blend
+    (FT_Get_MM_Func)        T1_Get_Multi_Master,
+    (FT_Set_MM_Design_Func) T1_Set_MM_Design,
+    (FT_Set_MM_Blend_Func)  T1_Set_MM_Blend,
+    (FT_Get_MM_Var_Func)    T1_Get_MM_Var,
+    (FT_Set_Var_Design_Func)T1_Set_Var_Design
   };
 #endif
 

reactos/lib/freetype/src/type1
t1gload.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- t1gload.c	10 May 2004 17:48:36 -0000	1.6
+++ t1gload.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -60,7 +60,7 @@
   {
     T1_Face   face  = (T1_Face)decoder->builder.face;
     T1_Font   type1 = &face->type1;
-    FT_Error  error = 0;
+    FT_Error  error = T1_Err_Ok;
 
 
     decoder->font_matrix = type1->font_matrix;

reactos/lib/freetype/src/type1
t1load.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- t1load.c	10 May 2004 17:48:36 -0000	1.6
+++ t1load.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -211,6 +211,159 @@
   }
 
 
+#define FT_INT_TO_FIXED( a )  ( (a) << 16 )
+#define FT_FIXED_TO_INT( a )  ( FT_RoundFix( a ) >> 16 )
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Given a normalized (blend) coordinate, figure out the design          */
+  /* coordinate appropriate for that value.                                */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Fixed )
+  mm_axis_unmap( PS_DesignMap  axismap,
+                 FT_Fixed      ncv )
+  {
+    int  j;
+
+
+    if ( ncv <= axismap->blend_points[0] )
+      return axismap->design_points[0];
+
+    for ( j = 1; j < axismap->num_points; ++j )
+    {
+      if ( ncv <= axismap->blend_points[j] )
+      {
+        FT_Fixed  t = FT_MulDiv( ncv - axismap->blend_points[j - 1],
+                                 0x10000L,
+                                 axismap->blend_points[j] -
+                                   axismap->blend_points[j - 1] );
+
+
+        return axismap->design_points[j - 1] +
+                 FT_MulDiv( t,
+                            axismap->design_points[j] - 
+                              axismap->design_points[j - 1],
+                            1L );
+      }
+    }
+
+    return axismap->design_points[axismap->num_points - 1];
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Given a vector of weights, one for each design, figure out the        */
+  /* normalized axis coordinates which gave rise to those weights.         */
+  /*                                                                       */
+  FT_LOCAL_DEF( void )
+  mm_weights_unmap( FT_Fixed*  weights,
+                    FT_Fixed*  axiscoords,
+                    FT_UInt    axis_count )
+  {
+    FT_ASSERT( axis_count <= T1_MAX_MM_AXIS );
+
+    if ( axis_count == 1 )
+      axiscoords[0] = weights[1];
+
+    else if ( axis_count == 2 )
+    {
+      axiscoords[0] = weights[3] + weights[1];
+      axiscoords[1] = weights[3] + weights[2];
+    }
+
+    else if ( axis_count == 3 )
+    {
+      axiscoords[0] = weights[7] + weights[5] + weights[3] + weights[1];
+      axiscoords[1] = weights[7] + weights[6] + weights[3] + weights[2];
+      axiscoords[2] = weights[7] + weights[6] + weights[5] + weights[4];
+    }
+
+    else
+    {
+      axiscoords[0] = weights[15] + weights[13] + weights[11] + weights[9] +
+                        weights[7] + weights[5] + weights[3] + weights[1];
+      axiscoords[1] = weights[15] + weights[14] + weights[11] + weights[10] +
+                        weights[7] + weights[6] + weights[3] + weights[2];
+      axiscoords[2] = weights[15] + weights[14] + weights[13] + weights[12] +
+                        weights[7] + weights[6] + weights[5] + weights[4];
+      axiscoords[3] = weights[15] + weights[14] + weights[13] + weights[12] +
+                        weights[11] + weights[10] + weights[9] + weights[8];
+    }
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Just a wrapper around T1_Get_Multi_Master to support the different    */
+  /*  arguments needed by the GX var distortable fonts.                    */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  T1_Get_MM_Var( T1_Face      face,
+                 FT_MM_Var*  *master )
+  {
+    FT_Memory        memory = face->root.memory;
+    FT_MM_Var       *mmvar;
+    FT_Multi_Master  mmaster;
+    FT_Error         error;
+    FT_UInt          i;
+    FT_Fixed         axiscoords[T1_MAX_MM_AXIS];
+    PS_Blend         blend = face->blend;
+
+
+    error = T1_Get_Multi_Master( face, &mmaster );
+    if ( error )
+      goto Exit;
+    if ( FT_ALLOC( mmvar,
+                   sizeof ( FT_MM_Var ) +
+                     mmaster.num_axis * sizeof ( FT_Var_Axis ) ) )
+      goto Exit;
+
+    mmvar->num_axis        = mmaster.num_axis;
+    mmvar->num_designs     = mmaster.num_designs;
+    mmvar->num_namedstyles = (FT_UInt)-1;                /* Does not apply */
+    mmvar->axis            = (FT_Var_Axis*)&mmvar[1];
+                                      /* Point to axes after MM_Var struct */
+    mmvar->namedstyle      = NULL;
+
+    for ( i = 0 ; i < mmaster.num_axis; ++i )
+    {
+      mmvar->axis[i].name    = mmaster.axis[i].name;
+      mmvar->axis[i].minimum = FT_INT_TO_FIXED( mmaster.axis[i].minimum);
+      mmvar->axis[i].maximum = FT_INT_TO_FIXED( mmaster.axis[i].maximum);
+      mmvar->axis[i].def     = ( mmvar->axis[i].minimum +
+                                   mmvar->axis[i].maximum ) / 2;
+                            /* Does not apply.  But this value is in range */
+      mmvar->axis[i].strid   = 0xFFFFFFFFLU;   /* Does not apply */
+      mmvar->axis[i].tag     = 0xFFFFFFFFLU;   /* Does not apply */
+
+      if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 )
+        mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' );
+      else if ( ft_strcmp( mmvar->axis[i].name, "Width" ) == 0 )
+        mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' );
+      else if ( ft_strcmp( mmvar->axis[i].name, "OpticalSize" ) == 0 )
+        mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' );
+    }
+
+    if ( blend->num_designs == 1U << blend->num_axis )
+    {
+      mm_weights_unmap( blend->default_weight_vector,
+                        axiscoords,
+                        blend->num_axis );
+
+      for ( i = 0; i < mmaster.num_axis; ++i )
+        mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
+                                            axiscoords[i] );
+    }
+
+    *master = mmvar;
+
+  Exit:
+    return error;
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   T1_Set_MM_Blend( T1_Face    face,
                    FT_UInt    num_coords,
@@ -280,14 +433,14 @@
         FT_Long       design  = coords[n];
         FT_Fixed      the_blend;
         PS_DesignMap  map     = blend->design_map + n;
-        FT_Fixed*     designs = map->design_points;
+        FT_Long*      designs = map->design_points;
         FT_Fixed*     blends  = map->blend_points;
         FT_Int        before  = -1, after = -1;
 
 
         for ( p = 0; p < (FT_UInt)map->num_points; p++ )
         {
-          FT_Fixed  p_design = designs[p];
+          FT_Long  p_design = designs[p];
 
 
           /* exact match? */
@@ -329,6 +482,33 @@
   }
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Just a wrapper around T1_Set_MM_Design to support the different       */
+  /* arguments needed by the GX var distortable fonts.                     */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  T1_Set_Var_Design( T1_Face    face,
+                     FT_UInt    num_coords,
+                     FT_Fixed*  coords )
+  {
+     FT_Long   lcoords[4];          /* maximum axis count is 4 */
+     FT_UInt   i;
+     FT_Error  error;
+
+
+     error = T1_Err_Invalid_Argument;
+     if ( num_coords <= 4 && num_coords > 0 )
+     {
+       for ( i = 0; i < num_coords; ++i )
+         lcoords[i] = FT_FIXED_TO_INT( coords[i] );
+       error = T1_Set_MM_Design( face, num_coords, lcoords );
+     }
+
+     return error;
+  }
+
+
   FT_LOCAL_DEF( void )
   T1_Done_Blend( T1_Face  face )
   {

reactos/lib/freetype/src/type1
t1load.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- t1load.h	1 Apr 2003 08:38:24 -0000	1.1
+++ t1load.h	18 Aug 2004 20:25:11 -0000	1.2
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (specification).                                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2004 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -60,6 +60,10 @@
   T1_Get_Multi_Master( T1_Face           face,
                        FT_Multi_Master*  master );
 
+  FT_LOCAL_DEF( FT_Error )
+  T1_Get_MM_Var( T1_Face      face,
+                 FT_MM_Var*  *master );
+
   FT_LOCAL( FT_Error )
   T1_Set_MM_Blend( T1_Face    face,
                    FT_UInt    num_coords,
@@ -70,6 +74,11 @@
                     FT_UInt   num_coords,
                     FT_Long*  coords );
 
+  FT_LOCAL_DEF( FT_Error )
+  T1_Set_Var_Design( T1_Face    face,
+                     FT_UInt    num_coords,
+                     FT_Fixed*  coords );
+
   FT_LOCAL( void )
   T1_Done_Blend( T1_Face  face );
 

reactos/lib/freetype/src/winfonts
winfnt.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- winfnt.c	10 May 2004 17:48:36 -0000	1.6
+++ winfnt.c	18 Aug 2004 20:25:11 -0000	1.7
@@ -466,12 +466,8 @@
         bsize->height = (FT_Short)(
           font->header.pixel_height + font->header.external_leading );
         bsize->size   = font->header.nominal_point_size << 6;
-        bsize->x_ppem =
-          (FT_Pos)( ( font->header.horizontal_resolution * bsize->size + 36 )
-                    / 72 );
-        bsize->y_ppem =
-          (FT_Pos)( ( font->header.vertical_resolution* bsize->size + 36 )
-                    / 72 );
+        bsize->x_ppem = font->header.pixel_width << 6;
+        bsize->y_ppem = font->header.pixel_height << 6;
       }
 
       {
@@ -553,7 +549,7 @@
     FT_Face   root = FT_FACE( face );
 
 
-    if ( size->metrics.y_ppem == root->available_sizes->height )
+    if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
     {
       FNT_Font  font = face->font;
 
@@ -658,6 +654,8 @@
     slot->format          = FT_GLYPH_FORMAT_BITMAP;
 
     /* now set up metrics */
+    slot->metrics.width        = bitmap->width << 6;
+    slot->metrics.height       = bitmap->rows << 6;
     slot->metrics.horiAdvance  = bitmap->width << 6;
     slot->metrics.horiBearingX = 0;
     slot->metrics.horiBearingY = slot->bitmap_top << 6;
CVSspam 0.2.8