FreeType 1.31.1
This commit is contained in:
180
lib/arch/win16/Makefile.BC
Normal file
180
lib/arch/win16/Makefile.BC
Normal 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
106
lib/arch/win16/Makefile.MS
Normal 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
175
lib/arch/win16/Makefile.VC
Normal 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
109
lib/arch/win16/depend.win
Normal 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
39
lib/arch/win16/freetype.c
Normal 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
209
lib/arch/win16/ft_conf.h
Normal 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
51
lib/arch/win16/hugefile.c
Normal 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
539
lib/arch/win16/hugemem.c
Normal 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
24
lib/arch/win16/makedef
Normal 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
32
lib/arch/win16/makedep
Normal 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
127
lib/arch/win16/ttf.def
Normal 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
|
||||
Reference in New Issue
Block a user