FreeType 1.31.1

This commit is contained in:
2023-08-27 18:03:45 +02:00
commit 5edbb7a80a
454 changed files with 173977 additions and 0 deletions

View File

@@ -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

View File

@@ -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 */

220
lib/arch/amigaos/ft_conf.h Normal file
View File

@@ -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 */

32
lib/arch/ansi/freetype.c Normal file
View File

@@ -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 */

227
lib/arch/ansi/ft_conf.h Normal file
View File

@@ -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 */

View File

@@ -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

View File

@@ -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 */

236
lib/arch/debugger/ft_conf.h Normal file
View File

@@ -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 */

47
lib/arch/mac/README Normal file
View File

@@ -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

48
lib/arch/mac/freetype.c Normal file
View File

@@ -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 */

211
lib/arch/mac/ft_conf.h Normal file
View File

@@ -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 */

1069
lib/arch/mac/ttmmap.c Normal file

File diff suppressed because it is too large Load Diff

132
lib/arch/msdos/Makefile.BC Normal file
View File

@@ -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

117
lib/arch/msdos/Makefile.MS Normal file
View File

@@ -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

View File

@@ -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

117
lib/arch/msdos/Makefile.VC Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

107
lib/arch/msdos/depend.dos Normal file
View File

@@ -0,0 +1,107 @@
# This dependency file to be used with various MS-DOS compilers
# has been generated automatically with the script `makedep' on
# 03-Sep-1999.
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

39
lib/arch/msdos/freetype.c Normal file
View File

@@ -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 */

253
lib/arch/msdos/ft_conf.h Normal file
View File

@@ -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 */

84
lib/arch/msdos/hugefile.c Normal file
View File

@@ -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 */

496
lib/arch/msdos/hugemem.c Normal file
View File

@@ -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 */

26
lib/arch/msdos/makedep Normal file
View File

@@ -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

84
lib/arch/os2/Makefile.dm Normal file
View File

@@ -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

91
lib/arch/os2/Makefile.emx Normal file
View File

@@ -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

73
lib/arch/os2/Makefile.icc Normal file
View File

@@ -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

88
lib/arch/os2/Makefile.wat Normal file
View File

@@ -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

32
lib/arch/os2/freetype.c Normal file
View File

@@ -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 */

239
lib/arch/os2/ft_conf.h Normal file
View File

@@ -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 */

1237
lib/arch/os2/os2file.c Normal file

File diff suppressed because it is too large Load Diff

1
lib/arch/unix/.cvsignore Normal file
View File

@@ -0,0 +1 @@
Makefile

244
lib/arch/unix/Makefile.in Normal file
View File

@@ -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

27
lib/arch/unix/freetype.c Normal file
View File

@@ -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 */

1027
lib/arch/unix/ttmmap.c Normal file

File diff suppressed because it is too large Load Diff

20
lib/arch/vms/README Normal file
View File

@@ -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.2 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>

155
lib/arch/vms/descrip.mms Normal file
View File

@@ -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;

215
lib/arch/vms/ft_conf.h Normal file
View File

@@ -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 */

180
lib/arch/win16/Makefile.BC Normal file
View File

@@ -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 = ft13_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

106
lib/arch/win16/Makefile.MS Normal file
View File

@@ -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

175
lib/arch/win16/Makefile.VC Normal file
View File

@@ -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 = ft13_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

109
lib/arch/win16/depend.win Normal file
View File

@@ -0,0 +1,109 @@
# This dependency file to be used with various Windows compilers
# has been generated automatically with the script `makedep' on
# 02-Sep-1999.
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

39
lib/arch/win16/freetype.c Normal file
View File

@@ -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 */

209
lib/arch/win16/ft_conf.h Normal file
View File

@@ -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 */

51
lib/arch/win16/hugefile.c Normal file
View File

@@ -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 */

539
lib/arch/win16/hugemem.c Normal file
View File

@@ -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 */

24
lib/arch/win16/makedef Normal file
View File

@@ -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 ft13_16
DESCRIPTION 'FreeType 1.3 16-bit DLL <20> 1996-1999 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

32
lib/arch/win16/makedep Normal file
View File

@@ -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

127
lib/arch/win16/ttf.def Normal file
View File

@@ -0,0 +1,127 @@
; This definition file to be used to built the library as DLL
; has been generated automatically with the script `makedef' on
; 02-Sep-1999.
LIBRARY ft13_16
DESCRIPTION 'FreeType 1.3 16-bit DLL <EFBFBD> 1996-1999 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_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

161
lib/arch/win32/Makefile.BC Normal file
View File

@@ -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 = ft13_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

165
lib/arch/win32/Makefile.CL Normal file
View File

@@ -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 = ft13_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) $@ +-$(?: =-+);
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

View File

@@ -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

195
lib/arch/win32/Makefile.VC Normal file
View File

@@ -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

View File

@@ -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

103
lib/arch/win32/depend.win Normal file
View File

@@ -0,0 +1,103 @@
# This dependency file to be used with various Win32 compilers
# has been generated automatically with the script `makedep' on
# 03-Sep-1999.
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

42
lib/arch/win32/freetype.c Normal file
View File

@@ -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 */

104
lib/arch/win32/freetype.dsp Normal file
View File

@@ -0,0 +1,104 @@
# 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

View File

@@ -0,0 +1,29 @@
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>
{{{
}}}
###############################################################################

BIN
lib/arch/win32/freetype.ide Normal file

Binary file not shown.

353
lib/arch/win32/freetype.mak Normal file
View File

@@ -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
################################################################################

BIN
lib/arch/win32/freetype.mdp Normal file

Binary file not shown.

210
lib/arch/win32/ft_conf.h Normal file
View File

@@ -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 */

24
lib/arch/win32/makedef Normal file
View File

@@ -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 ft13_32
DESCRIPTION 'FreeType 1.3 32-bit DLL <20> 1996-1999 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

29
lib/arch/win32/makedep Normal file
View File

@@ -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

127
lib/arch/win32/ttf.def Normal file
View File

@@ -0,0 +1,127 @@
; This definition file to be used to built the library as DLL
; has been generated automatically with the script `makedef' on
; 03-Sep-1999.
LIBRARY ft13_32
DESCRIPTION 'FreeType 1.3 32-bit DLL <EFBFBD> 1996-1999 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_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