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

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

@@ -0,0 +1,47 @@
This is the readme of the freetype.hqx archive in the contrib/mac
subdirectory. Please note that the FreeType team does *not* support the
Macintosh platform due to lack of knowledge. All questions regarding the
code should be sent to both David Williss and the freetype-devel list.
----------------------------------------------------------------------------
These are CodeWarrior projects for building the FreeType library on a Macintosh
I've only provided PPC projects here, but building for 68K shouldn't be hard.
There are two directories here (OK, "folders"). One contains a project for
building freetype.ppc.lib and the other is for freetype.ppc.dll. (I havn't
actually tested the DLL yet.)
The Macintosh stores TrueType fonts in a "Fonts" folder under the "System"
folder. There is a standard MacOS API for finding this folder, so I use it.
However, the fonts aren't normal flat files. They have all the data in
resources in the resource fork. Each font is an 'sfnt' resource, and each
file can have more than one 'sfnt' resource.
To get at them, I made a copy of ttmmap.c from the Unix implementation and
modified it to load/release the resource and lock/unlock the handle as needed.
This only required a change to the open and close functions. After that, it
works just as if it was using Unix memory mapping.
One thing however. Because of the bizarre scheme for storing the fonts, I
made up a way of specifying the font filename.
fonts:/fontfile/fontname
Where fonts:/ is a literal string that means "the fonts folder", fontfile is
the name of the actual file and fontname is the name of the 'sfnt' resource.
Currently, this is the only thing it understands. It might be nice if some
day (2.0 maybe?) ttfile.c and ttmmap.c wern't mutialy exclusive and it could
decide which method to use based on the filename or something.
Another thing that I had to change to make this work. It seems that Macintosh
TrueType fonts have no OS/2 table, so ttload.c needs to be modified to make
that nonfatal, at least on a Macintosh.
---
David Williss
MicroImages, Inc.
dwilliss@microimages.com

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

@@ -0,0 +1,48 @@
/* This file is *not* part of the FreeType project, because the team */
/* lacks the necessary expertise to support it. */
/* freetype.c for MacOS */
/* single object library component for MacOS */
/* Written by Dave Willis <dwilliss@microimages.com> on 1998-07-30. */
/* Modified by Antoine Leca for the 1.3 release, but untested. */
#define TT_MAKE_OPTION_SINGLE_OBJECT
/* Note, you should define the EXPORT_DEF and EXPORT_FUNC macros here */
/* if you want to build a DLL. If undefined, the macros are defined */
/* as "export" and "" (i.e. nothing), which is the normal behaviour. */
/* The macros are placed before each high-level API function */
/* declaration. You can then use them to take any compiler-specific */
/* pragma for DLL-exported symbols. See 'ttconfig.h' for details. */
/* first include common core components */
#define MAC_MAIN_OBJECT
#include "ttapi.c"
#include "ttcache.c"
#include "ttcalc.c"
#include "ttcmap.c"
#include "ttdebug.c"
#include "ttgload.c"
#include "ttinterp.c"
#include "ttload.c"
#include "ttobjs.c"
#include "ttobjs.c"
#include "ttraster.c"
/* then system-specific (or ANSI) components */
#include "ttmmap.c" /* Was "ttfile.c" */
#include "ttmemory.c"
#include "ttmutex.c"
/* finally, add some extensions */
#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
#include "ttextend.c"
#endif
/* END */

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

@@ -0,0 +1,211 @@
/* This file is *not* part of the FreeType project, because the team */
/* lacks the necessary expertise to support it. */
/* ft_conf.h for MacOS */
/* Written by Dave Willis <dwilliss@microimages.com> on 1998-07-30. */
/* Modified by Antoine Leca for the 1.3 release, but untested. */
/* we need the following because there are some typedefs in this file */
#ifndef FT_CONF_H
#define FT_CONF_H
/* Define to empty if the 'const' keyword does not work. */
/* #undef const */
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE
/* Define if you have the valloc function. */
#undef HAVE_VALLOC
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/**********************************************************************/
/* */
/* The following configuration macros can be tweaked manually by */
/* a developer to turn on or off certain features or options in the */
/* TrueType engine. This may be useful to tune it for specific */
/* purposes.. */
/* */
/**********************************************************************/
/*************************************************************************/
/* Define this if the underlying operating system uses a different */
/* character width than 8bit for file names. You must then also supply */
/* a typedef declaration for defining 'TT_Text'. Default is off. */
/* #define HAVE_TT_TEXT */
/*************************************************************************/
/* Define this if you want to generate code to support engine extensions */
/* Default is on, but if you're satisfied by the basic services provided */
/* by the engine and need no extensions, undefine this configuration */
/* macro to save a few more bytes. */
#define TT_CONFIG_OPTION_EXTEND_ENGINE
/*************************************************************************/
/* Define this if you want to generate code to support gray-scaling, */
/* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */
/* disable it if you don't need it. */
#define TT_CONFIG_OPTION_GRAY_SCALING
/*************************************************************************/
/* Define this if you want to completely disable the use of the bytecode */
/* interpreter. Doing so will produce a much smaller library, but the */
/* quality of the rendered glyphs will enormously suffer from this. */
/* */
/* This switch was introduced due to the Apple patents issue which */
/* emerged recently on the FreeType lists. We still do not have Apple's */
/* opinion on the subject and will change this as soon as we have. */
#undef TT_CONFIG_OPTION_NO_INTERPRETER
/*************************************************************************/
/* Define this if you want to use a big 'switch' statement within the */
/* bytecode interpreter. Because some non-optimizing compilers are not */
/* able to produce jump tables from such statements, undefining this */
/* configuration macro will generate the appropriate C jump table in */
/* ttinterp.c. If you use an optimizing compiler, you should leave it */
/* defined for better performance and code compactness.. */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
/*************************************************************************/
/* Define this if you want to build a 'static' version of the TrueType */
/* bytecode interpreter. This will produce much bigger code, which */
/* _may_ be faster on some architectures.. */
/* */
/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */
/* */
#undef TT_CONFIG_OPTION_STATIC_INTERPRETER
/*************************************************************************/
/* Define this if you want to build a 'static' version of the scan-line */
/* converter (the component which in charge of converting outlines into */
/* bitmaps). This will produce a bigger object file for "ttraster.c", */
/* which _may_ be faster on some architectures.. */
/* */
/* Do NOT DEFINE THIS is you build a thread-safe version of the engine */
/* */
#undef TT_CONFIG_OPTION_STATIC_RASTER
/*************************************************************************/
/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */
/* version of the library. */
#undef TT_CONFIG_OPTION_THREAD_SAFE
/**********************************************************************/
/* */
/* The following macros are used to define the debug level, as well */
/* as individual tracing levels for each component. There are */
/* currently three modes of operation : */
/* */
/* - trace mode (define DEBUG_LEVEL_TRACE) */
/* */
/* The engine prints all error messages, as well as tracing */
/* ones, filtered by each component's level */
/* */
/* - debug mode (define DEBUG_LEVEL_ERROR) */
/* */
/* Disable tracing, but keeps error output and assertion */
/* checks. */
/* */
/* - release mode (don't define anything) */
/* */
/* Don't include error-checking or tracing code in the */
/* engine's code. Ideal for releases. */
/* */
/* NOTE : */
/* */
/* Each component's tracing level is defined in its own source. */
/* */
/**********************************************************************/
/* Define if you want to use the tracing debug mode */
#undef DEBUG_LEVEL_TRACE
/* Define if you want to use the error debug mode - ignored if */
/* DEBUG_LEVEL_TRACE is defined */
#undef DEBUG_LEVEL_ERROR
/**************************************************************************/
/* Definition of various integer sizes. These types are used by ttcalc */
/* and ttinterp (for the 64-bit integers) only.. */
#if SIZEOF_INT == 4
typedef signed int TT_Int32;
typedef unsigned int TT_Word32;
#elif SIZEOF_LONG == 4
typedef signed long TT_Int32;
typedef unsigned long TT_Word32;
#else
#error "no 32bit type found"
#endif
#if SIZEOF_LONG == 8
/* LONG64 must be defined when a 64-bit type is available */
/* INT64 must then be defined to this type.. */
#define LONG64
#define INT64 long
#else
/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */
/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */
/* will produce many -ansi warnings during library compilation. */
#ifdef TT_USE_LONG_LONG
#define LONG64
#define INT64 long long
#endif /* TT_USE_LONG_LONG */
#endif
#endif /* FT_CONF_H */
/* END */

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

File diff suppressed because it is too large Load Diff