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

181
test/arch/msdos/Makefile.BC Normal file
View File

@@ -0,0 +1,181 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs for BC++ under MSDOS, large model.
#
# Tested with Borland C++ v.3.1, 4.02, 5.0
# You will need Borland MAKE (v.3.6 and above should be OK, for oldest
# versions refer to the instructions below).
#
#
# Use this file while in the 'test' directory with the following statement:
#
# make -farch\msdos\Makefile.BC
#
#
# Debug versions 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
LIBDIR = ..\lib
INCDIRS = -I$(LIBDIR);$(LIBDIR)\$(ARCH);.;$(LIBDIR)\extend
SPURIOUS_WARNINGS = -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -w-pia
# Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern
# Borland compilers (from BC++ 3.1 on) can increase the limit of
# the length of identifiers.
!if ! $d(DEBUG)
CFLAGS = -ml -A -O2 -3 -i40 $(INCDIRS) $(SPURIOUS_WARNINGS)
LDFLAGS = -ml
!else
CFLAGS = -v -N -ml -A -i40 $(INCDIRS) $(SPURIOUS_WARNINGS)
LDFLAGS = -v -ml
!endif
# full-screen MSDOS driver
GDRIVER = $(ARCH)\.\gfs_dos.c
DISPLAY = display.c
G1SRC = gmain.c blitter.c $(GDRIVER)
GSRC = $(DISPLAY) $(G1SRC)
GOBJ = $(GSRC:.c=.obj)
G1OBJ = $(G1SRC:.c=.obj)
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
OBJ = $(SRC:.c=.obj)
.c.obj:
$(CC) -c -o$* @&&|
$(CFLAGS) $<
|
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
!if !$d(DEBUG)
# Skipped if DEBUG build
all: freetype $(EXEFILES)
!endif
debug: freetype_debug $(EXEFILES)
!if $d(BIGFONTS)
MAKEBIG = -DBIGFONTS
!endif
freetype:
cd $(LIBDIR)
make -f$(FT_MAKEFILE) $(MAKEBIG) all
cd ..\test
freetype_debug:
cd $(LIBDIR)
make -f$(FT_MAKEFILE) -DDEBUG $(MAKEBIG) debug
cd ..\test
# Borland C compilers are unable to include <dos.h> in ANSI mode.
# So we have a special rule for this file, to build it outside ANSI.
$(GDRIVER:.c=.obj):
$(CC) -c -o$* @&&|
$(CFLAGS) -A- $*.c
|
.obj.exe:
$(CC) -e$* @&&|
$(LDFLAGS) $**
|
# Borland versions of make are unable to use the $** variable inside
# implicit rules (like .obj.exe:). The job has to be done by hand. :-(
ftzoom.exe: $(G1OBJ) ftzoom.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftzoom.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
ftview.exe: $(GOBJ) ftview.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftview.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
ftstring.exe: $(GOBJ) ftstring.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstring.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
ftstrtto.exe: $(GOBJ) ftstrtto.obj common.obj arabic.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstrtto.obj $(GOBJ) common.obj arabic.obj \
$(LIBDIR)\libttf.lib
fttimer.exe: $(G1OBJ) fttimer.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) fttimer.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
ftlint.exe: ftlint.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftlint.obj common.obj $(LIBDIR)\libttf.lib
ftdump.exe: ftdump.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftdump.obj common.obj $(LIBDIR)\libttf.lib
ftstrpnm.exe: ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
ftsbit.exe: ftsbit.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftsbit.obj common.obj $(LIBDIR)\libttf.lib
ftmetric.exe: ftmetric.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftmetric.obj common.obj $(LIBDIR)\libttf.lib
fterror.exe: fterror.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) fterror.obj common.obj $(LIBDIR)\libttf.lib
clean: do_clean
cd $(LIBDIR)
make -f$(FT_MAKEFILE) clean
cd ..\test
distclean: do_clean
cd $(LIBDIR)
make -f$(FT_MAKEFILE) distclean
cd ..\test
-del *.exe
do_clean:
-del *.obj
-del $(ARCH)\*.obj
del time.h # clean the ugly hack for Turbo C...
!include "$(ARCH)\depend.dos"
# end of Makefile

142
test/arch/msdos/Makefile.MS Normal file
View File

@@ -0,0 +1,142 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs 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.
#
# You will need NMAKE.
#
#
# Use this file while in the 'test' directory with the following statement:
#
# nmake /f arch\msdos\Makefile.MS
#
#
# Debug versions 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
FT_MAKE = $(MAKE) /nologo
CC = cl /nologo
LIBDIR = ..\lib
INCDIRS = -I$(LIBDIR) -I$(LIBDIR)\$(ARCH) -I. -I$(LIBDIR)\extend
!ifndef DEBUG
CFLAGS = /Ox /AL /Za /W2 /G2 $(INCDIRS)
LDFLAGS = /AL
!else
CFLAGS = /Zi /AL /Za /W2 /G2 $(INCDIRS)
LDFLAGS = /Zi /AL
!endif
# full-screen MSDOS driver
GDRIVER = $(ARCH)\gfs_dos.c
GSRC = display.c gmain.c blitter.c $(GDRIVER)
GOBJ = $(GSRC:.c=.obj)
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
OBJ = $(SRC:.c=.obj)
.c.obj:
@$(CC) /c /Fo$* @<<
$(CFLAGS) $<
<<
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
!ifndef DEBUG
# Skiped if DEBUG build
all: freetype $(EXEFILES)
!endif
debug: freetype_debug $(EXEFILES)
!ifdef BIGFONTS
MAKEBIG = BIGFONTS=1
!endif
freetype:
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) $(MAKEBIG) all
cd ..\test
freetype_debug:
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) DEBUG=1 $(MAKEBIG) debug
cd ..\test
.obj.exe:
$(CC) /Fe$* @<<
$(LDFLAGS) $**
<<
ftzoom.exe: $(GOBJ) ftzoom.obj common.obj $(LIBDIR)\libttf.lib
ftview.exe: $(GOBJ) ftview.obj common.obj $(LIBDIR)\libttf.lib
ftstring.exe: $(GOBJ) ftstring.obj common.obj $(LIBDIR)\libttf.lib
ftstrtto.exe: $(GOBJ) ftstrtto.obj common.obj arabic.obj $(LIBDIR)\libttf.lib
fttimer.exe: $(GOBJ) fttimer.obj common.obj $(LIBDIR)\libttf.lib
ftlint.exe: ftlint.obj common.obj $(LIBDIR)\libttf.lib
ftdump.exe: ftdump.obj common.obj $(LIBDIR)\libttf.lib
ftstrpnm.exe: ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
ftsbit.exe: ftsbit.obj common.obj $(LIBDIR)\libttf.lib
ftmetric.exe: ftmetric.obj common.obj $(LIBDIR)\libttf.lib
fterror.exe: fterror.obj common.obj $(LIBDIR)\libttf.lib
clean: do_clean
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) clean
cd ..\test
distclean: do_clean
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) distclean
cd ..\test
-del *.exe
do_clean:
-del *.obj
-del $(ARCH)\*.obj
!include "$(ARCH)\depend.dos"
# end of Makefile.MS

196
test/arch/msdos/Makefile.TC Normal file
View File

@@ -0,0 +1,196 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs for Turbo C under MSDOS, large model.
#
# 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 'test' directory with the following statement:
#
# make -farch\msdos\Makefile.TC
#
#
# Debug versions can be obtained (except for TC 1.5) with
#
# make -DDEBUG -farch\msdos\Makefile.TC
ARCH = arch\msdos
FT_MAKEFILE = $(ARCH)\Makefile.TC
CC = tcc
LIBDIR = ..\lib
INCDIRS = -I$(LIBDIR);$(LIBDIR)\$(ARCH);.;$(LIBDIR)\extend
!if ! $d(DEBUG)
CFLAGS = -ml -A -O -Z -G -a -w-stv -w-sig $(INCDIRS)
LDFLAGS = -ml
!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 $(INCDIRS)
LDFLAGS = -v -ml
!endif
# full-screen MSDOS driver
GDRIVER = $(ARCH)\.\gfs_dos.obj
# the line below does not work with these old versions of make...
# GOBJ = $(GSRC:.c=.o)
DISPLAY = display.obj
G1OBJ = gmain.obj blitter.obj $(GDRIVER)
GOBJ = $(DISPLAY) $(G1OBJ)
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
OBJ = arabic.obj \
common.obj \
ftdump.obj \
fterror.obj \
ftlint.obj \
ftmetric.obj \
ftsbit.obj \
ftstring.obj \
ftstrpnm.obj \
ftstrtto.obj \
fttimer.obj \
ftview.obj \
ftzoom.obj
.c.obj:
$(CC) $(CFLAGS) -c -o$* $<
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
!if !$d(DEBUG)
# Skipped if DEBUG build
all: freetype $(EXEFILES)
!endif
debug: freetype_debug $(EXEFILES)
freetype:
cd $(LIBDIR)
make -f$(FT_MAKEFILE) all
cd ..\test
freetype_debug:
cd $(LIBDIR)
make -f$(FT_MAKEFILE) -DDEBUG debug
cd ..\test
# Borland C compilers are unable to include <dos.h> in ANSI mode.
# So we have a special rule for this file, to build it outside ANSI.
$(GDRIVER):
$(CC) $(CFLAGS) -A- -c -o$* $*.c
!if $(__MAKE__) < 0x0300
# Also, Turbo C v.1.5 and v.2.0 are not fully ANSI compliant with regard to
# <time.h>, particularly the clock() function.
# So we use an ugly hack here: a modified version of time.h, with the
# necessary machinery, is included in the arch\msdos directory.
time.h: $(ARCH)\time_tc.h
copy $(ARCH)\time_tc.h time.h
# Below is the special rule for forcing recompilation of fttimer.obj
# using our <time.h>, without using the rule that is pulled in by
# !include "$(ARCH)\depend.dos" at the end of the Makefile...
fttimer.exe: $(G1OBJ) fttimer.c time.h common.obj $(LIBDIR)\libttf.lib
$(CC) $(CFLAGS) -c -o$* $*.c
$(CC) $(LDFLAGS) fttimer.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
!else
# Normal behaviour
fttimer.exe: $(G1OBJ) fttimer.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) fttimer.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
!endif
# This old gr... make is unable to have a $ variable to name all the
# dependencies. :-( So the job have to be done by hand...
ftzoom.exe: $(G1OBJ) ftzoom.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftzoom.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
ftview.exe: $(GOBJ) ftview.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftview.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
ftstring.exe: $(GOBJ) ftstring.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstring.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
ftstrtto.exe: $(GOBJ) ftstrtto.obj common.obj arabic.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstrtto.obj $(GOBJ) common.obj \
arabic.obj $(LIBDIR)\libttf.lib
# fttimer.exe is handled above (because of <time.h> hack)
ftlint.exe: ftlint.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftlint.obj common.obj $(LIBDIR)\libttf.lib
ftdump.exe: ftdump.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftdump.obj common.obj $(LIBDIR)\libttf.lib
ftstrpnm.exe: ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
ftsbit.exe: ftsbit.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftsbit.obj common.obj $(LIBDIR)\libttf.lib
ftmetric.exe: ftmetric.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) ftmetric.obj common.obj $(LIBDIR)\libttf.lib
fterror.exe: fterror.obj common.obj $(LIBDIR)\libttf.lib
$(CC) $(LDFLAGS) fterror.obj common.obj $(LIBDIR)\libttf.lib
clean: do_clean
cd $(LIBDIR)
make -f$(FT_MAKEFILE) clean
cd ..\test
distclean: do_clean
cd $(LIBDIR)
make -f$(FT_MAKEFILE) distclean
cd ..\test
-del *.exe
do_clean:
-del *.obj
-del $(ARCH)\*.obj
del time.h # clean the ugly hack for Turbo C...
!include "$(ARCH)\depend.dos"
# end of Makefile

143
test/arch/msdos/Makefile.VC Normal file
View File

@@ -0,0 +1,143 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs for Microsoft Visual C++ 1.x
# and Microsoft C/C++ v.7.0 16-bit compilers for MS-DOS, large model.
#
# You will need NMAKE.
#
#
# Use this file while in the 'test' directory with the following statement:
#
# nmake /f arch\msdos\Makefile.VC
#
#
# Debug versions 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
FT_MAKE = $(MAKE) /nologo
CC = cl /nologo
LIBDIR = ..\lib
INCDIRS = -I$(LIBDIR) -I$(LIBDIR)\$(ARCH) -I. -I$(LIBDIR)\extend
# 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 $(INCDIRS)
LDFLAGS = /AL
!else
CFLAGS = /Zi /Ge /AL /Za /W2 /G3 $(INCDIRS)
LDFLAGS = /Zi /AL
!endif
# full-screen MSDOS driver
GDRIVER = $(ARCH)\gfs_dos.c
GSRC = display.c gmain.c blitter.c $(GDRIVER)
GOBJ = $(GSRC:.c=.obj)
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
OBJ = $(SRC:.c=.obj)
.c.obj:
@$(CC) /c /Fo$* @<<
$(CFLAGS) $<
<<
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
!ifndef DEBUG
# Skiped if DEBUG build
all: freetype $(EXEFILES)
!endif
debug: freetype_debug $(EXEFILES)
!ifdef BIGFONTS
MAKEBIG = BIGFONTS=1
!endif
freetype:
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) $(MAKEBIG) all
cd ..\test
freetype_debug:
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) DEBUG=1 $(MAKEBIG) debug
cd ..\test
.obj.exe:
$(CC) /Fe$* @<<
$(LDFLAGS) $**
<<
ftzoom.exe: $(GOBJ) ftzoom.obj common.obj $(LIBDIR)\libttf.lib
ftview.exe: $(GOBJ) ftview.obj common.obj $(LIBDIR)\libttf.lib
ftstring.exe: $(GOBJ) ftstring.obj common.obj $(LIBDIR)\libttf.lib
ftstrtto.exe: $(GOBJ) ftstrtto.obj common.obj arabic.obj $(LIBDIR)\libttf.lib
fttimer.exe: $(GOBJ) fttimer.obj common.obj $(LIBDIR)\libttf.lib
ftlint.exe: ftlint.obj common.obj $(LIBDIR)\libttf.lib
ftdump.exe: ftdump.obj common.obj $(LIBDIR)\libttf.lib
ftstrpnm.exe: ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
ftsbit.exe: ftsbit.obj common.obj $(LIBDIR)\libttf.lib
ftmetric.exe: ftmetric.obj common.obj $(LIBDIR)\libttf.lib
fterror.exe: fterror.obj common.obj $(LIBDIR)\libttf.lib
clean: do_clean
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) clean
cd ..\test
distclean: do_clean
cd $(LIBDIR)
$(FT_MAKE) /f $(FT_MAKEFILE) distclean
cd ..\test
-del *.exe
do_clean:
-del *.obj
-del $(ARCH)\*.obj
!include "$(ARCH)\depend.dos"
# end of Makefile.VC

145
test/arch/msdos/Makefile.dm Normal file
View File

@@ -0,0 +1,145 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs for emx-gcc and djgpp under MSDOS.
#
# You will need dmake.
#
# Use this file while in the 'test' 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
LIBDIR = ../lib
LIBDIR_DOS = ..\lib
INCDIRS = -I$(LIBDIR) -I$(LIBDIR)/$(ARCH) -I. -I$(LIBDIR)/extend
CFLAGS = -Wall -ansi -O2 -g $(INCDIRS)
# CFLAGS = -ansi -Wall -O2 -s $(INCDIRS)
# full-screen MSDOS driver
GDRIVER = $(ARCH)/gfs_dos.c
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
GSRC = gmain.c display.c blitter.c $(GDRIVER)
GOBJ = $(GSRC:.c=.o)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.exe:
$(CC) $(CFLAGS) -o $@ @$(mktmp $(&:t"\n")\n)
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
.PHONY: all debug freetype freetype_debug \
clean distclean do_clean do_distclean depend
all: freetype $(EXEFILES)
debug: freetype_debug $(EXEFILES)
freetype:
[
cd $(LIBDIR_DOS)
$(FT_MAKE) -f $(FT_MAKEFILE) all
cd $(MAKEDIR)
]
freetype_debug:
[
cd $(LIBDIR_DOS)
$(FT_MAKE) -f $(FT_MAKEFILE) debug
cd $(MAKEDIR)
]
ftzoom.exe: $(GOBJ) ftzoom.o common.o $(LIBDIR)/libttf.a
ftview.exe: $(GOBJ) ftview.o common.o $(LIBDIR)/libttf.a
ftlint.exe: ftlint.o common.o $(LIBDIR)/libttf.a
ftdump.exe: ftdump.o common.o $(LIBDIR)/libttf.a
ftstring.exe: $(GOBJ) ftstring.o common.o $(LIBDIR)/libttf.a
fttimer.exe: $(GOBJ) fttimer.o common.o $(LIBDIR)/libttf.a
ftstrpnm.exe: ftstrpnm.o common.o $(LIBDIR)/libttf.a
ftsbit.exe: ftsbit.o common.o $(LIBDIR)/libttf.a
ftmetric.exe: ftmetric.o common.o $(LIBDIR)/libttf.a
ftstrtto.exe: $(GOBJ) ftstrtto.o common.o arabic.o $(LIBDIR)/libttf.a
clean: do_clean
[
cd $(LIBDIR_DOS)
$(FT_MAKE) -f $(FT_MAKEFILE) clean
cd $(MAKEDIR)
]
distclean: do_clean do_distclean
[
cd $(LIBDIR_DOS)
$(FT_MAKE) -f $(FT_MAKEFILE) distclean
cd $(MAKEDIR)
]
do_distclean:
-[
del dep.end
del *.exe
del core
]
do_clean:
-[
del *.o
del $(ARCH)\gfs_dos.o
]
#depend: $(SRC) $(GSRC)
#[
# cd $(LIBDIR_DOS)
# $(FT_MAKE) -f $(FT_MAKEFILE) depend
# cd $(MAKEDIR)
# $(CC) -E -M $(INCDIRS) @$(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,130 @@
# This file is part of the FreeType project.
#
# It builds the library and test programs for emx-gcc and djgpp under MSDOS.
#
# You will need a recent GNU make DOS port.
#
# Use this file while in the 'test' 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
LIBDIR = ../lib
INCDIRS = -I$(LIBDIR) -I$(LIBDIR)/$(ARCH) -I. -I$(LIBDIR)/extend
ifndef GETTEXT
GETTEXT=NO_GETTEXT
endif
CFLAGS = -Wall -ansi -O2 -g $(INCDIRS) -D$(GETTEXT)
# CFLAGS = -ansi -Wall -O2 -s $(INCDIRS) -D$(GETTEXT)
# full-screen MSDOS driver
GDRIVER = $(ARCH)/gfs_dos.c
SRC = arabic.c \
common.c \
ftdump.c \
fterror.c \
ftlint.c \
ftmetric.c \
ftsbit.c \
ftstring.c \
ftstrpnm.c \
ftstrtto.c \
fttimer.c \
ftview.c \
ftzoom.c
GSRC = gmain.c display.c blitter.c $(GDRIVER)
GOBJ = $(GSRC:.c=.o)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
ifeq ($(GETTEXT),HAVE_GETTEXT)
%.exe:
$(CC) $(CFLAGS) -o $@ $^ -lintl
else
%.exe:
$(CC) $(CFLAGS) -o $@ $^
endif
EXEFILES = ftdump.exe \
fterror.exe \
ftlint.exe \
ftmetric.exe \
ftsbit.exe \
ftstring.exe \
ftstrpnm.exe \
ftstrtto.exe \
fttimer.exe \
ftview.exe \
ftzoom.exe
.PHONY: all debug freetype freetype_debug \
clean distclean do_clean depend
all: freetype $(EXEFILES)
debug: freetype_debug $(EXEFILES)
HAVE_GETTEXT:
$(MAKE) -f $(FT_MAKEFILE) GETTEXT=HAVE_GETTEXT all
freetype:
$(MAKE) -C $(LIBDIR) -f $(FT_MAKEFILE) all
freetype_debug:
$(MAKE) -C $(LIBDIR) -f $(FT_MAKEFILE) debug
ftzoom.exe: $(GOBJ) ftzoom.o common.o $(LIBDIR)/libttf.a
ftview.exe: $(GOBJ) ftview.o common.o $(LIBDIR)/libttf.a
ftlint.exe: ftlint.o common.o $(LIBDIR)/libttf.a
ftdump.exe: ftdump.o common.o $(LIBDIR)/libttf.a
fterror.exe: fterror.o common.o $(LIBDIR)/libttf.a
ftstring.exe: $(GOBJ) ftstring.o common.o $(LIBDIR)/libttf.a
fttimer.exe: $(GOBJ) fttimer.o common.o $(LIBDIR)/libttf.a
ftstrpnm.exe: ftstrpnm.o common.o $(LIBDIR)/libttf.a
ftsbit.exe: ftsbit.o common.o $(LIBDIR)/libttf.a
ftmetric.exe: ftmetric.o common.o $(LIBDIR)/libttf.a
ftstrtto.exe: $(GOBJ) ftstrtto.o common.o arabic.o $(LIBDIR)/libttf.a
clean: do_clean
$(MAKE) -C $(LIBDIR) -f $(FT_MAKEFILE) clean
distclean: do_clean
$(MAKE) -C $(LIBDIR) -f $(FT_MAKEFILE) distclean
-del dep.end
-del *.exe
-del core
do_clean:
-del *.o
-del response
-del $(ARCH)\gfs_dos.o
depend: $(SRC) $(GSRC)
$(MAKE) -C $(LIBDIR) -f $(FT_MAKEFILE) depend
$(CC) -E -M $(INCDIRS) $^ > dep.end
ifeq (dep.end,$(wildcard dep.end))
include dep.end
endif
# end of Makefile.gcc

View File

@@ -0,0 +1,50 @@
# This dependency file to be used with various MS-DOS compilers
# has been generated automatically with the script `makedep' on
# 03-Sep-1999.
arabic.obj: arabic.c arabic.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxopen.h ..\lib\extend\ftxgdef.h \
..\lib\extend\ftxgsub.h ..\lib\extend\ftxgpos.h
blitter.obj: blitter.c blitter.h
common.obj: common.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h
display.obj: display.c display.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h gmain.h
fdebug.obj: fdebug.c ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\tttypes.h ..\lib\ttconfig.h \
..\lib\arch\msdos\ft_conf.h ..\lib\ttdebug.h ..\lib\ttobjs.h \
..\lib\ttengine.h ..\lib\ttmutex.h ..\lib\ttcache.h ..\lib\tttables.h \
..\lib\ttcmap.h
ftdump.obj: ftdump.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxcmap.h ..\lib\extend\ftxopen.h \
..\lib\extend\ftxgdef.h ..\lib\extend\ftxgsub.h \
..\lib\extend\ftxgpos.h ..\lib\extend\ftxsbit.h ..\lib\ttobjs.h \
..\lib\ttconfig.h ..\lib\arch\msdos\ft_conf.h ..\lib\ttengine.h \
..\lib\tttypes.h ..\lib\ttmutex.h ..\lib\ttcache.h ..\lib\tttables.h \
..\lib\ttcmap.h
fterror.obj: fterror.c ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxerr18.h \
..\lib\arch\msdos\ft_conf.h
ftlint.obj: ftlint.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\arch\msdos\ft_conf.h
ftmetric.obj: ftmetric.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxsbit.h ..\lib\arch\msdos\ft_conf.h
ftsbit.obj: ftsbit.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxsbit.h ..\lib\arch\msdos\ft_conf.h
ftstring.obj: ftstring.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h display.h gevents.h gdriver.h gmain.h
ftstrpnm.obj: ftstrpnm.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h
ftstrtto.obj: ftstrtto.c arabic.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxopen.h ..\lib\extend\ftxgdef.h \
..\lib\extend\ftxgsub.h ..\lib\extend\ftxgpos.h blitter.h common.h \
display.h ..\lib\extend\ftxkern.h ..\lib\extend\ftxsbit.h gdriver.h \
gevents.h gmain.h
fttimer.obj: fttimer.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h gdriver.h gevents.h gmain.h
ftview.obj: ftview.c blitter.h common.h display.h \
..\lib\extend\ftxsbit.h gdriver.h gevents.h gmain.h
ftzoom.obj: ftzoom.c common.h ..\lib\freetype.h ..\lib\fterrid.h \
..\lib\ftnameid.h ..\lib\extend\ftxpost.h gdriver.h gevents.h gmain.h
gmain.obj: gmain.c gdriver.h gmain.h
arch\msdos\gfs_dos.obj: arch\msdos\gfs_dos.c gdriver.h gevents.h gmain.h

357
test/arch/msdos/gfs_dos.c Normal file
View File

@@ -0,0 +1,357 @@
/*******************************************************************
*
* gfs_dos.c graphics utility fullscreen Dos driver. 1.0
*
* This is the driver for fullscreen Dos display, used by the
* graphics utility of the FreeType test suite.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
#include <stdio.h>
#include <stdlib.h>
#if defined( __STDC__ ) || defined( __TURBOC__ )
#include <string.h>
#else
#include <memory.h>
#endif
#include "gdriver.h"
#include "gevents.h"
#include "gmain.h"
/* The following #ifdef are used to define the following macros : */
/* */
/* - int86 : function to call an interrupt */
/* - reg_ax : the 'ax' register as stored in the REGS struct */
/* */
/* ---- DJGPP dos compiler support --------------------------------------- */
/* DJGPP v1.x */
#if !defined( __DJGPP__ ) && defined( __GO32__ )
#define DJGPP1
#undef __STRICT_ANSI__
#include <sys/nearptr.h>
#include <dos.h>
#include <strings.h>
#include <conio.h>
#define reg_ax regs.x.ax
#endif
/* DJGPP v2.x */
#ifdef __DJGPP__
#define DJGPP2
#undef __STRICT_ANSI__
#include <bios.h>
#include <conio.h>
#include <sys/movedata.h>
#define int86( a, b, c ) int86( a, b, c )
#define reg_ax regs.x.ax
#endif
/* ---- Microsoft C compilers support ------------------------------------ */
#if defined( M_I86 ) || defined( _M_I86 )
#include <dos.h>
#include <conio.h>
#define reg_ax regs.x.ax
#ifdef _M_I86 /* a recent compiler, which do not pollute name spaces */
#define getch() _getch()
#define REGS _REGS
#define int86( a, b, c ) _int86( a, b, c )
#endif
#ifndef MK_FP
#ifdef _MK_FP
#define MK_FP( seg, ofs ) _MK_FP( seg, ofs )
#else
#ifndef _M_I86 /* old versions */
#define __far _far
#endif
#define MK_FP( seg, offset ) (void __far *)( ((unsigned long)seg << 16) + \
(unsigned long)(unsigned)offset )
#endif /* _MK_FP */
#endif /* MK_FP */
#endif /* Microsoft compilers */
/* ---- Borland C compiler support --------------------------------------- */
#ifdef __TURBOC__
#ifdef __STDC__
#error "MK_FP is incompatible with ANSI mode. Use the `-A-' switch."
#endif
#include <dos.h> /* Includes the declaration of int86 */
#include <conio.h> /* for getch */
#define reg_ax regs.x.ax
#define int86( a, b, c ) int86( a, b, c )
#endif
/* ---- Phar Lap 286|DOS extender support -------------------------------- */
#ifdef DOSX286
/* The symbol DOSX286 must be specified on the command line. */
#include <phapi.h>
#endif
/* ---- EMX/Dos compiler support ----------------------------------------- */
#ifdef __EMX__
#include <dos.h>
#include <sys/hw.h>
#include <conio.h> /* for getch */
extern _read_kbd(); /* to avoid an ANSI warning during compilation */
#define int86 _int86
#define reg_ax regs.x.ax
#endif
/* ---- WATCOM Dos/16 & Dos/32 support ----------------------------------- */
#ifdef __WATCOMC__
#include <i86.h>
#define reg_ax regs.w.ax
#ifdef __386__
#define int86 int386
#endif
#endif
#if !defined( reg_ax ) || !defined( int86 )
#error "Your compiler is not (yet) supported. Check the source file!"
#endif
typedef struct _Translator
{
char key;
GEvent event_class;
int event_info;
} Translator;
#define NUM_Translators 20
static const Translator trans[NUM_Translators] =
{
{ (char)27, event_Quit, 0 },
{ 'q', event_Quit, 0 },
{ 'x', event_Rotate_Glyph, -1 },
{ 'c', event_Rotate_Glyph, 1 },
{ 'v', event_Rotate_Glyph, -16 },
{ 'b', event_Rotate_Glyph, 16 },
{ '{', event_Change_Glyph, -10000 },
{ '}', event_Change_Glyph, 10000 },
{ '(', event_Change_Glyph, -1000 },
{ ')', event_Change_Glyph, 1000 },
{ '9', event_Change_Glyph, -100 },
{ '0', event_Change_Glyph, 100 },
{ 'i', event_Change_Glyph, -10 },
{ 'o', event_Change_Glyph, 10 },
{ 'k', event_Change_Glyph, -1 },
{ 'l', event_Change_Glyph, 1 },
{ '+', event_Scale_Glyph, 10 },
{ '-', event_Scale_Glyph, -10 },
{ 'u', event_Scale_Glyph, 1 },
{ 'j', event_Scale_Glyph, -1 }
};
/* Set Graphics Mode */
int Driver_Set_Graphics( int mode )
{
union REGS regs;
switch ( mode )
{
case Graphics_Mode_Mono: /* Standard VGA 640x480x16 mode */
reg_ax = 0x12;
int86( 0x10, &regs, &regs );
vio_ScanLineWidth = 80;
vio_Width = 640;
vio_Height = 480;
break;
case Graphics_Mode_Gray: /* Standard VGA 320x200x256 mode */
reg_ax = 0x13;
int86( 0x10, &regs, &regs );
vio_ScanLineWidth = 320;
vio_Width = 320;
vio_Height = 200;
/* default gray_palette takes the gray levels of the standard VGA */
/* 256 colors mode */
gray_palette[0] = 0;
gray_palette[1] = 23;
gray_palette[2] = 27;
gray_palette[3] = 29;
gray_palette[4] = 31;
break;
default:
return 0; /* failure */
}
#if defined( __EMX__ )
Vio = _memaccess( 0xA0000, 0xAFFFF, 1 );
#elif defined( DJGPP1 ) || defined( DJGPP2 )
Vio = (char *)0xA0000;
#elif defined( __WATCOMC__ ) && defined( __386__ )
Vio = (char *)0xA0000;
#elif defined( DOSX286 )
{
unsigned short sel;
if ( DosMapRealSeg( 0xA000, (long)vio_ScanLineWidth*vio_Height, &sel ) )
return 0; /* failure */
Vio = (char*)MK_FP( sel, 0 );
}
#else
Vio = (char*)MK_FP( 0xA000, 0 );
#endif
return 1; /* success */
}
/* Revert to text mode */
int Driver_Restore_Mode()
{
union REGS regs;
reg_ax = 0x3;
int86( 0x10, &regs, &regs );
#ifdef DOSX286
#ifndef FP_SEG
#define FP_SEG(fp) (*((unsigned __far *)&(fp) + 1))
#endif
DosFreeSeg( FP_SEG( Vio ) );
#endif
return 1; /* success */
}
int Driver_Display_Bitmap( char* buffer, int line, int col )
{
int y, used_col;
char* target;
#ifdef DJGPP2
char cbuf = 0;
int i;
for( i = 0; i < vio_Height*vio_ScanLineWidth; i++ )
dosmemput( &cbuf, 1, (unsigned long) Vio+i );
#else
#ifdef DJGPP1
__djgpp_nearptr_enable();
Vio += __djgpp_conventional_base;
#else
memset( Vio, 0, vio_Height * vio_ScanLineWidth );
#endif /* DJGPP1 */
#endif /* DJGPP2 */
if ( line > vio_Height )
line = vio_Height;
if ( col > vio_ScanLineWidth )
used_col = vio_ScanLineWidth;
else
used_col = col;
target = Vio + ( line - 1 ) * vio_ScanLineWidth;
for ( y = 0; y < line; y++ )
{
#ifdef DJGPP2
dosmemput( buffer, used_col, (unsigned long)target );
#else
memcpy( target, buffer, used_col );
#endif
target -= vio_ScanLineWidth;
buffer += col;
}
#ifdef DJGPP1
__djgpp_nearptr_disable();
Vio -= __djgpp_conventional_base;
#endif
return 1; /* success */
}
void Get_Event( TEvent* event )
{
int i;
char c;
c = getch();
for ( i = 0; i < NUM_Translators; i++ )
{
if ( c == trans[i].key )
{
event->what = trans[i].event_class;
event->info = trans[i].event_info;
return;
}
}
/* unrecognized keystroke */
event->what = event_Keyboard;
event->info = (int)c;
return;
}
/* End */

22
test/arch/msdos/makedep Normal file
View File

@@ -0,0 +1,22 @@
# 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 -I../lib/arch/msdos -I../lib -I../lib/extend -I. *.c | \
sed -e "s/\.o:/.obj:/" -e "s:/:\\\\:g") >> depend.dos
(cd ../..
gcc -MM -I../lib/arch/win16 -I../lib -I../lib/extend -I. \
-Dreg_ax -Dint86 arch/msdos/*.c | \
sed -e "s/^\(.*\)\.o:/arch\\\\msdos\\\\\1.obj:/" \
-e "s:/:\\\\:g") >> depend.dos
# eof

124
test/arch/msdos/time_tc.h Normal file
View File

@@ -0,0 +1,124 @@
/*******************************************************************
*
* time.h Replacement for buggy <time.h> of old Turbo C compilers
*
* This file is a hack! It replaces <time.h> when compiling with
* old versions of Borland Turbo C compilers that lack clock(),
* and provide its own version.
*
* Written by Antoine Leca
* Copyright 1999 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.
*
******************************************************************/
#if !defined __TURBOC__ || !defined __MSDOS__ || __TURBOC__>0x200
/*
* We are not running on a Borland compiler, or either on
* a recent version that does not need the hack.
* Certainly the user does not clean up the directory.
* Stop the compilation.
*/
#error Remove the file time.h in directory test
#endif
#ifndef _TIME_H_DEFINED
#define _TIME_H_DEFINED
#if defined _TM_DEFINED || defined _TIME_T
#error Another version of <time.h> seems to have been already included
#endif
#ifndef __TIME_T
#define __TIME_T
typedef long time_t;
#endif
#ifndef __CLOCK_T
#define __CLOCK_T
typedef long clock_t;
#define CLK_TCK 18.2
#endif
#define CLOCKS_PER_SEC CLK_TCK
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
clock_t clock (void);
double difftime(time_t time2, time_t time1);
time_t time (time_t *timer);
char *asctime (const struct tm *tblock);
char *ctime (const time_t *time);
struct tm *gmtime (const time_t *timer);
struct tm *localtime(const time_t *timer);
#if __TURBOC__ <= 0x0150
/*******************************************************************
*
* Function : clock
*
* Description : Turbo C v.1.x lacks the clock() function that is
* needed for at least fttimer.
* So this is a replacement that does more or less
* the functionnality of clock(), using the BIOS.
* Since we do not know exactly when the process
* started (as clock() is supposed to do), we cheat
* a little here.
*
* Input : None
*
* Output : None
*
* Notes : Use two static objects.
* NEED_CLOCK_HERE is a macro that should be defined
* in only ONE module (otherwise, the linker will complain).
*
******************************************************************/
extern long biostime(int cmd, long newtime);
static long CountOfTicks;
static long DateOfReference = 0;
clock_t clock (void)
{
if (DateOfReference == 0) /* this is the first call */
{
DateOfReference = time(NULL) / 86400L;
CountOfTicks = biostime(0,0L) - CLOCKS_PER_SEC;
/* pretend we start one second ago */
return CLOCKS_PER_SEC; /* to avoid returning 0 */
}
return (time(NULL) / 86400L - DateOfReference) * 0x1800B0L
+ biostime(0,0L) - CountOfTicks;
}
#endif /* Turbo C v.1.x */
#endif /* defined __TIME_H_DEFINED */
/* End */