diff options
Diffstat (limited to 'Build/source/libs/libttf/arch')
65 files changed, 11031 insertions, 0 deletions
diff --git a/Build/source/libs/libttf/arch/amigaos/Makefile.gcc b/Build/source/libs/libttf/arch/amigaos/Makefile.gcc new file mode 100644 index 00000000000..ef023723791 --- /dev/null +++ b/Build/source/libs/libttf/arch/amigaos/Makefile.gcc @@ -0,0 +1,69 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for amiga using ADE Enviroment. +# +# You will need GNU make. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/amigaos/Makefile.gcc + +ARCH = arch/amigaos +FT_MAKEFILE = $(ARCH)/Makefile.gcc + +AR = ar +RM = rm + +CC = gcc + +CFLAGS = -Wall -pedantic -ansi -O2 -g -noixemul -I$(ARCH) -I. -Iextend + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxgdef.c \ + extend/ftxopen.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttextend.c ttfile.c ttgload.c ttinterp.c ttload.c \ + ttmemory.c ttmutex.c ttobjs.c ttraster.c +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a + + +$(OBJ_S): $(SRC_S) $(SRC_M) + + +libttf.a: $($(LIB_FILES)) + $(AR) src $@ $^ + +clean: + $(RM) $($(LIB_FILES)) + +distclean: clean + $(RM) dep.end libttf.a + +depend: $(SRC_S) $(SRC_M) $(SRC_X) + $(CC) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile.gcc diff --git a/Build/source/libs/libttf/arch/amigaos/freetype.c b/Build/source/libs/libttf/arch/amigaos/freetype.c new file mode 100644 index 00000000000..723c8f463ce --- /dev/null +++ b/Build/source/libs/libttf/arch/amigaos/freetype.c @@ -0,0 +1,25 @@ +/* This file is part of the FreeType project */ + +/* Single object library component for AmigaOS */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttfile.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttmemory.c" +#include "ttmutex.c" +#include "ttobjs.c" +#include "ttraster.c" + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/amigaos/ft_conf.h b/Build/source/libs/libttf/arch/amigaos/ft_conf.h new file mode 100644 index 00000000000..6aa4b3f73ea --- /dev/null +++ b/Build/source/libs/libttf/arch/amigaos/ft_conf.h @@ -0,0 +1,220 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for AmigaOS using ADE enviroment */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ + +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ + +/* #undef HAVE_MMAP */ + +/* Define if you have the <stdlib.h> header file. */ + +#define HAVE_STDLIB_H + +/* Define if the X Window System is missing or not being used. */ + +#define X_DISPLAY_MISSING + +/* The number of bytes in a int. */ + +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ + +#define SIZEOF_LONG 4 + +/* Define if you have the getpagesize function. */ + +#define HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ + +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ + +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ + +#define HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. */ + +#define HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ + +#define HAVE_UNISTD_H + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/ansi/freetype.c b/Build/source/libs/libttf/arch/ansi/freetype.c new file mode 100644 index 00000000000..820687a1533 --- /dev/null +++ b/Build/source/libs/libttf/arch/ansi/freetype.c @@ -0,0 +1,32 @@ +/* This file is part of the FreeType project */ + +/* Single file library component for the ANSI target */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#include "ttfile.c" +#include "ttmemory.c" +#include "ttmutex.c" + +/* the extensions are compiled separately, but we need to */ +/* include the file ttextend.c if we want to support them */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + +/* END */ diff --git a/Build/source/libs/libttf/arch/ansi/ft_conf.h b/Build/source/libs/libttf/arch/ansi/ft_conf.h new file mode 100644 index 00000000000..352e6465cbf --- /dev/null +++ b/Build/source/libs/libttf/arch/ansi/ft_conf.h @@ -0,0 +1,227 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for the ANSI Build */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. Unix-specific */ +#undef HAVE_FCNTL_H + +/* command.com can't pipe stderr into a file; any message would be */ +/* written into the graphics screen. */ +#define HAVE_PRINT_FUNCTION 1 + +#define Print( format, ap ) vfprintf( stdout, (format), (ap) ) + + +/* The number of bytes in a int. We use the ANSI header file limits.h */ +/* for determining it since there is no easy way to guess. */ +/* */ +#include <limits.h> +#if UINT_MAX == 0xFFFF +#define SIZEOF_INT 2 +#elif UINT_MAX == 0xFFFFFFFF +#define SIZEOF_INT 4 +#else +#error "Unsupported number of bytes in `int' type!" +#endif + +/* We now try to guess the size of longs in the same way */ +/* */ +#if ULONG_MAX == 0xFFFFFFFF +#define SIZEOF_LONG 4 +#elif ULONG_MAX == 0xFFFFFFFFFFFFFFFF +#define SIZEOF_LONG 8 +#else +#error "Unsupported number of bytes in `long' type!" +#endif + + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#define TT_CONFIG_OPTION_STATIC_RASTER + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/debugger/Makefile b/Build/source/libs/libttf/arch/debugger/Makefile new file mode 100644 index 00000000000..6da004b8526 --- /dev/null +++ b/Build/source/libs/libttf/arch/debugger/Makefile @@ -0,0 +1,96 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for emx-gcc under OS/2 or under +# Unix with extra debugging capabilities. +# +# You will need GNU make. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/debugger/Makefile + +ARCH = arch/debugger +FT_MAKEFILE = $(ARCH)/Makefile + +CC = gcc + +#CFLAGS = -W -Wall -O0 -g -ansi -pedantic -I$(ARCH) -I. -Iextend + +CFLAGS = -Wall -O0 -g -ansi -I$(ARCH) -I. -Iextend + +#CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend + +# Detect OS/2 to add the flag -DOS2 when compiling ttinterp.c +# +ifdef OS2_SHELL +OS := OS2 +RM := del +else +OS := UNIX # Unix build otherwise +RM := rm -f +endif + +TTFILE = ./ttfile.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxopen.c \ + extend/ftxgdef.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + +# We place the library file in the ARCH directory, so that it doesn't +# interfere with the normal build. +# +LIBTTF_A = $(ARCH)/libttf.a + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< -D$(OS) + +.PHONY: all debug clean distclean depend + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S $(LIBTTF_A) + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M $(LIBTTF_A) + +$(OBJ_S): $(SRC_S) $(SRC_M) + +$(LIBTTF_A): $($(LIB_FILES)) + -$(RM) $@ + ar src $@ $^ + +clean: +ifdef OS2_SHELL + -$(RM) $(subst /,\,$(LIBTTF_A)) + -$(RM) $(subst /,\,$(OBJS_S)) +else + -$(RM) $(LIBTTF_A) + -$(RM) $(OBJS_S) +endif + +distclean: clean + -$(RM) dep.end + +depend: $(SRC_S) $(SRC_M) $(SRC_X) + $(CC) $(CFLAGS) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile diff --git a/Build/source/libs/libttf/arch/debugger/freetype.c b/Build/source/libs/libttf/arch/debugger/freetype.c new file mode 100644 index 00000000000..b431cdfadc5 --- /dev/null +++ b/Build/source/libs/libttf/arch/debugger/freetype.c @@ -0,0 +1,32 @@ +/* This file is part of the FreeType project */ + +/* Single file library component for the debugging target */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#include "ttfile.c" +#include "ttmemory.c" +#include "ttmutex.c" + +/* the extensions are compiled separately, but we need to */ +/* include the file ttextend.c if we want to support them */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + +/* END */ diff --git a/Build/source/libs/libttf/arch/debugger/ft_conf.h b/Build/source/libs/libttf/arch/debugger/ft_conf.h new file mode 100644 index 00000000000..061b3781f5d --- /dev/null +++ b/Build/source/libs/libttf/arch/debugger/ft_conf.h @@ -0,0 +1,236 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for a debugging build */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. Unix-specific */ +#undef HAVE_FCNTL_H + +/* command.com can't pipe stderr into a file; any message would be */ +/* written into the graphics screen. */ +#define HAVE_PRINT_FUNCTION 1 + +#define Print( format, ap ) vfprintf( stdout, (format), (ap) ) + + +/* The number of bytes in a int. We use the ANSI header file limits.h */ +/* for determining it since there is no easy way to guess. */ +/* */ +#include <limits.h> +#if UINT_MAX == 0xFFFF +#define SIZEOF_INT 2 +#elif UINT_MAX == 0xFFFFFFFF +#define SIZEOF_INT 4 +#else +#error "Unsupported number of bytes in `int' type!" +#endif + +/* We now try to guess the size of longs in the same way */ +/* */ +#if ULONG_MAX == 0xFFFFFFFF +#define SIZEOF_LONG 4 +#elif ULONG_MAX == 0xFFFFFFFFFFFFFFFF +#define SIZEOF_LONG 8 +#else +#error "Unsupported number of bytes in `long' type!" +#endif + + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ +/* */ +/* For debugging, we use a jump table; this allows some interesting */ +/* things during development. */ + +#undef TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a `static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine. */ +/* */ +/* We use a static interpreter in the debugger; this helps in setting */ +/* data breakpoints to fixed memory addresses. */ + +#define TT_CONFIG_OPTION_STATIC_INTERPRETER + +/* an extra for the debugger */ +#define DEBUG_INTERPRETER + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ + +#define TT_CONFIG_OPTION_STATIC_RASTER + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode. */ +/* Set to DEBUG_LEVEL_TRACE for the debugger. */ +#define DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/mac/README b/Build/source/libs/libttf/arch/mac/README new file mode 100644 index 00000000000..80334869bdd --- /dev/null +++ b/Build/source/libs/libttf/arch/mac/README @@ -0,0 +1,47 @@ + +This is the readme of the freetype.hqx archive in the contrib/mac +subdirectory. Please note that the FreeType team does *not* support the +Macintosh platform due to lack of knowledge. All questions regarding the +code should be sent to both David Williss and the freetype-devel list. + + +---------------------------------------------------------------------------- + + +These are CodeWarrior projects for building the FreeType library on a Macintosh +I've only provided PPC projects here, but building for 68K shouldn't be hard. +There are two directories here (OK, "folders"). One contains a project for +building freetype.ppc.lib and the other is for freetype.ppc.dll. (I havn't +actually tested the DLL yet.) + +The Macintosh stores TrueType fonts in a "Fonts" folder under the "System" +folder. There is a standard MacOS API for finding this folder, so I use it. +However, the fonts aren't normal flat files. They have all the data in +resources in the resource fork. Each font is an 'sfnt' resource, and each +file can have more than one 'sfnt' resource. + +To get at them, I made a copy of ttmmap.c from the Unix implementation and +modified it to load/release the resource and lock/unlock the handle as needed. +This only required a change to the open and close functions. After that, it +works just as if it was using Unix memory mapping. + +One thing however. Because of the bizarre scheme for storing the fonts, I +made up a way of specifying the font filename. + + fonts:/fontfile/fontname + +Where fonts:/ is a literal string that means "the fonts folder", fontfile is +the name of the actual file and fontname is the name of the 'sfnt' resource. +Currently, this is the only thing it understands. It might be nice if some +day (2.0 maybe?) ttfile.c and ttmmap.c wern't mutialy exclusive and it could +decide which method to use based on the filename or something. + +Another thing that I had to change to make this work. It seems that Macintosh +TrueType fonts have no OS/2 table, so ttload.c needs to be modified to make +that nonfatal, at least on a Macintosh. + +--- + +David Williss +MicroImages, Inc. +dwilliss@microimages.com diff --git a/Build/source/libs/libttf/arch/mac/freetype.c b/Build/source/libs/libttf/arch/mac/freetype.c new file mode 100644 index 00000000000..5db4438d373 --- /dev/null +++ b/Build/source/libs/libttf/arch/mac/freetype.c @@ -0,0 +1,48 @@ +/* This file is *not* part of the FreeType project, because the team */ +/* lacks the necessary expertise to support it. */ + +/* freetype.c for MacOS */ +/* single object library component for MacOS */ + +/* Written by Dave Willis <dwilliss@microimages.com> on 1998-07-30. */ +/* Modified by Antoine Leca for the 1.3 release, but untested. */ + +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* Note, you should define the EXPORT_DEF and EXPORT_FUNC macros here */ +/* if you want to build a DLL. If undefined, the macros are defined */ +/* as "export" and "" (i.e. nothing), which is the normal behaviour. */ +/* The macros are placed before each high-level API function */ +/* declaration. You can then use them to take any compiler-specific */ +/* pragma for DLL-exported symbols. See 'ttconfig.h' for details. */ + + +/* first include common core components */ + +#define MAC_MAIN_OBJECT +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#include "ttmmap.c" /* Was "ttfile.c" */ +#include "ttmemory.c" +#include "ttmutex.c" + +/* finally, add some extensions */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/mac/ft_conf.h b/Build/source/libs/libttf/arch/mac/ft_conf.h new file mode 100644 index 00000000000..4043ae5250e --- /dev/null +++ b/Build/source/libs/libttf/arch/mac/ft_conf.h @@ -0,0 +1,211 @@ +/* This file is *not* part of the FreeType project, because the team */ +/* lacks the necessary expertise to support it. */ + +/* ft_conf.h for MacOS */ + +/* Written by Dave Willis <dwilliss@microimages.com> on 1998-07-30. */ +/* Modified by Antoine Leca for the 1.3 release, but untested. */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the 'const' keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/mac/ttmmap.c b/Build/source/libs/libttf/arch/mac/ttmmap.c new file mode 100644 index 00000000000..3a7a917fb33 --- /dev/null +++ b/Build/source/libs/libttf/arch/mac/ttmmap.c @@ -0,0 +1,1069 @@ +/******************************************************************* + * + * ttmmap.c 2.0 + * + * Memory-Mapped file component ( replaces ttfile.c ). + * + * Copyright 1996-1998 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. + * + * Changes between 2.0 and 1.3 : + * + * - adopted new design/separation introduced in ttfile.c 2.0 + * + ******************************************************************/ + +#include "ttconfig.h" + +#include <stdio.h> +#include <string.h> + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#include <folders.h> +#include <resources.h> + + +#include "freetype.h" +#include "tttypes.h" +#include "ttdebug.h" +#include "ttengine.h" +#include "ttmutex.h" +#include "ttmemory.h" +#include "ttfile.h" /* our prototypes */ + + /* This definition is mandatory for each file component! */ + EXPORT_FUNC + const TFileFrame TT_Null_FileFrame = { NULL, 0, 0 }; + + /* It has proven useful to do some bounds checks during */ + /* development phase. Define DEBUG_FILE when compiling */ + /* this component to enable them. */ + +#ifdef DEBUG_FILE +#define CHECK_FRAME( frame, n ) \ + do { \ + if ( frame.cursor+n > frame.address + frame.size ) \ + Panic( "Frame boundary error!\n" ); \ + } while ( 0 ) +#else +#define CHECK_FRAME( frame, n ) \ + do { \ + } while( 0 ) +#endif + + struct _TFileMap + { + String* base; /* base address of mapped file */ + Int refcount; /* reference count for handle region */ + Long size; /* stream size in file */ + Long offset; /* offset in file */ + Handle handle; /* Macintosh style handle to lock/unlock */ + short resid; /* Id of resource file to close when done */ + }; + + typedef struct _TFileMap TFileMap; + +#define MAP_Address( map ) (Byte*)( (map)->base + (map)->offset ) + + /* The stream record structure */ + typedef struct _TStream_Rec + { + TFileMap* map; /* mapped file description */ + Long pos ; /* cursor in mapped file */ + } TStream_Rec; + + typedef TStream_Rec* PStream_Rec; + +#define STREAM2REC( x ) ( (TStream_Rec*)HANDLE_Val( x ) ) + + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /**** ****/ + /**** N O N R E E N T R A N T I M P L E M E N T A T I O N ****/ + /**** ****/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + + /* The TFile_Component structure holds all the data that was */ + /* previously declared static or global in this component. */ + /* */ + /* It is accessible through the 'engine.file_component' */ + /* variable in re-entrant builds, or directly through the */ + /* static 'files' variable in other builds. */ + + struct _TFile_Component + { + TMutex lock; /* used by the thread-safe build only */ + PStream_Rec stream; /* current stream */ + TFileFrame frame; /* current frame */ + }; + + typedef struct _TFile_Component TFile_Component; + +/* The macro CUR_Stream denotes the current input stream */ +/* Note that for the re-entrant version, the 'stream' name has been */ +/* chosen according to the macro STREAM_ARGS. */ + +/* The macro CUR_Frame denotes the current file frame */ +/* Note that for the re-entrant version, the 'frame' name has been */ +/* chosen according to the macro FRAME_ARGS. */ + +/* The macro STREAM_VAR is used when calling public functions */ +/* that need an 'optional' stream argument. */ + +#define CUR_Stream files.stream /* thread-safe macros */ +#define CUR_Frame files.frame + +#define STREAM_VARS /* void */ +#define STREAM_VAR /* void */ + + /* the 'files' variable is only defined in non-reentrant builds */ + + static TFile_Component files; + + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + MUTEX_Create( files.lock ); + files.stream = NULL; + ZERO_Frame( files.frame ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + MUTEX_Destroy( files.lock ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Copies or duplicates a given stream. + * + * Input : org_stream original stream + * stream target stream (copy or duplicate) + * + * Output : Error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream org_stream, + TT_Stream* stream ) + { + MUTEX_Lock( files.lock ); + *stream = org_stream; + files.stream = STREAM2REC( org_stream ); /* set current stream */ + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream + * + * Output : Error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + HANDLE_Set( *stream, NULL ); + MUTEX_Release( files.lock ); + + return TT_Err_Ok; + } + +#else /* TT_CONFIG_OPTION_THREAD_SAFE */ + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /******** ********/ + /******** R E E N T R A N T I M P L E M E N T A T I O N ********/ + /******** ********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +#define CUR_Stream STREAM2REC( stream ) /* re-entrant macros */ +#define CUR_Frame (*frame) + +#define STREAM_VARS stream, +#define STREAM_VAR stream + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + engine.file_component = NULL; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Copies or duplicates a given stream. + * + * Input : org_stream original stream + * stream target stream (copy or duplicate) + * + * Output : Error code. The output stream is set to NULL in + * case of Failure. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream input_stream, + TT_Stream* copy ) + { + TT_Error error; + PStream_Rec stream_rec; + PStream_Rec copy_rec; + + + stream_rec = STREAM2REC( input_stream ); + + if ( ALLOC( copy_rec, sizeof ( TStream_Rec ) ) ) + goto Fail; + + HANDLE_Set( *copy, copy_rec ); + + copy_rec->map->refcount++; + copy_rec->pos = 0; + + return TT_Err_Ok; + + Fail: + HANDLE_Set( *copy, NULL ); + return error; + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream + * + * Output : error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + return TT_Close_Stream( stream ); + } + +#endif /* TT_CONFIG_OPTION_THREAD_SAFE */ + + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /*********** ***********/ + /*********** C O M M O N I M P L E M E N T A T I O N ***********/ + /*********** ***********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +/******************************************************************* + * + * Function : AllocateMap + * + * Description : Allocates a new map from the table. + * + * Output : Pointer to new stream rec. NULL in case of failure. + * + ******************************************************************/ + + static + TFileMap* Allocate_Map( void ) + { + TFileMap* result; + + + if ( MEM_Alloc( result, sizeof ( TFileMap ) ) ) + return NULL; + + result->refcount = 1; + return result; + } + + +/******************************************************************* + * + * Function : ReleaseMap + * + * Description : Releases a used map to the table if reference i + * counter reaches zero. + * + * Input : map + * + * Output : None. + * + * Note : Called by TT_Close_File() + * + ******************************************************************/ + + static + void Release_Map ( TFileMap* map ) + { + map->refcount--; + if ( map->refcount <= 0 ) + { + /* MacOS System calls */ + HUnlock(map->handle); + ReleaseResource(map->handle); + CloseResFile(map->resid); + + FREE( map ); + } + } + + +/* Whadda ya mean "strdup undefined"? Fine, I'll define my own! */ +static char *mystrdup(const char *str) { + char *ret; + + if ( TT_Alloc(strlen(str) + 1, (void**)&ret) != 0 ) return(NULL); + strcpy(ret, str); + return(ret); + } + +/******************************************************************* + * + * Function : TT_Open_Stream + * + * Description : Opens the font file and saves the total file size. + * + * Input : error address of stream's error variable + * (re-entrant build only). + * filepathname pathname of the file to open + * stream address of target TT_Stream structure + * + * Output : SUCCESS on success, FAILURE on error. + * The target stream is set to -1 in case of failure. + * + ******************************************************************/ +/* +** This is not a totally generic implementation. It currently assumes the filename +** starts with "fonts:" and uses slashes instead of colons like Mac code normally +** would. Given a filename of the form "fonts:/filename/resname", Load the resource +** and lock the handle +** +** The "fonts:" at the beginning is just a convention I came up with to +** indicate the Fonts folder inside the current System folder (find via FindFolder()) +*/ + + LOCAL_FUNC + TT_Error TT_Open_Stream( const String* filepathname, + TT_Stream* stream ) + { + TT_Error error; + Int file; + PStream_Rec stream_rec; + TFileMap* map; + + int size, err = 0; + short vRefNum, res = -1; + Str255 FontName; + char *cp, *p, *fname, *sep; + Str63 myName; + long dirID; + + + if ( ALLOC( *stream, sizeof ( TStream_Rec ) ) ) + return error; + + map = Allocate_Map(); + if ( !map ) + { + error = TT_Err_Out_Of_Memory; + goto Memory_Fail; + } + + stream_rec = STREAM2REC( *stream ); + + /* Find the dirID of the Fonts folder in the current System folder */ + if (FindFolder(kOnSystemDisk, kFontsFolderType, kDontCreateFolder, &vRefNum, &dirID)) + goto File_Fail; + + /* Break the name apart */ + fname = mystrdup(filepathname); /* Make a copy so we can muck with it */ + sep = ":/"; /* Things that can seperate file path componants */ + + strtok(fname, sep); /* Skip over "fonts:" */ + + if ((p = strtok(NULL, sep)) == NULL) /* Get filename */ + goto File_Fail; + strcpy(myName + 1, p); /* Make this a Pascal string (Yuck!) */ + myName[0] = strlen(p); + + if ((p = strtok(NULL, sep)) == NULL) /* Get res name */ + goto File_Fail; + strcpy(FontName+1, p); /* Make this a Pascal string (Yuck!) */ + FontName[0] = strlen(p); + + FREE( fname ); + + if ((cp = strchr(FontName, '.')) != NULL) /* Strip off ".ttf" , if any */ + *cp = 0; + + /* Read the font into a buffer */ + if ((map->resid = HOpenResFile(vRefNum, dirID, myName, fsRdPerm)) == -1) + goto File_Fail; + + if ((map->handle = Get1NamedResource('sfnt', FontName)) == NULL) + goto Map_Fail; + + HLock(map->handle); + map->base = *map->handle; + map->offset = 0; + map->size = GetResourceSizeOnDisk(map->handle); + + if ( map->base == NULL ) + goto Lock_Fail; + + stream_rec->map = map; + stream_rec->pos = 0; + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + CUR_Stream = stream_rec; +#endif + + return TT_Err_Ok; + + Lock_Fail: + ReleaseResource(map->handle); + + Map_Fail: + CloseResFile(map->resid); + + File_Fail: + error = TT_Err_Could_Not_Open_File; + FREE( map ); + + Memory_Fail: + FREE( *stream ); + FREE( fname ); + return error; + } + + +/******************************************************************* + * + * Function : TT_Close_Stream + * + * Description : Closes a stream. + * + * Input : stream + * + * Output : SUCCESS (always) + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TT_Close_Stream( TT_Stream* stream ) + { + PStream_Rec rec = STREAM2REC( *stream ); + + + Release_Map( rec->map ); + FREE( rec ); + + HANDLE_Set( *stream, NULL ); + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Flush_Stream + * + * Description : Flushes a stream, i.e., closes its file handle. + * + * Input : stream address of target TT_Stream structure + * + * Output : Error code + * + * NOTE : Never flush the current opened stream. This means that + * you should _never_ call this function between a + * TT_Use_Stream() and a TT_Done_Stream()! + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Flush_Stream( TT_Stream* stream ) + { + /* XXX - DUMMY IMPLEMENTATION */ + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Stream_Size + * + * Description : Returns the length of a given stream, even if it + * is flushed. + * + * Input : stream the stream + * + * Output : Length of stream in bytes. + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_Stream_Size( TT_Stream stream ) + { + PStream_Rec rec = STREAM2REC( stream ); + + + if ( rec ) + return rec->map->size; + else + return 0; /* invalid stream - return 0 */ + } + + +/******************************************************************* + * + * Function : TT_Seek_File + * + * Description : Seeks the file cursor to a different position. + * + * Input : position new position in file + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Seek_File( STREAM_ARGS Long position ) + { + if ( position > CUR_Stream->map->size ) + return TT_Err_Invalid_File_Offset; + + CUR_Stream->pos = position; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Skip_File + * + * Description : Skips forward the file cursor. + * + * Input : distance number of bytes to skip + * + * Output : see TT_Seek_File + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Skip_File( STREAM_ARGS Long distance ) + { + return TT_Seek_File( STREAM_VARS CUR_Stream->pos + distance ); + } + + +/******************************************************************* + * + * Function : TT_Read_File + * + * Description : Reads a chunk of the file and copies it to memory. + * + * Input : buffer target buffer + * count length in bytes to read + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_File( STREAM_ARGS void* buffer, Long count ) + { + if ( CUR_Stream->pos + count > CUR_Stream->map->size ) + return TT_Err_Invalid_File_Read; + + MEM_Copy( buffer, + MAP_Address( CUR_Stream->map ) + CUR_Stream->pos, count ); + CUR_Stream->pos += count; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Read_At_File + * + * Description : Reads file at a specified position. + * + * Input : position position to seek to before read + * buffer target buffer + * count number of bytes to read + * + * Output : SUCCESS on success. FAILURE if error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_At_File( STREAM_ARGS Long position, + void* buffer, + Long count ) + { + TT_Error error; + + + if ( (error = TT_Seek_File( STREAM_VARS position )) || + (error = TT_Read_File( STREAM_VARS buffer, count )) ) + return error; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_File_Pos + * + * Description : Returns current file seek pointer. + * + * Input : none + * + * Output : current file position + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_File_Pos( STREAM_ARG ) + { + return CUR_Stream->pos; + } + + +/******************************************************************* + * + * Function : TT_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : Error code + * + * Notes: The function fails if the byte range is not within the + * the file, or if there is not enough memory to cache + * the bytes properly (which usually means that aSize is + * too big in both cases). + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( CUR_Stream->pos + size > CUR_Stream->map->size ) + return TT_Err_Invalid_Frame_Access; + + CUR_Frame.size = size; + CUR_Frame.address = MAP_Address( CUR_Stream->map ) + CUR_Stream->pos; + CUR_Frame.cursor = CUR_Frame.address; + + CUR_Stream->pos += size; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Check_And_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : Error code + * + * Notes: The function truncates 'size' if the byte range is not + * within the file. + * + * It will fail if there is not enough memory to cache + * the bytes properly (which usually means that aSize is + * too big). + * + * It will fail if you make two consecutive calls + * to TT_Access_Frame(), without a TT_Forget_Frame() between + * them. + * + * The only difference with TT_Access_Frame() is that we + * check that the frame is within the current file. We + * otherwise truncate it. The 'overflow' is set to zero. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Check_And_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + TT_Error error; + Long readBytes; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + readBytes = CUR_Stream->map->size - CUR_Stream->pos; + if ( size > readBytes ) + { + /* There is overflow, we allocate a new block then */ + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + + CUR_Frame.size = size; + + /* copy the valid part */ + MEM_Copy( CUR_Frame.address, + MAP_Address( CUR_Stream->map ) + CUR_Stream->pos, + readBytes ); + } + else + { + CUR_Frame.size = size; + CUR_Frame.address = MAP_Address( CUR_Stream->map ) + CUR_Stream->pos; + } + + CUR_Frame.cursor = CUR_Frame.address; + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Forget_Frame + * + * Description : Releases a cached frame after reading. + * + * Input : None + * + * Output : SUCCESS on success. FAILURE on error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Forget_Frame( FRAME_ARG ) + { + if ( CUR_Frame.address == NULL ) + return TT_Err_Nested_Frame_Access; + + /* If we were using a duplicate in case of overflow, free it now */ + if ( CUR_Frame.address < (Byte*)CUR_Stream->map->base || + CUR_Frame.address >= (Byte*)CUR_Stream->map->base + + CUR_Stream->map->size ) + FREE( CUR_Frame.address ); + + ZERO_Frame( files.frame ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : GET_Byte + * + * Description : Extracts a byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted Byte + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + Byte TT_Get_Byte( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Byte)(*CUR_Frame.cursor++); + } + +#endif + + +/******************************************************************* + * + * Function : GET_Char + * + * Description : Extracts a signed byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted char + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Char TT_Get_Char( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Char)(*CUR_Frame.cursor++); + } + + +/******************************************************************* + * + * Function : GET_Short + * + * Description : Extracts a short from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted short + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Short TT_Get_Short( FRAME_ARG ) + { + Short getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((Short)CUR_Frame.cursor[0] << 8) | + (Short)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } + + +/******************************************************************* + * + * Function : GET_UShort + * + * Description : Extracts an unsigned short from the frame. + * + * Input : None or current frame + * + * Output : Extracted ushort + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + UShort TT_Get_UShort( FRAME_ARG ) + { + UShort getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((UShort)CUR_Frame.cursor[0] << 8) | + (UShort)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } + +#endif + + +/******************************************************************* + * + * Function : GET_Long + * + * Description : Extracts a long from the frame. + * + * Input : None or current frame + * + * Output : Extracted long + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_Get_Long( FRAME_ARG ) + { + Long getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ((Long)CUR_Frame.cursor[0] << 24) | + ((Long)CUR_Frame.cursor[1] << 16) | + ((Long)CUR_Frame.cursor[2] << 8 ) | + (Long)CUR_Frame.cursor[3]; + + CUR_Frame.cursor += 4; + + return getlong; + } + + +/******************************************************************* + * + * Function : GET_ULong + * + * Description : Extracts an unsigned long from the frame. + * + * Input : None + * + * Output : Extracted ulong + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + ULong TT_Get_ULong( FRAME_ARG ) + { + ULong getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ( ((ULong)CUR_Frame.cursor[0] << 24) | + ((ULong)CUR_Frame.cursor[1] << 16) | + ((ULong)CUR_Frame.cursor[2] << 8 ) | + (ULong)CUR_Frame.cursor[3] ); + + CUR_Frame.cursor += 4; + + return getlong; + } + +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.BC b/Build/source/libs/libttf/arch/msdos/Makefile.BC new file mode 100644 index 00000000000..ba5d50b38cc --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.BC @@ -0,0 +1,132 @@ +# This file is part of the FreeType project. +# +# It builds the library for Borland C++ for MS-DOS, large model. +# Due to size constraints, it does not try to pack all modules into one +# (`single-object mode'). +# +# You will need Borland MAKE. +# Tested with Borland C++ v.3.1, 4.02, 5.0. +# +# Use this file while in the lib directory with the following statement: +# +# make -farch/msdos/Makefile.BC +# +# +# A debug version can be obtained with +# +# make -DDEBUG -farch/msdos/Makefile.BC +# +# A special version enabled to handle big fonts (with more than 16,384 +# glyphs) can be obtained with +# +# make -DBIGFONTS -farch/msdos/Makefile.BC + +ARCH = arch\msdos +FT_MAKEFILE = $(ARCH)\Makefile.BC + +CC = bcc +LIB = tlib /c /e + +# Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern +# Borland compilers (from BC++ 3.1 on) can increase the limit on +# the length of identifiers. +!if ! $d(DEBUG) +CFLAGS = -ml -A -O2 -3 -i40 -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -I$(ARCH);.;extend +!else +CFLAGS = -v -N -ml -A -i40 -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -I$(ARCH);.;extend +!endif + + +!if $d(BIGFONTS) +CFLAGS = $(CFLAGS) -DTT_HUGE_PTR=__huge + +TTFILE = $(ARCH)\.\hugefile.c +TTMEMORY = $(ARCH)\.\hugemem.c +!else +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +!endif +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces before the \ at end of line, +# otherwise the substitution for TLIB command line will fail. +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ + extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c\ + extend\ftxsbit.c extend\ftxgsub.c extend\ftxgpos.c\ + extend\ftxopen.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c\ + ttgload.c ttinterp.c ttload.c ttobjs.c\ + ttraster.c ttextend.c ttdebug.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\.\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Borland's make does not handle $($(LIB_FILES)), and using +# -DLIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing TLIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# It is commented out below. See Makefile.TC for an application. +.c.obj: + $(CC) -c -o$* @&&| + $(CFLAGS) $< +| +# $(LIB) libttf +-$*.obj + + +!if !$d(DEBUG) +# Skipped if DEBUG build +# (but it changes nothing, since we always build in multiple parts). +all: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_M: = + ) +| + +!endif + + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_M: = + ) +| + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(**: = + ) +| + +!if $d(BIGFONTS) +$(TTMEMORY:.c=.obj): $(TTMEMORY) + $(CC) -c -o$* @&&| + $(CFLAGS) -A- $*.c +| +!endif + + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak + -del response + +distclean: clean + -del libttf.lib + +!include "$(ARCH)\depend.dos" + +# end of Makefile diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.MS b/Build/source/libs/libttf/arch/msdos/Makefile.MS new file mode 100644 index 00000000000..3c793faff94 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.MS @@ -0,0 +1,117 @@ +# This file is part of the FreeType project. +# +# It builds the library for Microsoft C for MS-DOS, large model. +# It also works for Visual C++ 1.x 16-bits compiler, but you should +# instead use the Makefile customized for it, Makefile.VC. +# Due to size constraints, it does not try to pack all modules into one. +# +# You will need NMAKE. +# +# Use this file while in the lib directory with the following statement: +# +# nmake /f arch\msdos\Makefile.MS +# +# +# A debug version can be obtained with +# +# nmake DEBUG=1 /f arch\msdos\Makefile.MS +# +# A special version enabled to handle big fonts (with more than 16,384 +# glyphs) can be obtained with +# +# nmake BIGFONTS=1 /f arch\msdos\Makefile.MS + +ARCH = arch\msdos +FT_MAKEFILE = $(ARCH)\Makefile.MS + +CC = cl /nologo +LIB = lib /noignorecase /nologo + +!ifndef DEBUG +CFLAGS = /Ox /AL /W2 /G2 /I$(ARCH) /I. /Iextend +!else +CFLAGS = /Zi /AL /W2 /G2 /I$(ARCH) /I. /Iextend +!endif + + +!ifndef BIGFONTS +CFLAGS = $(CFLAGS) /Za + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +!else +CFLAGS = $(CFLAGS) /DTT_HUGE_PTR=__huge /Ze + +TTFILE = $(ARCH)\hugefile.c +TTMEMORY = $(ARCH)\hugemem.c +!endif + +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces between the file names or at end of line, otherwise +# the substitution for LIB command line will fail. Thank you. +# +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ +extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\ +extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\ +ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using +# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing LIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# It is commented out below. See Makefile.TC for an application. +.c.obj: + @$(CC) /c /Fo$@ @<< + $(CFLAGS) $*.c +<< +# $(LIB) libttf +-$*.obj + + +!ifndef DEBUG +# Skipped if DEBUG build +# (but it changes nothing, since we always build in multiple parts). +all: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = ^ ); +<<KEEP +!endif + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = ^ ); +<<KEEP + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + $(LIB) $@ +-$(?: =-+); + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del response + +distclean: clean + -del libttf.lib + +!include "$(ARCH)\depend.dos" + +# end of Makefile.MS diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.TC b/Build/source/libs/libttf/arch/msdos/Makefile.TC new file mode 100644 index 00000000000..a3316c53f23 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.TC @@ -0,0 +1,86 @@ +# This file is part of the FreeType project. +# +# It builds the library for Turbo C for MS-DOS, large model. +# Due to size constraints, it does not try to pack all modules into one. +# +# You will need Borland MAKE. +# Tested with Turbo C v.1.5, v.2.0, Turbo C++ v.1.0 +# Turbo C v.1.0 (May '87) is too old (lack of structure assignment) +# to compile FreeType. Update your compiler. ;-) +# +# Use this file while in the lib directory with the following statement: +# +# make -farch/msdos/Makefile.TC +# +# +# A debug version can be obtained (except for TC1.5) with +# +# make -DDEBUG -farch/msdos/Makefile.TC + +ARCH = arch\msdos +FT_MAKEFILE = $(ARCH)\Makefile.TC + +CC = tcc +LIB = tlib /c + +!if ! $d(DEBUG) +CFLAGS = -ml -A -a -G -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -I$(ARCH);.;extend +!else +# For Turbo C v.1.5, replace the -v option below by -y. +CFLAGS = -v -N -ml -A -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -I$(ARCH);.;extend +!endif + + +TTFILE = .\ttfile.obj +TTMEMORY = .\ttmemory.obj +TTMUTEX = .\ttmutex.obj + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +OBJS_X = extend\ftxgasp.obj extend\ftxkern.obj extend\ftxpost.obj \ + extend\ftxcmap.obj extend\ftxwidth.obj extend\ftxerr18.obj \ + extend\ftxsbit.obj extend\ftxopen.obj extend\ftxgsub.obj \ + extend\ftxgpos.obj extend\ftxgdef.obj +# the line below does not work with these old versions of make... +# OBJS_X = $(SRC_X:.c=.obj) + +OBJS_M = ttapi.obj ttcache.obj ttcalc.obj ttcmap.obj ttdebug.obj \ + ttgload.obj ttinterp.obj ttload.obj ttobjs.obj \ + ttraster.obj ttextend.obj $(PORT) $(OBJS_X) +# OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +# Not used here because the compiler runs out of memory... +OBJ_S = $(ARCH)\freetype.obj +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Borland's make is very primitive, we include each .obj +# in the library as soon as it is compiled. + +.c.obj: + $(CC) $(CFLAGS) -c -o$* $< + $(LIB) libttf +-$*.obj + + +!if !$d(DEBUG) +# Skipped if DEBUG build +# (but it changes nothing, since we always build in multiple parts). +all: $(OBJS_M) + +!endif + +debug: $(OBJS_M) + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak +# -del response + +distclean: clean + -del libttf.lib + +!include "$(ARCH)\depend.dos" + +# end of Makefile diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.VC b/Build/source/libs/libttf/arch/msdos/Makefile.VC new file mode 100644 index 00000000000..e9d0855ad08 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.VC @@ -0,0 +1,117 @@ +# This file is part of the FreeType project. +# +# It builds the library for Microsoft Visual C++ 1.x for MS-DOS, large model. +# It also works for Microsoft C/C++ v.7.0 16-bit compiler, but not for +# previous versions (use Makefile.MS instead). +# +# You will need NMAKE. +# +# Use this file while in the lib directory with the following statement: +# +# nmake /f arch\msdos\Makefile.VC +# +# +# A debug version can be obtained with +# +# nmake DEBUG=1 /f arch\msdos\Makefile.VC +# +# A special version enabled to handle big fonts (with more than 16,384 +# glyphs) can be obtained with +# +# nmake BIGFONTS=1 /f arch\msdos\Makefile.VC + +ARCH = arch\msdos +FT_MAKEFILE = $(ARCH)\Makefile.VC + +CC = cl /nologo +LIB = lib /noignorecase /nologo + +# One can also consider using "set MSC_CMD_FLAGS=/Gr /Op- /Gy /YX". +# With Microsoft C/C++ 7.0, use /G2 instead of /G3. +!ifndef DEBUG +CFLAGS = $(CFLAGS) /Ox /AL /W2 /G3 /I$(ARCH) /I. /Iextend +!else +CFLAGS = $(CFLAGS) /Zi /Ge /AL /W2 /G3 /I$(ARCH) /I. /Iextend +!endif + + +!ifndef BIGFONTS +CFLAGS = $(CFLAGS) /Za + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +!else +CFLAGS = $(CFLAGS) /DTT_HUGE_PTR=__huge /Ze + +TTFILE = $(ARCH)\hugefile.c +TTMEMORY = $(ARCH)\hugemem.c +!endif + +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces between the file names or at end of line, otherwise +# the substitution for LIB command line will fail. Thank you. +# +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ +extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\ +extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\ +ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using +# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing LIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# It is commented out below. See Makefile.TC for an application. +.c.obj: + @$(CC) /c /Fo$@ @<< + $(CFLAGS) $*.c +<< +# $(LIB) libttf +-$*.obj + + +!ifndef DEBUG +# Skipped if DEBUG build +all: $(OBJS_S) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_S: = + ); +<<KEEP +!endif + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = + ); +<<KEEP + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + $(LIB) $@ +-$(?: =-+); + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del response + +distclean: clean + -del libttf.lib + +!include "$(ARCH)\depend.dos" + +# end of Makefile.VC diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.dm b/Build/source/libs/libttf/arch/msdos/Makefile.dm new file mode 100644 index 00000000000..710c355bf53 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.dm @@ -0,0 +1,84 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for emx-gcc or djgpp under MSDOS. +# +# You will need dmake. +# +# Use this file while in the lib directory with the following statement: +# +# dmake -r -f arch/msdos/Makefile.dm + +ARCH = arch/msdos +FT_MAKEFILE = $(ARCH)/Makefile.dm +FT_MAKE = dmake -r + +.IMPORT: COMSPEC +SHELL := $(COMSPEC) +SHELLFLAGS := /c +GROUPSHELL := $(SHELL) +GROUPFLAGS := $(SHELLFLAGS) +GROUPSUFFIX := .bat +SHELLMETAS := *"?<>&| + +CC = gcc + +CFLAGS = -Wall -O2 -g -ansi -pedantic -I$(ARCH) -I. -Iextend +# CFLAGS = -Wall -ansi -O2 -s -I$(ARCH) -I. -Iextend + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxopen.c \ + extend/ftxgdef.c extend/ftxerr18.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttfile.c ttgload.c ttinterp.c ttload.c \ + ttmemory.c ttmutex.c ttobjs.c ttraster.c ttextend.c +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a + + +$(OBJ_S): $(SRC_S) $(SRC_M) + $(CC) $(CFLAGS) -c -o $@ $(SRC_S) + +libttf.a: $($(LIB_FILES)) + +-del $@ + ar src $@ @$(mktmp $(<:t"\n")\n) + +clean: +-[ + del *.o + del extend\*.o + del $(ARCH)\*.o +] + +distclean: clean +-[ + del dep.end + del libttf.a +] + +# depend: $(SRC_S) $(SRC_M) $(SRC_X) +# $(CC) -E -M @$(mktmp $(<:t"\n")\n) > dep.end + +# ifeq (dep.end,$(wildcard dep.end)) +# include dep.end +# endif + +# end of Makefile.dm diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.gcc b/Build/source/libs/libttf/arch/msdos/Makefile.gcc new file mode 100644 index 00000000000..3325538fb4a --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.gcc @@ -0,0 +1,92 @@ +# This file is part of the FreeType project. +# +# It builds the library for emx-gcc or djgpp under MSDOS. +# +# You will need GNU make. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/msdos/Makefile.gcc +# +# If you have the GNU gettext package installed with DJGPP, you can also try +# +# make -f arch/msdos/Makefile.gcc HAVE_GETTEXT + +ARCH = arch/msdos +FT_MAKEFILE = $(ARCH)/Makefile.gcc + +CC = gcc + +ifndef GETTEXT +GETTEXT=NO_GETTEXT +endif + +ifdef DEBUG +CFLAGS = -Wall -O2 -g -ansi -pedantic -I$(ARCH) -I. -Iextend -D$(GETTEXT) +else +CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend -D$(GETTEXT) +endif + + +TTFILE = ./ttfile.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxgdef.c \ + extend/ftxopen.c extend/ftxerr18.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M DEBUG=1 libttf.a + +HAVE_GETTEXT: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S GETTEXT=HAVE_GETTEXT \ + libttf.a + +$(OBJ_S): $(SRC_S) $(SRC_M) + +libttf.a: $($(LIB_FILES)) + -del $@ + ar src $@ $^ + +clean: + -del *.o + -del extend\*.o + -del $(ARCH)\*.o + -del response + +distclean: clean + -del dep.end + -del libttf.a + +depend: $(SRS_S) $(SRC_M) $(SRC_X) + $(CC) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile.gcc diff --git a/Build/source/libs/libttf/arch/msdos/Makefile.wat b/Build/source/libs/libttf/arch/msdos/Makefile.wat new file mode 100644 index 00000000000..e2df1e36f44 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/Makefile.wat @@ -0,0 +1,88 @@ +# This file is part of the FreeType project +# +# This builds the Watcom library with Watcom's wcc386 under DOS +# +# You'll need Watcom's wmake +# +# +# Invoke by "wmake -f arch\msdos\Makefile.wat" while in the "lib" directory +# +# This will build "freetype\lib\libttf.lib" +# + +ARCH = arch\msdos +FT_MAKEFILE = $(ARCH)\Makefile.wat +FT_MAKE = wmake -h + + +.EXTENSIONS: +.EXTENSIONS: .lib .obj .c .h +.obj:.;.\extend;.\$(ARCH) +.c:.;.\extend;.\$(ARCH) +.h:.;.\extend;.\$(ARCH) + +CC = wcc386 + +CCFLAGS = /otexanl+ /s /w4 /zq /d3 -I$(ARCH) -I. -Iextend + + +# FIXME: should use something like OBJ = $(SRC:.c=.obj) + +SRC_X = ftxgasp.c ftxkern.c ftxpost.c & + ftxcmap.c ftxwidth.c ftxsbit.c ftxerr18.c & + ftxgsub.c ftxgpos.c ftxopen.c ftxgdef.c +OBJS_X = ftxgasp.obj ftxkern.obj ftxpost.obj & + ftxcmap.obj ftxwidth.obj ftxsbit.obj ftxerr18.obj & + ftxgsub.obj ftxgpos.obj ftxopen.obj ftxgdef.obj + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c & + ttfile.c ttgload.c ttinterp.c & + ttload.c ttmemory.c ttmutex.c ttobjs.c ttraster.c & + ttextend.c +OBJS_M = ttapi.obj ttcache.obj ttcalc.obj ttcmap.obj ttdebug.obj & + ttfile.obj ttgload.obj ttinterp.obj & + ttload.obj ttmemory.obj ttmutex.obj ttobjs.obj ttraster.obj & + ttextend.obj $(OBJS_X) + +SRC_S = freetype.c +OBJ_S = freetype.obj +OBJS_S = $(OBJ_S) $(OBJ_X) + + +.c.obj: + $(CC) $(CCFLAGS) $[* /fo=$[*.obj + +libname = libttf +libfile = $(libname).lib +cmdfile = $(libname).lst + + +all: .symbolic + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S $(libfile) + +debug: .symbolic + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M $(libfile) + + +$(libfile): $($(LIB_FILES)) + wlib -q -n $(libfile) @$(cmdfile) + +# is this correct? Know nothing about wmake and the Watcom compiler... +$(OBJ_S): $(SRC_S) $(SRC_M) + $(CC) $(CCFLAGS) $(SRC_S) /fo=$(OBJ_S) + +$(cmdfile): $($(LIB_FILES)) + @for %i in ($($(LIB_FILES))) do @%append $(cmdfile) +-%i + +clean: .symbolic + @-erase $(OBJ_S) + @-erase $(OBJS_M) + @-erase $(cmdfile) + +distclean: .symbolic clean + @-erase $(libfile) + +new: .symbolic + @-wtouch *.c + +# end of Makefile.wat diff --git a/Build/source/libs/libttf/arch/msdos/depend.dos b/Build/source/libs/libttf/arch/msdos/depend.dos new file mode 100644 index 00000000000..9039c57d2df --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/depend.dos @@ -0,0 +1,107 @@ +# This dependency file to be used with various MS-DOS compilers +# has been generated automatically with the script `makedep' on +# 07-Mar-2000. + +ttapi.obj: ttapi.c ttconfig.h arch\msdos\ft_conf.h freetype.h fterrid.h \ + ftnameid.h ttengine.h tttypes.h ttmutex.h ttcalc.h ttmemory.h \ + ttcache.h ttfile.h ttdebug.h ttobjs.h tttables.h ttcmap.h ttload.h \ + ttgload.h ttraster.h ttextend.h +ttcache.obj: ttcache.c ttengine.h tttypes.h ttconfig.h \ + arch\msdos\ft_conf.h freetype.h fterrid.h ftnameid.h ttmutex.h \ + ttmemory.h ttcache.h ttobjs.h tttables.h ttcmap.h ttdebug.h +ttcalc.obj: ttcalc.c ttcalc.h ttconfig.h arch\msdos\ft_conf.h freetype.h \ + fterrid.h ftnameid.h ttdebug.h tttypes.h tttables.h +ttcmap.obj: ttcmap.c ttobjs.h ttconfig.h arch\msdos\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttdebug.h ttfile.h ttmemory.h ttload.h +ttdebug.obj: ttdebug.c ttdebug.h ttconfig.h arch\msdos\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h tttables.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h ttcmap.h +ttextend.obj: ttextend.c ttextend.h ttconfig.h arch\msdos\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttmemory.h +ttfile.obj: ttfile.c ttconfig.h arch\msdos\ft_conf.h freetype.h \ + fterrid.h ftnameid.h tttypes.h ttdebug.h ttengine.h ttmutex.h \ + ttmemory.h ttfile.h +ttgload.obj: ttgload.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h ttgload.h \ + ttmemory.h tttags.h ttload.h +ttinterp.obj: ttinterp.c freetype.h fterrid.h ftnameid.h tttypes.h \ + ttconfig.h arch\msdos\ft_conf.h ttdebug.h ttcalc.h ttmemory.h \ + ttinterp.h ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h \ + ttcmap.h +ttload.obj: ttload.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h \ + ttmemory.h tttags.h ttload.h +ttmemory.obj: ttmemory.c ttdebug.h ttconfig.h arch\msdos\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmemory.h ttengine.h \ + ttmutex.h +ttmutex.obj: ttmutex.c ttmutex.h ttconfig.h arch\msdos\ft_conf.h +ttobjs.obj: ttobjs.c ttobjs.h ttconfig.h arch\msdos\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttfile.h ttdebug.h ttcalc.h ttmemory.h ttload.h \ + ttinterp.h ttextend.h +ttraster.obj: ttraster.c ttraster.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttengine.h tttypes.h ttmutex.h \ + ttdebug.h ttcalc.h ttmemory.h +extend\ftxcmap.obj: extend\ftxcmap.c extend\ftxcmap.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\msdos\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxerr18.obj: extend\ftxerr18.c ttconfig.h arch\msdos\ft_conf.h \ + extend\ftxerr18.h freetype.h fterrid.h ftnameid.h extend\ftxkern.h \ + extend\ftxpost.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h +extend\ftxgasp.obj: extend\ftxgasp.c extend\ftxgasp.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\msdos\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxgdef.obj: extend\ftxgdef.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgpos.obj: extend\ftxgpos.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgsub.obj: extend\ftxgsub.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxkern.obj: extend\ftxkern.c extend\ftxkern.h freetype.h fterrid.h \ + ftnameid.h ttextend.h ttconfig.h arch\msdos\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttdebug.h \ + ttmemory.h ttfile.h ttload.h tttags.h +extend\ftxopen.obj: extend\ftxopen.c tttypes.h ttconfig.h arch\msdos\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxpost.obj: extend\ftxpost.c extend\ftxpost.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\msdos\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttload.h ttfile.h \ + ttdebug.h tttags.h ttmemory.h ttextend.h +extend\ftxsbit.obj: extend\ftxsbit.c extend\ftxsbit.h freetype.h fterrid.h \ + ftnameid.h ttobjs.h ttconfig.h arch\msdos\ft_conf.h ttengine.h \ + tttypes.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h ttdebug.h \ + ttload.h ttmemory.h tttags.h ttextend.h +extend\ftxwidth.obj: extend\ftxwidth.c extend\ftxwidth.h freetype.h fterrid.h \ + ftnameid.h ttdebug.h ttconfig.h arch\msdos\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h \ + tttags.h ttload.h +arch\msdos\freetype.obj: arch\msdos\freetype.c ttapi.c ttconfig.h \ + arch\msdos\ft_conf.h freetype.h fterrid.h ftnameid.h ttengine.h \ + tttypes.h ttmutex.h ttcalc.h ttmemory.h ttcache.h ttfile.h ttdebug.h \ + ttobjs.h tttables.h ttcmap.h ttload.h ttgload.h ttraster.h ttextend.h \ + ttcache.c ttcalc.c ttcmap.c ttdebug.c ttgload.c tttags.h ttinterp.c \ + ttinterp.h ttload.c ttobjs.c ttraster.c arch\msdos\hugefile.c \ + ttfile.c arch\msdos\hugemem.c ttmutex.c ttextend.c +arch\msdos\hugefile.obj: arch\msdos\hugefile.c ttconfig.h arch\msdos\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttfile.c ttdebug.h \ + ttengine.h ttmutex.h ttmemory.h ttfile.h +arch\msdos\hugemem.obj: arch\msdos\hugemem.c ttdebug.h ttconfig.h \ + arch\msdos\ft_conf.h tttypes.h freetype.h fterrid.h ftnameid.h \ + ttmemory.h ttengine.h ttmutex.h diff --git a/Build/source/libs/libttf/arch/msdos/freetype.c b/Build/source/libs/libttf/arch/msdos/freetype.c new file mode 100644 index 00000000000..943d5f24776 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/freetype.c @@ -0,0 +1,39 @@ +/* This file is part of the FreeType project */ + +/* Single object library component for MSDOS. */ +/* Note that low-optimizing 16-bit compilers (such as Borland ones) can't */ +/* successfully compile this file, because it exceeds 64K of code size. */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#ifdef TT_HUGE_PTR +#include "arch/msdos/hugefile.c" +#include "arch/msdos/hugemem.c" +#else +#include "ttfile.c" +#include "ttmemory.c" +#endif +#include "ttmutex.c" + +/* finally, add some extensions */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/msdos/ft_conf.h b/Build/source/libs/libttf/arch/msdos/ft_conf.h new file mode 100644 index 00000000000..0199a5c2027 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/ft_conf.h @@ -0,0 +1,253 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for MSDOS */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ +#if defined( __EMX__ ) || defined( __DJGPP__ ) || defined( __GO32__ ) +/* some compilers are known to have <unistd.h>; */ +/* add yours if needed, and report to us the update. */ +#define HAVE_UNISTD_H +#else +/* most MS-DOS compilers lack <unistd.h> */ +#undef HAVE_UNISTD_H +#endif + +/* Define if you need <conio.h> for console I/O functions. */ +#ifdef __EMX__ +#define HAVE_CONIO_H +#endif + +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the libintl library. */ +#undef HAVE_LIBINTL + +/* DJGPP v.2 may feature the GNU gettext package, with some subtleties. */ +/* The macro HAVE_GETTEXT has to be set in the makefile. */ +#ifdef HAVE_GETTEXT +#define HAVE_LOCALE_H +#define HAVE_LIBINTL_H +#define HAVE_LIBINTL +#define LOCALEDIR "/usr/djgpp/share/locale" +/* Due to a name conflict, gettext is renamed gettext__ in DJGPP */ +#define gettext( str ) gettext__( str ) +#endif + +/* command.com can't pipe stderr into a file; any message would be */ +/* written into the graphics screen. */ +#define HAVE_PRINT_FUNCTION 1 + +#define Print( format, ap ) vfprintf( stdout, (format), (ap) ) + +/* The number of bytes in a int. We use the ANSI header file limits.h */ +/* for determining it since there is no easy way to guess. */ +#include <limits.h> +#if UINT_MAX == 0xFFFF +#define SIZEOF_INT 2 +#elif UINT_MAX == 0xFFFFFFFF +#define SIZEOF_INT 4 +#else +#error "Unsupported number of bytes in `int' type!" +#endif + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/msdos/hugefile.c b/Build/source/libs/libttf/arch/msdos/hugefile.c new file mode 100644 index 00000000000..901e0d6eae5 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/hugefile.c @@ -0,0 +1,84 @@ +/******************************************************************* + * + * hugefile.c + * + * File I/O Component (body) for dealing with "huge" objects under + * MS-DOS. Relies on the "default" version, with a small hook. + * + * Written by Antoine Leca based on ideas from Dave Hoo. + * Copyright 1999 by Dave Hoo, Antoine Leca, + * 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. + * + * NOTE + * + * This file #includes the normal version, to avoid discrepancies + * between versions. It uses only ANSI-mandated "tricks", so + * any ANSI-compliant compiler should be able to compile this file. + * + ******************************************************************/ + +#include "ttconfig.h" +#include "tttypes.h" + +/* Here we include <stdio.h>, to have the proper definition of fread */ +#include <stdio.h> + +/* Then, we divert the use of fread to our version */ +#undef fread +#define fread(ptr, size, n, stream) huge_fread(ptr, size, n, stream) + + LOCAL_FUNC + Long huge_fread ( void *ptr, size_t size, Long n, FILE *stream ); + +/* Now, we include the "normal" version of ttfile.c */ +/* The ANSI/ISO standard mandates that the include of <stdio.h> */ +/* there have no bad effects. */ +#include "ttfile.c" + +/* Then, we define our implementation of fread that makes use of */ +/* "huge"-allocated memory. */ + +/******************************************************************* + * + * Function : huge_fread + * + * Description : replacement version of fread that handles + * "huge"-allocated memory. + * + * Input : See the reference for the runtime library function fread + * + * Output : See the reference for the runtime library function fread + * + * Notes : + * + ******************************************************************/ + + LOCAL_DEF + Long huge_fread ( void *ptr, size_t size, Long n, FILE *stream ) + { + char TT_HUGE_PTR * p = (char TT_HUGE_PTR *) ptr; + ULong left = (ULong)n * size; + size_t toRead; + + while ( left ) + { + toRead = (left > 0x8000) ? 0x8000 : left; + if ( (fread)( p, 1, toRead, stream ) != toRead) + return -1; + else + { + left -= (ULong) toRead; + p += toRead; + } + } + return n * size; + } + + +/* END */ diff --git a/Build/source/libs/libttf/arch/msdos/hugemem.c b/Build/source/libs/libttf/arch/msdos/hugemem.c new file mode 100644 index 00000000000..aa44c69f01f --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/hugemem.c @@ -0,0 +1,496 @@ +/******************************************************************* + * + * hugemem.c + * + * Memory management component (body) + * for dealing with "huge" objects with 16-bit MS-DOS. + * + * Written by Dave Hoo and Antoine Leca. + * Copyright 1999 by Dave Hoo, Antoine Leca, + * 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. + * + ******************************************************************/ + +#include <limits.h> + +#include "ttdebug.h" +#include "ttmemory.h" +#include "ttengine.h" + +#ifndef TT_HUGE_PTR +#error "This component needs TT_HUGE_PTR to be #defined." +#endif + +/* ---- Microsoft C compilers support ------------------------------------ */ + +#if defined( M_I86 ) || defined( _M_I86 ) + +#include <malloc.h> +#define huge_alloc( size ) _halloc ( size, 1 ) +#define huge_free( block ) _hfree ( block ) + +#endif /* Microsoft compilers */ + +/* ---- Borland C compiler support --------------------------------------- */ + +#ifdef __TURBOC__ + +#include <alloc.h> +#define huge_alloc( size ) farmalloc ( size ) +#define huge_free( block ) farfree ( block ) + +#endif + +#if !defined( huge_alloc ) || !defined( huge_free ) +#error "Your compiler is not (yet) supported. Check the source file!" +#endif + +#ifdef TT_CONFIG_OPTION_THREAD_SAFE +#error "This component needs static allocation and is not re-entrant." +#endif + +/* required by the tracing mode */ +#undef TT_COMPONENT +#define TT_COMPONENT trace_memory + + +#ifdef DEBUG_MEMORY + +#include <stdio.h> + +#define MAX_TRACKED_BLOCKS 1024 + + struct TMemRec_ + { + void* base; + Long size; + }; + + typedef struct TMemRec_ TMemRec; + + static TMemRec pointers[MAX_TRACKED_BLOCKS + 1]; + + static Int num_alloc; + static Int num_free; + static Int num_realloc; /* counts only `real' reallocations + (i.e., an existing buffer will be resized + to a value larger than zero */ + + static Int fail_alloc; + static Int fail_realloc; + static Int fail_free; + +#else + + /* We need a tracing stack of the calls to big chunks of memory, */ + /* in order to call the matching version of free(). */ + +#define MAX_TRACKED_BIGCHUNKS 16 + + struct TMemRec_ + { + void* base; + Long size; + }; + + typedef struct TMemRec_ TMemRec; + + static TMemRec pointers[MAX_TRACKED_BIGCHUNKS + 1]; + +#endif /* DEBUG_MEMORY */ + + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + Long TTMemory_Allocated; + Long TTMemory_MaxAllocated; +#endif + + +/******************************************************************* + * + * Function : TT_Alloc + * + * Description : Allocates memory from the heap buffer. + * + * Input : Size size of the memory to be allocated + * P pointer to a buffer pointer + * + * Output : Error code. + * + * NOTE : The newly allocated block should _always_ be zeroed + * on return. Many parts of the engine rely on this to + * work properly. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Alloc( ULong Size, void** P ) + { + Int i; + + + if ( !P ) + return TT_Err_Invalid_Argument; + /* Also see below for another case of "invalid argument". */ + + if ( Size > 0 ) + { + if ( Size > ( UINT_MAX & ~0xFu ) ) + *P = (void*)huge_alloc( Size ); + else + *P = (void*)malloc( Size ); + if ( !*P ) + return TT_Err_Out_Of_Memory; + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + TTMemory_Allocated += Size; + TTMemory_MaxAllocated += Size; +#endif + +#ifdef DEBUG_MEMORY + + num_alloc++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != NULL ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_alloc++; + else + { + pointers[i].base = *P; + pointers[i].size = Size; + } + +#else + + if ( Size > ( UINT_MAX & ~0xFu ) ) + { + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != NULL ) + i++; + + if ( i >= MAX_TRACKED_BIGCHUNKS ) + /* We fail badly here. Increase MAX_TRACKED_BIGCHUNKS if needed. */ + return TT_Err_Invalid_Argument; + else + { + pointers[i].base = *P; + pointers[i].size = Size; + } + } + +#endif /* DEBUG_MEMORY */ + + if ( Size > ( UINT_MAX & ~0xFu ) ) + { + char TT_HUGE_PTR * p = (char TT_HUGE_PTR *) *P; + ULong left = (ULong)Size; + size_t toClear; + + while ( left ) + { + toClear = (left > 0xFF00) ? 0xFF00 : left; + MEM_Set( p, 0, toClear ); + left -= (ULong) toClear; + p += toClear; + } + } + else + MEM_Set( *P, 0, Size ); + } + else + *P = NULL; + + return TT_Err_Ok; + } + + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE + + +/******************************************************************* + * + * Function : TT_Realloc + * + * Description : Reallocates memory from the heap buffer. + * + * Input : Size new size of the memory to be allocated; + * if zero, TT_Free() will be called + * P pointer to a buffer pointer; if *P == NULL, + * TT_Alloc() will be called + * + * Output : Error code. + * + * NOTES : It's not necessary to zero the memory in case the + * reallocated buffer is larger than before -- the + * application has to take care of this. + * + * If the memory request fails, TT_Free() will be + * called on *P, and TT_Err_Out_Of_Memory returned. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Realloc( ULong Size, void** P ) + { + void* Q; + +#ifdef DEBUG_MEMORY + Int i; +#endif + + + if ( !P ) + return TT_Err_Invalid_Argument; + + if ( !*P ) + return TT_Alloc( Size, P ); + + if ( Size == 0 ) + return TT_Free( P ); + + if ( Size > ( UINT_MAX & ~0xFu ) ) + Q = NULL; /* Do not even try to deal with big chunks of memory. */ + else + Q = (void*)realloc( *P, Size ); + if ( !Q ) + { + TT_Free( *P ); + return TT_Err_Out_Of_Memory; + } + +#ifdef DEBUG_MEMORY + + num_realloc++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != *P ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_realloc++; + else + { +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + TTMemory_Allocated += Size - pointers[i].size; + if ( Size > pointers[i].size ) + TTMemory_MaxAllocated += Size - pointers[i].size; +#endif + + pointers[i].base = Q; + pointers[i].size = Size; + } +#endif /* DEBUG_MEMORY */ + + *P = Q; + + return TT_Err_Ok; + } + + +#endif /* TT_CONFIG_OPTION_EXTEND_ENGINE */ + + +/******************************************************************* + * + * Function : TT_Free + * + * Description : Releases a previously allocated block of memory. + * + * Input : P pointer to memory block + * + * Output : Always SUCCESS. + * + * Note : The pointer must _always_ be set to NULL by this function. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Free( void** P ) + { + Int i; + Long Size = 0; + + + if ( !P || !*P ) + return TT_Err_Ok; + +#ifdef DEBUG_MEMORY + + num_free++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != *P ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_free++; + else + { +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + TTMemory_Allocated -= pointers[i].size; +#endif + + Size = pointers[i].size; + pointers[i].base = NULL; + pointers[i].size = 0; + } + +#else + + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != *P ) + i++; + + /* If we did not found the pointer, then this is a "small" chunk. */ + + if ( i < MAX_TRACKED_BIGCHUNKS ) + { + Size = pointers[i].size; + pointers[i].base = NULL; + pointers[i].base = NULL; + } + +#endif /* DEBUG_MEMORY */ + + if ( Size > ( UINT_MAX & ~0xFu ) ) + huge_free( *P ); + else + free( *P ); + + *P = NULL; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTMemory_Init + * + * Description : Initializes the memory. + * + * Output : Always SUCCESS. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTMemory_Init( void ) + { +#ifdef DEBUG_MEMORY + Int i; + + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + pointers[i].base = NULL; + pointers[i].size = 0; + } + + num_alloc = 0; + num_realloc = 0; + num_free = 0; + + fail_alloc = 0; + fail_realloc = 0; + fail_free = 0; +#else + Int i; + + for ( i = 0; i < MAX_TRACKED_BIGCHUNKS; i++ ) + { + pointers[i].base = NULL; + pointers[i].size = 0; + } +#endif + + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + TTMemory_Allocated = 0; + TTMemory_MaxAllocated = 0; +#endif + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTMemory_Done + * + * Description : Finalizes memory usage. + * + * Output : Always SUCCESS. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTMemory_Done( void ) + { +#ifdef DEBUG_MEMORY + Int i, num_leaked, tot_leaked; + + + num_leaked = 0; + tot_leaked = 0; + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + if ( pointers[i].base ) + { + num_leaked ++; + tot_leaked += pointers[i].size; + } + } + + fprintf( stderr, + "%d memory allocations, of which %d failed\n", + num_alloc, + fail_alloc ); + + fprintf( stderr, + "%d memory reallocations, of which %d failed\n", + num_realloc, + fail_realloc ); + + fprintf( stderr, + "%d memory frees, of which %d failed\n", + num_free, + fail_free ); + + if ( num_leaked > 0 ) + { + fprintf( stderr, + "There are %d leaked memory blocks, totalizing %d bytes\n", + num_leaked, tot_leaked ); + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + if ( pointers[i].base ) + { + fprintf( stderr, + "index: %4d (base: $%08lx, size: %08ld)\n", + i, + (long)pointers[i].base, + pointers[i].size ); + } + } + } + else + fprintf( stderr, "No memory leaks !\n" ); + +#endif /* DEBUG_MEMORY */ + + return TT_Err_Ok; + } + + +/* END */ diff --git a/Build/source/libs/libttf/arch/msdos/makedep b/Build/source/libs/libttf/arch/msdos/makedep new file mode 100644 index 00000000000..d566ed84243 --- /dev/null +++ b/Build/source/libs/libttf/arch/msdos/makedep @@ -0,0 +1,26 @@ +# makedep +# +# This shell script creates a dependency file necessary for older compilers +# on the MS-DOS platform. + +echo "\ +# This dependency file to be used with various MS-DOS compilers +# has been generated automatically with the script \`makedep' on +# `date +%d-%b-%Y`. +" > depend.dos + +(cd ../.. + gcc -MM -Iarch/msdos -I. *.c | \ + sed -e "s/\.o:/.obj:/" -e "s:/:\\\\:g") >> depend.dos + +(cd ../.. + gcc -MM -Iarch/msdos -I. -Iextend extend/*.c | \ + sed -e "s/^\(.*\)\.o:/extend\\\\\1.obj:/" -e "s:/:\\\\:g") >> depend.dos + +(cd ../.. + gcc -MM -Iarch/msdos -I. -Iextend \ + -DTT_HUGE_PTR -Dhuge_alloc -Dhuge_free arch/msdos/*.c | \ + sed -e "s/^\(.*\)\.o:/arch\\\\msdos\\\\\1.obj:/" \ + -e "s:/:\\\\:g") >> depend.dos + +# eof diff --git a/Build/source/libs/libttf/arch/os2/Makefile.dm b/Build/source/libs/libttf/arch/os2/Makefile.dm new file mode 100644 index 00000000000..a5c18f714a5 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/Makefile.dm @@ -0,0 +1,84 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for emx-gcc under OS/2 +# +# You will need dmake. +# +# Use this file while in the lib directory with the following statement: +# +# dmake -r -f arch/os2/Makefile.dm + +ARCH = arch/os2 +FT_MAKEFILE = $(ARCH)/Makefile.dm +FT_MAKE = dmake -r + +.IMPORT: COMSPEC +SHELL := $(COMSPEC) +SHELLFLAGS := /c +GROUPSHELL := $(SHELL) +GROUPFLAGS := $(SHELLFLAGS) +GROUPSUFFIX := .cmd +SHELLMETAS := *"?<>&| + +CC = gcc + +CFLAGS = -Wall -O2 -g -ansi -pedantic -I$(ARCH) -I. -Iextend +# CFLAGS = -Wall -ansi -O2 -s -I$(ARCH) -I. -Iextend + +TTFILE = $(ARCH)/os2file.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxopen.c \ + extend/ftxgdef.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a + + +$(OBJ_S): $(SRC_S) $(SRC_M) + $(CC) $(CFLAGS) -c -o $@ $(SRC_S) + + +libttf.a: $($(LIB_FILES)) + +-del $@ + ar src $@ @$(mktmp $(<:t"\n")\n) + +clean: + -+del $(subst,/,\ $($(LIB_FILES))) + +distclean: clean + -+del dep.end libttf.a + +# depend: $(SRC_S) $(SRC_M) $(SRC_X) +# $(CC) -E -M @$(mktmp $(<:t"\n")\n) > dep.end + +# ifeq (dep.end,$(wildcard dep.end)) +# include dep.end +# endif + +# end of Makefile.dm diff --git a/Build/source/libs/libttf/arch/os2/Makefile.emx b/Build/source/libs/libttf/arch/os2/Makefile.emx new file mode 100644 index 00000000000..4ba9128def7 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/Makefile.emx @@ -0,0 +1,91 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for emx-gcc under OS/2. +# +# You will need GNU make. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/os2/Makefile.emx + +ARCH = arch/os2 +FT_MAKEFILE = $(ARCH)/Makefile.emx + +CC = gcc + +#CFLAGS = -W -Wall -O0 -g -ansi -pedantic -I$(ARCH) -I. -Iextend + +CFLAGS = -Wall -O3 -fno-inline -fomit-frame-pointer \ + -g -ansi -pedantic -I$(ARCH) -I. -Iextend + +#CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend + +TTFILE = $(ARCH)/os2file.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxopen.c \ + extend/ftxgdef.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + +SRCD_S = $(ARCH)/freetypd.c +OBJD_S = $(SRCD_S:.c=.o) +OBJDS_S = $(OBJD_S) $(OBJS_X) + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a + +debugger: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJDS_S libttfd.a + +$(OBJ_S): $(SRC_S) $(SRC_M) +$(OBJD_S): $(SRCD_S) $(SRC_M) + +libttf.a: $($(LIB_FILES)) + -del $@ + ar src $@ $^ + +libttfd.a: $(OBJDS) + +libttfd.a: $(OBJDS) + -del $@ + ar src $@ $^ + +clean: + -del $(subst /,\,$(OBJS_S)) + -del $(subst /,\,$(OBJS_M)) + +distclean: clean + -del dep.end + -del libttf.a + +depend: $(SRC_S) $(SRC_M) $(SRC_X) + $(CC) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile.emx diff --git a/Build/source/libs/libttf/arch/os2/Makefile.icc b/Build/source/libs/libttf/arch/os2/Makefile.icc new file mode 100644 index 00000000000..e633c8d9408 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/Makefile.icc @@ -0,0 +1,73 @@ +# This file is part of the FreeType project. +# +# It builds the library and test programs for IBM VisualAge C++ under OS/2. +# +# You will need nmake. +# +# Use this file while in the lib directory with the following statement: +# +# nmake -f arch\os2\Makefile.icc +# + +ARCH = arch\os2 +FT_MAKEFILE = $(ARCH)\Makefile.icc +FT_MAKE = $(MAKE) -nologo + +CC = icc +CFLAGS = -O+ -Ti- -Tm- -Sa -W3 -Wpro- -Wcnd- -Q+ -Iarch\os2 -I. -Iextend + +# NOTE: Optimizations are discarded, as it seems that Visual Age +# is buggy when producing ttraster.obj. The resulting code +# crashes under some circumstances (performing vertical dropout +# control when rendering smoothed outlines)! + +TTFILE = $(ARCH)\os2file.c +TTMEMORY = .\ttmemory.c +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c \ + extend\ftxcmap.c extend\ftxwidth.c extend\ftxsbit.c \ + extend\ftxgsub.c extend\ftxgpos.c extend\ftxopen.c \ + extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c \ + ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +all: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES="$(OBJS_S)" libttf.lib + +debug: + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES="$(OBJS_M)" libttf.lib + + +$(OBJ_S): $(SRC_S) $(SRC_M) + $(CC) -C $(CFLAGS) /Fo$@ $*.c + +$(OBJS_X): + $(CC) -C $(CFLAGS) /Fo$@ $*.c + +$(ARCH)\os2file.obj: + $(CC) -C $(CFLAGS) /Fo$@ $*.c + +libttf.lib: $(LIB_FILES) + !ilib /nologo /noignorecase /nobackup $@ +$?,, + +clean: + -del *.obj + -del extend\*.obj + -del arch\os2\*.obj + +distclean: clean + -del libttf.lib + +# end of Makefile.icc diff --git a/Build/source/libs/libttf/arch/os2/Makefile.wat b/Build/source/libs/libttf/arch/os2/Makefile.wat new file mode 100644 index 00000000000..4fe8adff09c --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/Makefile.wat @@ -0,0 +1,88 @@ +# This file is part of the FreeType project. +# +# This builds the Watcom library with Watcom's wcc386 under OS/2. +# +# You'll need Watcom's wmake. +# +# +# Invoke by "wmake -f arch\os2\Makefile.wat" when in the "lib" directory +# +# This will build "freetype\lib\libttf.lib" + +ARCH = arch\os2 +FT_MAKEFILE = $(ARCH)\Makefile.wat +FT_MAKE = wmake -h + + +.EXTENSIONS: +.EXTENSIONS: .lib .obj .c .h +.obj:.;.\extend;.\$(ARCH) +.c:.;.\extend;.\$(ARCH) +.h:.;.\extend;.\$(ARCH) + +CC = wcc386 + +CCFLAGS = /otexanl+ /s /w5 /zq -Iarch\os2 -I. -Iextend + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +TTMUTEX = .\ttmutex.c + +TTFILE_OBJ = ttfile.obj +TTMEMORY_OBJ = ttmemory.obj +TTMUTEX_OBJ = ttmutex.obj + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) +PORT_OBJS = $(TTFILE_OBJ) $(TTMEMORY_OBJ) $(TTMUTEX_OBJ) + +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c & + extend\ftxcmap.c extend\ftxwidth.c extend\ftxsbit.c & + extend\ftxgsub.c extend\ftxgpos.c extend\ftxopen.c & + extend\ftxgdef.c + +OBJS_X = extend\ftxgasp.obj extend\ftxkern.obj extend\ftxpost.obj & + extend\ftxcmap.obj extend\ftxwidth.obj extend\ftxsbit.obj & + extend\ftxgsub.obj extend\ftxgpos.obj extend\ftxopen.obj & + extend\ftxgdef.obj + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c & + ttgload.c ttinterp.c ttload.c ttobjs.c & + ttraster.c ttextend.c $(PORT) + +OBJS_M = ttapi.obj ttcache.obj ttcalc.obj ttcmap.obj & + ttgload.obj ttinterp.obj ttload.obj ttobjs.obj & + ttraster.obj ttextend.obj $(PORT_OBJS) $(OBJS_X) + +SRC_S = freetype.c +OBJ_S = freetype.obj +OBJS_S = $(OBJ_S) $(OBJS_X) + + +.c.obj: + $(CC) $(CCFLAGS) $[* /fo=$[*.obj + +all: .symbolic + $(FT_MAKE) -f $(FT_MAKEFILE) libttf.lib + +debug: .symbolic + $(FT_MAKE) -f $(FT_MAKEFILE) LIB_FILES="$(OBJS_M)" libttf.lib + + +libttf.lib: $(OBJS_M) + wlib -q -n libttf.lib $(OBJS_M) + +# is this correct? Know nothing about wmake and the Watcom compiler... +$(OBJ_S): $(SRC_S) $(SRC_M) + $(CC) $(CCFLAGS) $(SRC_S) /fo=$(OBJ_S) + +clean: .symbolic + @-erase $(OBJS_M) + @-erase *.err + +distclean: .symbolic clean + @-erase libttf.lib + +new: .symbolic + @-wtouch *.c + +# end of Makefile.wat diff --git a/Build/source/libs/libttf/arch/os2/freetype.c b/Build/source/libs/libttf/arch/os2/freetype.c new file mode 100644 index 00000000000..7a115cff672 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/freetype.c @@ -0,0 +1,32 @@ +/* This file is part of the FreeType project */ + +/* Single file library component for OS/2 */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#include "os2file.c" +#include "ttmemory.c" +#include "ttmutex.c" + +/* the extensions are compiled separately, but we need to */ +/* include the file ttextend.c if we want to support them */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + +/* END */ diff --git a/Build/source/libs/libttf/arch/os2/ft_conf.h b/Build/source/libs/libttf/arch/os2/ft_conf.h new file mode 100644 index 00000000000..c7026c711e2 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/ft_conf.h @@ -0,0 +1,239 @@ +/******************************************************************* + * + * ft_conf.h (OS/2 version) + * + * High-level interface specification. + * + * Copyright 1996-1998 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 is used to contain the definition of several + * configuration-specific macros. + * + ******************************************************************/ + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + + +/**********************************************************************/ +/* */ +/* We begin by a series of macros that are automatically set by the */ +/* 'configure' script on Unix. They must be set manually on OS/2, */ +/* so here they are : */ +/* */ +/**********************************************************************/ + +#define OS2 + +/* Define to empty if the keyword "const" does not work. */ +/* #undef const */ + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if you need <conio.h> for console I/O functions. */ +#if defined(__EMX__) || defined(__IBMC__) +#define HAVE_CONIO_H +#endif + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/os2/os2file.c b/Build/source/libs/libttf/arch/os2/os2file.c new file mode 100644 index 00000000000..e6003fd4dd3 --- /dev/null +++ b/Build/source/libs/libttf/arch/os2/os2file.c @@ -0,0 +1,1237 @@ +/******************************************************************* + * + * os2file.c (OS2 version) 2.1 + * + * File I/O Component (body). + * + * Copyright 1996-1999 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. + * + * NOTES: + * + * This implementation relies on the OS/2 file API. It was provided + * by the PM FreeType DLL author, Michal Necasek. + * + ******************************************************************/ + +#include "ttconfig.h" + +#include <os2.h> /* !Mike! */ + +#include <stdio.h> +#include <string.h> + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include "freetype.h" +#include "tttypes.h" +#include "ttdebug.h" +#include "ttengine.h" +#include "ttmutex.h" +#include "ttmemory.h" +#include "ttfile.h" /* our prototypes */ + + +/* For now, we don't define additional error messages in the core library */ +/* to report open-on demand errors. Define these errors as standard ones. */ + +#define TT_Err_Could_Not_ReOpen_File TT_Err_Could_Not_Open_File +#define TT_Err_Could_Not_ReSeek_File TT_Err_Could_Not_Open_File + + + /* This definition is mandatory for each file component! */ + EXPORT_FUNC + const TFileFrame TT_Null_FileFrame = { NULL, 0, 0 }; + + +/* It has proven useful to do some bounds checks during development phase. */ +/* They should probably be undefined for speed reasons in a later release. */ + +#if 0 +#define CHECK_FRAME( frame, n ) \ + do { \ + if ( frame.cursor + n > frame.address + frame.size ) \ + Panic( "Frame boundary error!\n" ); \ + } while ( 0 ) +#else +#define CHECK_FRAME( frame, n ) \ + do { \ + } while ( 0 ) +#endif + + + /* Because a stream can be flushed, i.e., its file handle can be */ + /* closed to save system resources, we must keep the stream's file */ + /* pathname to be able to re-open it on demand when it is flushed. */ + + struct _TStream_Rec + { + Bool opened; /* is the stream handle opened ? */ + String* name; /* the file's pathname */ + Long position; /* current pos. within the file */ + + HFILE file; /* file handle !Mike! */ + Long base; /* stream base in file */ + Long size; /* stream size in file */ + }; + + typedef struct _TStream_Rec TStream_Rec; + typedef TStream_Rec* PStream_Rec; + + + /* We support embedded TrueType files by allowing them to be */ + /* inside any file, at any location, hence the 'base' argument. */ + /* Note, however, that the current implementation does not allow you */ + /* to specify a 'base' index when opening a file. */ + /* (will come later) */ + /* I still don't know if this will turn out useful... - DavidT */ + +#define STREAM2REC( x ) ( (TStream_Rec*)HANDLE_Val( x ) ) + + static TT_Error Stream_Activate ( PStream_Rec stream ); + static TT_Error Stream_Deactivate( PStream_Rec stream ); + + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /**** ****/ + /**** N O N R E E N T R A N T I M P L E M E N T A T I O N ****/ + /**** ****/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + + /* In non-reentrant builds, we allocate a single block where we'll */ + /* place all the frames smaller than FRAME_CACHE_SIZE, rather than */ + /* allocating a new block on each access. Bigger frames will be */ + /* malloced normally in the heap. */ + /* */ + /* See TT_Access_Frame() and TT_Forget_Frame() for details. */ + +#define FRAME_CACHE_SIZE 2048 + + /* The TFile_Component structure holds all the data that was */ + /* previously declared static or global in this component. */ + /* */ + /* It is accessible through the 'engine.file_component' */ + /* variable in re-entrant builds, or directly through the */ + /* static 'files' variable in other builds. */ + + struct _TFile_Component + { + TMutex lock; /* used by the thread-safe build only */ + Byte* frame_cache; /* frame cache */ + PStream_Rec stream; /* current stream */ + TFileFrame frame; /* current frame */ + }; + + typedef struct _TFile_Component TFile_Component; + + static TFile_Component files; + +#define CUR_Stream files.stream +#define CUR_Frame files.frame + +#define STREAM_VARS /* void */ +#define STREAM_VAR /* void */ + +/* The macro CUR_Stream denotes the current input stream. */ +/* Note that for the re-entrant version, the 'stream' name has been */ +/* chosen according to the macro STREAM_ARGS. */ + +/* The macro CUR_Frame denotes the current file frame. */ +/* Note that for the re-entrant version, the 'frame' name has been */ +/* chosen according to the macro FRAME_ARGS. */ + +/* The macro STREAM_VAR is used when calling public functions */ +/* that need an 'optional' stream argument. */ + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + TT_Error error; + + MUTEX_Create( files.lock ); + files.stream = NULL; + ZERO_Frame( files.frame ); + + if ( ALLOC( files.frame_cache, FRAME_CACHE_SIZE ) ) + return error; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + FREE( files.frame_cache ); + MUTEX_Destroy( files.lock ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Copies or duplicates a given stream. + * + * Input : org_stream original stream + * stream target stream (copy or duplicate) + * + * Output : Error code. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream org_stream, + TT_Stream* stream ) + { + MUTEX_Lock( files.lock ); /* lock file mutex */ + + *stream = org_stream; /* copy the stream */ + files.stream = STREAM2REC( org_stream ); /* set current stream */ + + Stream_Activate( files.stream ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream target stream + * + * Output : Error code. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + HANDLE_Set( *stream, NULL ); + MUTEX_Release( files.lock ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : SUCCESS on success. FAILURE on error. + * + * Notes: The function fails if the byte range is not within the + * the file, or if there is not enough memory to cache + * the bytes properly (which usually means that `size' is + * too big in both cases). + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + TT_Error error; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( size <= FRAME_CACHE_SIZE ) + { + /* use the cache */ + CUR_Frame.address = files.frame_cache; + CUR_Frame.size = FRAME_CACHE_SIZE; + } + else + { + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + CUR_Frame.size = size; + } + + error = TT_Read_File( STREAM_VARS (void*)CUR_Frame.address, size ); + if ( error ) + { + if ( size > FRAME_CACHE_SIZE ) + FREE( CUR_Frame.address ); + CUR_Frame.address = NULL; + CUR_Frame.size = 0; + } + + CUR_Frame.cursor = CUR_Frame.address; + return error; + } + + +/******************************************************************* + * + * Function : TT_Check_And_Access_Frame + * + * Description : Notifies the component that we're going to read + * `size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : SUCCESS on success. FAILURE on error. + * + * Notes: The function truncates `size' if the byte range is not + * within the file. + * + * It will fail if there is not enough memory to cache + * the bytes properly (which usually means that `size' is + * too big). + * + * It will fail if you make two consecutive calls + * to TT_Access_Frame(), without a TT_Forget_Frame() between + * them. + * + * The only difference with TT_Access_Frame() is that we + * check that the frame is within the current file. We + * otherwise truncate it. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Check_And_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + TT_Error error; + Long readBytes, requested; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( size <= FRAME_CACHE_SIZE ) + { + /* use the cache */ + CUR_Frame.address = files.frame_cache; + CUR_Frame.size = FRAME_CACHE_SIZE; + } + else + { + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + CUR_Frame.size = size; + } + + requested = size; + readBytes = CUR_Stream->size - TT_File_Pos( STREAM_VAR ); + if ( size > readBytes ) + size = readBytes; + + error = TT_Read_File( STREAM_VARS (void*)CUR_Frame.address, size ); + if ( error ) + { + if ( requested > FRAME_CACHE_SIZE ) + FREE( CUR_Frame.address ); + CUR_Frame.address = NULL; + CUR_Frame.size = 0; + } + + CUR_Frame.cursor = CUR_Frame.address; + return error; + } + + +/******************************************************************* + * + * Function : TT_Forget_Frame + * + * Description : Releases a cached frame after reading. + * + * Input : None + * + * Output : SUCCESS on success. FAILURE on error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Forget_Frame( FRAME_ARG ) + { + if ( CUR_Frame.address == NULL ) + return TT_Err_Nested_Frame_Access; + + if ( CUR_Frame.size > FRAME_CACHE_SIZE ) + FREE( CUR_Frame.address ); + + ZERO_Frame( CUR_Frame ); + + return TT_Err_Ok; + } + + +#else /* TT_CONFIG_OPTION_THREAD_SAFE */ + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /******** ********/ + /******** R E E N T R A N T I M P L E M E N T A T I O N ********/ + /******** ********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +/* a simple macro to access the file component's data */ +#define files ( *((TFile_Component*)engine.file_component) ) + +#define CUR_Stream STREAM2REC( stream ) /* re-entrant macros */ +#define CUR_Frame (*frame) + +#define STREAM_VARS stream, +#define STREAM_VAR stream + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Duplicates a stream for a new usage. + * + * Input : input_stream source stream to duplicate + * copy address of target duplicate stream + * + * Output : error code. + * The target stream is set to NULL in case of failure. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream input_stream, + TT_Stream* copy ) + { + PStream_Rec rec = STREAM2REC( input_stream ); + + return TT_Open_Stream( rec->name, copy ); + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream target stream + * + * Output : + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + return TT_Close_Stream( stream ); + } + + +/******************************************************************* + * + * Function : TT_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : SUCCESS on success. FAILURE on error. + * + * Notes: The function fails if the byte range is not within the + * the file, or if there is not enough memory to cache + * the bytes properly (which usually means that `size' is + * too big in both cases). + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Access_Frame( STREAM_ARGS FRAME_ARGS int size ) + { + TT_Error error; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + CUR_Frame.size = size; + + error = TT_Read_File( STREAM_VARS (void*)CUR_Frame.address, size ); + if ( error ) + { + FREE( CUR_Frame.address ); + CUR_Frame.size = 0; + } + + CUR_Frame.cursor = CUR_Frame.address; + return error; + } + + +/******************************************************************* + * + * Function : TT_Check_And_Access_Frame + * + * Description : Notifies the component that we're going to read + * `size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : SUCCESS on success. FAILURE on error. + * + * Notes: The function truncates `size' if the byte range is not + * within the file. + * + * It will fail if there is not enough memory to cache + * the bytes properly (which usually means that `size' is + * too big). + * + * It will fail if you make two consecutive calls + * to TT_Access_Frame(), without a TT_Forget_Frame() between + * them. + * + * The only difference with TT_Access_Frame() is that we + * check that the frame is within the current file. We + * otherwise truncate it. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Check_And_Access_Frame( STREAM_ARGS FRAME_ARGS int size ) + { + TT_Error error; + Long readBytes; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + CUR_Frame.size = size; + + readBytes = CUR_Stream->size - TT_File_Pos( STREAM_VAR ); + if ( size > readBytes ) + size = readBytes; + + error = TT_Read_File( STREAM_VARS (void*)CUR_Frame.address, size ); + if ( error ) + { + FREE( CUR_Frame.address ); + CUR_Frame.size = 0; + } + + CUR_Frame.cursor = CUR_Frame.address; + return error; + } + + +/******************************************************************* + * + * Function : TT_Forget_Frame + * + * Description : Releases a cached frame after reading. + * + * Input : None + * + * Output : SUCCESS on success. FAILURE on error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Forget_Frame( FRAME_ARG ) + { + if ( CUR_Frame.address == NULL ) + return TT_Err_Nested_Frame_Access; + + FREE( CUR_Frame.address ); + ZERO_Frame( CUR_Frame ); + + return TT_Err_Ok; + } + +#endif /* TT_CONFIG_OPTION_THREAD_SAFE */ + + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /*********** ***********/ + /*********** C O M M O N I M P L E M E N T A T I O N ***********/ + /*********** ***********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +/******************************************************************* + * + * Function : Stream_Activate + * + * Description : activates a stream, this will either: + * - open a new file handle if the stream is closed + * - move the stream to the head of the linked list + * + * Input : stream the stream to activate + * + * Output : error condition. + * + * Note : this function is also called with fresh new streams + * created by TT_Open_Stream(). They have their 'size' + * field set to -1. + * + ******************************************************************/ + + static TT_Error Stream_Activate( PStream_Rec stream ) + { + ULONG ulAction; /* !Mike! */ + + if ( !stream->opened ) + { +#if 0 + if ( !(stream->file = fopen( stream->name, "rb" )) ) /* !Mike! */ +#endif + +/* XXX : Strange. GCC/EMX wants an (Byte*) for the file name? */ +#ifdef __EMX__ + + if ( DosOpen( (Byte*)stream->name, &(stream->file), + &ulAction, 0, + 0, OPEN_ACTION_OPEN_IF_EXISTS, + OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL ) ) + return TT_Err_Could_Not_ReOpen_File; + +#else + + if ( DosOpen( stream->name, &(stream->file), + &ulAction, 0, + 0, OPEN_ACTION_OPEN_IF_EXISTS, + OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL ) ) + return TT_Err_Could_Not_ReOpen_File; + +#endif /* __EMX__ */ + + stream->opened = TRUE; + + /* A newly created stream has a size field of -1 */ + if ( stream->size < 0 ) + { +#if 0 + fseek( stream->file, 0, SEEK_END ); /* !Mike! */ + stream->size = ftell( stream->file ); +#endif + + DosSetFilePtr( stream->file, 0, FILE_END, (ULONG *)&(stream->size) ); +#if 0 + fseek( stream->file, 0, SEEK_SET ); +#endif + + DosSetFilePtr( stream->file, 0, FILE_BEGIN, &ulAction ); + } + + /* Reset cursor in file */ + if ( stream->position ) + { +#if 0 /* !Mike! */ + if ( fseek( stream->file, stream->position, SEEK_SET ) != 0 ) +#endif + + if ( DosSetFilePtr( stream->file, stream->position, + FILE_BEGIN, &ulAction ) ) + { + /* error during seek */ +#if 0 + fclose( stream->file ); /* !Mike! */ +#endif + + DosClose( stream->file ); + stream->opened = FALSE; + return TT_Err_Could_Not_ReSeek_File; + } + } + } + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : Stream_DeActivate + * + * Description : deactivates a stream, this will: + * - close its file handle if it was opened + * - remove it from the opened list if necessary + * + * Input : stream the stream to deactivate + * + * Output : Error condition + * + * Note : the function is called whenever a stream is deleted + * (_not_ when a stream handle's is closed due to an + * activation). However, the stream record isn't + * destroyed by it... + * + ******************************************************************/ + + static TT_Error Stream_Deactivate( PStream_Rec stream ) + { + if ( stream->opened ) + { + /* Save its current position within the file */ +#if 0 + stream->position = ftell( stream->file ); /* !Mike! */ +#endif + + DosSetFilePtr( stream->file, 0, FILE_CURRENT, + (ULONG *)&(stream->position) ); +#if 0 + fclose( stream->file ); /* !Mike! */ +#endif + + DosClose( stream->file ); + stream->file = 0; + stream->opened = FALSE; + } + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Stream_Size + * + * Description : Returns the length of a given stream, even if it + * is flushed. + * + * Input : stream the stream + * + * Output : length of stream in bytes. + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_Stream_Size( TT_Stream stream ) + { + PStream_Rec rec = STREAM2REC( stream ); + + + if ( rec ) + return rec->size; + else + return 0; /* invalid stream - return 0 */ + } + + +/******************************************************************* + * + * Function : TT_Open_Stream + * + * Description : Opens the font file and saves the total file size. + * + * Input : error address of stream's error variable + * (re-entrant build only) + * filepathname pathname of the file to open + * stream address of target TT_Stream structure + * + * Output : SUCCESS on sucess, FAILURE on error. + * The target stream is set to -1 in case of failure. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TT_Open_Stream( const String* filepathname, + TT_Stream* stream ) + { + int len; + TT_Error error; + PStream_Rec stream_rec; + + + if ( ALLOC( *stream, sizeof ( TStream_Rec ) ) ) + return error; + + stream_rec = STREAM2REC( *stream ); + + stream_rec->file = NULLHANDLE; /* !Mike! */ + stream_rec->size = -1; + stream_rec->base = 0; + stream_rec->opened = FALSE; + stream_rec->position = 0; + + len = strlen( filepathname ) + 1; + if ( ALLOC( stream_rec->name, len ) ) + goto Fail; + + strncpy( (String*)stream_rec->name, filepathname, len ); + + error = Stream_Activate( stream_rec ); + if ( error ) + goto Fail_Activate; + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + CUR_Stream = stream_rec; +#endif + + return TT_Err_Ok; + + Fail_Activate: + FREE( stream_rec->name ); + Fail: + FREE( stream_rec ); + return error; + } + + +/******************************************************************* + * + * Function : TT_Close_Stream + * + * Description : Closes a stream. + * + * Input : stream address of target TT_Stream structure + * + * Output : SUCCESS (always). + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TT_Close_Stream( TT_Stream* stream ) + { + PStream_Rec rec = STREAM2REC( *stream ); + + + Stream_Deactivate( rec ); + FREE( rec->name ); + FREE( rec ); + + HANDLE_Set( *stream, NULL ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Flush_Stream + * + * Description : Flushes a stream, i.e., closes its file handle. + * + * Input : stream address of target TT_Stream structure + * + * Output : Error code + * + * NOTE : Never flush the current opened stream. This means that + * you should _never_ call this function between a + * TT_Use_Stream() and a TT_Done_Stream()! + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Flush_Stream( TT_Stream* stream ) + { + PStream_Rec rec = STREAM2REC( *stream ); + + + if ( rec ) + { + Stream_Deactivate( rec ); + return TT_Err_Ok; + } + else + return TT_Err_Invalid_Argument; + } + + +/******************************************************************* + * + * Function : TT_Seek_File + * + * Description : Seeks the file cursor to a different position. + * + * Input : position new position in file + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Seek_File( STREAM_ARGS long position ) + { + ULONG ibActual; /* !Mike! */ + + + position += CUR_Stream->base; + +#if 0 + if ( fseek( CUR_Stream->file, position, SEEK_SET ) ) /* !Mike! */ +#endif + + if ( DosSetFilePtr( CUR_Stream->file, position, FILE_BEGIN , &ibActual ) ) + return TT_Err_Invalid_File_Offset; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Skip_File + * + * Description : Skips forward the file cursor. + * + * Input : distance number of bytes to skip + * + * Output : see TT_Seek_File() + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Skip_File( STREAM_ARGS long distance ) + { + ULONG ibActual; /* !Mike! */ + + +#if 0 + return TT_Seek_File( STREAM_VARS ftell( CUR_Stream->file ) - + CUR_Stream->base + distance ); /* !Mike! */ +#endif + + DosSetFilePtr( CUR_Stream->file, 0, FILE_CURRENT, &ibActual ); + return TT_Seek_File( STREAM_VARS ibActual - CUR_Stream->base + distance ); + } + + +/******************************************************************* + * + * Function : TT_Read_File + * + * Description : Reads a chunk of the file and copies it to memory. + * + * Input : buffer target buffer + * count length in bytes to read + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_File( STREAM_ARGS void* buffer, long count ) + { + ULONG cbActual; /* !Mike! */ + +#if 0 /* !Mike! */ + if ( fread( buffer, 1, count, CUR_Stream->file ) != (unsigned long)count ) +#endif + + DosRead( CUR_Stream->file, buffer, count, &cbActual ); + if ( cbActual != (unsigned long)count ) + return TT_Err_Invalid_File_Read; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Read_At_File + * + * Description : Reads file at a specified position. + * + * Input : position position to seek to before read + * buffer target buffer + * count number of bytes to read + * + * Output : SUCCESS on success. FAILURE if error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_At_File( STREAM_ARGS long position, + void* buffer, + long count ) + { + TT_Error error; + + + if ( ( error = TT_Seek_File( STREAM_VARS position ) ) || + ( error = TT_Read_File( STREAM_VARS buffer, count ) ) ) + return error; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_File_Pos + * + * Description : Returns current file seek pointer. + * + * Input : none + * + * Output : current file position + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_File_Pos( STREAM_ARG ) + { + ULONG ibActual; /* !Mike! */ + + +#if 0 + return ftell( CUR_Stream->file ) - CUR_Stream->base; /* !Mike! */ +#endif + + DosSetFilePtr( CUR_Stream->file, 0, FILE_CURRENT, &ibActual ); + return ibActual - CUR_Stream->base; + } + + +/******************************************************************* + * + * Function : GET_Byte + * + * Description : Extracts a byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted Byte. + * + ******************************************************************/ +#if 0 + EXPORT_FUNC + Byte TT_Get_Byte( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Byte)(*CUR_Frame.cursor++); + } +#endif + +/******************************************************************* + * + * Function : GET_Char + * + * Description : Extracts a signed byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted char. + * + ******************************************************************/ + + EXPORT_FUNC + Char TT_Get_Char( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Char)(*CUR_Frame.cursor++); + } + + +/******************************************************************* + * + * Function : GET_Short + * + * Description : Extracts a short from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted short. + * + ******************************************************************/ + + EXPORT_FUNC + short TT_Get_Short( FRAME_ARG ) + { + short getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((short)CUR_Frame.cursor[0] << 8) | + (short)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } + + +/******************************************************************* + * + * Function : GET_UShort + * + * Description : Extracts an unsigned short from the frame. + * + * Input : None or current frame + * + * Output : Extracted ushort. + * + ******************************************************************/ +#if 0 + EXPORT_FUNC + unsigned short TT_Get_UShort( FRAME_ARG ) + { + unsigned short getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((unsigned short)CUR_Frame.cursor[0] << 8) | + (unsigned short)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } +#endif + +/******************************************************************* + * + * Function : GET_Long + * + * Description : Extracts a long from the frame. + * + * Input : None or current frame + * + * Output : Extracted long. + * + ******************************************************************/ + + EXPORT_FUNC + long TT_Get_Long( FRAME_ARG ) + { + long getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ((long)CUR_Frame.cursor[0] << 24) | + ((long)CUR_Frame.cursor[1] << 16) | + ((long)CUR_Frame.cursor[2] << 8 ) | + (long)CUR_Frame.cursor[3]; + + CUR_Frame.cursor += 4; + + return getlong; + } + + +/******************************************************************* + * + * Function : GET_ULong + * + * Description : Extracts an unsigned long from the frame. + * + * Input : None + * + * Output : Extracted ulong. + * + ******************************************************************/ +#if 0 + EXPORT_FUNC + unsigned long TT_Get_ULong( FRAME_ARG ) + { + unsigned long getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ( ((unsigned long)CUR_Frame.cursor[0] << 24) | + ((unsigned long)CUR_Frame.cursor[1] << 16) | + ((unsigned long)CUR_Frame.cursor[2] << 8 ) | + (unsigned long)CUR_Frame.cursor[3] ); + + CUR_Frame.cursor += 4; + + return getlong; + } +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/unix/Makefile.in b/Build/source/libs/libttf/arch/unix/Makefile.in new file mode 100644 index 00000000000..321cc7f8f72 --- /dev/null +++ b/Build/source/libs/libttf/arch/unix/Makefile.in @@ -0,0 +1,244 @@ +# This file is part of the FreeType project. +# +# lib/arch/unix/Makefile.in + +ARCH = arch/unix +FT_MAKEFILE = $(ARCH)/Makefile + +RM = @RM@ +RMF = @RM@ -f +RMDIR = @RMDIR@ +LN_S = @LN_S@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +VPATH = @srcdir@/../.. +srcdir = @srcdir@/../.. + +top_builddir=.. + +CC = @CC@ +CPP = @CPP@ + +LIBTOOL = $(top_builddir)/libtool +MKINSTALLDIRS = $(srcdir)/../mkinstalldirs + +version_info = @version_info@ + +include $(top_builddir)/MakeSub + +############### PORTABILITY COMPONENTS ######################## + +# location of memory component +MEMSRC = ttmemory.c + +# location of file component +FILESRC = @TT_FILE_COMPONENT@ + +# location of mutex component +MUTEXSRC = ttmutex.c + +# location of default extensions +FTEXTDIR = $(srcdir)/extend + + +# default extensions sources +EXTSRC = $(FTEXTDIR)/ftxkern.c \ + $(FTEXTDIR)/ftxgasp.c \ + $(FTEXTDIR)/ftxpost.c \ + $(FTEXTDIR)/ftxcmap.c \ + $(FTEXTDIR)/ftxsbit.c \ + $(FTEXTDIR)/ftxwidth.c \ + $(FTEXTDIR)/ftxerr18.c \ + $(FTEXTDIR)/ftxgsub.c \ + $(FTEXTDIR)/ftxgpos.c \ + $(FTEXTDIR)/ftxgdef.c \ + $(FTEXTDIR)/ftxopen.c + +EXTOBJ = ftxkern.lo \ + ftxgasp.lo \ + ftxpost.lo \ + ftxcmap.lo \ + ftxsbit.lo \ + ftxwidth.lo \ + ftxerr18.lo \ + ftxgsub.lo \ + ftxgpos.lo \ + ftxgdef.lo \ + ftxopen.lo + +# all engine sources +SRC_M = $(srcdir)/ttapi.c \ + $(srcdir)/ttcache.c \ + $(srcdir)/ttcalc.c \ + $(srcdir)/ttcmap.c \ + $(srcdir)/ttdebug.c \ + $(srcdir)/ttextend.c \ + $(srcdir)/ttgload.c \ + $(srcdir)/ttinterp.c \ + $(srcdir)/ttload.c \ + $(srcdir)/ttobjs.c \ + $(srcdir)/ttraster.c \ + $(srcdir)/$(FILESRC) \ + $(srcdir)/$(MEMSRC) \ + $(srcdir)/$(MUTEXSRC) +SRC_S = $(srcdir)/$(ARCH)/freetype.c + +# all header files +HEADERS = $(srcdir)/freetype.h \ + $(srcdir)/fterrid.h \ + $(srcdir)/ftnameid.h \ + $(FTEXTDIR)/ftxkern.h \ + $(FTEXTDIR)/ftxgasp.h \ + $(FTEXTDIR)/ftxcmap.h \ + $(FTEXTDIR)/ftxsbit.h \ + $(FTEXTDIR)/ftxpost.h \ + $(FTEXTDIR)/ftxwidth.h \ + $(FTEXTDIR)/ftxerr18.h \ + $(FTEXTDIR)/ftxgsub.h \ + $(FTEXTDIR)/ftxgpos.h \ + $(FTEXTDIR)/ftxgdef.h \ + $(FTEXTDIR)/ftxopen.h + +# all engine objects +OBJ_M = ttapi.lo \ + ttcache.lo \ + ttcalc.lo \ + ttcmap.lo \ + ttdebug.lo \ + ttextend.lo \ + ttgload.lo \ + ttinterp.lo \ + ttload.lo \ + ttobjs.lo \ + ttraster.lo \ + file.lo \ + memory.lo \ + mutex.lo \ + $(EXTOBJ) +OBJ_S = freetype.lo $(EXTOBJ) + + +# include paths +INCLUDES = -I. -I$(top_builddir) -I$(srcdir) -I$(FTEXTDIR) + +# C flags +CFLAGS = @CFLAGS@ @XX_CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +FT_CFLAGS = $(CFLAGS) $(INCLUDES) + +# linker flags +FT_LIBS = @LIBS@ + +# i18n stuff +LOCALEDIR = @LOCALEDIR@ + + +all: do_link + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES="$(OBJ_S)" libttf.la + +debug: do_link + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES="$(OBJ_M)" libttf.la + + +do_link: + -$(RMF) memory.c file.c mutex.c + $(LN_S) $(srcdir)/$(MEMSRC) memory.c + $(LN_S) $(srcdir)/$(FILESRC) file.c + $(LN_S) $(srcdir)/$(MUTEXSRC) mutex.c + + +.SUFFIXES: .lo +.c.lo: + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $< + +ftxkern.lo: $(FTEXTDIR)/ftxkern.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxkern.c + +ftxgasp.lo: $(FTEXTDIR)/ftxgasp.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxgasp.c + +ftxpost.lo: $(FTEXTDIR)/ftxpost.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxpost.c + +ftxcmap.lo: $(FTEXTDIR)/ftxcmap.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxcmap.c + +ftxsbit.lo: $(FTEXTDIR)/ftxsbit.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxsbit.c + +ftxwidth.lo: $(FTEXTDIR)/ftxwidth.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxwidth.c + +ftxerr18.lo: $(FTEXTDIR)/ftxerr18.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) \ + -DLOCALEDIR='"$(LOCALEDIR)"' \ + $(FTEXTDIR)/ftxerr18.c + +ftxgsub.lo: $(FTEXTDIR)/ftxgsub.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxgsub.c + +ftxgpos.lo: $(FTEXTDIR)/ftxgpos.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxgpos.c + +ftxgdef.lo: $(FTEXTDIR)/ftxgdef.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxgdef.c + +ftxopen.lo: $(FTEXTDIR)/ftxopen.c + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) $(FTEXTDIR)/ftxopen.c + +freetype.lo: $(SRC_S) $(SRC_M) + $(LIBTOOL) --mode=compile $(CC) -c $(FT_CFLAGS) \ + -DLOCALEDIR='"$(LOCALEDIR)"' \ + -DTT_MAKE_OPTION_SINGLE_OBJECT \ + $(SRC_S) + +libttf.la: $(LIB_FILES) + $(LIBTOOL) --mode=link $(CC) -o libttf.la $(LIB_FILES) \ + -rpath $(libdir) \ + -version-info $(version_info) $(FT_LIBS) + +install: libttf.la + $(MKINSTALLDIRS) $(libdir) $(includedir)/freetype + $(LIBTOOL) --mode=install $(INSTALL) libttf.la $(libdir) + -for P in $(HEADERS) ; do \ + $(INSTALL_DATA) $$P $(includedir)/freetype ; \ + done + +uninstall: + -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/libttf.la + -$(RMF) $(includedir)/freetype/* + -$(RMDIR) $(includedir)/freetype + +clean: + -$(RMF) $(OBJ_S) $(OBJ_M) *.o + +distclean: clean + -$(RMF) file.c memory.c mutex.c + -$(RMF) libttf.la + -$(RMF) *.orig *~ core *.core + -$(RMF) $(ARCH)/Makefile + -$(RMF) .libs/* + -$(RMDIR) .libs + +depend: do_link + (echo '/^#.* PUT NO STUFF BELOW/,$$d' ; echo w ; echo q) | \ + ed - $(ARCH)/Makefile + echo '# Dependencies generated by make depend: PUT NO STUFF BELOW' \ + >> $(ARCH)/Makefile + for file in $(SRC_S) $(SRC_M) $(EXTSRC) ; do \ + $(CPP) $(CPPFLAGS) $(INCLUDES) $$file | \ + sed -n -e 's|^# [1-9][0-9]* "\([^/].*\.h\)".*|\1|p' \ + -e 's|^# [1-9][0-9]* "\($(srcdir)/.*\.h\)".*|\1|p' | \ + sed -e 's|/\./|.|g' -e "s/^/`basename $$file .c`.lo: /" ; \ + done | \ + sort -u | \ + awk '{ if (LINE == 1) \ + { line = last = $$1 } \ + else if ($$1 != last) \ + { print line ; line = last = $$1 } \ + line = line " " $$2 } \ + END { print line }' >> $(ARCH)/Makefile + +# Dependencies generated by make depend: PUT NO STUFF BELOW diff --git a/Build/source/libs/libttf/arch/unix/freetype.c b/Build/source/libs/libttf/arch/unix/freetype.c new file mode 100644 index 00000000000..9a4860dbd2c --- /dev/null +++ b/Build/source/libs/libttf/arch/unix/freetype.c @@ -0,0 +1,27 @@ +/* This file is part of the FreeType project */ + +/* Single object library component for Unix */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* The Makefile creates proper links to following three files */ + +#include "file.c" +#include "memory.c" +#include "mutex.c" + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/unix/ttmmap.c b/Build/source/libs/libttf/arch/unix/ttmmap.c new file mode 100644 index 00000000000..aac7c1052e6 --- /dev/null +++ b/Build/source/libs/libttf/arch/unix/ttmmap.c @@ -0,0 +1,1027 @@ +/******************************************************************* + * + * ttmmap.c 2.0 + * + * Memory-Mapped file component ( replaces ttfile.c ). + * + * Copyright 1996-1999 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. + * + * Changes between 2.0 and 1.3 : + * + * - adopted new design/separation introduced in ttfile.c 2.0 + * + ******************************************************************/ + +#include "ttconfig.h" + +#include <stdio.h> +#include <string.h> + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <sys/mman.h> +#ifndef MAP_FILE +#define MAP_FILE 0x00 +#endif + +/* + * The prototype for munmap() is not provided on SunOS. This needs to + * have a check added later to see if the GNU C library is being used. + * If so, then this prototype is not needed. + */ +#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4) + extern int munmap( caddr_t addr, int len ); +#endif + +#include <sys/stat.h> +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + + +#include "freetype.h" +#include "tttypes.h" +#include "ttdebug.h" +#include "ttengine.h" +#include "ttmutex.h" +#include "ttmemory.h" +#include "ttfile.h" /* our prototypes */ + + /* This definition is mandatory for each file component! */ + EXPORT_FUNC + const TFileFrame TT_Null_FileFrame = { NULL, 0, 0 }; + + /* It has proven useful to do some bounds checks during */ + /* development phase. Define DEBUG_FILE when compiling */ + /* this component to enable them. */ + +#ifdef DEBUG_FILE +#define CHECK_FRAME( frame, n ) \ + do { \ + if ( frame.cursor + n > frame.address + frame.size ) \ + Panic( "Frame boundary error!\n" ); \ + } while ( 0 ) +#else +#define CHECK_FRAME( frame, n ) \ + do { \ + } while( 0 ) +#endif + + struct _TFileMap + { + String* base; /* base address of mapped file */ + Int refcount; /* reference count for mmaped region */ + Long size; /* stream size in file */ + Long offset; /* offset in file */ + }; + + typedef struct _TFileMap TFileMap; + +#define MAP_Address( map ) (Byte*)( (map)->base + (map)->offset ) + + /* The stream record structure */ + typedef struct _TStream_Rec + { + TFileMap* map; /* mapped file description */ + Long pos ; /* cursor in mapped file */ + } TStream_Rec; + + typedef TStream_Rec* PStream_Rec; + +#define STREAM2REC( x ) ( (TStream_Rec*)HANDLE_Val( x ) ) + + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /**** ****/ + /**** N O N R E E N T R A N T I M P L E M E N T A T I O N ****/ + /**** ****/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + + /* The TFile_Component structure holds all the data that was */ + /* previously declared static or global in this component. */ + /* */ + /* It is accessible through the 'engine.file_component' */ + /* variable in re-entrant builds, or directly through the */ + /* static 'files' variable in other builds. */ + + struct _TFile_Component + { + TMutex lock; /* used by the thread-safe build only */ + PStream_Rec stream; /* current stream */ + TFileFrame frame; /* current frame */ + }; + + typedef struct _TFile_Component TFile_Component; + +/* The macro CUR_Stream denotes the current input stream */ +/* Note that for the re-entrant version, the 'stream' name has been */ +/* chosen according to the macro STREAM_ARGS. */ + +/* The macro CUR_Frame denotes the current file frame */ +/* Note that for the re-entrant version, the 'frame' name has been */ +/* chosen according to the macro FRAME_ARGS. */ + +/* The macro STREAM_VAR is used when calling public functions */ +/* that need an 'optional' stream argument. */ + +#define CUR_Stream files.stream /* thread-safe macros */ +#define CUR_Frame files.frame + +#define STREAM_VARS /* void */ +#define STREAM_VAR /* void */ + + /* the 'files' variable is only defined in non-reentrant builds */ + + static TFile_Component files; + + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + MUTEX_Create( files.lock ); + files.stream = NULL; + ZERO_Frame( files.frame ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + MUTEX_Destroy( files.lock ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Copies or duplicates a given stream. + * + * Input : org_stream original stream + * stream target stream (copy or duplicate) + * + * Output : Error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream org_stream, + TT_Stream* stream ) + { + MUTEX_Lock( files.lock ); + *stream = org_stream; + files.stream = STREAM2REC( org_stream ); /* set current stream */ + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream + * + * Output : Error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + HANDLE_Set( *stream, NULL ); + MUTEX_Release( files.lock ); + + return TT_Err_Ok; + } + +#else /* TT_CONFIG_OPTION_THREAD_SAFE */ + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /******** ********/ + /******** R E E N T R A N T I M P L E M E N T A T I O N ********/ + /******** ********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +#define CUR_Stream STREAM2REC( stream ) /* re-entrant macros */ +#define CUR_Frame (*frame) + +#define STREAM_VARS stream, +#define STREAM_VAR stream + + +/******************************************************************* + * + * Function : TTFile_Init + * + * Description : Initializes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Init( PEngine_Instance engine ) + { + engine.file_component = NULL; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTFile_Done + * + * Description : Finalizes the File component. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTFile_Done( PEngine_Instance engine ) + { + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Use_Stream + * + * Description : Copies or duplicates a given stream. + * + * Input : org_stream original stream + * stream target stream (copy or duplicate) + * + * Output : Error code. The output stream is set to NULL in + * case of Failure. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Use_Stream( TT_Stream input_stream, + TT_Stream* copy ) + { + TT_Error error; + PStream_Rec stream_rec; + PStream_Rec copy_rec; + + + stream_rec = STREAM2REC( input_stream ); + + if ( ALLOC( copy_rec, sizeof ( TStream_Rec ) ) ) + goto Fail; + + HANDLE_Set( *copy, copy_rec ); + + copy_rec->map->refcount++; + copy_rec->pos = 0; + + return TT_Err_Ok; + + Fail: + HANDLE_Set( *copy, NULL ); + return error; + } + + +/******************************************************************* + * + * Function : TT_Done_Stream + * + * Description : Releases a given stream. + * + * Input : stream + * + * Output : error code + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Done_Stream( TT_Stream* stream ) + { + return TT_Close_Stream( stream ); + } + +#endif /* TT_CONFIG_OPTION_THREAD_SAFE */ + + + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + /*********** ***********/ + /*********** C O M M O N I M P L E M E N T A T I O N ***********/ + /*********** ***********/ + /*******************************************************************/ + /*******************************************************************/ + /*******************************************************************/ + +/******************************************************************* + * + * Function : AllocateMap + * + * Description : Allocates a new map from the table. + * + * Output : Pointer to new stream rec. NULL in case of failure. + * + ******************************************************************/ + + static + TFileMap* Allocate_Map( void ) + { + TFileMap* result; + + + if ( MEM_Alloc( result, sizeof ( TFileMap ) ) ) + return NULL; + + result->refcount = 1; + return result; + } + + +/******************************************************************* + * + * Function : ReleaseMap + * + * Description : Releases a used map to the table if reference i + * counter reaches zero. + * + * Input : map + * + * Output : None. + * + * Note : Called by TT_Close_File() + * + ******************************************************************/ + + static + void Release_Map ( TFileMap* map ) + { + map->refcount--; + if ( map->refcount <= 0 ) + { + munmap ( (void*)map->base, map->size ); + FREE( map ); + } + } + + +/******************************************************************* + * + * Function : TT_Open_Stream + * + * Description : Opens the font file and saves the total file size. + * + * Input : error address of stream's error variable + * (re-entrant build only). + * filepathname pathname of the file to open + * stream address of target TT_Stream structure + * + * Output : SUCCESS on success, FAILURE on error. + * The target stream is set to -1 in case of failure. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TT_Open_Stream( const String* filepathname, + TT_Stream* stream ) + { + TT_Error error; + Int file; + PStream_Rec stream_rec; + TFileMap* map; + struct stat stat_buf; + + + if ( ALLOC( *stream, sizeof ( TStream_Rec ) ) ) + return error; + + map = Allocate_Map(); + if ( !map ) + { + error = TT_Err_Out_Of_Memory; + goto Memory_Fail; + } + + stream_rec = STREAM2REC( *stream ); + + file = open( (String*)filepathname, O_RDONLY ); + if ( file < 0 ) + goto File_Fail; + + if ( fstat( file, &stat_buf ) < 0 ) + goto Map_Fail; + + map->offset = 0; + map->size = stat_buf.st_size + map->offset; + map->base = mmap( NULL, + map->size, + PROT_READ, + MAP_FILE | MAP_PRIVATE, + file, + 0 ); + + if ( (long)map->base == -1 ) + goto Map_Fail; + + close( file ); + + stream_rec->map = map; + stream_rec->pos = 0; + +#ifndef TT_CONFIG_OPTION_THREAD_SAFE + CUR_Stream = stream_rec; +#endif + + return TT_Err_Ok; + + Map_Fail: + close( file ); + + File_Fail: + error = TT_Err_Could_Not_Open_File; + FREE( map ); + + Memory_Fail: + FREE( *stream ); + return error; + } + + +/******************************************************************* + * + * Function : TT_Close_Stream + * + * Description : Closes a stream. + * + * Input : stream + * + * Output : SUCCESS (always) + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TT_Close_Stream( TT_Stream* stream ) + { + PStream_Rec rec = STREAM2REC( *stream ); + + + Release_Map( rec->map ); + FREE( rec ); + + HANDLE_Set( *stream, NULL ); + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Flush_Stream + * + * Description : Flushes a stream, i.e., closes its file handle. + * + * Input : stream address of target TT_Stream structure + * + * Output : Error code + * + * NOTE : Never flush the current opened stream. This means that + * you should _never_ call this function between a + * TT_Use_Stream() and a TT_Done_Stream()! + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Flush_Stream( TT_Stream* stream ) + { + /* XXX - DUMMY IMPLEMENTATION */ + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Stream_Size + * + * Description : Returns the length of a given stream, even if it + * is flushed. + * + * Input : stream the stream + * + * Output : Length of stream in bytes. + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_Stream_Size( TT_Stream stream ) + { + PStream_Rec rec = STREAM2REC( stream ); + + + if ( rec ) + return rec->map->size; + else + return 0; /* invalid stream - return 0 */ + } + + +/******************************************************************* + * + * Function : TT_Seek_File + * + * Description : Seeks the file cursor to a different position. + * + * Input : position new position in file + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Seek_File( STREAM_ARGS Long position ) + { + if ( position > CUR_Stream->map->size ) + return TT_Err_Invalid_File_Offset; + + CUR_Stream->pos = position; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Skip_File + * + * Description : Skips forward the file cursor. + * + * Input : distance number of bytes to skip + * + * Output : see TT_Seek_File + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Skip_File( STREAM_ARGS Long distance ) + { + return TT_Seek_File( STREAM_VARS CUR_Stream->pos + distance ); + } + + +/******************************************************************* + * + * Function : TT_Read_File + * + * Description : Reads a chunk of the file and copies it to memory. + * + * Input : buffer target buffer + * count length in bytes to read + * + * Output : SUCCESS on success. FAILURE if out of range. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_File( STREAM_ARGS void* buffer, Long count ) + { + if ( CUR_Stream->pos + count > CUR_Stream->map->size ) + return TT_Err_Invalid_File_Read; + + MEM_Copy( buffer, + MAP_Address( CUR_Stream->map ) + CUR_Stream->pos, count ); + CUR_Stream->pos += count; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Read_At_File + * + * Description : Reads file at a specified position. + * + * Input : position position to seek to before read + * buffer target buffer + * count number of bytes to read + * + * Output : SUCCESS on success. FAILURE if error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Read_At_File( STREAM_ARGS Long position, + void* buffer, + Long count ) + { + TT_Error error; + + + if ( (error = TT_Seek_File( STREAM_VARS position )) || + (error = TT_Read_File( STREAM_VARS buffer, count )) ) + return error; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_File_Pos + * + * Description : Returns current file seek pointer. + * + * Input : none + * + * Output : current file position + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_File_Pos( STREAM_ARG ) + { + return CUR_Stream->pos; + } + + +/******************************************************************* + * + * Function : TT_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : Error code + * + * Notes: The function fails if the byte range is not within the + * the file, or if there is not enough memory to cache + * the bytes properly (which usually means that aSize is + * too big in both cases). + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + if ( CUR_Stream->pos + size > CUR_Stream->map->size ) + return TT_Err_Invalid_Frame_Access; + + CUR_Frame.size = size; + CUR_Frame.address = MAP_Address( CUR_Stream->map ) + CUR_Stream->pos; + CUR_Frame.cursor = CUR_Frame.address; + + CUR_Stream->pos += size; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Check_And_Access_Frame + * + * Description : Notifies the component that we're going to read + * 'size' bytes from the current file position. + * This function should load/cache/map these bytes + * so that they will be addressed by the GET_xxx() + * functions easily. + * + * Input : size number of bytes to access. + * + * Output : Error code + * + * Notes: The function truncates 'size' if the byte range is not + * within the file. + * + * It will fail if there is not enough memory to cache + * the bytes properly (which usually means that aSize is + * too big). + * + * It will fail if you make two consecutive calls + * to TT_Access_Frame(), without a TT_Forget_Frame() between + * them. + * + * The only difference with TT_Access_Frame() is that we + * check that the frame is within the current file. We + * otherwise truncate it. The 'overflow' is set to zero. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Check_And_Access_Frame( STREAM_ARGS FRAME_ARGS Long size ) + { + TT_Error error; + Long readBytes; + + + if ( CUR_Frame.address != NULL ) + return TT_Err_Nested_Frame_Access; + + readBytes = CUR_Stream->map->size - CUR_Stream->pos; + if ( size > readBytes ) + { + /* There is overflow, we allocate a new block then */ + if ( ALLOC( CUR_Frame.address, size ) ) + return error; + + CUR_Frame.size = size; + + /* copy the valid part */ + MEM_Copy( CUR_Frame.address, + MAP_Address( CUR_Stream->map ) + CUR_Stream->pos, + readBytes ); + } + else + { + CUR_Frame.size = size; + CUR_Frame.address = MAP_Address( CUR_Stream->map ) + CUR_Stream->pos; + } + + CUR_Frame.cursor = CUR_Frame.address; + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TT_Forget_Frame + * + * Description : Releases a cached frame after reading. + * + * Input : None + * + * Output : SUCCESS on success. FAILURE on error. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Forget_Frame( FRAME_ARG ) + { + if ( CUR_Frame.address == NULL ) + return TT_Err_Nested_Frame_Access; + + /* If we were using a duplicate in case of overflow, free it now */ + if ( CUR_Frame.address < (Byte*)CUR_Stream->map->base || + CUR_Frame.address >= (Byte*)CUR_Stream->map->base + + CUR_Stream->map->size ) + FREE( CUR_Frame.address ); + + ZERO_Frame( files.frame ); + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : GET_Byte + * + * Description : Extracts a byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted Byte + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + Byte TT_Get_Byte( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Byte)(*CUR_Frame.cursor++); + } + +#endif + + +/******************************************************************* + * + * Function : GET_Char + * + * Description : Extracts a signed byte from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted char + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Char TT_Get_Char( FRAME_ARG ) + { + CHECK_FRAME( CUR_Frame, 1 ); + + return (Char)(*CUR_Frame.cursor++); + } + + +/******************************************************************* + * + * Function : GET_Short + * + * Description : Extracts a short from the current file frame. + * + * Input : None or current frame + * + * Output : Extracted short + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Short TT_Get_Short( FRAME_ARG ) + { + Short getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((Short)CUR_Frame.cursor[0] << 8) | + (Short)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } + + +/******************************************************************* + * + * Function : GET_UShort + * + * Description : Extracts an unsigned short from the frame. + * + * Input : None or current frame + * + * Output : Extracted ushort + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + UShort TT_Get_UShort( FRAME_ARG ) + { + UShort getshort; + + + CHECK_FRAME( CUR_Frame, 2 ); + + getshort = ((UShort)CUR_Frame.cursor[0] << 8) | + (UShort)CUR_Frame.cursor[1]; + + CUR_Frame.cursor += 2; + + return getshort; + } + +#endif + + +/******************************************************************* + * + * Function : GET_Long + * + * Description : Extracts a long from the frame. + * + * Input : None or current frame + * + * Output : Extracted long + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + + EXPORT_FUNC + Long TT_Get_Long( FRAME_ARG ) + { + Long getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ((Long)CUR_Frame.cursor[0] << 24) | + ((Long)CUR_Frame.cursor[1] << 16) | + ((Long)CUR_Frame.cursor[2] << 8 ) | + (Long)CUR_Frame.cursor[3]; + + CUR_Frame.cursor += 4; + + return getlong; + } + + +/******************************************************************* + * + * Function : GET_ULong + * + * Description : Extracts an unsigned long from the frame. + * + * Input : None + * + * Output : Extracted ulong + * + * NOTES : We consider that the programmer is intelligent enough + * not to try to get a byte that is out of the frame. Hence, + * we provide no bounds check here. (A misbehaving client + * could easily page fault using this call.) + * + ******************************************************************/ + +#if 0 + + EXPORT_FUNC + ULong TT_Get_ULong( FRAME_ARG ) + { + ULong getlong; + + + CHECK_FRAME( CUR_Frame, 4 ); + + getlong = ( ((ULong)CUR_Frame.cursor[0] << 24) | + ((ULong)CUR_Frame.cursor[1] << 16) | + ((ULong)CUR_Frame.cursor[2] << 8 ) | + (ULong)CUR_Frame.cursor[3] ); + + CUR_Frame.cursor += 4; + + return getlong; + } + +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/vms/README b/Build/source/libs/libttf/arch/vms/README new file mode 100644 index 00000000000..b450611f4ac --- /dev/null +++ b/Build/source/libs/libttf/arch/vms/README @@ -0,0 +1,20 @@ +This directory contains two files for compiling the FreeType library under +VMS: + + ft_conf.h the configuration file for the FreeType library + descrip.mms a makefile to be used with either MMS or MMK + +The files are such designed that after unpacking of freetype-1.4 one can +give the command + + MMS/DESCR=[.LIB.ARCH.VMS] + +to build the libraries. (Of course, for MMK use `MMK' on the command line +instead of `MMS'.) The makefile contains a `clean' target, but no `install' +target since I'm note sure where to install the library and the include +files. + +I did NOT do the test programs but I tested it with my own programs. + + + Jouk Jansen <joukj@hrem.stm.tudelft.nl> diff --git a/Build/source/libs/libttf/arch/vms/descrip.mms b/Build/source/libs/libttf/arch/vms/descrip.mms new file mode 100644 index 00000000000..9115316dff2 --- /dev/null +++ b/Build/source/libs/libttf/arch/vms/descrip.mms @@ -0,0 +1,155 @@ +# This file is part of the FreeType project. +# +# DESCRIP.MMS: Make file for VMS using MMS or MMK +# Created by Jouk Jansen (joukj@hrem.stm.tudelft.nl) + +ARCH = arch.unix + +CC = cc + +############### PORTABILITY COMPONENTS ######################## + +# location of memory component +MEMSRC = ttmemory.c + +# location of file component +FILESRC = ttfile.c + +# location of mutex component +MUTEXSRC = ttmutex.c + +# location of default extensions +FTEXTDIR = [.lib.extend] + +# default extensions sources +EXTSRC = $(FTEXTDIR)ftxkern.c \ + $(FTEXTDIR)ftxgasp.c \ + $(FTEXTDIR)ftxpost.c \ + $(FTEXTDIR)ftxcmap.c \ + $(FTEXTDIR)ftxsbit.c \ + $(FTEXTDIR)ftxwidth.c \ + $(FTEXTDIR)ftxerr18.c \ + $(FTEXTDIR)ftxgsub.c \ + $(FTEXTDIR)ftxgpos.c \ + $(FTEXTDIR)ftxopen.c \ + $(FTEXTDIR)ftxgdef.c + +EXTOBJ = [.lib]ftxkern.obj, \ + [.lib]ftxgasp.obj, \ + [.lib]ftxpost.obj, \ + [.lib]ftxcmap.obj, \ + [.lib]ftxsbit.obj, \ + [.lib]ftxwidth.obj, \ + [.lib]ftxerr18.obj, \ + [.lib]ftxgsub.obj, \ + [.lib]ftxgpos.obj, \ + [.lib]ftxopen.obj, \ + [.lib]ftxgdef.obj + +# all engine sources +SRC_M = [.lib]ttapi.c \ + [.lib]ttcache.c \ + [.lib]ttcalc.c \ + [.lib]ttcmap.c \ + [.lib]ttdebug.c \ + [.lib]ttextend.c \ + [.lib]ttgload.c \ + [.lib]ttinterp.c \ + [.lib]ttload.c \ + [.lib]ttobjs.c \ + [.lib]ttraster.c \ + [.lib]$(FILESRC) \ + [.lib]$(MEMSRC) \ + [.lib]$(MUTEXSRC) +SRC_S = [.lib.$(ARCH)]freetype.c + +# all header files with path +HEADERS = [.lib]freetype.h \ + [.lib]fterrid.h \ + [.lib]ftnameid.h \ + $(FTEXTDIR)ftxkern.h \ + $(FTEXTDIR)ftxgasp.h \ + $(FTEXTDIR)ftxcmap.h \ + $(FTEXTDIR)ftxsbit.h \ + $(FTEXTDIR)ftxpost.h \ + $(FTEXTDIR)ftxwidth.h \ + $(FTEXTDIR)ftxerr18.h \ + $(FTEXTDIR)ftxgsub.h \ + $(FTEXTDIR)ftxgpos.h \ + $(FTEXTDIR)ftxgdef.h \ + $(FTEXTDIR)ftxopen.h + +# all engine objects +OBJ_M = [.lib]ttapi.obj, \ + [.lib]ttcache.obj, \ + [.lib]ttcalc.obj, \ + [.lib]ttcmap.obj, \ + [.lib]ttdebug.obj, \ + [.lib]ttextend.obj, \ + [.lib]ttgload.obj, \ + [.lib]ttinterp.obj, \ + [.lib]ttload.obj, \ + [.lib]ttobjs.obj, \ + [.lib]ttraster.obj, \ + [.lib]file.obj, \ + [.lib]memory.obj, \ + [.lib]mutex.obj, \ + $(EXTOBJ) +OBJ_S = [.lib]freetype.obj + + +# include paths +INCLUDES = /include=([.lib],[],$(FTEXTDIR)) + +# C flags +CFLAGS = $(INCLUDES)/obj=[.lib] + +all : do_link [.lib]libttf.olb + library/compress [.lib]libttf.olb + +do_link : + if f$search( "[.lib]memory.c" ) .nes. "" then set file/remove [.lib]memory.c; + if f$search( "[.lib]file.c" ) .nes. "" then set file/remove [.lib]file.c; + if f$search( "[.lib]mutex.c" ) .nes. "" then set file/remove [.lib]mutex.c; + if f$search( "[.lib]ft_conf.h" ) .nes. "" then set file/remove [.lib]ft_conf.h; + set file/enter=[.lib]memory.c [.lib]$(MEMSRC) + set file/enter=[.lib]file.c [.lib]$(FILESRC) + set file/enter=[.lib]mutex.c [.lib]$(MUTEXSRC) + set file/enter=[.lib]ft_conf.h [.lib.arch.vms]ft_conf.h + +[.lib]ftxkern.obj : $(FTEXTDIR)ftxkern.c + +[.lib]ftxgasp.obj : $(FTEXTDIR)ftxgasp.c + +[.lib]ftxpost.obj : $(FTEXTDIR)ftxpost.c + +[.lib]ftxcmap.obj : $(FTEXTDIR)ftxcmap.c + +[.lib]ftxsbit.obj : $(FTEXTDIR)ftxsbit.c + +[.lib]ftxwidth.obj : $(FTEXTDIR)ftxwidth.c + +[.lib]ftxerr18.obj : $(FTEXTDIR)ftxerr18.c + +[.lib]ftxgsub.obj : $(FTEXTDIR)ftxgsub.c + +[.lib]ftxgpos.obj : $(FTEXTDIR)ftxgpos.c + +[.lib]ftxgdef.obj : $(FTEXTDIR)ftxgdef.c + +[.lib]ftxopen.obj : $(FTEXTDIR)ftxopen.c + +[.lib]freetype.obj : $(SRC_S) $(SRC_M) + + +[.lib]libttf.olb : $(OBJ_M) + library/create [.lib]libttf.olb $(OBJ_M) + + +clean : + delete [.lib]*.obj;* + delete [.lib]*.olb;* + if f$search( "[.lib]memory.c" ) .nes. "" then set file/remove [.lib]memory.c; + if f$search( "[.lib]file.c" ) .nes. "" then set file/remove [.lib]file.c; + if f$search( "[.lib]mutex.c" ) .nes. "" then set file/remove [.lib]mutex.c; + if f$search( "[.lib]ft_conf.h" ) .nes. "" then set file/remove [.lib]ft_conf.h; diff --git a/Build/source/libs/libttf/arch/vms/ft_conf.h b/Build/source/libs/libttf/arch/vms/ft_conf.h new file mode 100644 index 00000000000..b1315e63571 --- /dev/null +++ b/Build/source/libs/libttf/arch/vms/ft_conf.h @@ -0,0 +1,215 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for VMS using MMS or MMK */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/* Define if you have the getpagesize function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE 1 + +/* Define if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 + +/* Define if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if you have the <libintl.h> header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define if you have the libintl library. */ +/* #undef HAVE_LIBINTL */ + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #undef HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +/* #undef TT_CONFIG_OPTION_THREAD_SAFE */ + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +/* #undef DEBUG_LEVEL_TRACE */ + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +/* #undef DEBUG_LEVEL_ERROR */ + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/win16/Makefile.BC b/Build/source/libs/libttf/arch/win16/Makefile.BC new file mode 100644 index 00000000000..bbf540ebb9a --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/Makefile.BC @@ -0,0 +1,180 @@ +# This file is part of the FreeType project. +# +# It builds the library for Borland C++ for 16-bit Windows, large model. +# Due to size constraints, it does not try to pack all modules into one. +# +# You will need Borland MAKE. +# Tested with Borland C++ v.4.0 and 5.0. +# +# Use this file while in the lib directory with the following statement: +# +# make -farch/win16/Makefile.BC +# +# +# A DLL version of the library can be built with +# +# make -DDLL -farch/win16/Makefile.BC dll +# +# Debug versions can be obtained with +# +# make -DDEBUG -farch\win16\Makefile.BC +# +# Special versions enabled to handle big fonts (with more than 16,384 +# glyphs) can be obtained with +# +# make -DBIGFONTS -farch/win16/Makefile.BC + +ARCH = arch\win16 +FT_MAKEFILE = $(ARCH)\Makefile.BC +FT_DLL = ft14_16.dll + +CC = bcc +LIB = tlib /c /e +IMPLIB = implib -c -o + +SPURIOUS_WARNINGS = -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig + +# Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern +# Borland compilers (from BC++ 3.1 on) can increase the limit on +# the length of identifiers. +!if ! $d(DEBUG) +CFLAGS = -O2 -3 -ml -A -i40 -I$(ARCH);.;extend $(SPURIOUS_WARNINGS) +DLLFLAGS = -ml -WD -lC +!else +CFLAGS = -v -N -ml -A -i40 -I$(ARCH);.;extend $(SPURIOUS_WARNINGS) +DLLFLAGS = -v -ml -WD -lC +!endif + +CFLAGS = $(CFLAGS) -W + +FT_DEF = $(FT_DLL:.dll=.def) +!if $d(DLL) +CFLAGS = $(CFLAGS) -WD +!endif + + +!if $d(BIGFONTS) +CFLAGS = $(CFLAGS) -DTT_HUGE_PTR=__huge + +TTFILE = $(ARCH)\hugefile.c +TTMEMORY = $(ARCH)\hugemem.c +!else +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +!endif +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces before the \ at end of line, +# otherwise the substitution for TLIB command line will fail. +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ + extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c\ + extend\ftxsbit.c extend\ftxgsub.c extend\ftxgpos.c\ + extend\ftxopen.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c\ + ttgload.c ttinterp.c ttload.c ttobjs.c\ + ttraster.c ttextend.c ttdebug.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Borland make does not handle $($(LIB_FILES)), and using +# -DLIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing TLIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# See ../msdos/Makefile.TC for an application. +.c.obj: + @$(CC) -c -o$* @&&| + $(CFLAGS) $< +| + + +!if ! $d(DEBUG) +# Skipped if DEBUG build +# (but it changes nothing, since we always build in multiple parts). +all: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_M: = + ) +| +!endif + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_M: = + ) +| + +$(FT_DEF): $(ARCH)\ttf.def + -copy $(ARCH)\ttf.def $(FT_DEF) + +dll $(FT_DLL): $(OBJS_M) $(FT_DEF) +!if $d(DLL) + $(CC) -e$(FT_DLL) @&&| + $(DLLFLAGS) $(OBJS_M) +| + $(IMPLIB) libttf $(FT_DEF) +!else +# Re-invoke with flag set. Unfortunately, this discards the other flags. + make -DDLL -f$(ARCH)/Makefile.BC dll +!endif + +install: $(FT_DLL) +!if $d(INSTALL_DIR) + copy $(FT_DLL) $(INSTALL_DIR) +!else + copy $(FT_DLL) C:\WINDOWS +!endif + + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + -del libttf.lib + echo -+$(**: =-+)> response + $(LIB) libttf.lib @&&| ++ $(**: = + ) +| + +!if $d(BIGFONTS) +$(TTMEMORY:.c=.obj): $(TTMEMORY) + $(CC) -c -o$* @&&| + $(CFLAGS) -A- $*.c +| + +$(TTFILE:.c=.obj): $(TTFILE) + $(CC) -c -o$* @&&| + $(CFLAGS) -A- $*.c +| +!endif + + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak + -del response + -del *.def + +distclean: clean + -del libttf.lib + -del *.dll + -del $(FT_DEF) + -del C:\WINDOWS\$(FT_DLL) +!if $d(INSTALL_DIR) + -del $(INSTALL_DIR)\$(FT_DLL) +!endif + +!include "$(ARCH)\depend.win" + +# end of Makefile diff --git a/Build/source/libs/libttf/arch/win16/Makefile.MS b/Build/source/libs/libttf/arch/win16/Makefile.MS new file mode 100644 index 00000000000..9ff0b6749a4 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/Makefile.MS @@ -0,0 +1,106 @@ +# This file is part of the FreeType project. +# +# It builds the library for Microsoft C for Windows, large model. +# It also works for Visual C++ 1.x 16-bit compilers, but you should +# instead use the Makefile customized for it, Makefile.VC. +# Due to size constraints, it does not try to pack all modules into one. +# +# You will need NMAKE. +# +# Use this file while in the lib directory with the following statement: +# +# nmake /f arch\win16\Makefile.MS +# +# +# A debug version can be obtained with +# +# nmake DEBUG=1 /f arch\win16\Makefile.MS + +ARCH = arch\win16 +FT_MAKEFILE = $(ARCH)\Makefile.MS + +CC = cl /nologo +LIB = lib /noignorecase /nologo + +!ifndef DEBUG +CFLAGS = /Ox /AL /Za /W2 /G2 -I$(ARCH) -I. -Iextend +!else +CFLAGS = /Zi /AL /Za /W2 /G2 -I$(ARCH) -I. -Iextend +!endif + +# Use /Gw instead with Microsoft C version 6 +CFLAGS = $(CFLAGS) /GA + + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces between the file names or at end of line, otherwise +# the substitution for LIB command line will fail. Thank you. +# +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ +extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\ +extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\ +ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using +# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing LIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# See ..\msdos\Makefile.TC for an application. +.c.obj: + $(CC) /c /Fo$@ @<< + $(CFLAGS) $*.c +<< + + +!ifndef DEBUG +# Skipped if DEBUG build +# (but it changes nothing, since we always build in multiple parts). +all: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = ^ ); +<<KEEP +!endif + + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = ^ ); +<<KEEP + + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + $(LIB) $@ +-$(?: =-+); + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del response + +distclean: clean + -del libttf.lib + +!include "$(ARCH)\depend.win" + +# end of Makefile.MS diff --git a/Build/source/libs/libttf/arch/win16/Makefile.VC b/Build/source/libs/libttf/arch/win16/Makefile.VC new file mode 100644 index 00000000000..e7663839328 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/Makefile.VC @@ -0,0 +1,175 @@ +# This file is part of the FreeType project. +# +# It builds the library for Microsoft Visual C++ 1.x for 16-bit Windows, +# large model. It also works for Microsoft C/C++ v.7.0 16-bit compiler, +# but not for previous versions (see Makefile.MS instead). +# +# You will need NMAKE. +# +# Use this file while in the lib directory with the following statement: +# +# nmake /f arch\win16\Makefile.VC +# +# +# A DLL version of the library can be built with +# +# nmake DLL=1 /f arch\win16\Makefile.VC dll +# +# Debug versions can be obtained with +# +# nmake DEBUG=1 /f arch\win16\Makefile.VC +# +# Special versions enabled to handle big fonts (with more than 16,384 +# glyphs) can be obtained with +# +# nmake BIGFONTS=1 /f arch\win16\Makefile.VC + +ARCH = arch\win16 +FT_MAKEFILE = $(ARCH)\Makefile.VC +FT_DLL = ft14_16.dll + +CC = cl /nologo +LIB = lib /noignorecase /nologo +IMPLIB = implib /noignorecase /nologo + +# One can also consider using "set MSC_CMD_FLAGS=/Gr /Op- /Gy /YX". +# With Microsoft C/C++ 7.0, use /G2 instead of /G3. +!ifndef DEBUG +CFLAGS = /Ox /AL /Za /W2 /G3 -I$(ARCH) -I. -Iextend +DLLFLAGS = /AL /Ld +!else +CFLAGS = /Zi /Ge /AL /Za /W2 /G3 -I$(ARCH) -I. -Iextend +DLLFLAGS = /AL /Lw /Zi +!endif + +FT_DEF = $(FT_DLL:.dll=.def) +!ifdef DLL +CFLAGS = $(CFLAGS) /GD /GEf +!else +CFLAGS = $(CFLAGS) /GA +!endif + + +!ifdef BIGFONTS +CFLAGS = $(CFLAGS) /DTT_HUGE_PTR=__huge + +TTFILE = $(ARCH)\hugefile.c +TTMEMORY = $(ARCH)\hugemem.c +!else +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +!endif +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces between the file names or at end of line, otherwise +# the substitution for LIB command line will fail. Thank you. +# +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ +extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\ +extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\ +ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using +# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing LIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# See ..\msdos\Makefile.TC for an application. +.c.obj: + @$(CC) /c /Fo$@ @<< + $(CFLAGS) $*.c +<< + + +!ifndef DEBUG +# Skipped if DEBUG build +all: $(OBJS_S) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_S: = + ); +<<KEEP +!endif + + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @<<response ++ $(OBJS_M: = + ); +<<KEEP + +$(FT_DEF): $(ARCH)\ttf.def + -copy $(ARCH)\ttf.def $(FT_DEF) + +dll $(FT_DLL): $(OBJS_M) $(FT_DEF) +!ifdef DLL + $(CC) /Fe$(FT_DLL) @<< + $(DLLFLAGS) $** +<< + $(IMPLIB) libttf.lib $(FT_DEF) +!else +# Re-invoke with flag set. Unfortunately, this discards the other flags. + $(MAKE) DLL=1 /f $(ARCH)/Makefile.VC dll +!endif + +install: $(FT_DLL) +!ifdef INSTALL_DIR + copy $(FT_DLL) $(INSTALL_DIR) +!else + copy $(FT_DLL) C:\WINDOWS +!endif + + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + $(LIB) $@ +-$(?: =-+); + +!ifdef BIGFONTS +$(TTFILE:.c=.obj): + $(CC) /c /Fo$@ @<< + $(CFLAGS) /Ze $*.c + +$(TTMEMORY:.c=.obj): + $(CC) /c /Fo$@ @<< + $(CFLAGS) /Ze $*.c +<< + +$(OBJ_S): + $(CC) /c /Fo$@ @<< + $(CFLAGS) /Ze $*.c +<< +!endif + + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak + -del response + +distclean: clean + -del libttf.lib + -del *.dll + -del $(FT_DLL:.dll=.def) + -del C:\WINDOWS\$(FT_DLL) +!ifdef INSTALL_DIR + -del $(INSTALL_DIR)\$(FT_DLL) +!endif + +!include "$(ARCH)\depend.win" + +# end of Makefile.VC diff --git a/Build/source/libs/libttf/arch/win16/depend.win b/Build/source/libs/libttf/arch/win16/depend.win new file mode 100644 index 00000000000..6b3612cbfd2 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/depend.win @@ -0,0 +1,109 @@ +# This dependency file to be used with various Windows compilers +# has been generated automatically with the script `makedep' on +# 07-Mar-2000. + +ttapi.obj: ttapi.c ttconfig.h arch\win16\ft_conf.h freetype.h fterrid.h \ + ftnameid.h ttengine.h tttypes.h ttmutex.h ttcalc.h ttmemory.h \ + ttcache.h ttfile.h ttdebug.h ttobjs.h tttables.h ttcmap.h ttload.h \ + ttgload.h ttraster.h ttextend.h +ttcache.obj: ttcache.c ttengine.h tttypes.h ttconfig.h \ + arch\win16\ft_conf.h freetype.h fterrid.h ftnameid.h ttmutex.h \ + ttmemory.h ttcache.h ttobjs.h tttables.h ttcmap.h ttdebug.h +ttcalc.obj: ttcalc.c ttcalc.h ttconfig.h arch\win16\ft_conf.h freetype.h \ + fterrid.h ftnameid.h ttdebug.h tttypes.h tttables.h +ttcmap.obj: ttcmap.c ttobjs.h ttconfig.h arch\win16\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttdebug.h ttfile.h ttmemory.h ttload.h +ttdebug.obj: ttdebug.c ttdebug.h ttconfig.h arch\win16\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h tttables.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h ttcmap.h +ttextend.obj: ttextend.c ttextend.h ttconfig.h arch\win16\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttmemory.h +ttfile.obj: ttfile.c ttconfig.h arch\win16\ft_conf.h freetype.h \ + fterrid.h ftnameid.h tttypes.h ttdebug.h ttengine.h ttmutex.h \ + ttmemory.h ttfile.h +ttgload.obj: ttgload.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h ttgload.h \ + ttmemory.h tttags.h ttload.h +ttinterp.obj: ttinterp.c freetype.h fterrid.h ftnameid.h tttypes.h \ + ttconfig.h arch\win16\ft_conf.h ttdebug.h ttcalc.h ttmemory.h \ + ttinterp.h ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h \ + ttcmap.h +ttload.obj: ttload.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h \ + ttmemory.h tttags.h ttload.h +ttmemory.obj: ttmemory.c ttdebug.h ttconfig.h arch\win16\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmemory.h ttengine.h \ + ttmutex.h +ttmutex.obj: ttmutex.c ttmutex.h ttconfig.h arch\win16\ft_conf.h +ttobjs.obj: ttobjs.c ttobjs.h ttconfig.h arch\win16\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttfile.h ttdebug.h ttcalc.h ttmemory.h ttload.h \ + ttinterp.h ttextend.h +ttraster.obj: ttraster.c ttraster.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttengine.h tttypes.h ttmutex.h \ + ttdebug.h ttcalc.h ttmemory.h +extend\ftxcmap.obj: extend\ftxcmap.c extend\ftxcmap.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win16\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxerr18.obj: extend\ftxerr18.c ttconfig.h arch\win16\ft_conf.h \ + extend\ftxerr18.h freetype.h fterrid.h ftnameid.h extend\ftxkern.h \ + extend\ftxpost.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h +extend\ftxgasp.obj: extend\ftxgasp.c extend\ftxgasp.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win16\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxgdef.obj: extend\ftxgdef.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgpos.obj: extend\ftxgpos.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgsub.obj: extend\ftxgsub.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxkern.obj: extend\ftxkern.c extend\ftxkern.h freetype.h fterrid.h \ + ftnameid.h ttextend.h ttconfig.h arch\win16\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttdebug.h \ + ttmemory.h ttfile.h ttload.h tttags.h +extend\ftxopen.obj: extend\ftxopen.c tttypes.h ttconfig.h arch\win16\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxpost.obj: extend\ftxpost.c extend\ftxpost.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win16\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttload.h ttfile.h \ + ttdebug.h tttags.h ttmemory.h ttextend.h +extend\ftxsbit.obj: extend\ftxsbit.c extend\ftxsbit.h freetype.h fterrid.h \ + ftnameid.h ttobjs.h ttconfig.h arch\win16\ft_conf.h ttengine.h \ + tttypes.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h ttdebug.h \ + ttload.h ttmemory.h tttags.h ttextend.h +extend\ftxwidth.obj: extend\ftxwidth.c extend\ftxwidth.h freetype.h fterrid.h \ + ftnameid.h ttdebug.h ttconfig.h arch\win16\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h \ + tttags.h ttload.h +!ifndef __MAKE__ +arch\win16\freetype.obj: arch\win16\freetype.c ttapi.c ttconfig.h \ + arch\win16\ft_conf.h freetype.h fterrid.h ftnameid.h ttengine.h \ + tttypes.h ttmutex.h ttcalc.h ttmemory.h ttcache.h ttfile.h ttdebug.h \ + ttobjs.h tttables.h ttcmap.h ttload.h ttgload.h ttraster.h ttextend.h \ + ttcache.c ttcalc.c ttcmap.c ttdebug.c ttgload.c tttags.h ttinterp.c \ + ttinterp.h ttload.c ttobjs.c ttraster.c arch\win16\hugefile.c \ + ttfile.c arch\win16\hugemem.c ttmutex.c ttextend.c +arch\win16\hugefile.obj: arch\win16\hugefile.c ttconfig.h arch\win16\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttfile.c ttdebug.h \ + ttengine.h ttmutex.h ttmemory.h ttfile.h +arch\win16\hugemem.obj: arch\win16\hugemem.c ttdebug.h ttconfig.h \ + arch\win16\ft_conf.h tttypes.h freetype.h fterrid.h ftnameid.h \ + ttmemory.h ttengine.h ttmutex.h +!endif diff --git a/Build/source/libs/libttf/arch/win16/freetype.c b/Build/source/libs/libttf/arch/win16/freetype.c new file mode 100644 index 00000000000..1ff2c887de7 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/freetype.c @@ -0,0 +1,39 @@ +/* This file is part of the FreeType project */ + +/* Single object library component for 16-bit Windows. */ +/* Note that low-optimizing compilers (such as Borland ones) cannot */ +/* successfully compile this file, because it exceeds 64K of code size. */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#ifdef TT_HUGE_PTR +#include "arch/win16/hugefile.c" +#include "arch/win16/hugemem.c" +#else +#include "ttfile.c" +#include "ttmemory.c" +#endif +#include "ttmutex.c" + +/* finally, add some extensions */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/win16/ft_conf.h b/Build/source/libs/libttf/arch/win16/ft_conf.h new file mode 100644 index 00000000000..8578ab93148 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/ft_conf.h @@ -0,0 +1,209 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for 16-bit Windows */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if you need <conio.h> for console I/O functions. */ +#undef HAVE_CONIO_H + +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the libintl library. */ +#undef HAVE_LIBINTL + +/* command.com can't pipe stderr into a file; any message would be */ +/* written into the graphics screen. */ +#define HAVE_PRINT_FUNCTION 1 + +#define Print( format, ap ) vfprintf( stdout, (format), (ap) ) + +/* The number of bytes in a int. */ +#define SIZEOF_INT 2 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#undef LONG64 +#undef INT64 + +#endif /* FT_CONF_H */ + +/* End of ft_conf.h */ diff --git a/Build/source/libs/libttf/arch/win16/hugefile.c b/Build/source/libs/libttf/arch/win16/hugefile.c new file mode 100644 index 00000000000..17b5f5948f7 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/hugefile.c @@ -0,0 +1,51 @@ +/******************************************************************* + * + * hugefile.c + * + * File I/O Component (body) for dealing with "huge" objects + * under 16-bit Windows. Relies on the "default" version, with + * a small hook. Requires Windows 3.1+. + * + * Written by Antoine Leca based on ideas from Dave Hoo. + * Copyright 1999 by Dave Hoo, Antoine Leca, + * 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. + * + * NOTE + * + * This file #includes the normal version, to avoid discrepancies + * between versions. It uses only ANSI-mandated "tricks", so + * any ANSI-compliant compiler should be able to compile this file. + * + ******************************************************************/ + +#include "ttconfig.h" +#include "tttypes.h" + +#include <windows.h> + + /* Here we include <stdio.h>, to have the proper definition of fread */ +#include <stdio.h> + + /* Some compilers define fileno(), some define _fileno()... */ +#ifndef _fileno +#define _fileno(stream) fileno(stream) +#endif + + /* Then, we divert the use of fread to the Windows version */ +#undef fread +#define fread(ptr, size, n, stream) \ + _hread( _fileno(stream), (char TT_HUGE_PTR *) ptr, (ULong)n * size ) + + + /* Now, we include the "normal" version of `ttfile.c' */ + /* The ANSI/ISO standard mandates that the include of <stdio.h> */ + /* there have no bad effects. */ +#include "ttfile.c" + +/* END */ diff --git a/Build/source/libs/libttf/arch/win16/hugemem.c b/Build/source/libs/libttf/arch/win16/hugemem.c new file mode 100644 index 00000000000..c1abe5f1535 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/hugemem.c @@ -0,0 +1,539 @@ +/******************************************************************* + * + * hugemem.c + * + * Memory management component (body) + * for dealing with "huge" objects with 16-bit Windows. + * + * Written by Antoine Leca based on ideas from Dave Hoo. + * Copyright 1999 by Dave Hoo, Antoine Leca, + * 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. + * + ******************************************************************/ + +#include <limits.h> +#include <windows.h> + +#include "ttdebug.h" +#include "ttmemory.h" +#include "ttengine.h" + +#ifndef TT_HUGE_PTR +#error "This component needs TT_HUGE_PTR to be #defined." +#endif + +#ifdef TT_CONFIG_OPTION_THREAD_SAFE +#error "This component needs static allocation and is not re-entrant." +#endif + + /* If the memory reclaimed is abobve this limit, alloc directly from */ + /* global heap. Else, alloc using malloc (using suballocation). */ +#ifndef MEMORY_MIN_GLOBAL +#define MEMORY_MIN_GLOBAL 4096 +#endif + +/* required by the tracing mode */ +#undef TT_COMPONENT +#define TT_COMPONENT trace_memory + + +#ifdef DEBUG_MEMORY + +#include <stdio.h> + +#define MAX_TRACKED_BLOCKS 1024 + + struct TMemRec_ + { + void* base; + Long size; + }; + + typedef struct TMemRec_ TMemRec; + + static TMemRec pointers[MAX_TRACKED_BLOCKS + 1]; + + static Int num_alloc; + static Int num_free; + static Int num_realloc; /* counts only `real' reallocations + (i.e., an existing buffer will be resized + to a value larger than zero */ + + static Int fail_alloc; + static Int fail_realloc; + static Int fail_free; + +#else + + /* We need a tracing stack of the calls to big chunks of memory, */ + /* in order to call the matching version of free(). */ + +#define MAX_TRACKED_BIGCHUNKS 64 + + struct TMemRec_ + { + void* base; + }; + + typedef struct TMemRec_ TMemRec; + + static TMemRec pointers[MAX_TRACKED_BIGCHUNKS + 1]; + +#endif /* DEBUG_MEMORY */ + + +#ifndef TT_CONFIG_REENTRANT + Long TTMemory_Allocated; + Long TTMemory_MaxAllocated; +#endif + + +/******************************************************************* + * + * Function : TT_Alloc + * + * Description : Allocates memory from the heap buffer. + * + * Input : Size size of the memory to be allocated + * P pointer to a buffer pointer + * + * Output : Error code. + * + * NOTE : The newly allocated block should _always_ be zeroed + * on return. Many parts of the engine rely on this to + * work properly. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Alloc( ULong Size, void** P ) + { + Int i; + + + if ( !P ) + return TT_Err_Invalid_Argument; + /* Also see below for another case of "invalid argument". */ + + if ( Size > 0 ) + { + if ( Size >= MEMORY_MIN_GLOBAL ) + { + HANDLE hMem; + + hMem = GlobalAlloc( GMEM_ZEROINIT, Size ); + if ( !hMem ) + return TT_Err_Out_Of_Memory; + + *P = (void*)GlobalLock( hMem ); + } + else + *P = (void*)malloc( Size ); + + if ( !*P ) + return TT_Err_Out_Of_Memory; + +#ifndef TT_CONFIG_REENTRANT + TTMemory_MaxAllocated += Size; + TTMemory_Allocated += Size; +#endif + +#ifdef DEBUG_MEMORY + + num_alloc++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != NULL ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_alloc++; + else + { + pointers[i].base = *P; + pointers[i].size = Size; + } + +#else + + if ( Size >= MEMORY_MIN_GLOBAL ) + { + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != NULL ) + i++; + + if ( i >= MAX_TRACKED_BIGCHUNKS ) + /* We fail badly here. Increase MAX_TRACKED_BIGCHUNKS if needed. */ + return TT_Err_Invalid_Argument; + else + pointers[i].base = *P; + } + +#endif /* DEBUG_MEMORY */ + + /* The nice thing about GlobalAlloc is that it zeroes the memory. */ + + if ( Size < MEMORY_MIN_GLOBAL ) + MEM_Set( *P, 0, Size ); + + } + else + *P = NULL; + + return TT_Err_Ok; + } + + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE + + +/******************************************************************* + * + * Function : TT_Realloc + * + * Description : Reallocates memory from the heap buffer. + * + * Input : Size new size of the memory to be allocated; + * if zero, TT_Free() will be called + * P pointer to a buffer pointer; if *P == NULL, + * TT_Alloc() will be called + * + * Output : Error code. + * + * NOTES : It's not necessary to zero the memory in case the + * reallocated buffer is larger than before -- the + * application has to take care of this. + * + * If the memory request fails, TT_Free() will be + * called on *P, and TT_Err_Out_Of_Memory returned. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Realloc( ULong Size, void** P ) + { + ULong oldSize; + void* Q; + Int i; + + + if ( !P ) + return TT_Err_Invalid_Argument; + + if ( !*P ) + return TT_Alloc( Size, P ); + + if ( Size == 0 ) + return TT_Free( P ); + +#ifdef DEBUG_MEMORY + + num_realloc++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != *P ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_realloc++; + else + oldSize = pointers[i].size; + +#else + + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != *P ) + i++; + + /* If we did not found the pointer, then this is a "small" chunk. */ + + if ( i < MAX_TRACKED_BIGCHUNKS ) + { + /* Signal we found a big one. Real size does not matter. */ + oldSize = MEMORY_MIN_GLOBAL; + } + +#endif /* DEBUG_MEMORY */ + + if ( oldSize >= MEMORY_MIN_GLOBAL ) + { + /* Deal with a big chunk. */ + HANDLE hMem, hNewMem; + + hMem = GlobalHandle ( (ULong)*P >> 16 ) & 0xFFFF; + if ( !hMem ) /* Bad call... */ + return TT_Err_Invalid_Argument; + + GlobalUnlock( hMem ); + hNewMem = GlobalReAlloc( hMem, Size, 0 ); + if ( hNewMem ) + *P = (void*)GlobalLock( hNewMem ); + } + if ( Size >= MEMORY_MIN_GLOBAL ) + { + /* A small chunk crosses the limit... */ + + if( TT_Alloc( Size, &Q ) != TT_Err_Ok ) + Q = NULL; /* Failed to create the new block. */ + else + MEM_Copy( Q, *P, oldSize ); + + /* We need to register the new entry. */ +#ifndef DEBUG_MEMORY + + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != NULL ) + i++; + + if ( i >= MAX_TRACKED_BIGCHUNKS ) + /* We fail badly here. Increase MAX_TRACKED_BIGCHUNKS if needed. */ + return TT_Err_Invalid_Argument; +#endif /* DEBUG_MEMORY */ + } + else + Q = (void*)realloc( *P, Size ); + + if ( !Q ) + { + TT_Free( *P ); + return TT_Err_Out_Of_Memory; + } + +#ifdef DEBUG_MEMORY + + if ( i < MAX_TRACKED_BLOCKS ) + { +#ifndef TT_CONFIG_REENTRANT + TTMemory_Allocated += Size - pointers[i].size; + if ( Size > pointers[i].size ) + TTMemory_MaxAllocated += Size - pointers[i].size; +#endif + + pointers[i].base = Q; + pointers[i].size = Size; + } +#else + if ( i < MAX_TRACKED_BIGCHUNKS ) + { + pointers[i].base = Q; + } +#endif /* DEBUG_MEMORY */ + + *P = Q; + + return TT_Err_Ok; + } + + +#endif /* TT_CONFIG_OPTION_EXTEND_ENGINE */ + + +/******************************************************************* + * + * Function : TT_Free + * + * Description : Releases a previously allocated block of memory. + * + * Input : P pointer to memory block + * + * Output : Always SUCCESS. + * + * Note : The pointer must _always_ be set to NULL by this function. + * + ******************************************************************/ + + EXPORT_FUNC + TT_Error TT_Free( void** P ) + { + Int i; + Long Size = 0; + + + if ( !P || !*P ) + return TT_Err_Ok; + +#ifdef DEBUG_MEMORY + + num_free++; + + i = 0; + while ( i < MAX_TRACKED_BLOCKS && pointers[i].base != *P ) + i++; + + if ( i >= MAX_TRACKED_BLOCKS ) + fail_free++; + else + { +#ifndef TT_CONFIG_REENTRANT + TTMemory_Allocated -= pointers[i].size; +#endif + + Size = pointers[i].size; + pointers[i].base = NULL; + pointers[i].size = 0; + } + +#else + + i = 0; + while ( i < MAX_TRACKED_BIGCHUNKS && pointers[i].base != *P ) + i++; + + /* If we did not found the pointer, then this is a "small" chunk. */ + + if ( i < MAX_TRACKED_BIGCHUNKS ) + { + pointers[i].base = NULL; + /* Signal we found a big one. Real size does not matter. */ + Size = MEMORY_MIN_GLOBAL; + } + +#endif /* DEBUG_MEMORY */ + + if ( Size >= MEMORY_MIN_GLOBAL ) + { + HANDLE hMem; + + hMem = GlobalHandle ( (ULong)*P >> 16 ) & 0xFFFF; + if ( !hMem ) /* Bad call... */ + return TT_Err_Invalid_Argument; + + GlobalUnlock( hMem ); + GlobalFree ( hMem ); + } + else + free( *P ); + + *P = NULL; + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTMemory_Init + * + * Description : Initializes the memory. + * + * Output : Always SUCCESS. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTMemory_Init( void ) + { +#ifdef DEBUG_MEMORY + Int i; + + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + pointers[i].base = NULL; + pointers[i].size = 0; + } + + num_alloc = 0; + num_realloc = 0; + num_free = 0; + + fail_alloc = 0; + fail_realloc = 0; + fail_free = 0; +#else + Int i; + + for ( i = 0; i < MAX_TRACKED_BIGCHUNKS; i++ ) + { + pointers[i].base = NULL; + } +#endif + + +#ifndef TT_CONFIG_REENTRANT + TTMemory_Allocated = 0; + TTMemory_MaxAllocated = 0; +#endif + + return TT_Err_Ok; + } + + +/******************************************************************* + * + * Function : TTMemory_Done + * + * Description : Finalizes memory usage. + * + * Output : Always SUCCESS. + * + ******************************************************************/ + + LOCAL_FUNC + TT_Error TTMemory_Done( void ) + { +#ifdef DEBUG_MEMORY + Int i, num_leaked, tot_leaked; + + + num_leaked = 0; + tot_leaked = 0; + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + if ( pointers[i].base ) + { + num_leaked ++; + tot_leaked += pointers[i].size; + } + } + + fprintf( stderr, + "%d memory allocations, of which %d failed\n", + num_alloc, + fail_alloc ); + + fprintf( stderr, + "%d memory reallocations, of which %d failed\n", + num_realloc, + fail_realloc ); + + fprintf( stderr, + "%d memory frees, of which %d failed\n", + num_free, + fail_free ); + + if ( num_leaked > 0 ) + { + fprintf( stderr, + "There are %d leaked memory blocks, totalizing %d bytes\n", + num_leaked, tot_leaked ); + + for ( i = 0; i < MAX_TRACKED_BLOCKS; i++ ) + { + if ( pointers[i].base ) + { + fprintf( stderr, + "index: %4d (base: $%08lx, size: %08ld)\n", + i, + (long)pointers[i].base, + pointers[i].size ); + } + } + } + else + fprintf( stderr, "No memory leaks !\n" ); + +#endif /* DEBUG_MEMORY */ + + return TT_Err_Ok; + } + + +/* END */ diff --git a/Build/source/libs/libttf/arch/win16/makedef b/Build/source/libs/libttf/arch/win16/makedef new file mode 100644 index 00000000000..f16fbb15f96 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/makedef @@ -0,0 +1,24 @@ +# makedef +# +# This shell script creates a .DEF file necessary for building as DLL +# on the Windows 16-bit platform. + +echo "\ +; This definition file to be used to built the library as DLL +; has been generated automatically with the script \`makedef' on +; `date +%d-%b-%Y`. + +LIBRARY ft14_16 +DESCRIPTION 'FreeType 1.4 16-bit DLL © 1996-2000 Turner, Wilhelm, Lemberg' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE +EXPORTS +" > ttf.def + +(cd ../.. + sed -n -e "/^ *EXPORT_DEF/!d ; n ; s/(.*$//" \ + -e "s/;$//" -e "s/ const / /" -e "s/ *[a-zA-Z][a-zA-Z_\*]* //" \ + -e "s/ *//g" -e "s/^\(.*\)/ _\1/" -e "p" *.h extend/*.h) >> ttf.def + +# eof diff --git a/Build/source/libs/libttf/arch/win16/makedep b/Build/source/libs/libttf/arch/win16/makedep new file mode 100644 index 00000000000..594952bd2a1 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/makedep @@ -0,0 +1,32 @@ +# makedep +# +# This shell script creates a dependency file necessary for older compilers +# on the Windows 16-bit platform. + +echo "\ +# This dependency file to be used with various Windows compilers +# has been generated automatically with the script \`makedep' on +# `date +%d-%b-%Y`. +" > depend.win + +(cd ../.. + gcc -MM -Iarch/win16 -I. \ + *.c | \ + sed -e "s/\.o:/.obj:/" -e "s:/:\\\\:g") >> depend.win + +(cd ../.. + gcc -MM -Iarch/win16 -I. -Iextend \ + extend/*.c | \ + sed -e "s/^\(.*\)\.o:/extend\\\\\1.obj:/" -e "s:/:\\\\:g") >> depend.win + +echo "!ifndef __MAKE__" >> depend.win + +(cd ../.. + gcc -MM -Iarch/win16 -I. -Iextend -DTT_HUGE_PTR \ + arch/win16/*.c | \ + sed -e "s/^\(.*\)\.o:/arch\\\\win16\\\\\1.obj:/" \ + -e "s:/:\\\\:g") >> depend.win + +echo "!endif" >> depend.win + +# eof diff --git a/Build/source/libs/libttf/arch/win16/ttf.def b/Build/source/libs/libttf/arch/win16/ttf.def new file mode 100644 index 00000000000..3ebc14cddb2 --- /dev/null +++ b/Build/source/libs/libttf/arch/win16/ttf.def @@ -0,0 +1,130 @@ +; This definition file to be used to built the library as DLL +; has been generated automatically with the script `makedef' on +; 07-Mar-2000. + +LIBRARY ft14_16 +DESCRIPTION 'FreeType 1.4 16-bit DLL © 1996-2000 Turner, Wilhelm, Lemberg' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE +EXPORTS + + _TT_FreeType_Version + _TT_Init_FreeType + _TT_Done_FreeType + _TT_Set_Raster_Gray_Palette + _TT_Open_Face + _TT_Open_Collection + _TT_Get_Face_Properties + _TT_Set_Face_Pointer + _TT_Get_Face_Pointer + _TT_Flush_Face + _TT_Get_Face_Metrics + _TT_Close_Face + _TT_Get_Font_Data + _TT_New_Instance + _TT_Set_Instance_Resolutions + _TT_Set_Instance_CharSize + _TT_Set_Instance_CharSizes + _TT_Set_Instance_PixelSizes + _TT_Set_Instance_Transform_Flags + _TT_Get_Instance_Metrics + _TT_Set_Instance_Pointer + _TT_Get_Instance_Pointer + _TT_Done_Instance + _TT_New_Glyph + _TT_Done_Glyph + _TT_Load_Glyph + _TT_Get_Glyph_Outline + _TT_Get_Glyph_Metrics + _TT_Get_Glyph_Big_Metrics + _TT_Get_Glyph_Bitmap + _TT_Get_Glyph_Pixmap + _TT_New_Outline + _TT_Done_Outline + _TT_Copy_Outline + _TT_Get_Outline_Bitmap + _TT_Get_Outline_Pixmap + _TT_Get_Outline_BBox + _TT_Transform_Outline + _TT_Translate_Outline + _TT_Transform_Vector + _TT_MulDiv + _TT_MulFix + _TT_Get_CharMap_Count + _TT_Get_CharMap_ID + _TT_Get_CharMap + _TT_Char_Index + _TT_Get_Name_Count + _TT_Get_Name_ID + _TT_Get_Name_String + _TT_Register_Extension + _TT_Extension_Get + _TT_Use_Stream + _TT_Done_Stream + _TT_Flush_Stream + _TT_Read_File + _TT_Seek_File + _TT_Skip_File + _TT_Read_At_File + _TT_File_Pos + _TT_Stream_Size + _TT_Null_FileFrame + _TT_Access_Frame + _TT_Check_And_Access_Frame + _TT_Forget_Frame + _TT_Get_Char + _TT_Get_Short + _TT_Get_Long + _TT_LookUp_Table + _TT_Alloc + _TT_Realloc + _TT_Free + _TT_CharMap_First + _TT_CharMap_Next + _TT_CharMap_Last + _TT_ErrToString18 + _TT_Get_Face_Gasp_Flags + _TT_Init_GDEF_Extension + _TT_Load_GDEF_Table + _TT_GDEF_Get_Glyph_Property + _TT_GDEF_Build_ClassDefinition + _TT_Init_GPOS_Extension + _TT_Load_GPOS_Table + _TT_GPOS_Select_Script + _TT_GPOS_Select_Language + _TT_GPOS_Select_Feature + _TT_GPOS_Query_Scripts + _TT_GPOS_Query_Languages + _TT_GPOS_Query_Features + _TT_GPOS_Add_Feature + _TT_GPOS_Clear_Features + _TT_GPOS_Register_Glyph_Function + _TT_GPOS_Register_MM_Function + _TT_GPOS_Apply_String + _TT_Init_GSUB_Extension + _TT_Load_GSUB_Table + _TT_GSUB_Select_Script + _TT_GSUB_Select_Language + _TT_GSUB_Select_Feature + _TT_GSUB_Query_Scripts + _TT_GSUB_Query_Languages + _TT_GSUB_Query_Features + _TT_GSUB_Add_Feature + _TT_GSUB_Clear_Features + _TT_GSUB_Register_Alternate_Function + _TT_GSUB_Apply_String + _TT_GSUB_Add_String + _TT_Init_Kerning_Extension + _TT_Get_Kerning_Directory + _TT_Load_Kerning_Table + _TT_Init_Post_Extension + _TT_Load_PS_Names + _TT_Get_PS_Name + _TT_Init_SBit_Extension + _TT_Get_Face_Bitmaps + _TT_New_SBit_Image + _TT_Done_SBit_Image + _TT_Get_SBit_Strike + _TT_Load_Glyph_Bitmap + _TT_Get_Face_Widths diff --git a/Build/source/libs/libttf/arch/win32/Makefile.BC b/Build/source/libs/libttf/arch/win32/Makefile.BC new file mode 100644 index 00000000000..a2a74d91392 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/Makefile.BC @@ -0,0 +1,161 @@ +# This file is part of the FreeType project. +# +# It builds the library for Borland C++ for Win32. +# +# You will need Borland MAKE. +# Tested with Borland C++ v.5.0 and Borland C++ builder 4.0. +# Does not work with Borland C++ 4.0, since it needs __declspec. +# +# Use this file while in the lib directory with the following statement: +# +# make -farch/win32/Makefile.BC +# +# +# A DLL version of the library can be built with +# +# make -DDLL -farch/win32/Makefile.BC dll +# +# A debug version can be obtained with +# +# make -DDEBUG -farch/win32/Makefile.BC + +ARCH = arch\win32 +FT_MAKEFILE = $(ARCH)\Makefile.BC +FT_DLL = ft14_32.dll + +CC = bcc32 +LIB = tlib /c /e +IMPLIB = implib -c + +SPURIOUS_WARNINGS = -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig + +!if ! $d(DEBUG) +CFLAGS = -O2 -A -i40 -I$(ARCH);.;extend $(SPURIOUS_WARNINGS) +DLLFLAGS = -WD +!else +CFLAGS = -v -A -i40 -I$(ARCH);.;extend $(SPURIOUS_WARNINGS) +DLLFLAGS = -v -WD +!endif + +FT_DEF = $(FT_DLL:.dll=.def) +!if $d(DLL) +CFLAGS = $(CFLAGS) \ + -DEXPORT_DEF=__declspec(dllexport) -DEXPORT_FUNC=__declspec(dllexport) +!endif + + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces before the \ at end of line, +# otherwise the substitution for TLIB command line will fail. +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ + extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c\ + extend\ftxsbit.c extend\ftxgsub.c extend\ftxgpos.c\ + extend\ftxopen.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c\ + ttgload.c ttinterp.c ttload.c ttobjs.c\ + ttraster.c ttextend.c ttdebug.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Borland make does not handle $($(LIB_FILES)), and using +# -DLIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing TLIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# See ../msdos/Makefile.TC for an application. +.c.obj: + $(CC) -c -o$* @&&| + $(CFLAGS) $< +| + + +!if ! $d(DEBUG) +# Skipped if DEBUG build +all: $(OBJS_S) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_S: = + ) +| + +dll $(FT_DLL): $(OBJS_S) $(FT_DEF) +!if $d(DLL) + $(CC) @&&| + $(DLLFLAGS) -e$(FT_DLL) $(OBJS_S) +| + $(IMPLIB) libttf $(FT_DLL) +!else + $(MAKE) -DDLL -f$(FT_MAKEFILE) dll # Re-invoke with flag set. +!endif +!endif + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) libttf.lib @&&| ++ $(OBJS_M: = + ) +| + +!ifdef DEBUG +dll $(FT_DLL): $(OBJS_M) $(FT_DEF) +!if $d(DLL) + $(CC) @&&| + $(DLLFLAGS) -e$(FT_DLL) $(OBJS_M) +| + $(IMPLIB) libttf $(FT_DLL) +!else + $(MAKE) -DDEBUG -DDLL -f$(FT_MAKEFILE) dll +!endif +!endif + +install: $(FT_DLL) +!ifdef INSTALL_DIR + copy $(FT_DLL) $(INSTALL_DIR) +!else + copy $(FT_DLL) C:\WINDOWS +!endif + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + -del libttf.lib + echo -+$(**: =-+)> response + $(LIB) libttf.lib @&&| ++ $(**: = + ) +| + +$(FT_DEF): $(ARCH)\ttf.def + -copy $(ARCH)\ttf.def $(FT_DEF) + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak + -del response + -del *.def + -del *.tds + +distclean: clean + -del libttf.lib + -del *.dll + -del $(FT_DEF) + -del C:\WINDOWS\$(FT_DLL) +!if $d(INSTALL_DIR) + -del $(INSTALL_DIR)\$(FT_DLL) +!endif + +!include "$(ARCH)\depend.win" + +# end of Makefile diff --git a/Build/source/libs/libttf/arch/win32/Makefile.CL b/Build/source/libs/libttf/arch/win32/Makefile.CL new file mode 100644 index 00000000000..5b1cb14a2e7 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/Makefile.CL @@ -0,0 +1,165 @@ +# This file is part of the FreeType project. +# +# It builds the library for Microsoft Visual C++ for 32-bit Windows. +# +# You will need NMAKE. +# +# Use this file while in the lib directory with the following statement: +# +# nmake /f arch\win32\Makefile.CL +# +# +# A DLL version of the library can be built with +# +# nmake DLL=1 /f arch\win32\Makefile.CL dll +# +# Debug versions can be obtained with +# +# nmake DEBUG=1 /f arch\win32\Makefile.CL + +ARCH = arch\win32 +FT_MAKEFILE = $(ARCH)\Makefile.CL +FT_DLL = ft14_32.dll + +CC = cl /nologo +LIB = lib /nologo +LINK = link /nologo + +CFLAGS = /Za /W2 -I$(ARCH) -I. -Iextend + +!ifndef DEBUG +CFLAGS = $(CFLAGS) /Ox +DLLFLAGS = /RELEASE +!else +CFLAGS = $(CFLAGS) /Zi /Ge +DLLFLAGS = /DEBUG +!endif + +!ifdef DLL +CFLAGS = $(CFLAGS) /GD \ + /DEXPORT_DEF=__declspec(dllexport) /DEXPORT_FUNC=__declspec(dllexport) +!else +CFLAGS = $(CFLAGS) /GA +!endif + + +TTFILE = .\ttfile.c +TTMEMORY = .\ttmemory.c +TTMUTEX = .\ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +# Do not insert spaces between the file names or at end of line, otherwise +# the substitution for LIB command line will fail. Thank you. +# +SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\ +extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\ +extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c +OBJS_X = $(SRC_X:.c=.obj) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\ +ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X) + +SRC_S = $(ARCH)\freetype.c +OBJ_S = $(SRC_S:.c=.obj) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using +# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat +# by constructing LIB's response file directly in the `all' target. +# +# Another solution, useful during debugging of part of the library, +# would be to include each .obj in the library as soon as it is compiled. +# See ..\msdos\Makefile.TC for an application. +.c.obj: + @$(CC) /c /Fo$@ @<< + $(CFLAGS) $*.c +<< + + +!ifndef DEBUG +# Skipped if DEBUG build +all: $(OBJS_S) + -del libttf.lib + $(LIB) /OUT:libttf.lib @<<response + $(OBJS_S) +<<KEEP + +dll $(FT_DLL): $(OBJS_S) +!ifdef DLL + $(LINK) @<<response + $(DLLFLAGS) + /DLL + /OUT:$(FT_DLL) + /IMPLIB:libttf.lib + /DEF:$(ARCH)\ttf.def + $** +<<KEEP +!else + $(MAKE) DLL=1 /f $(FT_MAKEFILE) dll # Re-invoke with flag set. +!endif + +!endif + + +debug: $(OBJS_M) + -del libttf.lib + $(LIB) /OUT:libttf.lib @<<response + $(OBJS_M) +<<KEEP + +!ifdef DEBUG +dll $(FT_DLL): $(OBJS_M) +!ifdef DLL + $(LINK) @<<response + $(DLLFLAGS) + /DLL + /OUT:$(FT_DLL) + /IMPLIB:libttf.lib + /DEF:$(ARCH)\ttf.def + $** +<<KEEP +!else + $(MAKE) DLL=1 DEBUG=1 /f $(FT_MAKEFILE) dll # Re-invoke with flag set. +!endif +!endif + +install: $(FT_DLL) +!ifdef INSTALL_DIR + copy $(FT_DLL) $(INSTALL_DIR) +!else + copy $(FT_DLL) C:\WINDOWS +!endif + + +$(OBJ_S): $(SRC_S) $(SRC_M) + +# Not used here because it excesses the capacity of COMMAND.COM... +libttf.lib: $(LIB_FILES) + $(LIB) /OUT:$@ $** + + +clean: + -del *.obj + -del extend\*.obj + -del $(ARCH)\*.obj + -del libttf.bak + -del response + -del *.exp + -del *.pch + -del *.ilk + +distclean: clean + -del libttf.lib + -del *.dll + -del *.pdb + -del C:\WINDOWS\$(FT_DLL) +!ifdef INSTALL_DIR + -del $(INSTALL_DIR)\$(FT_DLL) +!endif + +!include "$(ARCH)\depend.win" + +# end of Makefile.CL diff --git a/Build/source/libs/libttf/arch/win32/Makefile.Min b/Build/source/libs/libttf/arch/win32/Makefile.Min new file mode 100644 index 00000000000..526adff9ee0 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/Makefile.Min @@ -0,0 +1,98 @@ +# This file is part of the FreeType project. +# +# It builds the library for MinGW32 gcc under Win9x. +# +# You will need a port of GNU make; the MinGW32 port works. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/win32/Makefile.Min +# +# +# When compared to the other Makefiles for gcc, there is a difference +# here, because COMMAND.COM on Win 9x is not able to process more than +# 126 characters. So the command line for ar use the * shell character. +# +# This is not as safe as normal, because unnecessary files may be +# included by mistake in the library. +# The normal behaviour can be restored by defining NON_LIMITED_SHELL=1 + +ARCH = arch/win32 +FT_MAKEFILE = $(ARCH)/Makefile.Min + +CC = gcc + +ifdef DEBUG +CFLAGS = -Wall -O2 -g -ansi -pedantic -I$(ARCH) -I. -Iextend +else +CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend +endif + + +TTFILE = ./ttfile.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxgdef.c \ + extend/ftxopen.c extend/ftxerr18.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=$(OBJS_S) OBJ_LOC=$(ARCH) libttf.a + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=$(OBJS_M) DEBUG=1 OBJ_LOC=. libttf.a + +$(OBJ_S): $(SRC_S) $(SRC_M) + +ifdef NOT_LIMITED_SHELL +libttf.a: $(LIB_FILES) + -del $@ + ar src $@ $^ +else +# The previous command exceeds the capacity of COMMAND.COM, +# so we cheat by passing * character to ar +libttf.a: $(LIB_FILES) + -del $@ + ar src $@ $(OBJ_LOC)/*.o extend/*.o +endif + + +clean: + -del *.o + -del extend\*.o + -del $(subst /,\,$(ARCH)\*.o) + -del response + +distclean: clean + -del dep.end + -del libttf.a + +depend: $(SRS_S) $(SRC_M) $(SRC_X) + $(CC) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile.Min diff --git a/Build/source/libs/libttf/arch/win32/Makefile.VC b/Build/source/libs/libttf/arch/win32/Makefile.VC new file mode 100644 index 00000000000..7974aa734d8 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/Makefile.VC @@ -0,0 +1,195 @@ +# Visual C++ 2.x, 4.x, 5.0 and 6.0 makefile for freetype +# adapted from suns example makefile (related to the TCL script language) + +# Does not depend on the presence of any environment variables in +# order to compile freetype; all needed information is derived from +# location of the compiler directories. + +# +# Project directories +# +# ROOT = top of source tree +# +# TMPDIR = location where .obj files should be stored during build +# +# TOOLS32 = location of VC++ 32-bit development tools. Note that the +# VC++ 2.0 header files are broken, so you need to use the +# ones that come with the developer network CD's, or later +# versions of VC++. +# + +ROOT = ..\.. +TMPDIR = . +#TOOLS32 = c:\msdev # VC++ 2.x,4.x +#TOOLS32 = c:\Program Files\devstudio\vc # VC++ 5.x +TOOLS32 = c:\Program Files\Microsoft Visual Studio\Vc98 # VC++ 6.x +INSTALLDIR = c:\WINNT\SYSTEM32 + +# Set this to the appropriate value of /MACHINE: for your platform +MACHINE = IX86 + +# Comment the following line to compile with symbols +NODEBUG=1 + + +###################################################################### +# Do not modify below this line +###################################################################### + +TTF = ttf +TTFLIB = $(TTF).lib +TTFDLL = $(TTF).dll + +TTFOBJS = \ + $(TMPDIR)\ttapi.obj \ + $(TMPDIR)\ttcache.obj \ + $(TMPDIR)\ttcalc.obj \ + $(TMPDIR)\ttcmap.obj \ + $(TMPDIR)\ttdebug.obj \ + $(TMPDIR)\ttfile.obj \ + $(TMPDIR)\ttgload.obj \ + $(TMPDIR)\ttinterp.obj \ + $(TMPDIR)\ttload.obj \ + $(TMPDIR)\ttmemory.obj \ + $(TMPDIR)\ttmutex.obj \ + $(TMPDIR)\ttobjs.obj \ + $(TMPDIR)\ttraster.obj \ + $(TMPDIR)\ttextend.obj \ + $(TMPDIR)\ftxcmap.obj \ + $(TMPDIR)\ftxgasp.obj \ + $(TMPDIR)\ftxkern.obj \ + $(TMPDIR)\ftxpost.obj \ + $(TMPDIR)\ftxwidth.obj \ + $(TMPDIR)\ftxerr18.obj + + +PATH=$(TOOLS32)\bin;$(PATH) + +cc32 = "$(TOOLS32)\bin\cl.exe" +link32 = "$(TOOLS32)\bin\link.exe" +include32 = "-I$(TOOLS32)\include" -I$(ROOT)\arch\win32 +CP = copy +RM = del + +TTF_INCLUDES = -I$(ROOT) +TTF_DEFINES = -nologo -D__WIN32__ -D__WIN32DLL__ + +TTF_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \ + $(TTF_INCLUDES) $(TTF_DEFINES) +CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE +DOS_CFLAGS = $(cdebug) $(cflags) $(include16) -AL + +###################################################################### +# Link flags +###################################################################### + +!IFDEF NODEBUG +ldebug = /RELEASE +!ELSE +ldebug = -debug:full -debugtype:cv +!ENDIF + +# declarations common to all linker options +lcommon = /NODEFAULTLIB /RELEASE /NOLOGO + +# declarations for use on Intel i386, i486, and Pentium systems +!IF "$(MACHINE)" == "IX86" +DLLENTRY = @12 +lflags = $(lcommon) /MACHINE:$(MACHINE) +!ELSE +lflags = $(lcommon) /MACHINE:$(MACHINE) +!ENDIF + +conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup +guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +!IF "$(MACHINE)" == "PPC" +libc = libc.lib +libcdll = crtdll.lib +!ELSE +libc = libc.lib oldnames.lib +libcdll = msvcrt.lib oldnames.lib +!ENDIF + +baselibs = kernel32.lib $(optlibs) advapi32.lib +winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib + +guilibs = $(libc) $(winlibs) +conlibs = $(libc) $(baselibs) +guilibsdll = $(libcdll) $(winlibs) +conlibsdll = $(libcdll) $(baselibs) + +###################################################################### +# Compile flags +###################################################################### + +!IFDEF NODEBUG +cdebug = -O2 -Gs -GD +!ELSE +cdebug = -Z7 -Od -WX +!ENDIF + +# declarations common to all compiler options +ccommon = -c -W3 -nologo -YX -Dtry=__try -Dexcept=__except + +# NEED BYTEORDER INFORMATION HERE !! +!IF "$(MACHINE)" == "IX86" +cflags = $(ccommon) -D_X86_=1 +!ELSE +!IF "$(MACHINE)" == "MIPS" +cflags = $(ccommon) -D_MIPS_=1 +!ELSE +!IF "$(MACHINE)" == "PPC" +cflags = $(ccommon) -D_PPC_=1 +!ELSE +!IF "$(MACHINE)" == "ALPHA" +cflags = $(ccommon) -D_ALPHA_=1 +!ENDIF +!ENDIF +!ENDIF +!ENDIF + +cvars = -DWIN32 -D_WIN32 +cvarsmt = $(cvars) -D_MT +cvarsdll = $(cvarsmt) -D_DLL + +###################################################################### +# Project specific targets +###################################################################### + +release: $(TTFDLL) +all: $(TTFDLL) + +install: $(TTFDLL) + -@md $(INSTALLDIR) + -@$(CP) $(TTFDLL) $(INSTALLDIR) + + + +$(TTFDLL): $(TTFOBJS) ttf.def + $(link32) $(ldebug) $(dlllflags) \ + $(guilibsdll) -out:$(TTFDLL) -def:ttf.def $(TTFOBJS) + +#ttf.def: $(TTFOBJS) +# ..\..\tcl8.0.4\win\release\dumpexts -o $@ ttf.dll $(TTFOBJS) + + +# +# Implicit rules +# + +{$(ROOT)\extend}.c{$(TMPDIR)}.obj: + $(cc32) $(TTF_CFLAGS) -Fo$(TMPDIR)\ $< + +{$(ROOT)}.c{$(TMPDIR)}.obj: + $(cc32) $(TTF_CFLAGS) -Fo$(TMPDIR)\ $< + + +clean: + -@del *.exp + -@del *.lib + -@del *.dll + -@del $(TMPDIR)\*.obj + -@del *.pch + -@del *.pdb diff --git a/Build/source/libs/libttf/arch/win32/Makefile.gcc b/Build/source/libs/libttf/arch/win32/Makefile.gcc new file mode 100644 index 00000000000..68c9f4e6ce9 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/Makefile.gcc @@ -0,0 +1,96 @@ +# This file is part of the FreeType project. +# +# It builds the library for gcc under Win32. +# This Makefile will fail with MinGW32 ports of gcc and make under +# bare-bones Windows 9X, because of the limitations of command.com. +# Use Makefile.min instead. +# +# You will need GNU make. +# +# Use this file while in the lib directory with the following statement: +# +# make -f arch/win32/Makefile.gcc +# +# +# If you have the GNU gettext package installed, you can also try +# +# make -f arch/win32/Makefile.gcc HAVE_GETTEXT + +ARCH = arch/win32 +FT_MAKEFILE = $(ARCH)/Makefile.gcc + +CC = gcc + +ifndef GETTEXT +GETTEXT=NO_GETTEXT +endif + +ifdef DEBUG +CFLAGS = -Wall -O2 -g -ansi -pedantic -I$(ARCH) -I. -Iextend -D$(GETTEXT) +else +CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend -D$(GETTEXT) +endif + + +TTFILE = ./ttfile.c +TTMEMORY = ./ttmemory.c +TTMUTEX = ./ttmutex.c + +PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX) + +SRC_X = extend/ftxgasp.c extend/ftxkern.c extend/ftxpost.c \ + extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \ + extend/ftxgsub.c extend/ftxgpos.c extend/ftxgdef.c \ + extend/ftxopen.c extend/ftxerr18.c +OBJS_X = $(SRC_X:.c=.o) + +SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \ + ttgload.c ttinterp.c ttload.c ttobjs.c \ + ttraster.c ttextend.c $(PORT) +OBJS_M = $(SRC_M:.c=.o) $(OBJS_X) + +SRC_S = $(ARCH)/freetype.c +OBJ_S = $(SRC_S:.c=.o) +OBJS_S = $(OBJ_S) $(OBJS_X) + + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all debug clean distclean depend + + +all: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a + +debug: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M DEBUG=1 libttf.a + +HAVE_GETTEXT: + $(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S GETTEXT=HAVE_GETTEXT \ + libttf.a + +$(OBJ_S): $(SRC_S) $(SRC_M) + +libttf.a: $($(LIB_FILES)) + -del $@ + ar src $@ $^ + +clean: + -del *.o + -del extend\*.o + -del $(subst /,\,$(ARCH)/*.o) + -del response + +distclean: clean + -del dep.end + -del libttf.a + +depend: $(SRS_S) $(SRC_M) $(SRC_X) + $(CC) -E -M $^ > dep.end + +ifeq (dep.end,$(wildcard dep.end)) + include dep.end +endif + +# end of Makefile.gcc diff --git a/Build/source/libs/libttf/arch/win32/depend.win b/Build/source/libs/libttf/arch/win32/depend.win new file mode 100644 index 00000000000..3f81600d244 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/depend.win @@ -0,0 +1,103 @@ +# This dependency file to be used with various Win32 compilers +# has been generated automatically with the script `makedep' on +# 07-Mar-2000. + +ttapi.obj: ttapi.c ttconfig.h arch\win32\ft_conf.h freetype.h fterrid.h \ + ftnameid.h ttengine.h tttypes.h ttmutex.h ttcalc.h ttmemory.h \ + ttcache.h ttfile.h ttdebug.h ttobjs.h tttables.h ttcmap.h ttload.h \ + ttgload.h ttraster.h ttextend.h +ttcache.obj: ttcache.c ttengine.h tttypes.h ttconfig.h \ + arch\win32\ft_conf.h freetype.h fterrid.h ftnameid.h ttmutex.h \ + ttmemory.h ttcache.h ttobjs.h tttables.h ttcmap.h ttdebug.h +ttcalc.obj: ttcalc.c ttcalc.h ttconfig.h arch\win32\ft_conf.h freetype.h \ + fterrid.h ftnameid.h ttdebug.h tttypes.h tttables.h +ttcmap.obj: ttcmap.c ttobjs.h ttconfig.h arch\win32\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttdebug.h ttfile.h ttmemory.h ttload.h +ttdebug.obj: ttdebug.c ttdebug.h ttconfig.h arch\win32\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h tttables.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h ttcmap.h +ttextend.obj: ttextend.c ttextend.h ttconfig.h arch\win32\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttmemory.h +ttfile.obj: ttfile.c ttconfig.h arch\win32\ft_conf.h freetype.h \ + fterrid.h ftnameid.h tttypes.h ttdebug.h ttengine.h ttmutex.h \ + ttmemory.h ttfile.h +ttgload.obj: ttgload.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h ttgload.h \ + ttmemory.h tttags.h ttload.h +ttinterp.obj: ttinterp.c freetype.h fterrid.h ftnameid.h tttypes.h \ + ttconfig.h arch\win32\ft_conf.h ttdebug.h ttcalc.h ttmemory.h \ + ttinterp.h ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h \ + ttcmap.h +ttload.obj: ttload.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttdebug.h ttcalc.h ttfile.h \ + ttengine.h ttmutex.h tttables.h ttobjs.h ttcache.h ttcmap.h \ + ttmemory.h tttags.h ttload.h +ttmemory.obj: ttmemory.c ttdebug.h ttconfig.h arch\win32\ft_conf.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmemory.h ttengine.h \ + ttmutex.h +ttmutex.obj: ttmutex.c ttmutex.h ttconfig.h arch\win32\ft_conf.h +ttobjs.obj: ttobjs.c ttobjs.h ttconfig.h arch\win32\ft_conf.h ttengine.h \ + tttypes.h freetype.h fterrid.h ftnameid.h ttmutex.h ttcache.h \ + tttables.h ttcmap.h ttfile.h ttdebug.h ttcalc.h ttmemory.h ttload.h \ + ttinterp.h ttextend.h +ttraster.obj: ttraster.c ttraster.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttengine.h tttypes.h ttmutex.h \ + ttdebug.h ttcalc.h ttmemory.h +extend\ftxcmap.obj: extend\ftxcmap.c extend\ftxcmap.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win32\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxerr18.obj: extend\ftxerr18.c ttconfig.h arch\win32\ft_conf.h \ + extend\ftxerr18.h freetype.h fterrid.h ftnameid.h extend\ftxkern.h \ + extend\ftxpost.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h +extend\ftxgasp.obj: extend\ftxgasp.c extend\ftxgasp.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win32\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h +extend\ftxgdef.obj: extend\ftxgdef.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgpos.obj: extend\ftxgpos.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxgsub.obj: extend\ftxgsub.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h tttags.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxkern.obj: extend\ftxkern.c extend\ftxkern.h freetype.h fterrid.h \ + ftnameid.h ttextend.h ttconfig.h arch\win32\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttdebug.h \ + ttmemory.h ttfile.h ttload.h tttags.h +extend\ftxopen.obj: extend\ftxopen.c tttypes.h ttconfig.h arch\win32\ft_conf.h \ + freetype.h fterrid.h ftnameid.h ttload.h ttobjs.h ttengine.h \ + ttmutex.h ttcache.h tttables.h ttcmap.h ttextend.h ttmemory.h \ + ttfile.h ttdebug.h extend\ftxopen.h extend\ftxgdef.h extend\ftxgsub.h \ + extend\ftxgpos.h extend\ftxopenf.h +extend\ftxpost.obj: extend\ftxpost.c extend\ftxpost.h freetype.h fterrid.h \ + ftnameid.h tttypes.h ttconfig.h arch\win32\ft_conf.h ttobjs.h \ + ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttload.h ttfile.h \ + ttdebug.h tttags.h ttmemory.h ttextend.h +extend\ftxsbit.obj: extend\ftxsbit.c extend\ftxsbit.h freetype.h fterrid.h \ + ftnameid.h ttobjs.h ttconfig.h arch\win32\ft_conf.h ttengine.h \ + tttypes.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h ttdebug.h \ + ttload.h ttmemory.h tttags.h ttextend.h +extend\ftxwidth.obj: extend\ftxwidth.c extend\ftxwidth.h freetype.h fterrid.h \ + ftnameid.h ttdebug.h ttconfig.h arch\win32\ft_conf.h tttypes.h \ + ttobjs.h ttengine.h ttmutex.h ttcache.h tttables.h ttcmap.h ttfile.h \ + tttags.h ttload.h +!ifndef __MAKE__ +arch\win32\freetype.obj: arch\win32\freetype.c ttapi.c ttconfig.h \ + arch\win32\ft_conf.h freetype.h fterrid.h ftnameid.h ttengine.h \ + tttypes.h ttmutex.h ttcalc.h ttmemory.h ttcache.h ttfile.h ttdebug.h \ + ttobjs.h tttables.h ttcmap.h ttload.h ttgload.h ttraster.h ttextend.h \ + ttcache.c ttcalc.c ttcmap.c ttdebug.c ttgload.c tttags.h ttinterp.c \ + ttinterp.h ttload.c ttobjs.c ttraster.c ttfile.c ttmemory.c ttmutex.c \ + ttextend.c +!endif diff --git a/Build/source/libs/libttf/arch/win32/freetype.c b/Build/source/libs/libttf/arch/win32/freetype.c new file mode 100644 index 00000000000..8c391a77a8b --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.c @@ -0,0 +1,42 @@ +/* This file is part of the FreeType project */ + +/* single object library component for Win32 */ +#define TT_MAKE_OPTION_SINGLE_OBJECT + +/* Note, you should define the EXPORT_DEF and EXPORT_FUNC macros */ +/* here if you want to build a Win32 DLL. If undefined, the */ +/* macros default to "extern"/"" (nothing), which is suitable */ +/* for static libraries. See `ttconfig.h' for details. */ + +/* The macro EXPORT_DEF is placed before each high-level API */ +/* function declaration, and EXPORT_FUNC before each definition */ +/* (body). You can then use it to take any compiler-specific */ +/* pragma for DLL-exported symbols */ + +/* first include common core components */ + +#include "ttapi.c" +#include "ttcache.c" +#include "ttcalc.c" +#include "ttcmap.c" +#include "ttdebug.c" +#include "ttgload.c" +#include "ttinterp.c" +#include "ttload.c" +#include "ttobjs.c" +#include "ttraster.c" + +/* then system-specific (or ANSI) components */ + +#include "ttfile.c" +#include "ttmemory.c" +#include "ttmutex.c" + +/* finally, add some extensions */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE +#include "ttextend.c" +#endif + + +/* END */ diff --git a/Build/source/libs/libttf/arch/win32/freetype.dsp b/Build/source/libs/libttf/arch/win32/freetype.dsp new file mode 100644 index 00000000000..38b3068bdb9 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.dsp @@ -0,0 +1,208 @@ +# Microsoft Developer Studio Project File - Name="freetype" - Package Owner=<4> + +# Microsoft Developer Studio Generated Build File, Format Version 5.00 + +# ** DO NOT EDIT ** + + + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + + + +CFG=freetype - Win32 Debug + +!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +!MESSAGE use the Export Makefile command and run + +!MESSAGE + +!MESSAGE NMAKE /f "freetype.mak". + +!MESSAGE + +!MESSAGE You can specify a configuration when running NMAKE + +!MESSAGE by defining the macro CFG on the command line. For example: + +!MESSAGE + +!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug" + +!MESSAGE + +!MESSAGE Possible choices for configuration are: + +!MESSAGE + +!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") + +!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") + +!MESSAGE + + + +# Begin Project + +# PROP Scc_ProjName "" + +# PROP Scc_LocalPath "" + +CPP=cl.exe + + + +!IF "$(CFG)" == "freetype - Win32 Release" + + + +# PROP BASE Use_MFC 0 + +# PROP BASE Use_Debug_Libraries 0 + +# PROP BASE Output_Dir "Release" + +# PROP BASE Intermediate_Dir "Release" + +# PROP BASE Target_Dir "" + +# PROP Use_MFC 0 + +# PROP Use_Debug_Libraries 0 + +# PROP Output_Dir "Release" + +# PROP Intermediate_Dir "Release" + +# PROP Target_Dir "" + +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c + +# ADD CPP /nologo /W3 /GX /O1 /I "." /I "..\.." /I "..\..\extend" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c + +# SUBTRACT CPP /YX + +BSC32=bscmake.exe + +# ADD BASE BSC32 /nologo + +# ADD BSC32 /nologo + +LIB32=link.exe -lib + +# ADD BASE LIB32 /nologo + +# ADD LIB32 /nologo + + + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + + + +# PROP BASE Use_MFC 0 + +# PROP BASE Use_Debug_Libraries 1 + +# PROP BASE Output_Dir "Debug" + +# PROP BASE Intermediate_Dir "Debug" + +# PROP BASE Target_Dir "" + +# PROP Use_MFC 0 + +# PROP Use_Debug_Libraries 1 + +# PROP Output_Dir "Debug" + +# PROP Intermediate_Dir "Debug" + +# PROP Target_Dir "" + +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c + +# ADD CPP /nologo /W3 /GX /Zi /O1 /I "." /I "..\.." /I "..\..\extend" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c + +# SUBTRACT CPP /YX + +BSC32=bscmake.exe + +# ADD BASE BSC32 /nologo + +# ADD BSC32 /nologo + +LIB32=link.exe -lib + +# ADD BASE LIB32 /nologo + +# ADD LIB32 /nologo + + + +!ENDIF + + + +# Begin Target + + + +# Name "freetype - Win32 Release" + +# Name "freetype - Win32 Debug" + +# Begin Source File + + + +SOURCE=.\freetype.c + +# End Source File + +# Begin Source File + + + +SOURCE=..\..\Extend\Ftxcmap.c + +# End Source File + +# Begin Source File + + + +SOURCE=..\..\Extend\ftxerr18.c + +# End Source File + +# Begin Source File + + + +SOURCE=..\..\Extend\Ftxgasp.c + +# End Source File + +# Begin Source File + + + +SOURCE=..\..\Extend\Ftxkern.c + +# End Source File + +# Begin Source File + + + +SOURCE=..\..\Extend\ftxpost.c + +# End Source File + +# End Target + +# End Project + diff --git a/Build/source/libs/libttf/arch/win32/freetype.dsw b/Build/source/libs/libttf/arch/win32/freetype.dsw new file mode 100644 index 00000000000..43933921a5a --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.dsw @@ -0,0 +1,58 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 + +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + + + +############################################################################### + + + +Project: "freetype"=.\freetype.dsp - Package Owner=<4> + + + +Package=<5> + +{{{ + +}}} + + + +Package=<4> + +{{{ + +}}} + + + +############################################################################### + + + +Global: + + + +Package=<5> + +{{{ + +}}} + + + +Package=<3> + +{{{ + +}}} + + + +############################################################################### + + + diff --git a/Build/source/libs/libttf/arch/win32/freetype.ide b/Build/source/libs/libttf/arch/win32/freetype.ide Binary files differnew file mode 100644 index 00000000000..f5c4043e572 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.ide diff --git a/Build/source/libs/libttf/arch/win32/freetype.mak b/Build/source/libs/libttf/arch/win32/freetype.mak new file mode 100644 index 00000000000..2cb684e20ab --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.mak @@ -0,0 +1,353 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +!IF "$(CFG)" == "" +CFG=freetype - Win32 Debug +!MESSAGE No configuration specified. Defaulting to freetype - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "freetype - Win32 Release" && "$(CFG)" !=\ + "freetype - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "freetype - Win32 Debug" +CPP=cl.exe + +!IF "$(CFG)" == "freetype - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\freetype.lib" + +CLEAN : + -@erase ".\Release\freetype.lib" + -@erase ".\Release\Ftxkern.obj" + -@erase ".\Release\ftxpost.obj" + -@erase ".\Release\ftxerr18.obj" + -@erase ".\Release\Ftxcmap.obj" + -@erase ".\Release\Freetype.obj" + -@erase ".\Release\Ftxgasp.obj" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /W3 /GX /O2 /I "." /I "..\.." /I "..\..\extend" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "." /I "..\.." /I "..\..\extend" /D "WIN32"\ + /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/freetype.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS= +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/freetype.bsc" +BSC32_SBRS= +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +LIB32_FLAGS=/nologo /out:"$(OUTDIR)/freetype.lib" +LIB32_OBJS= \ + "$(INTDIR)/Ftxkern.obj" \ + "$(INTDIR)/ftxpost.obj" \ + "$(INTDIR)/ftxerr18.obj" \ + "$(INTDIR)/Ftxcmap.obj" \ + "$(INTDIR)/Freetype.obj" \ + "$(INTDIR)/Ftxgasp.obj" + +"$(OUTDIR)\freetype.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) + $(LIB32) @<< + $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) +<< + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\freetype.lib" + +CLEAN : + -@erase ".\Debug\freetype.lib" + -@erase ".\Debug\Freetype.obj" + -@erase ".\Debug\Ftxkern.obj" + -@erase ".\Debug\ftxpost.obj" + -@erase ".\Debug\Ftxcmap.obj" + -@erase ".\Debug\Ftxgasp.obj" + -@erase ".\Debug\ftxerr18.obj" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /W3 /GX /Z7 /Od /I "." /I "..\.." /I "..\..\extend" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MLd /W3 /GX /Z7 /Od /I "." /I "..\.." /I "..\..\extend" /D\ + "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/freetype.pch" /YX\ + /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS= +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/freetype.bsc" +BSC32_SBRS= +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +LIB32_FLAGS=/nologo /out:"$(OUTDIR)/freetype.lib" +LIB32_OBJS= \ + "$(INTDIR)/Freetype.obj" \ + "$(INTDIR)/Ftxkern.obj" \ + "$(INTDIR)/ftxpost.obj" \ + "$(INTDIR)/Ftxcmap.obj" \ + "$(INTDIR)/Ftxgasp.obj" \ + "$(INTDIR)/ftxerr18.obj" + +"$(OUTDIR)\freetype.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) + $(LIB32) @<< + $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "freetype - Win32 Release" +# Name "freetype - Win32 Debug" + +!IF "$(CFG)" == "freetype - Win32 Release" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=\Freetype\Lib\Extend\ftxpost.c +DEP_CPP_FTXPO=\ + ".\..\..\Extend\ftxpost.h"\ + ".\..\..\tttypes.h"\ + ".\..\..\ttobjs.h"\ + ".\..\..\tttables.h"\ + ".\..\..\ttload.h"\ + ".\..\..\ttfile.h"\ + ".\..\..\tttags.h"\ + ".\..\..\ttmemory.h"\ + ".\..\..\ttextend.h"\ + ".\..\..\freetype.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + "..\..\ttengine.h"\ + "..\..\ttmutex.h"\ + "..\..\ttcache.h"\ + "..\..\ttcmap.h"\ + ".\..\..\ttdebug.h"\ + + +"$(INTDIR)\ftxpost.obj" : $(SOURCE) $(DEP_CPP_FTXPO) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=\Freetype\Lib\Extend\ftxerr18.c +DEP_CPP_FTXER=\ + ".\..\..\Extend\ftxerr18.h"\ + ".\..\..\Extend\ftxkern.h"\ + ".\..\..\Extend\ftxpost.h"\ + ".\..\..\freetype.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + + +"$(INTDIR)\ftxerr18.obj" : $(SOURCE) $(DEP_CPP_FTXER) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=\Freetype\Lib\Extend\Ftxgasp.c +DEP_CPP_FTXGA=\ + ".\..\..\Extend\ftxgasp.h"\ + ".\..\..\tttypes.h"\ + ".\..\..\ttobjs.h"\ + ".\..\..\tttables.h"\ + ".\..\..\freetype.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + "..\..\ttengine.h"\ + "..\..\ttmutex.h"\ + "..\..\ttcache.h"\ + "..\..\ttcmap.h"\ + + +"$(INTDIR)\Ftxgasp.obj" : $(SOURCE) $(DEP_CPP_FTXGA) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=\Freetype\Lib\Extend\Ftxkern.c +DEP_CPP_FTXKE=\ + ".\..\..\Extend\ftxkern.h"\ + ".\..\..\ttextend.h"\ + ".\..\..\tttypes.h"\ + ".\..\..\ttdebug.h"\ + ".\..\..\ttmemory.h"\ + ".\..\..\ttfile.h"\ + ".\..\..\ttobjs.h"\ + ".\..\..\ttload.h"\ + ".\..\..\tttags.h"\ + ".\..\..\freetype.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + "..\..\ttengine.h"\ + "..\..\ttmutex.h"\ + "..\..\ttcache.h"\ + ".\..\..\tttables.h"\ + "..\..\ttcmap.h"\ + + +"$(INTDIR)\Ftxkern.obj" : $(SOURCE) $(DEP_CPP_FTXKE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=\Freetype\Lib\Extend\Ftxcmap.c +DEP_CPP_FTXCM=\ + ".\..\..\Extend\ftxcmap.h"\ + ".\..\..\tttypes.h"\ + ".\..\..\ttobjs.h"\ + ".\..\..\tttables.h"\ + ".\..\..\freetype.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + "..\..\ttengine.h"\ + "..\..\ttmutex.h"\ + "..\..\ttcache.h"\ + "..\..\ttcmap.h"\ + + +"$(INTDIR)\Ftxcmap.obj" : $(SOURCE) $(DEP_CPP_FTXCM) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\Freetype.c +DEP_CPP_FREET=\ + ".\..\..\ttapi.c"\ + ".\..\..\ttcache.c"\ + ".\..\..\ttcalc.c"\ + ".\..\..\ttcmap.c"\ + ".\..\..\ttgload.c"\ + ".\..\..\ttinterp.c"\ + ".\..\..\ttload.c"\ + ".\..\..\ttobjs.c"\ + ".\..\..\ttraster.c"\ + ".\..\..\ttfile.c"\ + ".\..\..\ttmemory.c"\ + ".\..\..\ttmutex.c"\ + ".\..\..\ttextend.c"\ + ".\..\..\freetype.h"\ + "..\..\ttengine.h"\ + "..\..\ttcalc.h"\ + ".\..\..\ttmemory.h"\ + "..\..\ttcache.h"\ + ".\..\..\ttfile.h"\ + ".\..\..\ttobjs.h"\ + ".\..\..\ttload.h"\ + "..\..\ttgload.h"\ + "..\..\ttraster.h"\ + ".\..\..\ttextend.h"\ + "..\..\ttconfig.h"\ + ".\ft_conf.h"\ + "..\..\ttmutex.h"\ + ".\..\..\tttypes.h"\ + ".\..\..\ttdebug.h"\ + ".\..\..\tttables.h"\ + "..\..\ttcmap.h"\ + ".\..\..\tttags.h"\ + "..\..\ttinterp.h"\ + {$(INCLUDE)}"\unistd.h"\ + + +"$(INTDIR)\Freetype.obj" : $(SOURCE) $(DEP_CPP_FREET) "$(INTDIR)" + + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/Build/source/libs/libttf/arch/win32/freetype.mdp b/Build/source/libs/libttf/arch/win32/freetype.mdp Binary files differnew file mode 100644 index 00000000000..9082b5a70a9 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/freetype.mdp diff --git a/Build/source/libs/libttf/arch/win32/ft_conf.h b/Build/source/libs/libttf/arch/win32/ft_conf.h new file mode 100644 index 00000000000..63819dd95c5 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/ft_conf.h @@ -0,0 +1,210 @@ +/* This file is part of the FreeType project */ + +/* ft_conf.h for Win32 */ + + +/* we need the following because there are some typedefs in this file */ + +#ifndef FT_CONF_H +#define FT_CONF_H + +#ifndef WIN32 +#define WIN32 +#endif + +/* Define to empty if the 'const' keyword does not work. */ +/* #undef const */ + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/**********************************************************************/ +/* */ +/* The following configuration macros can be tweaked manually by */ +/* a developer to turn on or off certain features or options in the */ +/* TrueType engine. This may be useful to tune it for specific */ +/* purposes.. */ +/* */ +/**********************************************************************/ + + +/*************************************************************************/ +/* Define this if the underlying operating system uses a different */ +/* character width than 8bit for file names. You must then also supply */ +/* a typedef declaration for defining 'TT_Text'. Default is off. */ + +/* #define HAVE_TT_TEXT */ + + +/*************************************************************************/ +/* Define this if you want to generate code to support engine extensions */ +/* Default is on, but if you're satisfied by the basic services provided */ +/* by the engine and need no extensions, undefine this configuration */ +/* macro to save a few more bytes. */ + +#define TT_CONFIG_OPTION_EXTEND_ENGINE + + +/*************************************************************************/ +/* Define this if you want to generate code to support gray-scaling, */ +/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */ +/* disable it if you don't need it. */ + +#define TT_CONFIG_OPTION_GRAY_SCALING + + +/*************************************************************************/ +/* Define this if you want to completely disable the use of the bytecode */ +/* interpreter. Doing so will produce a much smaller library, but the */ +/* quality of the rendered glyphs will enormously suffer from this. */ +/* */ +/* This switch was introduced due to the Apple patents issue which */ +/* emerged recently on the FreeType lists. We still do not have Apple's */ +/* opinion on the subject and will change this as soon as we have. */ + +#undef TT_CONFIG_OPTION_NO_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to use a big 'switch' statement within the */ +/* bytecode interpreter. Because some non-optimizing compilers are not */ +/* able to produce jump tables from such statements, undefining this */ +/* configuration macro will generate the appropriate C jump table in */ +/* ttinterp.c. If you use an optimizing compiler, you should leave it */ +/* defined for better performance and code compactness.. */ + +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the TrueType */ +/* bytecode interpreter. This will produce much bigger code, which */ +/* _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_INTERPRETER + + +/*************************************************************************/ +/* Define this if you want to build a 'static' version of the scan-line */ +/* converter (the component which in charge of converting outlines into */ +/* bitmaps). This will produce a bigger object file for "ttraster.c", */ +/* which _may_ be faster on some architectures.. */ +/* */ +/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */ +/* */ +#undef TT_CONFIG_OPTION_STATIC_RASTER + + +/*************************************************************************/ +/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */ +/* version of the library. */ + +#undef TT_CONFIG_OPTION_THREAD_SAFE + + +/**********************************************************************/ +/* */ +/* The following macros are used to define the debug level, as well */ +/* as individual tracing levels for each component. There are */ +/* currently three modes of operation : */ +/* */ +/* - trace mode (define DEBUG_LEVEL_TRACE) */ +/* */ +/* The engine prints all error messages, as well as tracing */ +/* ones, filtered by each component's level */ +/* */ +/* - debug mode (define DEBUG_LEVEL_ERROR) */ +/* */ +/* Disable tracing, but keeps error output and assertion */ +/* checks. */ +/* */ +/* - release mode (don't define anything) */ +/* */ +/* Don't include error-checking or tracing code in the */ +/* engine's code. Ideal for releases. */ +/* */ +/* NOTE : */ +/* */ +/* Each component's tracing level is defined in its own source. */ +/* */ +/**********************************************************************/ + +/* Define if you want to use the tracing debug mode */ +#undef DEBUG_LEVEL_TRACE + +/* Define if you want to use the error debug mode - ignored if */ +/* DEBUG_LEVEL_TRACE is defined */ +#undef DEBUG_LEVEL_ERROR + + +/**************************************************************************/ +/* Definition of various integer sizes. These types are used by ttcalc */ +/* and ttinterp (for the 64-bit integers) only.. */ + +#if SIZEOF_INT == 4 + + typedef signed int TT_Int32; + typedef unsigned int TT_Word32; + +#elif SIZEOF_LONG == 4 + + typedef signed long TT_Int32; + typedef unsigned long TT_Word32; + +#else +#error "no 32bit type found" +#endif + +#if SIZEOF_LONG == 8 + +/* LONG64 must be defined when a 64-bit type is available */ +/* INT64 must then be defined to this type.. */ +#define LONG64 +#define INT64 long + +#else + +/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */ +/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */ +/* will produce many -ansi warnings during library compilation. */ +#ifdef TT_USE_LONG_LONG + +#define LONG64 +#define INT64 long long + +#endif /* TT_USE_LONG_LONG */ +#endif + +#endif /* FT_CONF_H */ + + +/* END */ diff --git a/Build/source/libs/libttf/arch/win32/makedef b/Build/source/libs/libttf/arch/win32/makedef new file mode 100644 index 00000000000..158f10faa2f --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/makedef @@ -0,0 +1,24 @@ +# makedef +# +# This shell script creates a .DEF file necessary for building as DLL +# on the Windows 32-bit platform. + +echo "\ +; This definition file to be used to built the library as DLL +; has been generated automatically with the script \`makedef' on +; `date +%d-%b-%Y`. + +LIBRARY ft14_32 +DESCRIPTION 'FreeType 1.4 32-bit DLL © 1996-2000 Turner, Wilhelm, Lemberg' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +EXPORTS +" > ttf.def + +(cd ../.. + sed -n -e "/^ *EXPORT_DEF/!d ; n ; s/(.*$//" \ + -e "s/;$//" -e "s/ const / /" -e "s/ *[a-zA-Z][a-zA-Z_\*]* //" \ + -e "s/ *//g" -e "s/^/ /" -e "p" *.h extend/*.h) >> ttf.def + +# eof diff --git a/Build/source/libs/libttf/arch/win32/makedep b/Build/source/libs/libttf/arch/win32/makedep new file mode 100644 index 00000000000..34ade91f25b --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/makedep @@ -0,0 +1,29 @@ +# makedep +# +# This shell script creates a dependency file necessary for some compilers +# on the Win32 platform. + +echo "\ +# This dependency file to be used with various Win32 compilers +# has been generated automatically with the script \`makedep' on +# `date +%d-%b-%Y`. +" > depend.win + +(cd ../.. + gcc -MM -Iarch/win32 -I. *.c | \ + sed -e "s/\.o:/.obj:/" -e "s:/:\\\\:g") >> depend.win + +(cd ../.. + gcc -MM -Iarch/win32 -I. -Iextend extend/*.c | \ + sed -e "s/^\(.*\)\.o:/extend\\\\\1.obj:/" -e "s:/:\\\\:g") >> depend.win + +echo "!ifndef __MAKE__" >> depend.win + +(cd ../.. + gcc -MM -Iarch/win32 -I. -Iextend arch/win32/*.c | \ + sed -e "s/^\(.*\)\.o:/arch\\\\win32\\\\\1.obj:/" \ + -e "s:/:\\\\:g") >> depend.win + +echo "!endif" >> depend.win + +# eof diff --git a/Build/source/libs/libttf/arch/win32/ttf.def b/Build/source/libs/libttf/arch/win32/ttf.def new file mode 100644 index 00000000000..96fe92f2482 --- /dev/null +++ b/Build/source/libs/libttf/arch/win32/ttf.def @@ -0,0 +1,130 @@ +; This definition file to be used to built the library as DLL +; has been generated automatically with the script `makedef' on +; 07-Mar-2000. + +LIBRARY ft14_32 +DESCRIPTION 'FreeType 1.4 32-bit DLL © 1996-2000 Turner, Wilhelm, Lemberg' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +EXPORTS + + TT_FreeType_Version + TT_Init_FreeType + TT_Done_FreeType + TT_Set_Raster_Gray_Palette + TT_Open_Face + TT_Open_Collection + TT_Get_Face_Properties + TT_Set_Face_Pointer + TT_Get_Face_Pointer + TT_Flush_Face + TT_Get_Face_Metrics + TT_Close_Face + TT_Get_Font_Data + TT_New_Instance + TT_Set_Instance_Resolutions + TT_Set_Instance_CharSize + TT_Set_Instance_CharSizes + TT_Set_Instance_PixelSizes + TT_Set_Instance_Transform_Flags + TT_Get_Instance_Metrics + TT_Set_Instance_Pointer + TT_Get_Instance_Pointer + TT_Done_Instance + TT_New_Glyph + TT_Done_Glyph + TT_Load_Glyph + TT_Get_Glyph_Outline + TT_Get_Glyph_Metrics + TT_Get_Glyph_Big_Metrics + TT_Get_Glyph_Bitmap + TT_Get_Glyph_Pixmap + TT_New_Outline + TT_Done_Outline + TT_Copy_Outline + TT_Get_Outline_Bitmap + TT_Get_Outline_Pixmap + TT_Get_Outline_BBox + TT_Transform_Outline + TT_Translate_Outline + TT_Transform_Vector + TT_MulDiv + TT_MulFix + TT_Get_CharMap_Count + TT_Get_CharMap_ID + TT_Get_CharMap + TT_Char_Index + TT_Get_Name_Count + TT_Get_Name_ID + TT_Get_Name_String + TT_Register_Extension + TT_Extension_Get + TT_Use_Stream + TT_Done_Stream + TT_Flush_Stream + TT_Read_File + TT_Seek_File + TT_Skip_File + TT_Read_At_File + TT_File_Pos + TT_Stream_Size + TT_Null_FileFrame + TT_Access_Frame + TT_Check_And_Access_Frame + TT_Forget_Frame + TT_Get_Char + TT_Get_Short + TT_Get_Long + TT_LookUp_Table + TT_Alloc + TT_Realloc + TT_Free + TT_CharMap_First + TT_CharMap_Next + TT_CharMap_Last + TT_ErrToString18 + TT_Get_Face_Gasp_Flags + TT_Init_GDEF_Extension + TT_Load_GDEF_Table + TT_GDEF_Get_Glyph_Property + TT_GDEF_Build_ClassDefinition + TT_Init_GPOS_Extension + TT_Load_GPOS_Table + TT_GPOS_Select_Script + TT_GPOS_Select_Language + TT_GPOS_Select_Feature + TT_GPOS_Query_Scripts + TT_GPOS_Query_Languages + TT_GPOS_Query_Features + TT_GPOS_Add_Feature + TT_GPOS_Clear_Features + TT_GPOS_Register_Glyph_Function + TT_GPOS_Register_MM_Function + TT_GPOS_Apply_String + TT_Init_GSUB_Extension + TT_Load_GSUB_Table + TT_GSUB_Select_Script + TT_GSUB_Select_Language + TT_GSUB_Select_Feature + TT_GSUB_Query_Scripts + TT_GSUB_Query_Languages + TT_GSUB_Query_Features + TT_GSUB_Add_Feature + TT_GSUB_Clear_Features + TT_GSUB_Register_Alternate_Function + TT_GSUB_Apply_String + TT_GSUB_Add_String + TT_Init_Kerning_Extension + TT_Get_Kerning_Directory + TT_Load_Kerning_Table + TT_Init_Post_Extension + TT_Load_PS_Names + TT_Get_PS_Name + TT_Init_SBit_Extension + TT_Get_Face_Bitmaps + TT_New_SBit_Image + TT_Done_SBit_Image + TT_Get_SBit_Strike + TT_Load_Glyph_Bitmap + TT_Get_Face_Widths |