diff options
Diffstat (limited to 'nx-X11/extras/freetype2/builds/amiga')
7 files changed, 1311 insertions, 0 deletions
diff --git a/nx-X11/extras/freetype2/builds/amiga/README b/nx-X11/extras/freetype2/builds/amiga/README new file mode 100644 index 000000000..161166676 --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/README @@ -0,0 +1,90 @@ +The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted +on 68k-Amiga producing MorphOS-PPC-binaries from +http://www.morphos.de). To use it, type "make assign", then "make"; +it produces a link library libft2_ppc.a. + +The smakefile is a makefile for Amiga SAS/C 6.58 (no longer available, +latest sold version was 6.50, updates can be found in Aminet). It is +based on the version found in the sourcecode of ttf.library 0.83b for +FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com, +http://ragriffi.home.sprynet.com). + +You will also need the latest include files and amiga.lib from the +Amiga web site (http://www.amiga.com/3.9/download/NDK3.9.lha) for +AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up. + +To use it, call "smake assign" and then "smake" from the builds/amiga +directory. The results are: + +- A link library "ft2_680x0.lib" (where x depends on the setting of + the CPU entry in the smakefile) containing all FreeType2 parts + except of the init code, debugging code, and the system interface + code. + +- ftsystem.o, an object module containing the standard version of the + system interface code which uses fopen() fclose() fread() fseek() + ftell() malloc() realloc() and free() from lib:sc.lib (not pure). + +- ftsystempure.o, an object module containing the pure version of the + system interface code which uses Open() Close() Read() Seek() + ExamineFH() AsmAllocPooled() AsmFreePooled() etc. This version can + be used in both normal programs and in Amiga run-time shared system + librarys (can be linked with lib:libinit.o, no copying of DATA and + BSS hunks for each OpenLibrary() necessary). Source code is in + src/base/ftsystem.c. + +- ftdebug.o, an object module containing the standard version of the + debugging code which uses vprintf() and exit() (not pure). + Debugging can be turned on in FT:include/freetype/config/ftoption.h + and with FT_SetTraceLevel(). + +- ftdebugpure.o, an object module containing the pure version of the + debugging code which uses KVPrintf() from lib:debug.lib and no + exit(). For debugging of Amiga run-time shared system libraries. + Source code is in src/base/ftdebug.c. + +- NO ftinit.o. Since linking with a link library should result in + linking only the needed object modules in it, but standard + ftsystem.o would force ALL FreeType2 modules to be linked to your + program, I decided to use a different scheme: You must #include + FT:src/base/ftinit.c in your sourcecode and specify with #define + statements which modules you need. See + include/freetype/config/ftmodule.h. + + +To use in your own programs: + +- Insert the #define and #include statements from top of + include/freetype/config/ftmodule.h in your source code and uncomment + the #define statements for the FreeType2 modules you need. + +- You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for + calling the FreeType2 functions, since the link library and the + object files are compiled with PARAMETERS=BOTH. + +- "smake assign" (assign "FT:" to the FreeType2 main directory). + +- Compile your program. + +- Link with either ftsystem.o or ftsystempure.o, if debugging enabled + with either ftdebug.o or (ftdebugpure.o and lib:debug.lib), and with + ft2_680x0.lib as link library. + + +To adapt to other compilers: + +- The standard ANSI C maximum length of 31 significant characters in + identifiers is not enough for FreeType2. Check if your compiler has + a minimum length of 40 significant characters or can be switched to + it. "idlen=40" is the option for SAS/C. Setting #define + HAVE_LIMIT_ON_IDENTS in an include file may also work (not tested). + +- Make sure that the include directory in builds/amiga is searched + before the normal FreeType2 include directory, so you are able to + replace problematic include files with your own version (same may be + useful for the src directory). + +- An example of how to replace/workaround a problematic include file + is include/config/ftconfig.h; it changes a #define that would + prevent SAS/C from generating XDEF's where it should do that and + then includes the standard FreeType2 include file. diff --git a/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftconfig.h b/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftconfig.h new file mode 100644 index 000000000..9c6ff45f5 --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftconfig.h @@ -0,0 +1,20 @@ +// TetiSoft: We must change FT_BASE_DEF and FT_EXPORT_DEF + +//#define FT_BASE_DEF( x ) extern x // SAS/C wouldn't generate an XDEF +//#define FT_EXPORT_DEF( x ) extern x // SAS/C wouldn't generate an XDEF +#undef FT_BASE_DEF +#define FT_BASE_DEF( x ) x +#undef FT_EXPORT_DEF +#define FT_EXPORT_DEF( x ) x + +// TetiSoft: now include original file +#ifndef __MORPHOS__ +#include "FT:include/freetype/config/ftconfig.h" +#else +// We must define that, it seems that +// lib/gcc-lib/ppc-morphos/2.95.3/include/syslimits.h is missing in +// ppc-morphos-gcc-2.95.3-bin.tgz (gcc for 68k producing MorphOS PPC elf +// binaries from http://www.morphos.de) +#define _LIBC_LIMITS_H_ +#include "/FT/include/freetype/config/ftconfig.h" +#endif diff --git a/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftmodule.h b/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftmodule.h new file mode 100644 index 000000000..d7bc9cbd4 --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/include/freetype/config/ftmodule.h @@ -0,0 +1,123 @@ +// TetiSoft: To specify which modules you need, +// insert the following in your source file and uncomment as needed: + +/* +//#define FT_USE_AUTOHINT // autohinter +//#define FT_USE_RASTER // monochrome rasterizer +//#define FT_USE_SMOOTH // anti-aliasing rasterizer +//#define FT_USE_TT // truetype font driver +//#define FT_USE_T1 // type1 font driver +//#define FT_USE_T42 // type42 font driver +//#define FT_USE_T1CID // cid-keyed type1 font driver // no cmap support +//#define FT_USE_CFF // opentype font driver +//#define FT_USE_BDF // bdf bitmap font driver +//#define FT_USE_PCF // pcf bitmap font driver +//#define FT_USE_PFR // pfr font driver +//#define FT_USE_WINFNT // windows .fnt|.fon bitmap font driver +#include "FT:src/base/ftinit.c" +*/ + +// TetiSoft: make sure that needed support modules are built in. +// Dependencies can be found by searching for FT_Get_Module. + +#ifdef FT_USE_T42 +#define FT_USE_TT +#endif + +#ifdef FT_USE_TT +#define FT_USE_SFNT +#endif + +#ifdef FT_USE_CFF +#define FT_USE_SFNT +#define FT_USE_PSHINT +#define FT_USE_PSNAMES +#endif + +#ifdef FT_USE_T1 +#define FT_USE_PSAUX +#define FT_USE_PSHINT +#define FT_USE_PSNAMES +#endif + +#ifdef FT_USE_T1CID +#define FT_USE_PSAUX +#define FT_USE_PSHINT +#define FT_USE_PSNAMES +#endif + +#ifdef FT_USE_PSAUX +#define FT_USE_PSNAMES +#endif + +#ifdef FT_USE_SFNT +#define FT_USE_PSNAMES +#endif + +// TetiSoft: Now include the modules + +#ifdef FT_USE_AUTOHINT +FT_USE_MODULE(autohint_module_class) +#endif + +#ifdef FT_USE_PSHINT +FT_USE_MODULE(pshinter_module_class) +#endif + +#ifdef FT_USE_CFF +FT_USE_MODULE(cff_driver_class) +#endif + +#ifdef FT_USE_T1CID +FT_USE_MODULE(t1cid_driver_class) +#endif + +#ifdef FT_USE_BDF +FT_USE_MODULE(bdf_driver_class) +#endif + +#ifdef FT_USE_PCF +FT_USE_MODULE(pcf_driver_class) +#endif + +#ifdef FT_USE_PFR +FT_USE_MODULE(pfr_driver_class) +#endif + +#ifdef FT_USE_PSAUX +FT_USE_MODULE(psaux_module_class) +#endif + +#ifdef FT_USE_PSNAMES +FT_USE_MODULE(psnames_module_class) +#endif + +#ifdef FT_USE_RASTER +FT_USE_MODULE(ft_raster1_renderer_class) +#endif + +#ifdef FT_USE_SFNT +FT_USE_MODULE(sfnt_module_class) +#endif + +#ifdef FT_USE_SMOOTH +FT_USE_MODULE(ft_smooth_renderer_class) +FT_USE_MODULE(ft_smooth_lcd_renderer_class) +FT_USE_MODULE(ft_smooth_lcdv_renderer_class) +#endif + +#ifdef FT_USE_TT +FT_USE_MODULE(tt_driver_class) +#endif + +#ifdef FT_USE_T1 +FT_USE_MODULE(t1_driver_class) +#endif + +#ifdef FT_USE_T42 +FT_USE_MODULE(t42_driver_class) +#endif + +#ifdef FT_USE_WINFNT +FT_USE_MODULE(winfnt_driver_class) +#endif diff --git a/nx-X11/extras/freetype2/builds/amiga/makefile b/nx-X11/extras/freetype2/builds/amiga/makefile new file mode 100644 index 000000000..db773302c --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/makefile @@ -0,0 +1,207 @@ +# +# Makefile for FreeType2 link library using ppc-morphos-gcc-2.95.3-bin.tgz +# (gcc 2.95.3 hosted on 68k-Amiga producing MorphOS-PPC-binaries from +# http://www.morphos.de) +# +# to build from the builds/amiga directory call +# +# make assign +# make +# +# Your programs source code should start with this +# (uncomment the parts you do not need to keep the program small): +# ---8<--- +#define FT_USE_AUTOHINT // autohinter +#define FT_USE_RASTER // monochrome rasterizer +#define FT_USE_SMOOTH // anti-aliasing rasterizer +#define FT_USE_TT // truetype font driver +#define FT_USE_T1 // type1 font driver +#define FT_USE_T42 // type42 font driver +#define FT_USE_T1CID // cid-keyed type1 font driver +#define FT_USE_CFF // opentype font driver +#define FT_USE_BDF // bdf bitmap font driver +#define FT_USE_PCF // pcf bitmap font driver +#define FT_USE_PFR // pfr font driver +#define FT_USE_WINFNT // windows .fnt|.fon bitmap font driver +#include "FT:src/base/ftinit.c" +# ---8<--- +# +# link your programs with libft2_ppc.a and either ftsystem.ppc.o or ftsystempure.ppc.o +# (and either ftdebug.ppc.o or ftdebugpure.ppc.o if you enabled FT_DEBUG_LEVEL_ERROR or +# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h). + +all: libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o + +assign: + assign FT: // + +FTSRC = /FT/src + +CC = ppc-morphos-gcc +AR = ppc-morphos-ar rc +RANLIB = ppc-morphos-ranlib +LD = ppc-morphos-ld +CFLAGS = -O2 -I/emu/emulinclude/includegcc -I/emu/include -Iinclude -I$(FTSRC) -I/FT/include + +# +# FreeType2 library base +# +ftbase.ppc.o: $(FTSRC)/base/ftbase.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftinit.ppc.o: $(FTSRC)/base/ftinit.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftsystem.ppc.o: $(FTSRC)/base/ftsystem.c + $(CC) -c $(CFLAGS) -o $@ $< + +# pure version for use in run-time library etc +ftsystempure.ppc.o: src/base/ftsystem.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftdebug.ppc.o: $(FTSRC)/base/ftdebug.c + $(CC) -c $(CFLAGS) -o $@ $< + +# pure version for use in run-time library etc +ftdebugpure.ppc.o: src/base/ftdebug.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library base extensions +# +ftglyph.ppc.o: $(FTSRC)/base/ftglyph.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftbbox.ppc.o: $(FTSRC)/base/ftbbox.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftmm.ppc.o: $(FTSRC)/base/ftmm.c + $(CC) -c $(CFLAGS) -o $@ $< + +ftsynth.ppc.o: $(FTSRC)/base/ftsynth.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library autohinting module +# +autohint.ppc.o: $(FTSRC)/autohint/autohint.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library autohinting module extensions +# +ahoptim.ppc.o: $(FTSRC)/autohint/ahoptim.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library postscript hinting module +# +pshinter.ppc.o: $(FTSRC)/pshinter/pshinter.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library PS support module +# +psaux.ppc.o: $(FTSRC)/psaux/psaux.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library PS glyph names module +# +psnames.ppc.o: $(FTSRC)/psnames/psnames.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library monochrome raster module +# +raster.ppc.o: $(FTSRC)/raster/raster.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library anti-aliasing raster module +# +smooth.ppc.o: $(FTSRC)/smooth/smooth.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library 'sfnt' module +# +sfnt.ppc.o: $(FTSRC)/sfnt/sfnt.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library glyph and image caching system (still experimental) +# +ftcache.ppc.o: $(FTSRC)/cache/ftcache.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library OpenType font driver +# +cff.ppc.o: $(FTSRC)/cff/cff.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library TrueType font driver +# +truetype.ppc.o: $(FTSRC)/truetype/truetype.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library Type1 font driver +# +type1.ppc.o: $(FTSRC)/type1/type1.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library Type42 font driver +# +type42.ppc.o: $(FTSRC)/type42/type42.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library CID-keyed Type1 font driver +# +type1cid.ppc.o: $(FTSRC)/cid/type1cid.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library BDF bitmap font driver +# +bdf.ppc.o: $(FTSRC)/bdf/bdf.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library PCF bitmap font driver +# +pcf.ppc.o: $(FTSRC)/pcf/pcf.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library PFR font driver +# +pfr.ppc.o: $(FTSRC)/pfr/pfr.c + $(CC) -c $(CFLAGS) -o $@ $< + +# +# FreeType2 library Windows FNT/FON bitmap font driver +# +winfnt.ppc.o: $(FTSRC)/winfonts/winfnt.c + $(CC) -c $(CFLAGS) -o $@ $< + +BASEPPC = ftbase.ppc.o ftglyph.ppc.o ftbbox.ppc.o ftmm.ppc.o ftsynth.ppc.o + +DEBUGPPC = ftdebug.ppc.o ftdebugpure.ppc.o + +AHINTPPC = autohint.ppc.o ahoptim.ppc.o + +PSPPC = psaux.ppc.o psnames.ppc.o pshinter.ppc.o + +RASTERPPC = raster.ppc.o smooth.ppc.o + +FONTDPPC = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\ + bdf.ppc.o pcf.ppc.o pfr.ppc.o winfnt.ppc.o + +libft2_ppc.a: $(BASEPPC) $(AHINTPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) + $(AR) $@ $(BASEPPC) $(AHINTPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 diff --git a/nx-X11/extras/freetype2/builds/amiga/smakefile b/nx-X11/extras/freetype2/builds/amiga/smakefile new file mode 100644 index 000000000..c8b3e6cd5 --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/smakefile @@ -0,0 +1,236 @@ +# +# Makefile for FreeType2 link library using Amiga SAS/C 6.58 +# +# to build from the builds/amiga directory call +# +# smake assign +# smake +# +# Your programs source code should start with this +# (uncomment the parts you do not need to keep the program small): +# ---8<--- +#define FT_USE_AUTOHINT // autohinter +#define FT_USE_RASTER // monochrome rasterizer +#define FT_USE_SMOOTH // anti-aliasing rasterizer +#define FT_USE_TT // truetype font driver +#define FT_USE_T1 // type1 font driver +#define FT_USE_T42 // type42 font driver +#define FT_USE_T1CID // cid-keyed type1 font driver +#define FT_USE_CFF // opentype font driver +#define FT_USE_BDF // bdf bitmap font driver +#define FT_USE_PCF // pcf bitmap font driver +#define FT_USE_PFR // pfr font driver +#define FT_USE_WINFNT // windows .fnt|.fon bitmap font driver +#include "FT:src/base/ftinit.c" +# ---8<--- +# +# link your programs with ft2_680x0.lib and either ftsystem.o or ftsystempure.o +# (and either ftdebug.o or ftdebugpure.o if you enabled FT_DEBUG_LEVEL_ERROR or +# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h). + +OBJBASE = ftbase.o ftglyph.o ftbbox.o ftmm.o ftsynth.o + +OBJSYSTEM = ftsystem.o ftsystempure.o + +OBJDEBUG = ftdebug.o ftdebugpure.o + +OBJAHINT = autohint.o ahoptim.o + +OBJPSHINT = pshinter.o + +OBJPSAUX = psaux.o + +OBJPSNAM = psnames.o + +OBJRAST = raster.o + +OBJSMOOTH = smooth.o + +OBJSFNT = sfnt.o + +OBJCACHE = ftcache.o + +OBJPS = $(OBJPSAUX) $(OBJPSNAM) $(OBJPSHINT) + +OBJRASTER = $(OBJRAST) $(OBJSMOOTH) + +OBJFONTD = cff.o type1.o type42.o type1cid.o\ + truetype.o winfnt.o bdf.o pcf.o pfr.o + +CORE = FT:src/ + +CPU = 68000 +#CPU = 68020 +#CPU = 68030 +#CPU = 68040 +#CPU = 68060 + +OPTIMIZER = optinlocal + +SCFLAGS = optimize opttime optsched strmerge strsect=near idlen=40 cpu=$(CPU)\ + idir=include/ idir=$(CORE) idir=FT:include/ nostackcheck nochkabort\ + noicons ignore=79,85,110,306 parameters=both + +LIB = ft2_$(CPU).lib + +# sample linker options +OPTS = link lib=$(LIB),lib:sc.lib,lib:amiga.lib,lib:debug.lib\ + smallcode smalldata noicons utillib + +# sample program entry +#myprog: myprog.c ftsystem.o $(LIB) +# sc $< programname=$@ ftsystem.o $(SCFLAGS) $(OPTS) + +all: $(LIB) $(OBJSYSTEM) $(OBJDEBUG) + +assign: + assign FT: // + +# uses separate object modules in lib to make for easier debugging +# also, can make smaller programs if entire engine is not used +ft2_$(CPU).lib: $(OBJBASE) $(OBJAHINT) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) + oml $@ r $(OBJBASE) $(OBJAHINT) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) + +clean: + -delete \#?.o + +realclean: clean + -delete ft2$(CPU).lib + +# +# freetype library base +# +ftbase.o: $(CORE)base/ftbase.c + sc $(SCFLAGS) objname=$@ $< +ftinit.o: $(CORE)base/ftinit.c + sc $(SCFLAGS) objname=$@ $< +ftsystem.o: $(CORE)base/ftsystem.c + sc $(SCFLAGS) objname=$@ $< +ftsystempure.o: src/base/ftsystem.c ## pure version for use in run-time library etc + sc $(SCFLAGS) objname=$@ $< +ftdebug.o: $(CORE)base/ftdebug.c + sc $(SCFLAGS) objname=$@ $< +ftdebugpure.o: src/base/ftdebug.c ## pure version for use in run-time library etc + sc $(SCFLAGS) objname=$@ $< +# +# freetype library base extensions +# +ftglyph.o: $(CORE)base/ftglyph.c + sc $(SCFLAGS) objname=$@ $< +ftbbox.o: $(CORE)base/ftbbox.c + sc $(SCFLAGS) objname=$@ $< +ftmm.o: $(CORE)base/ftmm.c + sc $(SCFLAGS) objname=$@ $< +ftsynth.o: $(CORE)base/ftsynth.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library autohinting module +# +autohint.o: $(CORE)autohint/autohint.c + sc $(SCFLAGS) objname=$@ $< +# +# freetype library autohinting module extensions +# +ahoptim.o: $(CORE)autohint/ahoptim.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library PS hinting module +# +pshinter.o: $(CORE)pshinter/pshinter.c + sc $(SCFLAGS) objname=$@ $< +# +# freetype library PS support module +# +psaux.o: $(CORE)psaux/psaux.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library PS glyph names module +# +psnames.o: $(CORE)psnames/psnames.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library monochrome raster module +# +raster.o: $(CORE)raster/raster.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library anti-aliasing raster module +# +smooth.o: $(CORE)smooth/smooth.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library 'sfnt' module +# +sfnt.o: $(CORE)sfnt/sfnt.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library glyph and image caching system (still experimental) +# +ftcache.o: $(CORE)cache/ftcache.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library OpenType font driver +# +cff.o: $(CORE)cff/cff.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library TrueType font driver +# +truetype.o: $(CORE)truetype/truetype.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library Type1 font driver +# +type1.o: $(CORE)type1/type1.c + sc $(SCFLAGS) objname=$@ $< + +# +# FreeType2 library Type42 font driver +# +type42.o: $(CORE)type42/type42.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library CID-keyed Type1 font driver +# +type1cid.o: $(CORE)cid/type1cid.c + sc $(SCFLAGS) objname=$@ $< +# +# freetype library CID-keyed Type1 font driver extensions +# +#cidafm.o: $(CORE)cid/cidafm.c +# sc $(SCFLAGS) objname=$@ $< + +# +# freetype library BDF bitmap font driver +# +bdf.o: $(CORE)bdf/bdf.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library PCF bitmap font driver +# +pcf.o: $(CORE)pcf/pcf.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library PFR font driver +# +pfr.o: $(CORE)pfr/pfr.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library Windows FNT/FON bitmap font driver +# +winfnt.o: $(CORE)winfonts/winfnt.c + sc $(SCFLAGS) objname=$@ $< diff --git a/nx-X11/extras/freetype2/builds/amiga/src/base/ftdebug.c b/nx-X11/extras/freetype2/builds/amiga/src/base/ftdebug.c new file mode 100644 index 000000000..a61868746 --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/src/base/ftdebug.c @@ -0,0 +1,185 @@ +// TetiSoft: replaced vprintf() with KVPrintF() and commented out exit() +extern void __stdargs KVPrintF( const char *formatString, const void *values ); + +/***************************************************************************/ +/* */ +/* ftdebug.c */ +/* */ +/* Debugging and logging component (body). */ +/* */ +/* Copyright 1996-2001 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 component contains various macros and functions used to ease the */ + /* debugging of the FreeType engine. Its main purpose is in assertion */ + /* checking, tracing, and error detection. */ + /* */ + /* There are now three debugging modes: */ + /* */ + /* - trace mode */ + /* */ + /* Error and trace messages are sent to the log file (which can be the */ + /* standard error output). */ + /* */ + /* - error mode */ + /* */ + /* Only error messages are generated. */ + /* */ + /* - release mode: */ + /* */ + /* No error message is sent or generated. The code is free from any */ + /* debugging parts. */ + /* */ + /*************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H + + +#ifdef FT_DEBUG_LEVEL_TRACE + char ft_trace_levels[trace_max]; +#endif + + +#if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE ) + + +#include <stdarg.h> +#include <stdlib.h> + + + FT_EXPORT_DEF( void ) + FT_Message( const char* fmt, ... ) + { + va_list ap; + + + va_start( ap, fmt ); +// vprintf( fmt, ap ); + KVPrintF( fmt, ap ); + va_end( ap ); + } + + + FT_EXPORT_DEF( void ) + FT_Panic( const char* fmt, ... ) + { + va_list ap; + + + va_start( ap, fmt ); +// vprintf( fmt, ap ); + KVPrintF( fmt, ap ); + va_end( ap ); + +// exit( EXIT_FAILURE ); + } + + + + /* since I don't know wether "getenv" is available on the Amiga */ + /* I prefer to simply disable this code for now in all builds */ + /* */ + +/* #ifdef FT_DEBUG_LEVEL_TRACE */ +#if 0 + + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + const char* ft2_debug = getenv( "FT2_DEBUG" ); + + + if ( ft2_debug ) + { + const char* p = ft2_debug; + const char* q; + + + for ( ; *p; p++ ) + { + /* skip leading whitespace and separators */ + if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' ) + continue; + + /* read toggle name, followed by '=' */ + q = p; + while ( *p && *p != ':' ) + p++; + + if ( *p == ':' && p > q ) + { + int n, i, len = p - q; + int level = -1, found = -1; + + + for ( n = 0; n < trace_count; n++ ) + { + const char* toggle = ft_trace_toggles[n]; + + + for ( i = 0; i < len; i++ ) + { + if ( toggle[i] != q[i] ) + break; + } + + if ( i == len && toggle[i] == 0 ) + { + found = n; + break; + } + } + + /* read level */ + p++; + if ( *p ) + { + level = *p++ - '0'; + if ( level < 0 || level > 6 ) + level = -1; + } + + if ( found >= 0 && level >= 0 ) + { + if ( found == trace_any ) + { + /* special case for "any" */ + for ( n = 0; n < trace_count; n++ ) + ft_trace_levels[n] = level; + } + else + ft_trace_levels[found] = level; + } + } + } + } + } + + +#else /* !FT_DEBUG_LEVEL_TRACE */ + + + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* nothing */ + } + + +#endif /* !FT_DEBUG_LEVEL_TRACE */ + + +/* END */ diff --git a/nx-X11/extras/freetype2/builds/amiga/src/base/ftsystem.c b/nx-X11/extras/freetype2/builds/amiga/src/base/ftsystem.c new file mode 100644 index 000000000..e76d4161e --- /dev/null +++ b/nx-X11/extras/freetype2/builds/amiga/src/base/ftsystem.c @@ -0,0 +1,450 @@ +/***************************************************************************/ +/* */ +/* ftsystem.c */ +/* */ +/* Amiga-specific FreeType low-level system interface (body). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* This file contains the Amiga interface used by FreeType to access */ + /* low-level, i.e. memory management, i/o access as well as thread */ + /* synchronisation. */ + /* */ + /*************************************************************************/ + + +// Maintained by Detlef Würkner <TetiSoft@apg.lahn.de> + +// TetiSoft: Modified to avoid fopen() fclose() fread() fseek() ftell() +// malloc() realloc() and free() which can't be used in an amiga +// shared run-time library linked with libinit.o + +#include <exec/memory.h> + +#ifdef __GNUC__ +// Avoid warnings "struct X declared inside parameter list" +#include <exec/devices.h> +#include <exec/io.h> +#include <exec/semaphores.h> +#include <dos/exall.h> +#endif + +// Necessary with OS3.9 includes +#define __USE_SYSBASE + +#include <proto/exec.h> +#include <proto/dos.h> + +#ifndef __GNUC__ +/* TetiSoft: Missing in alib_protos.h, see amiga.lib autodoc + * (These amiga.lib functions work under AmigaOS V33 and up) + */ +extern APTR __asm +AsmCreatePool( register __d0 ULONG memFlags, + register __d1 ULONG puddleSize, + register __d2 ULONG threshSize, + register __a6 struct ExecBase* SysBase ); + +extern VOID __asm +AsmDeletePool( register __a0 APTR poolHeader, + register __a6 struct ExecBase* SysBase ); + +extern APTR __asm +AsmAllocPooled( register __a0 APTR poolHeader, + register __d0 ULONG memSize, + register __a6 struct ExecBase* SysBase ); + +extern VOID __asm +AsmFreePooled( register __a0 APTR poolHeader, + register __a1 APTR memory, + register __d0 ULONG memSize, + register __a6 struct ExecBase* SysBase); +#endif + + +// TetiSoft: C implementation of AllocVecPooled (see autodoc exec/AllocPooled) +APTR +AllocVecPooled( APTR poolHeader, + ULONG memSize ) +{ + ULONG newSize = memSize + sizeof ( ULONG ); +#ifdef __GNUC__ + ULONG *mem = AllocPooled( poolHeader, newSize ); +#else + ULONG *mem = AsmAllocPooled( poolHeader, newSize, SysBase ); +#endif + + if ( !mem ) + return NULL; + *mem = newSize; + return mem + 1; +} + + +// TetiSoft: C implementation of FreeVecPooled (see autodoc exec/AllocPooled) +void +FreeVecPooled( APTR poolHeader, + APTR memory ) +{ + ULONG *realmem = (ULONG *)memory - 1; + +#ifdef __GNUC__ + FreePooled( poolHeader, realmem, *realmem ); +#else + AsmFreePooled( poolHeader, realmem, *realmem, SysBase ); +#endif +} + + +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_DEBUG_H +#include FT_SYSTEM_H +#include FT_ERRORS_H +#include FT_TYPES_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + + /*************************************************************************/ + /* */ + /* MEMORY MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* It is not necessary to do any error checking for the */ + /* allocation-related functions. This will be done by the higher level */ + /* routines like FT_Alloc() or FT_Realloc(). */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_alloc */ + /* */ + /* <Description> */ + /* The memory allocation function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* size :: The requested size in bytes. */ + /* */ + /* <Return> */ + /* The address of newly allocated block. */ + /* */ + FT_CALLBACK_DEF( void* ) + ft_alloc( FT_Memory memory, + long size ) + { +// FT_UNUSED( memory ); + +// return malloc( size ); + return AllocVecPooled( memory->user, size ); + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_realloc */ + /* */ + /* <Description> */ + /* The memory reallocation function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* cur_size :: The current size of the allocated memory block. */ + /* */ + /* new_size :: The newly requested size in bytes. */ + /* */ + /* block :: The current address of the block in memory. */ + /* */ + /* <Return> */ + /* The address of the reallocated memory block. */ + /* */ + FT_CALLBACK_DEF( void* ) + ft_realloc( FT_Memory memory, + long cur_size, + long new_size, + void* block ) + { +// FT_UNUSED( memory ); +// FT_UNUSED( cur_size ); + +// return realloc( block, new_size ); + + void* new_block; + + new_block = AllocVecPooled ( memory->user, new_size ); + if ( new_block != NULL ) + { + CopyMem ( block, new_block, + ( new_size > cur_size ) ? cur_size : new_size ); + FreeVecPooled ( memory->user, block ); + } + return new_block; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_free */ + /* */ + /* <Description> */ + /* The memory release function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* block :: The address of block in memory to be freed. */ + /* */ + FT_CALLBACK_DEF( void ) + ft_free( FT_Memory memory, + void* block ) + { +// FT_UNUSED( memory ); + +// free( block ); + + FreeVecPooled( memory->user, block ); + } + + + /*************************************************************************/ + /* */ + /* RESOURCE MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_io + + /* We use the macro STREAM_FILE for convenience to extract the */ + /* system-specific stream handle from a given FreeType stream object */ +// #define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer ) +#define STREAM_FILE( stream ) ( (BPTR)stream->descriptor.pointer ) // TetiSoft + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_close_stream */ + /* */ + /* <Description> */ + /* The function to close a stream. */ + /* */ + /* <Input> */ + /* stream :: A pointer to the stream object. */ + /* */ + FT_CALLBACK_DEF( void ) + ft_close_stream( FT_Stream stream ) + { +// fclose( STREAM_FILE( stream ) ); + Close( STREAM_FILE( stream ) ); // TetiSoft + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = 0; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_io_stream */ + /* */ + /* <Description> */ + /* The function to open a stream. */ + /* */ + /* <Input> */ + /* stream :: A pointer to the stream object. */ + /* */ + /* offset :: The position in the data stream to start reading. */ + /* */ + /* buffer :: The address of buffer to store the read data. */ + /* */ + /* count :: The number of bytes to read from the stream. */ + /* */ + /* <Return> */ + /* The number of bytes actually read. */ + /* */ + FT_CALLBACK_DEF( unsigned long ) + ft_io_stream( FT_Stream stream, + unsigned long offset, + unsigned char* buffer, + unsigned long count ) + { +// FILE* file; + BPTR file; // TetiSoft + + + file = STREAM_FILE( stream ); + +// fseek( file, offset, SEEK_SET ); + Seek( file, offset, OFFSET_BEGINNING ); // TetiSoft + +// return (unsigned long)fread( buffer, 1, count, file ); + return (unsigned long)FRead( file, buffer, 1, count); + } + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_Open( FT_Stream stream, + const char* filepathname ) + { +// FILE* file; + BPTR file; // TetiSoft + struct FileInfoBlock* fib; // TetiSoft + + + if ( !stream ) + return FT_Err_Invalid_Stream_Handle; + +// file = fopen( filepathname, "rb" ); + file = Open( filepathname, MODE_OLDFILE ); // TetiSoft + if ( !file ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_Err_Cannot_Open_Resource; + } + +// fseek( file, 0, SEEK_END ); +// astream->size = ftell( file ); +// fseek( file, 0, SEEK_SET ); + fib = AllocDosObject( DOS_FIB, NULL ); + if ( !fib ) + { + Close ( file ); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_Err_Cannot_Open_Resource; + } + if ( !( ExamineFH( file, fib ) ) ) + { + FreeDosObject( DOS_FIB, fib ); + Close ( file ); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_Err_Cannot_Open_Resource; + } + stream->size = fib->fib_Size; + FreeDosObject( DOS_FIB, fib ); + +// stream->descriptor.pointer = file; + stream->descriptor.pointer = (void *)file; + + stream->pathname.pointer = (char*)filepathname; + stream->pos = 0; + + stream->read = ft_io_stream; + stream->close = ft_close_stream; + + FT_TRACE1(( "FT_Stream_Open:" )); + FT_TRACE1(( " opened `%s' (%d bytes) successfully\n", + filepathname, stream->size )); + + return FT_Err_Ok; + } + + +#ifdef FT_DEBUG_MEMORY + + extern FT_Int + ft_mem_debug_init( FT_Memory memory ); + + extern void + ft_mem_debug_done( FT_Memory memory ); + +#endif + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( FT_Memory ) + FT_New_Memory( void ) + { + FT_Memory memory; + + +// memory = (FT_Memory)malloc( sizeof ( *memory ) ); + memory = (FT_Memory)AllocVec( sizeof ( *memory ), MEMF_PUBLIC ); + if ( memory ) + { +// memory->user = 0; +#ifdef __GNUC__ + memory->user = CreatePool( MEMF_PUBLIC, 2048, 2048 ); +#else + memory->user = AsmCreatePool( MEMF_PUBLIC, 2048, 2048, SysBase ); +#endif + if ( memory->user == NULL ) + { + FreeVec( memory ); + memory = NULL; + } + else + { + memory->alloc = ft_alloc; + memory->realloc = ft_realloc; + memory->free = ft_free; +#ifdef FT_DEBUG_MEMORY + ft_mem_debug_init( memory ); +#endif + } + } + + return memory; + } + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( void ) + FT_Done_Memory( FT_Memory memory ) + { +#ifdef FT_DEBUG_MEMORY + ft_mem_debug_done( memory ); +#endif + +#ifdef __GNUC__ + DeletePool( memory->user ); +#else + AsmDeletePool( memory->user, SysBase ); +#endif + FreeVec( memory ); + } + + +/* END */ |