diff --git a/vendor/freetype/LICENSE.TXT b/vendor/freetype/LICENSE.TXT index 8b9ce9e2e6e..0f9df2177a4 100644 --- a/vendor/freetype/LICENSE.TXT +++ b/vendor/freetype/LICENSE.TXT @@ -35,9 +35,10 @@ in earlier FreeType versions. The gzip module uses the zlib license (see `src/gzip/zlib.h`) which too is compatible to the above two licenses. -The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code -taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses -the 'Old MIT' license, compatible to the above two licenses. +The files `src/autofit/ft-hb-ft.c`, `src/autofit/ft-hb-decls.h`, +`src/autofit/ft-hb-types.h`, and `src/autofit/hb-script-list.h` +contain code taken (almost) verbatim from the HarfBuzz library, which +uses the 'Old MIT' license compatible to the above two licenses. The MD5 checksum support (only used for debugging in development builds) is in the public domain. diff --git a/vendor/freetype/README b/vendor/freetype/README index 0f5d3e0e021..28879dabdee 100644 --- a/vendor/freetype/README +++ b/vendor/freetype/README @@ -1,7 +1,7 @@ FreeType 2.13.3 =============== -Homepage: https://www.freetype.org +Homepage: https://freetype.org FreeType is a freely available software library to render fonts. @@ -13,7 +13,7 @@ Please read the `docs/CHANGES` file, it contains IMPORTANT INFORMATION. Read the files `docs/INSTALL*` for installation instructions; see the -file `docs/LICENSE.TXT` for the available licenses. +file `LICENSE.TXT` for the available licenses. For using FreeType's git repository instead of a distribution bundle, please read file `README.git`. Note that you have to actually clone @@ -38,7 +38,7 @@ and download one of the following files. To view the documentation online, go to - https://www.freetype.org/freetype2/docs/ + https://freetype.org/freetype2/docs/ Mailing Lists @@ -54,7 +54,7 @@ e-mail lists. The lists are moderated; see - https://www.freetype.org/contact.html + https://freetype.org/contact.html how to subscribe. @@ -85,7 +85,7 @@ FreeType! Details on the process can be found here: - https://www.freetype.org/developer.html#patches + https://freetype.org/developer.html#patches Enjoy! diff --git a/vendor/freetype/builds/amiga/README b/vendor/freetype/builds/amiga/README new file mode 100644 index 00000000000..aec3bc4f3f9 --- /dev/null +++ b/vendor/freetype/builds/amiga/README @@ -0,0 +1,110 @@ + +README for the builds/amiga subdirectory. + +Copyright (C) 2005-2024 by +Werner Lemberg and Detlef Würkner. + +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. + + +The makefile.os4 is for the AmigaOS4 SDK. To use it, type +"make -f makefile.os4", it produces a link library libft2_ppc.a. + +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 (https://os.amigaworld.de/download.php?id=3) 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. Because 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, because 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/freetype/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. + +Local Variables: +coding: latin-1 +End: diff --git a/vendor/freetype/builds/amiga/include/config/ftconfig.h b/vendor/freetype/builds/amiga/include/config/ftconfig.h new file mode 100644 index 00000000000..f26b8e0f9a9 --- /dev/null +++ b/vendor/freetype/builds/amiga/include/config/ftconfig.h @@ -0,0 +1,55 @@ +/***************************************************************************/ +/* */ +/* ftconfig.h */ +/* */ +/* Amiga-specific configuration file (specification only). */ +/* */ +/* Copyright (C) 2005-2024 by */ +/* Werner Lemberg and Detlef Würkner. */ +/* */ +/* 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 is an example how to override the default FreeType2 header files + * with Amiga-specific changes. When the compiler searches this directory + * before the default directory, we can do some modifications. + * + * Here we must change FT_EXPORT_DEF so that SAS/C does + * generate the needed XDEFs. + */ + +#if 0 +#define FT_EXPORT_DEF( x ) extern x +#endif + +#undef FT_EXPORT_DEF +#define FT_EXPORT_DEF( x ) x + +/* Now include the original file */ +#ifndef __MORPHOS__ +#ifdef __SASC +#include "FT:include/freetype/config/ftconfig.h" +#else +#include "/FT/include/freetype/config/ftconfig.h" +#endif +#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 + +/* +Local Variables: +coding: latin-1 +End: +*/ diff --git a/vendor/freetype/builds/amiga/include/config/ftmodule.h b/vendor/freetype/builds/amiga/include/config/ftmodule.h new file mode 100644 index 00000000000..a7be0a426ce --- /dev/null +++ b/vendor/freetype/builds/amiga/include/config/ftmodule.h @@ -0,0 +1,158 @@ +/***************************************************************************/ +/* */ +/* ftmodule.h */ +/* */ +/* Amiga-specific FreeType module selection. */ +/* */ +/* Copyright (C) 2005-2024 by */ +/* Werner Lemberg and Detlef Würkner. */ +/* */ +/* 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. */ +/* */ +/***************************************************************************/ + +/* + * To avoid that all your programs include all FreeType modules, + * you copy the following piece of source code into your own + * source file and specify which modules you really need in your + * application by uncommenting the appropriate lines. + */ +/* +//#define FT_USE_AUTOFIT // autofitter +//#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 +//#define FT_USE_OTV // opentype validator +//#define FT_USE_GXV // truetype gx validator +#include "FT:src/base/ftinit.c" +*/ + +/* Make sure that the 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 + +/* Now include the modules */ + +#ifdef FT_USE_AUTOFIT +FT_USE_MODULE( FT_Module_Class, autofit_module_class ) +#endif + +#ifdef FT_USE_TT +FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) +#endif + +#ifdef FT_USE_T1 +FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) +#endif + +#ifdef FT_USE_CFF +FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) +#endif + +#ifdef FT_USE_T1CID +FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) +#endif + +#ifdef FT_USE_PFR +FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) +#endif + +#ifdef FT_USE_T42 +FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) +#endif + +#ifdef FT_USE_WINFNT +FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) +#endif + +#ifdef FT_USE_PCF +FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) +#endif + +#ifdef FT_USE_PSAUX +FT_USE_MODULE( FT_Module_Class, psaux_module_class ) +#endif + +#ifdef FT_USE_PSNAMES +FT_USE_MODULE( FT_Module_Class, psnames_module_class ) +#endif + +#ifdef FT_USE_PSHINT +FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) +#endif + +#ifdef FT_USE_RASTER +FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) +#endif + +#ifdef FT_USE_SFNT +FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) +#endif + +#ifdef FT_USE_SMOOTH +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) +#endif + +#ifdef FT_USE_OTV +FT_USE_MODULE( FT_Module_Class, otv_module_class ) +#endif + +#ifdef FT_USE_BDF +FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) +#endif + +#ifdef FT_USE_GXV +FT_USE_MODULE( FT_Module_Class, gxv_module_class ) +#endif + +/* +Local Variables: +coding: latin-1 +End: +*/ diff --git a/vendor/freetype/builds/amiga/makefile.os4 b/vendor/freetype/builds/amiga/makefile.os4 new file mode 100644 index 00000000000..fcf7126037e --- /dev/null +++ b/vendor/freetype/builds/amiga/makefile.os4 @@ -0,0 +1,297 @@ +# +# Makefile for FreeType2 link library using gcc 4.0.3 from the +# AmigaOS4 SDK +# + + +# Copyright (C) 2005-2024 by +# Werner Lemberg and Detlef Würkner. +# +# 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. + + +# to build from the builds/amiga directory call +# +# make -f makefile.os4 +# +# Your programs source code should start with this +# (uncomment the parts you do not need to keep the program small): +# ---8<--- +#define FT_USE_AUTOFIT // autofitter +#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 +#define FT_USE_OTV // opentype validator +#define FT_USE_GXV // truetype gx validator +#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: assign libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o + +assign: + assign FT: // + +CC = ppc-amigaos-gcc +AR = ppc-amigaos-ar +RANLIB = ppc-amigaos-ranlib + +DIRFLAGS = -Iinclude -I/FT/src -I/FT/include -I/SDK/include + +WARNINGS = -Wall -W -Wundef -Wpointer-arith -Wbad-function-cast \ + -Waggregate-return -Wwrite-strings -Wshadow + +OPTIONS = -DFT2_BUILD_LIBRARY -DNDEBUG -fno-builtin +OPTIMIZE = -O2 -fomit-frame-pointer -fstrength-reduce -finline-functions + +CFLAGS = -mcrt=clib2 $(DIRFLAGS) $(WARNINGS) $(FT2FLAGS) $(OPTIONS) $(OPTIMIZE) + +# +# FreeType2 library base +# +ftbase.ppc.o: FT:src/base/ftbase.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbase.c + +ftinit.ppc.o: FT:src/base/ftinit.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftinit.c + +ftsystem.ppc.o: FT:src/base/ftsystem.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftsystem.c + +# pure version for use in run-time library etc +ftsystempure.ppc.o: src/base/ftsystem.c + $(CC) -c $(CFLAGS) -o $@ src/base/ftsystem.c + +# +# FreeType2 library base extensions +# +ftbbox.ppc.o: FT:src/base/ftbbox.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbbox.c + +ftbdf.ppc.o: FT:src/base/ftbdf.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbdf.c + +ftbitmap.ppc.o: FT:src/base/ftbitmap.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftbitmap.c + +ftcid.ppc.o: FT:src/base/ftcid.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftcid.c + +ftdebug.ppc.o: FT:src/base/ftdebug.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftdebug.c + +# pure version for use in run-time library etc +ftdebugpure.ppc.o: src/base/ftdebug.c + $(CC) -c $(CFLAGS) -o $@ src/base/ftdebug.c + +ftfstype.ppc.o: FT:src/base/ftfstype.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftfstype.c + +ftgasp.ppc.o: FT:src/base/ftgasp.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftgasp.c + +ftglyph.ppc.o: FT:src/base/ftglyph.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftglyph.c + +ftgxval.ppc.o: FT:src/base/ftgxval.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftgxval.c + +ftmm.ppc.o: FT:src/base/ftmm.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftmm.c + +ftotval.ppc.o: FT:src/base/ftotval.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftotval.c + +ftpatent.ppc.o: FT:src/base/ftpatent.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftpatent.c + +ftpfr.ppc.o: FT:src/base/ftpfr.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftpfr.c + +ftstroke.ppc.o: FT:src/base/ftstroke.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftstroke.c + +ftsynth.ppc.o: FT:src/base/ftsynth.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftsynth.c + +fttype1.ppc.o: FT:src/base/fttype1.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/fttype1.c + +ftwinfnt.ppc.o: FT:src/base/ftwinfnt.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/base/ftwinfnt.c + +# +# FreeType2 library autofitting module +# +autofit.ppc.o: FT:src/autofit/autofit.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/autofit/autofit.c + +# +# FreeType2 library postscript hinting module +# +pshinter.ppc.o: FT:src/pshinter/pshinter.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/pshinter/pshinter.c + +# +# FreeType2 library PS support module +# +psaux.ppc.o: FT:src/psaux/psaux.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/psaux/psaux.c + +# +# FreeType2 library PS glyph names module +# +psnames.ppc.o: FT:src/psnames/psnames.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/psnames/psnames.c + +# +# FreeType2 library monochrome raster module +# +raster.ppc.o: FT:src/raster/raster.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/raster/raster.c + +# +# FreeType2 library anti-aliasing raster module +# +smooth.ppc.o: FT:src/smooth/smooth.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/smooth/smooth.c + +# +# FreeType2 library 'sfnt' module +# +sfnt.ppc.o: FT:src/sfnt/sfnt.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/sfnt/sfnt.c + +# +# FreeType2 library glyph and image caching system +# +ftcache.ppc.o: FT:src/cache/ftcache.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/cache/ftcache.c + +# +# FreeType2 library OpenType font driver +# +cff.ppc.o: FT:src/cff/cff.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/cff/cff.c + +# +# FreeType2 library TrueType font driver +# +truetype.ppc.o: FT:src/truetype/truetype.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/truetype/truetype.c + +# +# FreeType2 library Type1 font driver +# +type1.ppc.o: FT:src/type1/type1.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/type1/type1.c + +# +# FreeType2 library Type42 font driver +# +type42.ppc.o: FT:src/type42/type42.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/type42/type42.c + +# +# FreeType2 library CID-keyed Type1 font driver +# +type1cid.ppc.o: FT:src/cid/type1cid.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/cid/type1cid.c + +# +# FreeType2 library BDF bitmap font driver +# +bdf.ppc.o: FT:src/bdf/bdf.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/bdf/bdf.c + +# +# FreeType2 library PCF bitmap font driver +# +pcf.ppc.o: FT:src/pcf/pcf.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/pcf/pcf.c + +# +# FreeType2 library gzip support for compressed PCF bitmap fonts +# +gzip.ppc.o: FT:src/gzip/ftgzip.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/gzip/ftgzip.c + +# +# FreeType2 library bzip2 support for compressed PCF bitmap fonts +# +bzip2.ppc.o: FT:src/bzip2/ftbzip2.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/bzip2/ftbzip2.c + +# +# FreeType2 library compress support for compressed PCF bitmap fonts +# +lzw.ppc.o: FT:src/lzw/ftlzw.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/lzw/ftlzw.c + +# +# FreeType2 library PFR font driver +# +pfr.ppc.o: FT:src/pfr/pfr.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/pfr/pfr.c + +# +# FreeType2 library Windows FNT/FON bitmap font driver +# +winfnt.ppc.o: FT:src/winfonts/winfnt.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/winfonts/winfnt.c + +# +# FreeType2 library TrueTypeGX Validator +# +gxvalid.ppc.o: FT:src/gxvalid/gxvalid.c + $(CC) -c $(CFLAGS) -Wno-aggregate-return -o $@ /FT/src/gxvalid/gxvalid.c + +# +# FreeType2 library OpenType validator +# +otvalid.ppc.o: FT:src/otvalid/otvalid.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/otvalid/otvalid.c + +BASE = ftbase.ppc.o ftbbox.ppc.o ftbdf.ppc.o ftbitmap.ppc.o ftcid.ppc.o \ + ftfstype.ppc.o ftgasp.ppc.o ftglyph.ppc.o \ + ftgxval.ppc.o ftmm.ppc.o ftotval.ppc.o \ + ftpatent.ppc.o ftpfr.ppc.o ftstroke.ppc.o ftsynth.ppc.o \ + fttype1.ppc.o ftwinfnt.ppc.o + +DEBUG = ftdebug.ppc.o ftdebugpure.ppc.o + +AFIT = autofit.ppc.o + +GXV = gxvalid.ppc.o + +OTV = otvalid.ppc.o + +PS = psaux.ppc.o psnames.ppc.o pshinter.ppc.o + +RASTER = raster.ppc.o smooth.ppc.o + +FONTD = 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: $(BASE) $(AFIT) $(GXV) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o + $(AR) r $@ $(BASE) $(AFIT) $(GXV) $(OTV) $(PS) $(RASTER) sfnt.ppc.o ftcache.ppc.o $(FONTD) gzip.ppc.o lzw.ppc.o + $(RANLIB) $@ + +#Local Variables: +#coding: latin-1 +#End: diff --git a/vendor/freetype/builds/amiga/smakefile b/vendor/freetype/builds/amiga/smakefile new file mode 100644 index 00000000000..9efb362c219 --- /dev/null +++ b/vendor/freetype/builds/amiga/smakefile @@ -0,0 +1,299 @@ +# +# Makefile for FreeType2 link library using Amiga SAS/C 6.58 +# + + +# Copyright (C) 2005-2024 by +# Werner Lemberg and Detlef Würkner. +# +# 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. + + +# 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_AUTOFIT // autofitter +#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 +#define FT_USE_OTV // opentype validator +#define FT_USE_GXV // truetype gx validator +#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 ftbbox.o ftbdf.o ftbitmap.o ftcid.o ftfstype.o \ + ftgasp.o ftglyph.o ftgxval.o ftmm.o ftotval.o \ + ftpatent.o ftpfr.o ftstroke.o ftsynth.o fttype1.o ftwinfnt.o + +OBJSYSTEM = ftsystem.o ftsystempure.o + +OBJDEBUG = ftdebug.o ftdebugpure.o + +OBJAFIT = autofit.o + +OBJGXV = gxvalid.o + +OBJOTV = otvalid.o + +OBJPS = psaux.o psnames.o pshinter.o + +OBJRASTER = raster.o smooth.o + +OBJSFNT = sfnt.o + +OBJCACHE = ftcache.o + +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 data=faronly idlen=50 cpu=$(CPU)\ + idir=include/ idir=$(CORE) idir=FT:include/ nostackcheck nochkabort\ + noicons ignore=79,85,110,306 parameters=both define=FT2_BUILD_LIBRARY + +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) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o bzip2.o + oml $@ r $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o bzip2.o + +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 +# +ftbbox.o: $(CORE)base/ftbbox.c + sc $(SCFLAGS) objname=$@ $< +ftbdf.o: $(CORE)base/ftbdf.c + sc $(SCFLAGS) objname=$@ $< +ftbitmap.o: $(CORE)base/ftbitmap.c + sc $(SCFLAGS) objname=$@ $< +ftcid.o: $(CORE)base/ftcid.c + sc $(SCFLAGS) objname=$@ $< +ftfstype.o: $(CORE)base/ftfstype.c + sc $(SCFLAGS) objname=$@ $< +ftgasp.o: $(CORE)base/ftgasp.c + sc $(SCFLAGS) objname=$@ $< +ftglyph.o: $(CORE)base/ftglyph.c + sc $(SCFLAGS) objname=$@ $< +ftgxval.o: $(CORE)base/ftgxval.c + sc $(SCFLAGS) objname=$@ $< +ftmm.o: $(CORE)base/ftmm.c + sc $(SCFLAGS) objname=$@ $< +ftotval.o: $(CORE)base/ftotval.c + sc $(SCFLAGS) objname=$@ $< +ftpatent.o: $(CORE)base/ftpatent.c + sc $(SCFLAGS) objname=$@ $< +ftpfr.o: $(CORE)base/ftpfr.c + sc $(SCFLAGS) objname=$@ $< +ftstroke.o: $(CORE)base/ftstroke.c + sc $(SCFLAGS) objname=$@ $< +ftsynth.o: $(CORE)base/ftsynth.c + sc $(SCFLAGS) objname=$@ $< +fttype1.o: $(CORE)base/fttype1.c + sc $(SCFLAGS) objname=$@ $< +ftwinfnt.o: $(CORE)base/ftwinfnt.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library autofitter module +# +autofit.o: $(CORE)autofit/autofit.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) code=far 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 gzip support for compressed PCF bitmap fonts +# +gzip.o: $(CORE)gzip/ftgzip.c + sc $(SCFLAGS) define FAR objname=$@ $< + +# +# freetype library bzip2 support for compressed PCF bitmap fonts +# +bzip2.o: $(CORE)bzip2/ftbzip2.c + sc $(SCFLAGS) define FAR objname=$@ $< + +# +# freetype library compress support for compressed PCF bitmap fonts +# +lzw.o: $(CORE)lzw/ftlzw.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=$@ $< + +# +# freetype library TrueTypeGX validator +# +gxvalid.o: $(CORE)gxvalid/gxvalid.c + sc $(SCFLAGS) objname=$@ $< + +# +# freetype library OpenType validator +# +otvalid.o: $(CORE)otvalid/otvalid.c + sc $(SCFLAGS) objname=$@ $< + +#Local Variables: +#coding: latin-1 +#End: diff --git a/vendor/freetype/builds/amiga/src/base/ftdebug.c b/vendor/freetype/builds/amiga/src/base/ftdebug.c new file mode 100644 index 00000000000..4d8addbfc11 --- /dev/null +++ b/vendor/freetype/builds/amiga/src/base/ftdebug.c @@ -0,0 +1,348 @@ +/**************************************************************************** + * + * ftdebug.c + * + * Debugging and logging component for amiga (body). + * + * Copyright (C) 1996-2024 by + * David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner. + * + * 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. + * + */ + + + /* + * Based on the default `ftdebug.c' file, + * replaced `vprintf' with `KVPrintF', + * commented out `exit', + * replaced `getenv' with `GetVar'. + */ + +#include +#include +#include +#include + +#define __NOLIBBASE__ +#define __NOLOBALIFACE__ +#define __USE_INLINE__ + +#include +#include + +#ifndef __amigaos4__ + extern struct Library* DOSBase; +#else + extern struct DOSIFace* IDOS; +#endif + + +#include +#include +#include + + +#ifdef FT_DEBUG_LEVEL_ERROR + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Message( const char* fmt, + ... ) + { + va_list ap; + + + va_start( ap, fmt ); + KVPrintF( fmt, ap ); + va_end( ap ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Panic( const char* fmt, + ... ) + { + va_list ap; + + + va_start( ap, fmt ); + KVPrintF( fmt, ap ); + va_end( ap ); + + /* exit( EXIT_FAILURE ); */ + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( int ) + FT_Throw( FT_Error error, + int line, + const char* file ) + { +#if 0 + /* activating the code in this block makes FreeType very chatty */ + fprintf( stderr, + "%s:%d: error 0x%02x: %s\n", + file, + line, + error, + FT_Error_String( error ) ); +#else + FT_UNUSED( error ); + FT_UNUSED( line ); + FT_UNUSED( file ); +#endif + + return 0; + } + +#endif /* FT_DEBUG_LEVEL_ERROR */ + + + +#ifdef FT_DEBUG_LEVEL_TRACE + + /* array of trace levels, initialized to 0; */ + /* this gets adjusted at run-time */ + static int ft_trace_levels_enabled[trace_count]; + + /* array of trace levels, always initialized to 0 */ + static int ft_trace_levels_disabled[trace_count]; + + /* a pointer to either `ft_trace_levels_enabled' */ + /* or `ft_trace_levels_disabled' */ + int* ft_trace_levels; + + /* define array of trace toggle names */ +#define FT_TRACE_DEF( x ) #x , + + static const char* ft_trace_toggles[trace_count + 1] = + { +#include + NULL + }; + +#undef FT_TRACE_DEF + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( FT_Int ) + FT_Trace_Get_Count( void ) + { + return trace_count; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( const char * ) + FT_Trace_Get_Name( FT_Int idx ) + { + int max = FT_Trace_Get_Count(); + + + if ( idx < max ) + return ft_trace_toggles[idx]; + else + return NULL; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Disable( void ) + { + ft_trace_levels = ft_trace_levels_disabled; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Enable( void ) + { + ft_trace_levels = ft_trace_levels_enabled; + } + + + /************************************************************************** + * + * Initialize the tracing sub-system. This is done by retrieving the + * value of the `FT2_DEBUG' environment variable. It must be a list of + * toggles, separated by spaces, `;', or `,'. Example: + * + * export FT2_DEBUG="any:3 memory:7 stream:5" + * + * This requests that all levels be set to 3, except the trace level for + * the memory and stream components which are set to 7 and 5, + * respectively. + * + * See the file `include/freetype/internal/fttrace.h' for details of + * the available toggle names. + * + * The level must be between 0 and 7; 0 means quiet (except for serious + * runtime errors), and 7 means _very_ verbose. + */ + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* const char* ft2_debug = ft_getenv( "FT2_DEBUG" ); */ + char buf[256]; + const char* ft2_debug = &buf[0]; + + + /* if ( ft2_debug ) */ + if ( GetVar( "FT2_DEBUG", (STRPTR)ft2_debug, 256, LV_VAR ) > 0 ) + { + 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 ) + break; + + if ( *p == ':' && p > q ) + { + FT_Int n, i, len = (FT_Int)( p - q ); + FT_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 > 7 ) + 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_enabled[n] = level; + } + else + ft_trace_levels_enabled[found] = level; + } + } + } + } + + ft_trace_levels = ft_trace_levels_enabled; + } + + +#else /* !FT_DEBUG_LEVEL_TRACE */ + + + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* nothing */ + } + + + FT_BASE_DEF( FT_Int ) + FT_Trace_Get_Count( void ) + { + return 0; + } + + + FT_BASE_DEF( const char * ) + FT_Trace_Get_Name( FT_Int idx ) + { + FT_UNUSED( idx ); + + return NULL; + } + + + FT_BASE_DEF( void ) + FT_Trace_Disable( void ) + { + /* nothing */ + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Enable( void ) + { + /* nothing */ + } + + +#endif /* !FT_DEBUG_LEVEL_TRACE */ + + +/* END */ diff --git a/vendor/freetype/builds/amiga/src/base/ftsystem.c b/vendor/freetype/builds/amiga/src/base/ftsystem.c new file mode 100644 index 00000000000..7f1a0ea3057 --- /dev/null +++ b/vendor/freetype/builds/amiga/src/base/ftsystem.c @@ -0,0 +1,530 @@ +/***************************************************************************/ +/* */ +/* ftsystem.c */ +/* */ +/* Amiga-specific FreeType low-level system interface (body). */ +/* */ +/* Copyright (C) 1996-2024 by */ +/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */ +/* */ +/* 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 */ + /* */ + /* Based on the original ftsystem.c, */ + /* modified to avoid fopen(), fclose(), fread(), fseek(), ftell(), */ + /* malloc(), realloc(), and free(). */ + /* */ + /* Those C library functions are often not thread-safe or cant be */ + /* used in a shared Amiga library. If that's not a problem for you, */ + /* you can of course use the default ftsystem.c with C library calls */ + /* instead. */ + /* */ + /* This implementation needs exec V39+ because it uses AllocPooled() etc */ + /* */ + /*************************************************************************/ + +#define __NOLIBBASE__ +#define __NOGLOBALIFACE__ +#define __USE_INLINE__ +#include +#include +#include +#ifdef __amigaos4__ +extern struct ExecIFace *IExec; +extern struct DOSIFace *IDOS; +#else +extern struct Library *SysBase; +extern struct Library *DOSBase; +#endif + +#define IOBUF_SIZE 512 + +/* structure that helps us to avoid + * useless calls of Seek() and Read() + */ +struct SysFile +{ + BPTR file; + ULONG iobuf_start; + ULONG iobuf_end; + UBYTE iobuf[IOBUF_SIZE]; +}; + +#ifndef __amigaos4__ +/* C implementation of AllocVecPooled (see autodoc exec/AllocPooled) */ +APTR +Alloc_VecPooled( APTR poolHeader, + ULONG memSize ) +{ + ULONG newSize = memSize + sizeof ( ULONG ); + ULONG *mem = AllocPooled( poolHeader, newSize ); + + if ( !mem ) + return NULL; + *mem = newSize; + return mem + 1; +} + +/* C implementation of FreeVecPooled (see autodoc exec/AllocPooled) */ +void +Free_VecPooled( APTR poolHeader, + APTR memory ) +{ + ULONG *realmem = (ULONG *)memory - 1; + + FreePooled( poolHeader, realmem, *realmem ); +} +#endif + +#include +#include FT_CONFIG_CONFIG_H +#include +#include +#include +#include + +#include +#include +#include + + + /*************************************************************************/ + /* */ + /* MEMORY MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* It is not necessary to do any error checking for the */ + /* allocation-related functions. This is done by the higher level */ + /* routines like ft_mem_alloc() or ft_mem_realloc(). */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* ft_alloc */ + /* */ + /* */ + /* The memory allocation function. */ + /* */ + /* */ + /* memory :: A pointer to the memory object. */ + /* */ + /* size :: The requested size in bytes. */ + /* */ + /* */ + /* The address of newly allocated block. */ + /* */ + FT_CALLBACK_DEF( void* ) + ft_alloc( FT_Memory memory, + long size ) + { +#ifdef __amigaos4__ + return AllocVecPooled( memory->user, size ); +#else + return Alloc_VecPooled( memory->user, size ); +#endif + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_realloc */ + /* */ + /* */ + /* The memory reallocation function. */ + /* */ + /* */ + /* 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. */ + /* */ + /* */ + /* The address of the reallocated memory block. */ + /* */ + FT_CALLBACK_DEF( void* ) + ft_realloc( FT_Memory memory, + long cur_size, + long new_size, + void* block ) + { + void* new_block; + +#ifdef __amigaos4__ + new_block = AllocVecPooled ( memory->user, new_size ); +#else + new_block = Alloc_VecPooled ( memory->user, new_size ); +#endif + if ( new_block != NULL ) + { + CopyMem ( block, new_block, + ( new_size > cur_size ) ? cur_size : new_size ); +#ifdef __amigaos4__ + FreeVecPooled ( memory->user, block ); +#else + Free_VecPooled ( memory->user, block ); +#endif + } + return new_block; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_free */ + /* */ + /* */ + /* The memory release function. */ + /* */ + /* */ + /* 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 ) + { +#ifdef __amigaos4__ + FreeVecPooled( memory->user, block ); +#else + Free_VecPooled( memory->user, block ); +#endif + } + + + /*************************************************************************/ + /* */ + /* 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 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 ) ( (struct SysFile *)stream->descriptor.pointer ) + + + /*************************************************************************/ + /* */ + /* */ + /* ft_amiga_stream_close */ + /* */ + /* */ + /* The function to close a stream. */ + /* */ + /* */ + /* stream :: A pointer to the stream object. */ + /* */ + FT_CALLBACK_DEF( void ) + ft_amiga_stream_close( FT_Stream stream ) + { + struct SysFile* sysfile; + + sysfile = STREAM_FILE( stream ); + Close ( sysfile->file ); + FreeMem ( sysfile, sizeof ( struct SysFile )); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = NULL; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_amiga_stream_io */ + /* */ + /* */ + /* The function to open a stream. */ + /* */ + /* */ + /* 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. */ + /* */ + /* */ + /* The number of bytes actually read. */ + /* */ + FT_CALLBACK_DEF( unsigned long ) + ft_amiga_stream_io( FT_Stream stream, + unsigned long offset, + unsigned char* buffer, + unsigned long count ) + { + struct SysFile* sysfile; + unsigned long read_bytes; + + if ( count != 0 ) + { + sysfile = STREAM_FILE( stream ); + + /* handle the seek */ + if ( (offset < sysfile->iobuf_start) || (offset + count > sysfile->iobuf_end) ) + { + /* requested offset implies we need a buffer refill */ + if ( !sysfile->iobuf_end || offset != sysfile->iobuf_end ) + { + /* a physical seek is necessary */ + Seek( sysfile->file, offset, OFFSET_BEGINNING ); + } + sysfile->iobuf_start = offset; + sysfile->iobuf_end = 0; /* trigger a buffer refill */ + } + + /* handle the read */ + if ( offset + count <= sysfile->iobuf_end ) + { + /* we have buffer and requested bytes are all inside our buffer */ + CopyMem( &sysfile->iobuf[offset - sysfile->iobuf_start], buffer, count ); + read_bytes = count; + } + else + { + /* (re)fill buffer */ + if ( count <= IOBUF_SIZE ) + { + /* requested bytes is a subset of the buffer */ + read_bytes = Read( sysfile->file, sysfile->iobuf, IOBUF_SIZE ); + if ( read_bytes == -1UL ) + { + /* error */ + read_bytes = 0; + } + else + { + sysfile->iobuf_end = offset + read_bytes; + CopyMem( sysfile->iobuf, buffer, count ); + if ( read_bytes > count ) + { + read_bytes = count; + } + } + } + else + { + /* we actually need more than our buffer can hold, so we decide + ** to do a single big read, and then copy the last IOBUF_SIZE + ** bytes of that to our internal buffer for later use */ + read_bytes = Read( sysfile->file, buffer, count ); + if ( read_bytes == -1UL ) + { + /* error */ + read_bytes = 0; + } + else + { + ULONG bufsize; + + bufsize = ( read_bytes > IOBUF_SIZE ) ? IOBUF_SIZE : read_bytes; + sysfile->iobuf_end = offset + read_bytes; + sysfile->iobuf_start = sysfile->iobuf_end - bufsize; + CopyMem( &buffer[read_bytes - bufsize] , sysfile->iobuf, bufsize ); + } + } + } + } + else + { + read_bytes = 0; + } + + return read_bytes; + } + + + /* documentation is in ftobjs.h */ + + FT_BASE_DEF( FT_Error ) + FT_Stream_Open( FT_Stream stream, + const char* filepathname ) + { + struct FileInfoBlock* fib; + struct SysFile* sysfile; + + + if ( !stream ) + return FT_THROW( Invalid_Stream_Handle ); + +#ifdef __amigaos4__ + sysfile = AllocMem ( sizeof (struct SysFile ), MEMF_SHARED ); +#else + sysfile = AllocMem ( sizeof (struct SysFile ), MEMF_PUBLIC ); +#endif + if ( !sysfile ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_THROW( Cannot_Open_Resource ); + } + sysfile->file = Open( (STRPTR)filepathname, MODE_OLDFILE ); + if ( !sysfile->file ) + { + FreeMem ( sysfile, sizeof ( struct SysFile )); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_THROW( Cannot_Open_Resource ); + } + + fib = AllocDosObject( DOS_FIB, NULL ); + if ( !fib ) + { + Close ( sysfile->file ); + FreeMem ( sysfile, sizeof ( struct SysFile )); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_THROW( Cannot_Open_Resource ); + } + if ( !( ExamineFH( sysfile->file, fib ) ) ) + { + FreeDosObject( DOS_FIB, fib ); + Close ( sysfile->file ); + FreeMem ( sysfile, sizeof ( struct SysFile )); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + + return FT_THROW( Cannot_Open_Resource ); + } + stream->size = fib->fib_Size; + FreeDosObject( DOS_FIB, fib ); + + stream->descriptor.pointer = (void *)sysfile; + stream->pathname.pointer = (char*)filepathname; + sysfile->iobuf_start = 0; + sysfile->iobuf_end = 0; + stream->pos = 0; + + stream->read = ft_amiga_stream_io; + stream->close = ft_amiga_stream_close; + + if ( !stream->size ) + { + ft_amiga_stream_close( stream ); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " opened `%s' but zero-sized\n", filepathname )); + return FT_THROW( Cannot_Open_Stream ); + } + + FT_TRACE1(( "FT_Stream_Open:" )); + FT_TRACE1(( " opened `%s' (%ld 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_BASE_DEF( FT_Memory ) + FT_New_Memory( void ) + { + FT_Memory memory; + + +#ifdef __amigaos4__ + memory = (FT_Memory)AllocVec( sizeof ( *memory ), MEMF_SHARED ); +#else + memory = (FT_Memory)AllocVec( sizeof ( *memory ), MEMF_PUBLIC ); +#endif + if ( memory ) + { +#ifdef __amigaos4__ + memory->user = CreatePool( MEMF_SHARED, 16384, 16384 ); +#else + memory->user = CreatePool( MEMF_PUBLIC, 16384, 16384 ); +#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_BASE_DEF( void ) + FT_Done_Memory( FT_Memory memory ) + { +#ifdef FT_DEBUG_MEMORY + ft_mem_debug_done( memory ); +#endif + + DeletePool( memory->user ); + FreeVec( memory ); + } + +/* +Local Variables: +coding: latin-1 +End: +*/ +/* END */ diff --git a/vendor/freetype/builds/ansi/ansi-def.mk b/vendor/freetype/builds/ansi/ansi-def.mk new file mode 100644 index 00000000000..687af104127 --- /dev/null +++ b/vendor/freetype/builds/ansi/ansi-def.mk @@ -0,0 +1,77 @@ +# +# FreeType 2 configuration rules for a `normal' ANSI system +# + + +# Copyright (C) 1996-2024 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. + + +DELETE := rm -f +CAT := cat +SEP := / +PLATFORM_DIR := $(TOP_DIR)/builds/ansi +PLATFORM := ansi + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := bin + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := lib$(PROJECT) + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= + + +# EOF diff --git a/vendor/freetype/builds/ansi/ansi.mk b/vendor/freetype/builds/ansi/ansi.mk new file mode 100644 index 00000000000..ec4076e7782 --- /dev/null +++ b/vendor/freetype/builds/ansi/ansi.mk @@ -0,0 +1,21 @@ +# +# FreeType 2 configuration rules for a `normal' pseudo ANSI compiler/system +# + + +# Copyright (C) 1996-2024 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 $(TOP_DIR)/builds/ansi/ansi-def.mk +include $(TOP_DIR)/builds/compiler/ansi-cc.mk +include $(TOP_DIR)/builds/link_std.mk + + +# EOF diff --git a/vendor/freetype/builds/atari/ATARI.H b/vendor/freetype/builds/atari/ATARI.H new file mode 100644 index 00000000000..4ddd2eb2eba --- /dev/null +++ b/vendor/freetype/builds/atari/ATARI.H @@ -0,0 +1,20 @@ +#if defined( GXVALID_H_ ) +#pragma warn -aus /* too many unevaluated variables in gxvalid */ +#endif + +#ifndef ATARI_H +#define ATARI_H + +#pragma warn -stu + +/* PureC doesn't like 32bit enumerations */ + +#ifndef FT_IMAGE_TAG +#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value +#endif /* FT_IMAGE_TAG */ + +#ifndef FT_ENC_TAG +#define FT_ENC_TAG( value, a, b, c, d ) value +#endif /* FT_ENC_TAG */ + +#endif /* ATARI_H */ diff --git a/vendor/freetype/builds/atari/FNames.SIC b/vendor/freetype/builds/atari/FNames.SIC new file mode 100644 index 00000000000..f3657179d91 --- /dev/null +++ b/vendor/freetype/builds/atari/FNames.SIC @@ -0,0 +1,37 @@ +/* the following changes file names for PureC projects */ + +if (argc > 0) +{ + ordner = argv[0]; + if (basename(ordner) == "") /* ist Ordner */ + { + ChangeFilenames(ordner); + } +} + +proc ChangeFilenames(folder) +local i,entries,directory,file; +{ + entries = filelist(directory,folder); + for (i = 0; i < entries; ++i) + { + file = directory[i,0]; + if ((directory[i,3]&16) > 0) /* subdirectory */ + { + ChangeFilenames(folder+file+"\\"); + } + else + { + if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0)) + ChangeFilename(folder,file); + } + } +} + +proc ChangeFilename(path,datei) +local newfile,err; +{ + newfile=datei; + newfile[0]=(newfile[0] | 32) ^ 32; + err=files.rename("-q",path+datei,newfile); +} diff --git a/vendor/freetype/builds/atari/FREETYPE.PRJ b/vendor/freetype/builds/atari/FREETYPE.PRJ new file mode 100644 index 00000000000..4776a5bc690 --- /dev/null +++ b/vendor/freetype/builds/atari/FREETYPE.PRJ @@ -0,0 +1,32 @@ +;FreeType project file + +FREETYPE.LIB + +.C [-K -P -R -A] +.L [-J -V] +.S + += + +..\..\src\base\ftsystem.c +..\..\src\base\ftdebug.c + +..\..\src\base\ftinit.c +..\..\src\base\ftglyph.c +..\..\src\base\ftmm +..\..\src\base\ftbbox + +..\..\src\base\ftbase.c +..\..\src\autohint\autohint.c +;..\..\src\cache\ftcache.c +..\..\src\cff\cff.c +..\..\src\cid\type1cid.c +..\..\src\psaux\psaux.c +..\..\src\pshinter\pshinter.c +..\..\src\psnames\psnames.c +..\..\src\raster\raster.c +..\..\src\sfnt\sfnt.c +..\..\src\smooth\smooth.c +..\..\src\truetype\truetype.c +..\..\src\type1\type1.c +..\..\src\type42\type42.c diff --git a/vendor/freetype/builds/atari/README.TXT b/vendor/freetype/builds/atari/README.TXT new file mode 100644 index 00000000000..1300817b261 --- /dev/null +++ b/vendor/freetype/builds/atari/README.TXT @@ -0,0 +1,51 @@ +Compiling FreeType 2 with PureC compiler +======================================== + +[See below for a German version.] + +To compile FreeType 2 as a library the following changes must be applied: + +- All *.c files must start with an uppercase letter. + (In case GEMSCRIPT is available: + Simply drag the whole FreeType 2 directory to the file `FNames.SIC'.) + +- You have to change the INCLUDE directory in PureC's compiler options + to contain both the `INCLUDE' and `freetype2\include' directory. + Example: + + INCLUDE;E:\freetype2\include + +- The file `freetype/include/Ft2build.h' must be patched as follows to + include ATARI.H: + + #ifndef FT2_BUILD_GENERIC_H_ + #define FT2_BUILD_GENERIC_H_ + + #include "ATARI.H" + + + +Compilieren von FreeType 2 mit PureC +==================================== + +Um FreeType 2 als eine Bibliothek (library) zu compilieren, muss folgendes +ge„ndert werden: + +- Alle *.c-files mssen mit einem GROSSBUCHSTABEN beginnen. + (Falls GEMSCRIPT zur Verfgung steht: + Den kompletten Ordner freetype2 auf die Datei `FNames.SIC' draggen.) + +- In den Compiler-Optionen von PureC muss das INCLUDE directory auf INCLUDE + und freetype2\include verweisen. Z.B.: + + INCLUDE;E:\freetype2\include + +- In der Datei freetype/include/Ft2build.h muss zu Beginn + ein #include "ATARI.H" wie folgt eingefgt werden: + + #ifndef FT2_BUILD_GENERIC_H_ + #define FT2_BUILD_GENERIC_H_ + + #include "ATARI.H" + +--- end of README.TXT --- diff --git a/vendor/freetype/builds/atari/deflinejoiner.awk b/vendor/freetype/builds/atari/deflinejoiner.awk new file mode 100644 index 00000000000..16d9e6dd933 --- /dev/null +++ b/vendor/freetype/builds/atari/deflinejoiner.awk @@ -0,0 +1,181 @@ +#!/usr/bin/env awk + + +function shift( array, \ + junk, elm0, l ) +{ + elm0 = array[0] + for ( l = 0; l < asorti( array, junk ) - 1; l++ ) + array[l] = array[l+1]; + delete array[l] + return elm0 +} + + +function init_cpp_src_line() +{ + logical_line = "" + delete break_pos +} + + +function shift_valid_bp( array, \ + junk, elm ) +{ + elm = -1 + + if ( 0 < asorti( array, junk ) ) + do { + elm = shift( array ) + } while ( 0 > elm ); + + return elm +} + + +function check_cpp_src_line_break_pos( \ + i, junk ) +{ + printf( "break_pos:" ) + for ( i = 0; i < asorti( break_pos, junk ); i++ ) + printf( " %d", break_pos[i] ); + printf( "\n" ) +} + + +function check_cpp_src_line() +{ + printf( "logical_line[%s]\n", logical_line ) + check_cpp_src_line_break_pos() +} + + +function append_line( phys_line, \ + filt_line, bp_len ) +{ + filt_line = phys_line + sub( /\\$/, " ", filt_line ) + logical_line = logical_line filt_line + bp_len = asorti( break_pos, junk ) + break_pos[bp_len] = length( logical_line ) - 1 +} + + +function print_line( \ + c0, c1, i, junk, part_str ) +{ + c0 = 0 + + while( asorti( break_pos, junk ) > 1 ) + { + if ( ( c1 = shift_valid_bp( break_pos ) ) < 1 ) + { + part_str = substr( logical_line, c0 + 1 ) + printf( "%s\n", part_str ) + return + } + + part_str = substr( logical_line, c0 + 1, c1 - c0 + 1 ) + gsub( / $/, "\\", part_str ) + printf( "%s\n", part_str ) + c0 = c1 + 1 + } + + part_str = substr( logical_line, c0 + 1 ) + printf( "%s\n", part_str ) +} + + +function shrink_spaces( pos, \ + tail, removed_length, k ) +{ + tail = substr( logical_line, pos ) + sub( /^[ \t]+/, " ", tail ) + removed_length = length( logical_line ) - pos - length( tail ) + 1 + logical_line = substr( logical_line, 0, pos - 1 ) tail + + + for ( k = 0; k < asorti( break_pos, junk ); k++ ) + if ( ( pos + removed_length ) <= break_pos[k] ) + break_pos[k] = break_pos[k] - removed_length; + else if ( pos <= break_pos[k] ) + break_pos[k] = -1; + + return removed_length +} + + +function shrink_spaces_to_linebreak( pos, \ + junk, part_str, removed_length, i ) +{ + for ( i = 0; i < asorti( break_pos, junk ) && break_pos[i] < pos ; i++ ) + ; + + if ( break_pos[i] < 1 ) + return; + + part_str = substr( logical_line, pos, break_pos[i] - pos + 1 ) + sub( /^[ \t]+/, " ", part_str ) + removed_length = ( break_pos[i] - pos + 1 ) - length( part_str ) + + tail = substr( logical_line, pos + removed_length ) + logical_line = substr( logical_line, 0, pos - 1 ) tail + + for ( ; i < asorti( break_pos, junk ); i++ ) + break_pos[i] -= removed_length; + + return removed_length +} + + +function delete_linebreaks_in_2nd_token( \ + tail, paren_depth, junk, i, j, k, l ) +{ + if ( logical_line ~ /^[ \t]*#[ \t]*define[ \t]+[0-9A-Za-z_]+\(/ ) + { + tail = logical_line + sub( /^[ \t]*#[ \t]*define[ \t]+[0-9A-Za-z_]+/, "", tail ) + + paren_depth = 0 + l = 0 + i = length( logical_line ) - length( tail ) + 1 # seek to the 1st op paren + j = i + do { + if ( substr( logical_line, j, 2 ) ~ /[ \t][ \t]/ ) + l = shrink_spaces( j ); + else if ( substr( logical_line, j, 1 ) == "(" ) + paren_depth += 1; + else if ( substr( logical_line, j, 1 ) == ")" ) + paren_depth -= 1; + j += 1 + } while ( j < length( logical_line ) && paren_depth != 0 ) + + for ( k = 0; k < asorti( break_pos, junk ); k++ ) + if ( i <= break_pos[k] && break_pos[k] < j ) + break_pos[k] = -1; + + if ( l > 0 ) + shrink_spaces_to_linebreak( j ); + } +} + + +BEGIN{ + init_cpp_src_line() +} +{ + append_line( $0 ) + if ( $0 !~ /\\$/ ) + { + delete_linebreaks_in_2nd_token() + print_line() + init_cpp_src_line() + } +} +END{ + if ( 0 < length( logical_line ) ) + { + delete_linebreaks_in_2nd_token() + print_line() + } +} diff --git a/vendor/freetype/builds/atari/gen-purec-patch.sh b/vendor/freetype/builds/atari/gen-purec-patch.sh new file mode 100644 index 00000000000..1ec050c11fa --- /dev/null +++ b/vendor/freetype/builds/atari/gen-purec-patch.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +TOP_DIR=. +OBJ_DIR=. + +for x in "$@" +do + case x"$x" in + x--srcdir=* | x--topdir=* ) + TOP_DIR=`echo $x | sed 's/^--[a-z]*dir=//'` + ;; + x--builddir=* | x--objdir=* ) + OBJ_DIR=`echo $x | sed 's/^--[a-z]*dir=//'` + ;; + esac +done + +mkdir -p ${OBJ_DIR}/builds/atari/tmp/orig + +( cd ${TOP_DIR} && find . -name '*.[CHch]' -type f | fgrep -v builds/atari/tmp | cpio -o ) | \ +( cd ${OBJ_DIR}/builds/atari/tmp/orig && cpio -idum ) +cp ${TOP_DIR}/builds/atari/deflinejoiner.awk ${OBJ_DIR}/builds/atari/tmp + +pushd ${OBJ_DIR}/builds/atari/tmp + + cp -pr orig purec + for f in `cd orig && find . -type f` + do + echo filter $f + env LANG=C awk -f deflinejoiner.awk < orig/$f > purec/$f + done + + echo '#define FT2_BUILD_LIBRARY' > purec/include/ft2build.h + echo '#include "ATARI.H"' >> purec/include/ft2build.h + env LANG=C awk -f deflinejoiner.awk < orig/include/ft2build.h >> purec/include/ft2build.h + + env LANG=C diff -ur orig purec > ../purec.diff + +popd +rm -rf ${OBJ_DIR}/builds/atari/tmp diff --git a/vendor/freetype/builds/beos/beos-def.mk b/vendor/freetype/builds/beos/beos-def.mk new file mode 100644 index 00000000000..30e79dbaabd --- /dev/null +++ b/vendor/freetype/builds/beos/beos-def.mk @@ -0,0 +1,79 @@ +# +# FreeType 2 configuration rules for a BeOS system +# +# this is similar to the "ansi-def.mk" file, except for BUILD and PLATFORM +# + + +# Copyright (C) 1996-2024 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. + + +DELETE := rm -f +CAT := cat +SEP := / +PLATFORM_DIR := $(TOP_DIR)/builds/beos +PLATFORM := beos + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := bin + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := lib$(PROJECT) + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= + + +# EOF diff --git a/vendor/freetype/builds/beos/beos.mk b/vendor/freetype/builds/beos/beos.mk new file mode 100644 index 00000000000..eb9fde4be12 --- /dev/null +++ b/vendor/freetype/builds/beos/beos.mk @@ -0,0 +1,19 @@ +# +# FreeType 2 configuration rules for a BeOS system +# + +# Copyright (C) 1996-2024 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 $(TOP_DIR)/builds/beos/beos-def.mk +include $(TOP_DIR)/builds/compiler/ansi-cc.mk +include $(TOP_DIR)/builds/link_std.mk + + +# EOF diff --git a/vendor/freetype/builds/beos/detect.mk b/vendor/freetype/builds/beos/detect.mk new file mode 100644 index 00000000000..874e8a8c2c0 --- /dev/null +++ b/vendor/freetype/builds/beos/detect.mk @@ -0,0 +1,41 @@ +# +# FreeType 2 configuration file to detect an BeOS host platform. +# + + +# Copyright (C) 1996-2024 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. + + +.PHONY: setup + + +ifeq ($(PLATFORM),ansi) + + ifdef BE_HOST_CPU + + PLATFORM := beos + + endif # test MACHTYPE beos +endif + +ifeq ($(PLATFORM),beos) + + DELETE := rm -f + CAT := cat + SEP := / + PLATFORM_DIR := $(TOP_DIR)/builds/beos + CONFIG_FILE := beos.mk + + setup: std_setup + +endif # test PLATFORM beos + + +# EOF diff --git a/vendor/freetype/builds/cmake/FindBrotliDec.cmake b/vendor/freetype/builds/cmake/FindBrotliDec.cmake new file mode 100644 index 00000000000..385f0abc5a1 --- /dev/null +++ b/vendor/freetype/builds/cmake/FindBrotliDec.cmake @@ -0,0 +1,52 @@ +# FindBrotliDec.cmake +# +# Copyright (C) 2019-2024 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# Written by 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. +# +# +# Try to find libbrotlidec include and library directories. +# +# If found, the following variables are set. +# +# BROTLIDEC_INCLUDE_DIRS +# BROTLIDEC_LIBRARIES + +find_package(PkgConfig QUIET) + +pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec) + +if (PC_BROTLIDEC_VERSION) + set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}") +endif () + + +find_path(BROTLIDEC_INCLUDE_DIRS + NAMES brotli/decode.h + HINTS ${PC_BROTLIDEC_INCLUDEDIR} + ${PC_BROTLIDEC_INCLUDE_DIRS} + PATH_SUFFIXES brotli) + +find_library(BROTLIDEC_LIBRARIES + NAMES brotlidec + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + BrotliDec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR BROTLIDEC_VERSION) + +mark_as_advanced( + BROTLIDEC_INCLUDE_DIRS + BROTLIDEC_LIBRARIES) diff --git a/vendor/freetype/builds/cmake/FindHarfBuzz.cmake b/vendor/freetype/builds/cmake/FindHarfBuzz.cmake new file mode 100644 index 00000000000..0f0e33a1a1f --- /dev/null +++ b/vendor/freetype/builds/cmake/FindHarfBuzz.cmake @@ -0,0 +1,203 @@ +# Copyright (c) 2012, Intel Corporation +# Copyright (c) 2019 Sony Interactive Entertainment Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors may +# be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# Try to find Harfbuzz include and library directories. +# +# After successful discovery, this will set for inclusion where needed: +# HarfBuzz_INCLUDE_DIRS - containing the HarfBuzz headers +# HarfBuzz_LIBRARIES - containing the HarfBuzz library + +#[=======================================================================[.rst: +FindHarfBuzz +-------------- + +Find HarfBuzz headers and libraries. + +Imported Targets +^^^^^^^^^^^^^^^^ + +``HarfBuzz::HarfBuzz`` + The HarfBuzz library, if found. + +``HarfBuzz::ICU`` + The HarfBuzz ICU library, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables in your project: + +``HarfBuzz_FOUND`` + true if (the requested version of) HarfBuzz is available. +``HarfBuzz_VERSION`` + the version of HarfBuzz. +``HarfBuzz_LIBRARIES`` + the libraries to link against to use HarfBuzz. +``HarfBuzz_INCLUDE_DIRS`` + where to find the HarfBuzz headers. +``HarfBuzz_COMPILE_OPTIONS`` + this should be passed to target_compile_options(), if the + target is not used for linking + +#]=======================================================================] + +find_package(PkgConfig QUIET) +pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz) +set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER}) +set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION}) + +find_path(HarfBuzz_INCLUDE_DIR + NAMES hb.h + HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS} + PATH_SUFFIXES harfbuzz +) + +find_library(HarfBuzz_LIBRARY + NAMES ${HarfBuzz_NAMES} harfbuzz + HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS} +) + +if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION) + if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h") + file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content) + + string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}") + set(HarfBuzz_VERSION "${CMAKE_MATCH_1}") + endif () +endif () + +if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}") + if (HarfBuzz_FIND_REQUIRED) + message(FATAL_ERROR + "Required version (" ${HarfBuzz_FIND_VERSION} ")" + " is higher than found version (" ${HarfBuzz_VERSION} ")") + else () + message(WARNING + "Required version (" ${HarfBuzz_FIND_VERSION} ")" + " is higher than found version (" ${HarfBuzz_VERSION} ")") + unset(HarfBuzz_VERSION) + unset(HarfBuzz_INCLUDE_DIRS) + unset(HarfBuzz_LIBRARIES) + return () + endif () +endif () + +# Find components +if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY) + set(_HarfBuzz_REQUIRED_LIBS_FOUND ON) + set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}") +else () + set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF) + set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)") +endif () + +if (NOT CMAKE_VERSION VERSION_LESS 3.3) + if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS) + pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu) + set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER}) + + find_path(HarfBuzz_ICU_INCLUDE_DIR + NAMES hb-icu.h + HINTS ${PC_HARFBUZZ_ICU_INCLUDEDIR} ${PC_HARFBUZZ_ICU_INCLUDE_DIRS} + PATH_SUFFIXES harfbuzz + ) + + find_library(HarfBuzz_ICU_LIBRARY + NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu + HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS} + ) + + if (HarfBuzz_ICU_LIBRARY) + if (HarfBuzz_FIND_REQUIRED_ICU) + list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}") + else () + list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}") + endif () + else () + if (HarfBuzz_FIND_REQUIRED_ICU) + set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF) + list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)") + else () + list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)") + endif () + endif () + endif () +endif () + +if (NOT HarfBuzz_FIND_QUIETLY) + if (HarfBuzz_LIBS_FOUND) + message(STATUS "Found the following HarfBuzz libraries:") + foreach (found ${HarfBuzz_LIBS_FOUND}) + message(STATUS " ${found}") + endforeach () + endif () + if (HarfBuzz_LIBS_NOT_FOUND) + message(STATUS "The following HarfBuzz libraries were not found:") + foreach (found ${HarfBuzz_LIBS_NOT_FOUND}) + message(STATUS " ${found}") + endforeach () + endif () +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HarfBuzz + FOUND_VAR HarfBuzz_FOUND + REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND + VERSION_VAR HarfBuzz_VERSION +) + +if (NOT CMAKE_VERSION VERSION_LESS 3.1) + if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz) + add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL) + set_target_properties(HarfBuzz::HarfBuzz PROPERTIES + IMPORTED_LOCATION "${HarfBuzz_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}" + ) + endif () + + if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU) + add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL) + set_target_properties(HarfBuzz::ICU PROPERTIES + IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_ICU_INCLUDE_DIR}" + ) + endif () +endif () + +mark_as_advanced( + HarfBuzz_INCLUDE_DIR + HarfBuzz_ICU_INCLUDE_DIR + HarfBuzz_LIBRARY + HarfBuzz_ICU_LIBRARY +) + +if (HarfBuzz_FOUND) + set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY}) + set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR} ${HarfBuzz_ICU_INCLUDE_DIR}) +endif () diff --git a/vendor/freetype/builds/cmake/iOS.cmake b/vendor/freetype/builds/cmake/iOS.cmake new file mode 100644 index 00000000000..92097ef7ab4 --- /dev/null +++ b/vendor/freetype/builds/cmake/iOS.cmake @@ -0,0 +1,270 @@ +# iOS.cmake +# +# Copyright (C) 2014-2024 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# Written by David Wimsey +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. +# +# +# This file is derived from the files `Platform/Darwin.cmake' and +# `Platform/UnixPaths.cmake', which are part of CMake 2.8.4. It has been +# altered for iOS development. + + +# Options +# ------- +# +# IOS_PLATFORM = OS | SIMULATOR +# +# This decides whether SDKS are selected from the `iPhoneOS.platform' or +# `iPhoneSimulator.platform' folders. +# +# OS - the default, used to build for iPhone and iPad physical devices, +# which have an ARM architecture. +# SIMULATOR - used to build for the Simulator platforms, which have an +# x86 architecture. +# +# CMAKE_IOS_DEVELOPER_ROOT = /path/to/platform/Developer folder +# +# By default, this location is automatically chosen based on the +# IOS_PLATFORM value above. If you manually set this variable, it +# overrides the default location and forces the use of a particular +# Developer Platform. +# +# CMAKE_IOS_SDK_ROOT = /path/to/platform/Developer/SDKs/SDK folder +# +# By default, this location is automatically chosen based on the +# CMAKE_IOS_DEVELOPER_ROOT value. In this case it is always the most +# up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path. If you +# manually set this variable, it forces the use of a specific SDK +# version. +# +# +# Macros +# ------ +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE) +# +# A convenience macro for setting Xcode specific properties on targets. +# +# Example: +# +# set_xcode_property(myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1") +# +# find_host_package (PROGRAM ARGS) +# +# A macro to find executable programs on the host system, not within the +# iOS environment. Thanks to the `android-cmake' project for providing +# the command. + + +# standard settings +set(CMAKE_SYSTEM_NAME Darwin) +set(CMAKE_SYSTEM_VERSION 1) +set(UNIX True) +set(APPLE True) +set(IOS True) + +# required as of cmake 2.8.10 +set(CMAKE_OSX_DEPLOYMENT_TARGET "" + CACHE STRING "Force unset of the deployment target for iOS" FORCE +) + +# determine the cmake host system version so we know where to find the iOS +# SDKs +find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) +if (CMAKE_UNAME) + exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" + DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") +endif (CMAKE_UNAME) + +# skip the platform compiler checks for cross compiling +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_C_COMPILER_WORKS TRUE) + +# all iOS/Darwin specific settings - some may be redundant +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set(CMAKE_SHARED_MODULE_PREFIX "lib") +set(CMAKE_SHARED_MODULE_SUFFIX ".so") +set(CMAKE_MODULE_EXISTS 1) +set(CMAKE_DL_LIBS "") + +set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG + "-compatibility_version ") +set(CMAKE_C_OSX_CURRENT_VERSION_FLAG + "-current_version ") +set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG + "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG + "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +# hidden visibility is required for cxx on iOS +set(CMAKE_C_FLAGS_INIT "") +set(CMAKE_CXX_FLAGS_INIT + "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden") + +set(CMAKE_C_LINK_FLAGS + "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") +set(CMAKE_CXX_LINK_FLAGS + "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + +set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-dynamiclib -headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS + "-bundle -headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_LOADER_C_FLAG + "-Wl,-bundle_loader,") +set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG + "-Wl,-bundle_loader,") +set(CMAKE_FIND_LIBRARY_SUFFIXES + ".dylib" ".so" ".a") + +# hack: If a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old +# build tree (where `install_name_tool' was hardcoded), and where +# CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't +# fail in `CMakeFindBinUtils.cmake' (because it isn't rerun), hardcode +# CMAKE_INSTALL_NAME_TOOL here to `install_name_tool' so it behaves as +# it did before. +if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) +endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + +# set up iOS platform unless specified manually with IOS_PLATFORM +if (NOT DEFINED IOS_PLATFORM) + set(IOS_PLATFORM "OS") +endif (NOT DEFINED IOS_PLATFORM) + +set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform") + +# check the platform selection and setup for developer root +if (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_PLATFORM_LOCATION "iPhoneOS.platform") + + # this causes the installers to properly locate the output libraries + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") + +elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR") + set(IOS_PLATFORM_LOCATION "iPhoneSimulator.platform") + + # this causes the installers to properly locate the output libraries + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") + +else (${IOS_PLATFORM} STREQUAL "OS") + message(FATAL_ERROR + "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR.") + +endif (${IOS_PLATFORM} STREQUAL "OS") + +# set up iOS developer location unless specified manually with +# CMAKE_IOS_DEVELOPER_ROOT -- +# note that Xcode 4.3 changed the installation location; choose the most +# recent one available +set(XCODE_POST_43_ROOT + "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") +set(XCODE_PRE_43_ROOT + "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") + +if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + if (EXISTS ${XCODE_POST_43_ROOT}) + set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT}) + elseif (EXISTS ${XCODE_PRE_43_ROOT}) + set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT}) + endif (EXISTS ${XCODE_POST_43_ROOT}) +endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + +set(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} + CACHE PATH "Location of iOS Platform" +) + +# find and use the most recent iOS SDK unless specified manually with +# CMAKE_IOS_SDK_ROOT +if (NOT DEFINED CMAKE_IOS_SDK_ROOT) + file(GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*") + if (_CMAKE_IOS_SDKS) + list(SORT _CMAKE_IOS_SDKS) + list(REVERSE _CMAKE_IOS_SDKS) + list(GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT) + else (_CMAKE_IOS_SDKS) + message(FATAL_ERROR + "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.") + endif (_CMAKE_IOS_SDKS) + + message(STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}") +endif (NOT DEFINED CMAKE_IOS_SDK_ROOT) + +set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} + CACHE PATH "Location of the selected iOS SDK" +) + +# set the sysroot default to the most recent SDK +set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} + CACHE PATH "Sysroot used for iOS support" +) + +# set the architecture for iOS -- +# note that currently both ARCHS_STANDARD_32_BIT and +# ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually +if (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_ARCH $(ARCHS_STANDARD_32_64_BIT)) +else (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_ARCH i386) +endif (${IOS_PLATFORM} STREQUAL "OS") + +set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} + CACHE string "Build architecture for iOS" +) + +# set the find root to the iOS developer roots and to user defined paths +set(CMAKE_FIND_ROOT_PATH + ${CMAKE_IOS_DEVELOPER_ROOT} + ${CMAKE_IOS_SDK_ROOT} + ${CMAKE_PREFIX_PATH} + CACHE string "iOS find search path root" +) + +# default to searching for frameworks first +set(CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +set(CMAKE_SYSTEM_FRAMEWORK_PATH + ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks + ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks + ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks +) + +# only search the iOS SDKs, not the remainder of the host filesystem +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# this little macro lets you set any Xcode specific property +macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property(TARGET ${TARGET} + PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) +endmacro(set_xcode_property) + +# this macro lets you find executable programs on the host system +macro(find_host_package) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set(IOS FALSE) + + find_package(${ARGN}) + + set(IOS TRUE) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro(find_host_package) + +# eof diff --git a/vendor/freetype/builds/cmake/testbuild.sh b/vendor/freetype/builds/cmake/testbuild.sh new file mode 100644 index 00000000000..eba97a17d96 --- /dev/null +++ b/vendor/freetype/builds/cmake/testbuild.sh @@ -0,0 +1,157 @@ +#!/bin/sh -e + +# Copyright (C) 2015-2024 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 script tests the CMake build. Simply run +# +# builds/cmake/testbuild.sh +# +# or +# +# BUILD_SHARED_LIBS=1 builds/cmake/testbuild.sh +# +# The script: +# +# - builds the main CMakeLists.txt +# - builds and runs a small test app in a separate build tree so +# the config-module is tested, too +# +# Options (environment variables): +# +# - The variable BUILD_SHARED_LIBS will be forwarded to the CMake project +# that builds the library. +# + + +# prepare temporary dir + +cd `dirname $0`/../.. +ftdir=`pwd` +tmpdir=/tmp/freetype-cmake-testbuild +rm -rf $tmpdir +mkdir -p $tmpdir + + +# build and install freetype + +if test -n "$BUILD_SHARED_LIBS"; then + bsl=-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS +else + bsl=-UBUILD_SHARED_LIBS +fi + +build_opts="-DWITH_ZLIB=0 \ + -DWITH_BZip2=0 \ + -DWITH_PNG=0 \ + -DWITH_HarfBuzz=0 \ + $bsl \ + -DCMAKE_INSTALL_PREFIX=$tmpdir/out" + +(set -x; cmake -H$ftdir \ + -B$tmpdir/ftb \ + -DCMAKE_BUILD_TYPE=Debug \ + $build_opts) +(set -x; cmake --build $tmpdir/ftb \ + --config Debug \ + --target install) + +(set -x; cmake $tmpdir/ftb \ + -DCMAKE_BUILD_TYPE=Release) +(set -x; cmake --build $tmpdir/ftb \ + --config Release \ + --target install \ + --clean-first) + + +# create test project CMakeLists.txt + +cat >$tmpdir/CMakeLists.txt << END +cmake_minimum_required(VERSION 2.6) +project(freetype-cmake-testbuild) + +find_package(Freetype REQUIRED CONFIG) + +add_executable(freetype-cmake-test main.c) +target_link_libraries(freetype-cmake-test freetype) + +enable_testing() +add_test(freetype-cmake-test freetype-cmake-test) +END + + +# create test project main.c + +cat >$tmpdir/main.c << END +#include +#include + +#include +#include + + +FT_Library library; + + +int main(int argc, + char*argv[]) +{ + FT_Error error; + FT_Int major = 0; + FT_Int minor = 0; + FT_Int patch = 0; + + error = FT_Init_FreeType(&library); + if (error) + return EXIT_FAILURE; + + FT_Library_Version(library, &major, &minor, &patch); + if (major != FREETYPE_MAJOR + || minor != FREETYPE_MINOR + || patch != FREETYPE_PATCH) + return EXIT_FAILURE; + + printf("FT_Library_Version: %d.%d.%d\n", major, minor, patch); + + error = FT_Done_FreeType(library); + if (error) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} +END + + +# build and test + +mkdir -p $tmpdir/tb +cd $tmpdir/tb + +LD_LIBRARY_PATH=$tmpdir/out/lib:$LD_LIBRARY_PATH +DYLD_LIBRARY_PATH=$tmpdir/out/lib:$DYLD_LIBRARY_PATH +export LD_LIBRARY_PATH +export DYLD_LIBRARY_PATH + +(set -x; cmake $tmpdir \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_PREFIX_PATH=$tmpdir/out) +(set -x; cmake --build . \ + --config Debug) +(set -x; ctest -V -C Debug) + +(set -x; cmake . \ + -DCMAKE_BUILD_TYPE=Release) +(set -x; cmake --build . \ + --config Release \ + --clean-first) +(set -x; ctest -V -C Release) + +rm -rf $tmpdir + +# EOF diff --git a/vendor/freetype/builds/compiler/ansi-cc.mk b/vendor/freetype/builds/compiler/ansi-cc.mk new file mode 100644 index 00000000000..ccb79c5e750 --- /dev/null +++ b/vendor/freetype/builds/compiler/ansi-cc.mk @@ -0,0 +1,80 @@ +# +# FreeType 2 generic pseudo ANSI compiler +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := cc +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := o +SO := o + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := a +SA := a + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +# we assume the compiler is already strictly ANSI +# +ANSIFLAGS ?= + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST)) + + +# EOF diff --git a/vendor/freetype/builds/compiler/bcc-dev.mk b/vendor/freetype/builds/compiler/bcc-dev.mk new file mode 100644 index 00000000000..bade0e624ed --- /dev/null +++ b/vendor/freetype/builds/compiler/bcc-dev.mk @@ -0,0 +1,86 @@ +# +# FreeType 2 Borland C++-specific with NO OPTIMIZATIONS + DEBUGGING +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := bcc32 +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := + + +# Target flag -- no trailing space. +# +T := -o +TE := -e + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= -A + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = tlib /u /P128 $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%)) + + +# Borland C++ specific temporary files +# +CLEAN += \ + $(subst /,$(SEP),$(TOP_DIR)/apinames.$(O)) \ + $(subst /,$(SEP),$(OBJ_DIR)/apinames.tds) + + +# EOF diff --git a/vendor/freetype/builds/compiler/bcc.mk b/vendor/freetype/builds/compiler/bcc.mk new file mode 100644 index 00000000000..12038048517 --- /dev/null +++ b/vendor/freetype/builds/compiler/bcc.mk @@ -0,0 +1,86 @@ +# +# FreeType 2 Borland C++-specific rules +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := bcc32 +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := + + +# Target flag -- no trailing space. +# +T := -o +TE := -e + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= -A + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = tlib /u /P128 $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%)) + + +# Borland C++ specific temporary files +# +CLEAN += \ + $(subst /,$(SEP),$(TOP_DIR)/apinames.$(O)) \ + $(subst /,$(SEP),$(OBJ_DIR)/apinames.tds) + + +# EOF diff --git a/vendor/freetype/builds/compiler/emx.mk b/vendor/freetype/builds/compiler/emx.mk new file mode 100644 index 00000000000..3d5573b4ee9 --- /dev/null +++ b/vendor/freetype/builds/compiler/emx.mk @@ -0,0 +1,77 @@ +# +# FreeType 2 emx-specific definitions +# + + +# Copyright (C) 2003-2024 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. + + +# Compiler command line name +# +CC := set GCCOPT="-ansi -pedantic"; gcc +COMPILER_SEP := / + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := o +SO := o + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := a +SA := a + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c -g -O6 -Wall + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul + + +# EOF diff --git a/vendor/freetype/builds/compiler/gcc-dev.mk b/vendor/freetype/builds/compiler/gcc-dev.mk new file mode 100644 index 00000000000..cdcd899f98f --- /dev/null +++ b/vendor/freetype/builds/compiler/gcc-dev.mk @@ -0,0 +1,97 @@ +# +# FreeType 2 gcc-specific with NO OPTIMIZATIONS + DEBUGGING +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := gcc +COMPILER_SEP := / + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := o +SO := o + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := a +SA := a + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +ifndef CFLAGS + ifeq ($(findstring g++,$(CC)),) + nested_externs := -Wnested-externs + strict_prototypes := -Wstrict-prototypes + endif + + CFLAGS := -c -g -O0 \ + -Wall \ + -W \ + -Wundef \ + -Wshadow \ + -Wpointer-arith \ + -Wwrite-strings \ + -Wredundant-decls \ + -Wno-format-extra-args \ + -Wno-long-long \ + $(nested_externs) \ + $(strict_prototypes) +endif + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# You can override this on the command line. +# +ANSIFLAGS ?= -std=c99 -pedantic + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST) + + +# EOF diff --git a/vendor/freetype/builds/compiler/gcc.mk b/vendor/freetype/builds/compiler/gcc.mk new file mode 100644 index 00000000000..6916cacf192 --- /dev/null +++ b/vendor/freetype/builds/compiler/gcc.mk @@ -0,0 +1,77 @@ +# +# FreeType 2 gcc-specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := gcc +COMPILER_SEP := / + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := o +SO := o + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := a +SA := a + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c -g -O3 -Wall + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= -std=c99 -pedantic + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST) + + +# EOF diff --git a/vendor/freetype/builds/compiler/intelc.mk b/vendor/freetype/builds/compiler/intelc.mk new file mode 100644 index 00000000000..64a6a681e4c --- /dev/null +++ b/vendor/freetype/builds/compiler/intelc.mk @@ -0,0 +1,85 @@ +# +# FreeType 2 Intel C/C++ definitions (VC++ compatibility mode) +# + + +# Copyright (C) 1996-2024 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. + + +# compiler command line name +# +CC := icl +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := /I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := /D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := /Fl + + +# Target flag. +# +T := /Fo +TE := /Fe + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +# Note that the Intel C/C++ compiler version 4.5 complains about +# the use of FT_FIELD_OFFSET with "value must be arithmetic type"! +# This really looks like a bug in the compiler because the macro +# _does_ compute an arithmetic value, so we disable this warning +# with "/Qwd32". +# +CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32 + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= /Qansi_alias /Za + +# Library linking +# +#CLEAN_LIBRARY = +LINK_LIBRARY = lib /nologo /out:$(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST)) + + +# EOF diff --git a/vendor/freetype/builds/compiler/unix-lcc.mk b/vendor/freetype/builds/compiler/unix-lcc.mk new file mode 100644 index 00000000000..66248d6fce5 --- /dev/null +++ b/vendor/freetype/builds/compiler/unix-lcc.mk @@ -0,0 +1,83 @@ +# +# FreeType 2 Unix LCC specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +# Command line name +# +CC := lcc +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := o +SO := o + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := a +SA := a + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c -g + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +# LCC is pure ANSI anyway! +# +# the "-A" flag simply increments verbosity about non ANSI code +# +ANSIFLAGS ?= -A + + +# library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(PROJECT_LIBRARY) +LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST) + + +# EOF diff --git a/vendor/freetype/builds/compiler/visualage.mk b/vendor/freetype/builds/compiler/visualage.mk new file mode 100644 index 00000000000..e0fca45e3e9 --- /dev/null +++ b/vendor/freetype/builds/compiler/visualage.mk @@ -0,0 +1,76 @@ +# +# FreeType 2 Visual Age C++ specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +# command line compiler name +# +CC := icc +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := /I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := /D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := /Fl + + +# Target flag. +# +T := /Fo + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +CFLAGS ?= /Q- /Gd+ /O2 /G5 /W3 /C + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSI_FLAGS := /Sa + + +# Library linking +# +#CLEAN_LIBRARY := +LINK_LIBRARY = lib /nologo /out:$(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST)) + + +# EOF diff --git a/vendor/freetype/builds/compiler/visualc.mk b/vendor/freetype/builds/compiler/visualc.mk new file mode 100644 index 00000000000..9eda2a02945 --- /dev/null +++ b/vendor/freetype/builds/compiler/visualc.mk @@ -0,0 +1,82 @@ +# +# FreeType 2 Visual C++ definitions +# + + +# Copyright (C) 1996-2024 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. + + +# compiler command line name +# +CC := cl +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := /I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := /D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := /Fl + + +# Target flag. +# +T := /Fo + +# Target executable flag +# +TE := /Fe + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= /nologo /c /Ox /W3 /WX + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= /Za /D_CRT_SECURE_NO_DEPRECATE + + +# Library linking +# +#CLEAN_LIBRARY = +LINK_LIBRARY = lib /nologo /out:$(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST)) + + +# EOF diff --git a/vendor/freetype/builds/compiler/watcom.mk b/vendor/freetype/builds/compiler/watcom.mk new file mode 100644 index 00000000000..16fd877ec91 --- /dev/null +++ b/vendor/freetype/builds/compiler/watcom.mk @@ -0,0 +1,81 @@ +# +# FreeType 2 Watcom-specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +# Compiler command line name +# +CC := wcc386 +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I= + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -FO= + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -zq + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS ?= -za + + +# Library linking +# +CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY)) +LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \ + wlib -q -n $@; \ + $(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \ + echo > nul) + +# EOF diff --git a/vendor/freetype/builds/compiler/win-lcc.mk b/vendor/freetype/builds/compiler/win-lcc.mk new file mode 100644 index 00000000000..1511da52f41 --- /dev/null +++ b/vendor/freetype/builds/compiler/win-lcc.mk @@ -0,0 +1,81 @@ +# +# FreeType 2 Win32-LCC specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +# Command line name +# +CC := lcc +COMPILER_SEP := $(SEP) + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -Fl + + +# Target flag. +# +T := -Fo + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +CFLAGS ?= -c -g2 -O + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +# LCC is pure ANSI anyway! +# +ANSIFLAGS ?= + + +# library linking +# +#CLEAN_LIBRARY := +LINK_LIBRARY = lcclib /out:$(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST)) + + +# EOF diff --git a/vendor/freetype/builds/detect.mk b/vendor/freetype/builds/detect.mk new file mode 100644 index 00000000000..de42b8e62d4 --- /dev/null +++ b/vendor/freetype/builds/detect.mk @@ -0,0 +1,128 @@ +# +# FreeType 2 host platform detection rules +# + + +# Copyright (C) 1996-2024 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 sub-Makefile is in charge of detecting the current platform. It sets +# the following variables: +# +# PLATFORM_DIR The configuration and system-specific directory. Usually +# `builds/$(PLATFORM)' but can be different for custom builds +# of the library. +# +# The following variables must be defined in system specific `detect.mk' +# files: +# +# PLATFORM The detected platform. This will default to `ansi' if +# auto-detection fails. +# CONFIG_FILE The configuration sub-makefile to use. This usually depends +# on the compiler defined in the `CC' environment variable. +# DELETE The shell command used to remove a given file. +# COPY The shell command used to copy one file. +# SEP The platform-specific directory separator. +# COMPILER_SEP The separator used in arguments of the compilation tools. +# CC The compiler to use. +# +# You need to set the following variable(s) before calling it: +# +# TOP_DIR The top-most directory in the FreeType library source +# hierarchy. If not defined, it will default to `.'. + +# Set auto-detection default to `ansi' resp. UNIX-like operating systems. +# +PLATFORM := ansi +DELETE := $(RM) +COPY := cp +CAT := cat +SEP := / + +BUILD_CONFIG := $(TOP_DIR)/builds + +# These two assignments must be delayed. +PLATFORM_DIR = $(BUILD_CONFIG)/$(PLATFORM) +CONFIG_RULES = $(PLATFORM_DIR)/$(CONFIG_FILE) + +# We define the BACKSLASH variable to hold a single back-slash character. +# This is needed because a line like +# +# SEP := \ +# +# does not work with GNU Make (the backslash is interpreted as a line +# continuation). While a line like +# +# SEP := \\ +# +# really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows! +# +BACKSLASH := $(strip \ ) + +# Find all auto-detectable platforms. +# +PLATFORMS := $(notdir $(subst /detect.mk,,$(wildcard $(BUILD_CONFIG)/*/detect.mk))) +.PHONY: $(PLATFORMS) ansi + +# Filter out platform specified as setup target. +# +PLATFORM := $(firstword $(filter $(MAKECMDGOALS),$(PLATFORMS))) + +# If no setup target platform was specified, enable auto-detection/ +# default platform. +# +ifeq ($(PLATFORM),) + PLATFORM := ansi +endif + +# If the user has explicitly asked for `ansi' on the command line, +# disable auto-detection. +# +ifeq ($(findstring ansi,$(MAKECMDGOALS)),) + # Now, include all detection rule files found in the `builds/' + # directories. Note that the calling order of the various `detect.mk' + # files isn't predictable. + # + include $(wildcard $(BUILD_CONFIG)/*/detect.mk) +endif + +# In case no detection rule file was successful, use the default. +# +ifndef CONFIG_FILE + CONFIG_FILE := ansi.mk + setup: std_setup + .PHONY: setup +endif + +# Flash out and copy rules. +# +.PHONY: std_setup + +std_setup: + $(info ) + $(info $(PROJECT_TITLE) build system -- automatic system detection) + $(info ) + $(info The following settings are used:) + $(info ) + $(info $(empty) platform $(PLATFORM)) + $(info $(empty) compiler $(CC)) + $(info $(empty) configuration directory $(subst /,$(SEP),$(PLATFORM_DIR))) + $(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES))) + $(info ) + $(info If this does not correspond to your system or settings please remove the file) + $(info `$(CONFIG_MK)' from this directory then read the INSTALL file for help.) + $(info ) + $(info Otherwise, simply type `$(MAKE)' again to build the library,) + $(info or `$(MAKE) refdoc' to build the API reference (this needs Python >= 3.5).) + $(info ) + @$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) + + +# EOF diff --git a/vendor/freetype/builds/dos/detect.mk b/vendor/freetype/builds/dos/detect.mk new file mode 100644 index 00000000000..93cc7194f9c --- /dev/null +++ b/vendor/freetype/builds/dos/detect.mk @@ -0,0 +1,152 @@ +# +# FreeType 2 configuration file to detect a DOS host platform. +# + + +# Copyright (C) 1996-2024 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. + + +.PHONY: setup + + +ifeq ($(PLATFORM),ansi) + + # Test for DJGPP by checking the DJGPP environment variable, which must be + # set in order to use the system (ie. it will always be present when the + # `make' utility is run). + # + # We test for the COMSPEC environment variable, then run the `ver' + # command-line program to see if its output contains the word `Dos' or + # `DOS'. + # + # If this is true, we are running a Dos-ish platform (or an emulation). + # + ifdef DJGPP + PLATFORM := dos + else + ifdef COMSPEC + is_dos := $(findstring DOS,$(subst Dos,DOS,$(shell ver))) + + # We try to recognize a Dos session under OS/2. The `ver' command + # returns `Operating System/2 ...' there, so `is_dos' should be empty. + # + # To recognize a Dos session under OS/2, we check COMSPEC for the + # substring `MDOS\COMMAND' + # + ifeq ($(is_dos),) + is_dos := $(findstring MDOS\COMMAND,$(COMSPEC)) + endif + + # We also try to recognize Dos 7.x without Windows 9X launched. + # See builds/windows/detect.mk for explanations about the logic. + # + ifeq ($(is_dos),) + ifdef winbootdir +#ifneq ($(OS),Windows_NT) + # If windows is available, do not trigger this test. + ifndef windir + is_dos := $(findstring Windows,$(strip $(shell ver))) + endif +#endif + endif + endif + + endif # test COMSPEC + + ifneq ($(is_dos),) + + PLATFORM := dos + + endif # test Dos + endif # test DJGPP +endif # test PLATFORM ansi + +ifeq ($(PLATFORM),dos) + + # Use DJGPP (i.e. gcc) by default. + # + CONFIG_FILE := dos-gcc.mk + CC ?= gcc + + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring emx,$(MAKECMDGOALS)),) # EMX gcc + CONFIG_FILE := dos-emx.mk + CC := gcc + + .PHONY: emx + emx: setup + @cd . + endif + + ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C + CONFIG_FILE := dos-tcc.mk + CC := tcc + + .PHONY: turboc + turboc: setup + @cd . + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := dos-wat.mk + CC := wcc386 + + .PHONY: watcom + watcom: setup + @cd . + endif + + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit + CONFIG_FILE := dos-bcc.mk + CC := bcc32 + + .PHONY: borlandc + borlandc: setup + @cd . + endif + + ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit + CONFIG_FILE := dos-bcc.mk + CC := bcc + + .PHONY: borlandc16 + borlandc16: setup + @cd . + endif + + ifneq ($(findstring bash,$(SHELL)),) # check for bash + SEP := / + DELETE := rm + COPY := cp + CAT := cat + setup: std_setup + else + SEP := $(BACKSLASH) + DELETE := del + CAT := type + + # Setting COPY is a bit trickier. We can be running DJGPP on some + # Windows NT derivatives, like XP. See builds/windows/detect.mk for + # explanations why we need hacking here. + # + ifeq ($(OS),Windows_NT) + COPY := cmd.exe /c copy + else + COPY := copy + endif # test NT + + setup: std_setup + endif + +endif # test PLATFORM dos + + +# EOF diff --git a/vendor/freetype/builds/dos/dos-def.mk b/vendor/freetype/builds/dos/dos-def.mk new file mode 100644 index 00000000000..1b04bf94523 --- /dev/null +++ b/vendor/freetype/builds/dos/dos-def.mk @@ -0,0 +1,48 @@ +# +# FreeType 2 DOS specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +DELETE := del +CAT := type +SEP := $(strip \ ) +PLATFORM_DIR := $(TOP_DIR)/builds/dos +PLATFORM := dos + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := Scripts + +# The executable file extension (for tools), *with* leading dot. +# +E := .exe + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := $(PROJECT) + + +# The NO_OUTPUT macro is used to ignore the output of commands. +# +NO_OUTPUT = > nul + + +# EOF diff --git a/vendor/freetype/builds/dos/dos-emx.mk b/vendor/freetype/builds/dos/dos-emx.mk new file mode 100644 index 00000000000..c58931ad521 --- /dev/null +++ b/vendor/freetype/builds/dos/dos-emx.mk @@ -0,0 +1,21 @@ +# +# FreeType 2 configuration rules for the EMX gcc compiler +# + + +# Copyright (C) 2003-2024 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 $(TOP_DIR)/builds/dos/dos-def.mk +include $(TOP_DIR)/builds/compiler/emx.mk +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/dos/dos-gcc.mk b/vendor/freetype/builds/dos/dos-gcc.mk new file mode 100644 index 00000000000..a2822757ef3 --- /dev/null +++ b/vendor/freetype/builds/dos/dos-gcc.mk @@ -0,0 +1,21 @@ +# +# FreeType 2 configuration rules for the DJGPP compiler +# + + +# Copyright (C) 1996-2024 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 $(TOP_DIR)/builds/dos/dos-def.mk +include $(TOP_DIR)/builds/compiler/gcc.mk +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/dos/dos-wat.mk b/vendor/freetype/builds/dos/dos-wat.mk new file mode 100644 index 00000000000..6f935def903 --- /dev/null +++ b/vendor/freetype/builds/dos/dos-wat.mk @@ -0,0 +1,20 @@ +# +# FreeType 2 configuration rules for the Watcom C/C++ compiler +# + + +# Copyright (C) 2003-2024 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 $(TOP_DIR)/builds/dos/dos-def.mk +include $(TOP_DIR)/builds/compiler/watcom.mk +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/exports.mk b/vendor/freetype/builds/exports.mk new file mode 100644 index 00000000000..31da7c6d7ed --- /dev/null +++ b/vendor/freetype/builds/exports.mk @@ -0,0 +1,80 @@ +# +# FreeType 2 exports sub-Makefile +# + + +# Copyright (C) 2005-2024 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. + + +# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY +# OTHER MAKEFILES. + + +# This sub-Makefile is used to compute the list of exported symbols whenever +# the EXPORTS_LIST variable is defined by one of the platform or compiler +# specific build files. +# +# EXPORTS_LIST contains the name of the `list' file, for example a Windows +# .DEF file. +# +ifneq ($(EXPORTS_LIST),) + + # CCexe is the compiler used to compile the `apinames' tool program + # on the host machine. This isn't necessarily the same as the compiler + # which can be a cross-compiler for a different architecture, for example. + # + ifeq ($(CCexe),) + CCexe := $(CC) + endif + + # TE acts like T, but for executables instead of object files. + ifeq ($(TE),) + TE := $T + endif + + # The list of public headers we're going to parse. + PUBLIC_HEADERS := $(filter-out $(PUBLIC_DIR)/ftmac.h, \ + $(wildcard $(PUBLIC_DIR)/*.h)) + ifneq ($(ftmac_c),) + PUBLIC_HEADERS += $(PUBLIC_DIR)/ftmac.h + endif + + # The `apinames' source and executable. We use $E_BUILD as the host + # executable suffix, which *includes* the final dot. + # + # Note that $(APINAMES_OPTIONS) is empty, except for Windows compilers. + # + APINAMES_SRC := $(subst /,$(SEP),$(TOP_DIR)/src/tools/apinames.c) + APINAMES_EXE := $(subst /,$(SEP),$(OBJ_DIR)/apinames$(E_BUILD)) + + $(APINAMES_EXE): $(APINAMES_SRC) + $(CCexe) $(CCexe_CFLAGS) $(TE)$@ $< $(CCexe_LDFLAGS) + + .PHONY: symbols_list + + symbols_list: $(EXPORTS_LIST) + + # We manually add TT_New_Context and TT_RunIns, which are needed by TT + # debuggers, to the EXPORTS_LIST. + # + $(EXPORTS_LIST): $(APINAMES_EXE) $(PUBLIC_HEADERS) + $(subst /,$(SEP),$(APINAMES_EXE)) -o$@ $(APINAMES_OPTIONS) $(PUBLIC_HEADERS) + @echo TT_New_Context >> $(EXPORTS_LIST) + @echo TT_RunIns >> $(EXPORTS_LIST) + + $(PROJECT_LIBRARY): $(EXPORTS_LIST) + + CLEAN += $(EXPORTS_LIST) \ + $(APINAMES_EXE) + +endif + + +# EOF diff --git a/vendor/freetype/builds/freetype.mk b/vendor/freetype/builds/freetype.mk new file mode 100644 index 00000000000..feed7bd85b3 --- /dev/null +++ b/vendor/freetype/builds/freetype.mk @@ -0,0 +1,385 @@ +# +# FreeType 2 library sub-Makefile +# + + +# Copyright (C) 1996-2024 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. + + +# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY +# OTHER MAKEFILES. + + +# The following variables (set by other Makefile components, in the +# environment, or on the command line) are used: +# +# PLATFORM_DIR The architecture-dependent directory, +# e.g., `$(TOP_DIR)/builds/unix'. Added to INCLUDES also. +# +# OBJ_DIR The directory in which object files are created. +# +# LIB_DIR The directory in which the library is created. +# +# DOC_DIR The directory in which the API reference is created. +# +# INCLUDES A list of directories to be included additionally. +# +# DEVEL_DIR Development directory which is added to the INCLUDES +# variable before the standard include directories. +# +# CFLAGS Compilation flags. This overrides the default settings +# in the platform-specific configuration files. +# +# FTSYS_SRC If set, its value is used as the name of a replacement +# file for `src/base/ftsystem.c'. +# +# FTDEBUG_SRC If set, its value is used as the name of a replacement +# file for `src/base/ftdebug.c'. [For a normal build, this +# file does nothing.] +# +# FTMODULE_H The file which contains the list of module classes for +# the current build. Usually, this is automatically +# created by `modules.mk'. +# +# BASE_OBJ_S +# BASE_OBJ_M A list of base objects (for single object and multiple +# object builds, respectively). Set up in +# `src/base/rules.mk'. +# +# BASE_EXT_OBJ A list of base extension objects. Set up in +# `src/base/rules.mk'. +# +# DRV_OBJ_S +# DRV_OBJ_M A list of driver objects (for single object and multiple +# object builds, respectively). Set up cumulatively in +# `src//rules.mk'. +# +# CLEAN +# DISTCLEAN The sub-makefiles can append additional stuff to these two +# variables which is to be removed for the `clean' resp. +# `distclean' target. +# +# TOP_DIR, SEP, +# COMPILER_SEP, +# LIBRARY, CC, +# A, I, O, T Check `config.mk' for details. + + +# The targets `objects' and `library' are defined at the end of this +# Makefile after all other rules have been included. +# +.PHONY: single multi objects library refdoc refdoc-venv + +# default target -- build single objects and library +# +single: objects library + +# `multi' target -- build multiple objects and library +# +multi: objects library + + +# The FreeType source directory, usually `./src'. +# +SRC_DIR := $(TOP_DIR)/src + +# The directory where the base layer components are placed, usually +# `./src/base'. +# +BASE_DIR := $(SRC_DIR)/base + +# Other derived directories. +# +PUBLIC_DIR := $(TOP_DIR)/include/freetype +INTERNAL_DIR := $(PUBLIC_DIR)/internal +SERVICES_DIR := $(INTERNAL_DIR)/services +CONFIG_DIR := $(PUBLIC_DIR)/config + +# The documentation directory. +# +DOC_DIR ?= $(TOP_DIR)/docs + +# The final name of the library file. +# +PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A + + +# include paths +# +# IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed +# before the standard include list. Porters are then able to +# put their own version of some of the FreeType components +# in the `builds/' directory, as these files will +# override the default sources. +# +INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \ + $(DEVEL_DIR) \ + $(PLATFORM_DIR) \ + $(TOP_DIR)/include) + +INCLUDE_FLAGS := $(INCLUDES:%=$I%) + +# For a development build, we assume that the external library dependencies +# defined in `ftoption.h' are fulfilled, so we directly access the necessary +# include directory information using `pkg-config'. +# +ifdef DEVEL_DIR + INCLUDE_FLAGS += $(shell pkg-config --cflags libpng) + INCLUDE_FLAGS += $(shell pkg-config --cflags harfbuzz) + INCLUDE_FLAGS += $(shell pkg-config --cflags libbrotlidec) +endif + + +# C flags used for the compilation of an object file. This must include at +# least the paths for the `base' and `builds/' directories; +# debug/optimization/warning flags + ansi compliance if needed. +# +# $(INCLUDE_FLAGS) should come before $(CFLAGS) to avoid problems with +# old FreeType versions. +# +# Note what we also define the macro FT2_BUILD_LIBRARY when building +# FreeType. This is required to let our sources include the internal +# headers (something forbidden by clients). +# +# `CPPFLAGS' might be specified by the user in the environment. +# +FT_CFLAGS = $(CPPFLAGS) \ + $(CFLAGS) \ + $DFT2_BUILD_LIBRARY + +FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS) + + +# Include the `exports' rules file. +# +include $(TOP_DIR)/builds/exports.mk + + +# Initialize the list of objects. +# +OBJECTS_LIST := + + +# Define $(PUBLIC_H) as the list of all public header files located in +# `$(TOP_DIR)/include/freetype'. $(INTERNAL_H), and $(CONFIG_H) are defined +# similarly. $(FTOPTION_H) is the option file used in the compilation. +# +# This is used to simplify the dependency rules -- if one of these files +# changes, the whole library is recompiled. +# +ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),) + FTOPTION_H := $(OBJ_DIR)/ftoption.h +else ifneq ($(wildcard $(PLATFORM_DIR)/ftoption.h),) + FTOPTION_H := $(PLATFORM_DIR)/ftoption.h +endif + +PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h) +INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \ + $(wildcard $(SERVICES_DIR)/*.h) +CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \ + $(wildcard $(PLATFORM_DIR)/config/*.h) \ + $(FTMODULE_H) \ + $(FTOPTION_H) +DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h) + +FREETYPE_H := $(PUBLIC_H) $(INTERNAL_H) $(CONFIG_H) $(DEVEL_H) + + +# ftsystem component +# +FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c + +FTSYS_OBJ := $(OBJ_DIR)/ftsystem.$O + +OBJECTS_LIST += $(FTSYS_OBJ) + +$(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H) + $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# ftdebug component +# +FTDEBUG_SRC ?= $(BASE_DIR)/ftdebug.c + +FTDEBUG_OBJ := $(OBJ_DIR)/ftdebug.$O + +OBJECTS_LIST += $(FTDEBUG_OBJ) + +$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H) + $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# Include all rule files from FreeType components. +# +include $(SRC_DIR)/base/rules.mk +include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES)) +include $(SRC_DIR)/dlg/rules.mk + + +# ftinit component +# +# The C source `ftinit.c' contains the FreeType initialization routines. +# It is able to automatically register one or more drivers when the API +# function FT_Init_FreeType() is called. +# +# The set of initial drivers is determined by the driver Makefiles +# includes above. Each driver Makefile updates the FTINIT_xxx lists +# which contain additional include paths and macros used to compile the +# single `ftinit.c' source. +# +FTINIT_SRC := $(BASE_DIR)/ftinit.c +FTINIT_OBJ := $(OBJ_DIR)/ftinit.$O + +OBJECTS_LIST += $(FTINIT_OBJ) + +$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) + $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# ftver component +# +# The VERSIONINFO resource `ftver.rc' contains version and copyright +# to be compiled by windres and tagged into DLL usually. +# +ifneq ($(RC),) + FTVER_SRC := $(BASE_DIR)/ftver.rc + FTVER_OBJ := $(OBJ_DIR)/ftver.$O + + OBJECTS_LIST += $(FTVER_OBJ) + + $(FTVER_OBJ): $(FTVER_SRC) + $(RC) -o $@ $< +endif + + +# All FreeType library objects. +# +OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) $(DLG_OBJS_M) +OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) $(DLG_OBJS_S) + + +# The target `multi' on the Make command line indicates that we want to +# compile each source file independently. +# +# Otherwise, each module/driver is compiled in a single object file through +# source file inclusion (see `src/base/ftbase.c' or +# `src/truetype/truetype.c' for examples). +# +BASE_OBJECTS := $(OBJECTS_LIST) + +ifneq ($(findstring multi,$(MAKECMDGOALS)),) + OBJECTS_LIST += $(OBJ_M) +else + OBJECTS_LIST += $(OBJ_S) +endif + +objects: $(OBJECTS_LIST) + +library: $(PROJECT_LIBRARY) + +# Run `docwriter' in the current Python environment. +# +PYTHON ?= python + +refdoc: + @echo Running docwriter... + $(PYTHON) -m docwriter \ + --prefix=ft2 \ + --title=FreeType-$(version) \ + --site=reference \ + --output=$(DOC_DIR) \ + $(PUBLIC_DIR)/*.h \ + $(PUBLIC_DIR)/config/*.h \ + $(PUBLIC_DIR)/cache/*.h + @echo Building static site... + cd $(DOC_DIR) && $(PYTHON) -m mkdocs build + @echo Done. + +# Variables for running `refdoc' with Python's `virtualenv'. The +# environment is created in `DOC_DIR/env' and is gitignored. +# +# We still need to cd into `DOC_DIR' to build `mkdocs' because paths in +# `mkdocs.yml' are relative to the current working directory. +# +VENV_NAME := env +VENV_DIR := $(DOC_DIR)$(SEP)$(VENV_NAME) +ENV_PYTHON := $(VENV_DIR)$(SEP)$(BIN)$(SEP)$(PYTHON) + +refdoc-venv: + @echo Setting up virtualenv for Python... + virtualenv --python=$(PYTHON) $(VENV_DIR) + @echo Installing docwriter... + $(ENV_PYTHON) -m pip install docwriter + @echo Running docwriter... + $(ENV_PYTHON) -m docwriter \ + --prefix=ft2 \ + --title=FreeType-$(version) \ + --site=reference \ + --output=$(DOC_DIR) \ + $(PUBLIC_DIR)/*.h \ + $(PUBLIC_DIR)/config/*.h \ + $(PUBLIC_DIR)/cache/*.h + @echo Building static site... + cd $(DOC_DIR) && $(VENV_NAME)$(SEP)$(BIN)$(SEP)python -m mkdocs build + @echo Done. + +.PHONY: clean_project_std distclean_project_std + +# Standard cleaning and distclean rules. These are not accepted +# on all systems though. +# +clean_project_std: + -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) $(CLEAN) + +distclean_project_std: clean_project_std + -$(DELETE) $(PROJECT_LIBRARY) + -$(DELETE) *.orig *~ core *.core $(DISTCLEAN) + + +.PHONY: clean_project_dos distclean_project_dos + +# The Dos command shell does not support very long list of arguments, so +# we are stuck with wildcards. +# +# Don't break the command lines with \; this prevents the "del" command from +# working correctly on Win9x. +# +clean_project_dos: + -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR)/*.$O $(CLEAN) $(NO_OUTPUT)) + +distclean_project_dos: clean_project_dos + -$(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY) $(DISTCLEAN) $(NO_OUTPUT)) + + +.PHONY: remove_config_mk remove_ftmodule_h + +# Remove configuration file (used for distclean). +# +remove_config_mk: + -$(DELETE) $(subst /,$(SEP),$(CONFIG_MK) $(NO_OUTPUT)) + +# Remove module list (used for distclean). +# +remove_ftmodule_h: + -$(DELETE) $(subst /,$(SEP),$(FTMODULE_H) $(NO_OUTPUT)) + + +.PHONY: clean distclean + +# The `config.mk' file must define `clean_project' and `distclean_project'. +# Implementations may use to relay these to either the `std' or `dos' +# versions from above, or simply provide their own implementation. +# +clean: clean_project +distclean: distclean_project remove_config_mk remove_ftmodule_h + -$(DELETE) $(subst /,$(SEP),$(DOC_DIR)/*.html $(NO_OUTPUT)) + + +# EOF diff --git a/vendor/freetype/builds/link_dos.mk b/vendor/freetype/builds/link_dos.mk new file mode 100644 index 00000000000..42df6dfa4ad --- /dev/null +++ b/vendor/freetype/builds/link_dos.mk @@ -0,0 +1,42 @@ +# +# Link instructions for Dos-like systems (Dos, Win32, OS/2) +# + + +# Copyright (C) 1996-2024 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. + + +ifdef BUILD_PROJECT + + .PHONY: clean_project distclean_project + + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP_DIR)/builds/$(PROJECT).mk + + # The cleanup targets. + # + clean_project: clean_project_dos + distclean_project: distclean_project_dos + + # This final rule is used to link all object files into a single library. + # this is compiler-specific + # + $(PROJECT_LIBRARY): $(OBJECTS_LIST) + ifdef CLEAN_LIBRARY + -$(CLEAN_LIBRARY) $(NO_OUTPUT) + endif + $(LINK_LIBRARY) + +endif + + +# EOF diff --git a/vendor/freetype/builds/link_std.mk b/vendor/freetype/builds/link_std.mk new file mode 100644 index 00000000000..48fe09723ea --- /dev/null +++ b/vendor/freetype/builds/link_std.mk @@ -0,0 +1,42 @@ +# +# Link instructions for standard systems +# + + +# Copyright (C) 1996-2024 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. + + +ifdef BUILD_PROJECT + + .PHONY: clean_project distclean_project + + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP_DIR)/builds/$(PROJECT).mk + + # The cleanup targets. + # + clean_project: clean_project_std + distclean_project: distclean_project_std + + # This final rule is used to link all object files into a single library. + # this is compiler-specific + # + $(PROJECT_LIBRARY): $(OBJECTS_LIST) + ifdef CLEAN_LIBRARY + -$(CLEAN_LIBRARY) $(NO_OUTPUT) + endif + $(LINK_LIBRARY) + +endif + + +# EOF diff --git a/vendor/freetype/builds/mac/FreeType.m68k_cfm.make.txt b/vendor/freetype/builds/mac/FreeType.m68k_cfm.make.txt new file mode 100644 index 00000000000..b74565f1079 --- /dev/null +++ b/vendor/freetype/builds/mac/FreeType.m68k_cfm.make.txt @@ -0,0 +1,209 @@ +# File: FreeType.m68k_cfm.make +# Target: FreeType.m68k_cfm +# Created: Thursday, October 27, 2005 09:23:25 PM + + +MAKEFILE = FreeType.m68k_cfm.make +\xA5MondoBuild\xA5 = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified + +ObjDir = :objs: +Includes = \xB6 + -ansi strict \xB6 + -includes unix \xB6 + -i :include: \xB6 + -i :src: \xB6 + -i :include:freetype:config: + +Sym-68K = -sym off + +COptions = \xB6 + -d FT_MACINTOSH=1 \xB6 + -d HAVE_FSSPEC=1 \xB6 + -d HAVE_FSREF=0 \xB6 + -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 + -d HAVE_QUICKDRAW_CARBON=0 \xB6 + -d HAVE_ATS=0 \xB6 + -d FT2_BUILD_LIBRARY \xB6 + -d FT_CONFIG_CONFIG_H="" \xB6 + -d FT_CONFIG_MODULES_H="" \xB6 + {Includes} {Sym-68K} -model cfmseg + + +### Source Files ### + +SrcFiles = \xB6 + :src:autofit:autofit.c \xB6 + :builds:mac:ftbase.c \xB6 + :src:base:ftbbox.c \xB6 + :src:base:ftbdf.c \xB6 + :src:base:ftbitmap.c \xB6 + :src:base:ftdebug.c \xB6 + :src:base:ftfstype.c \xB6 + :src:base:ftglyph.c \xB6 + :src:base:ftgxval.c \xB6 + :src:base:ftinit.c \xB6 + :src:base:ftmm.c \xB6 + :src:base:ftotval.c \xB6 + :src:base:ftpfr.c \xB6 + :src:base:ftstroke.c \xB6 + :src:base:ftsynth.c \xB6 + :src:base:ftsystem.c \xB6 + :src:base:fttype1.c \xB6 + :src:base:ftwinfnt.c \xB6 + :src:cache:ftcache.c \xB6 + :src:bdf:bdf.c \xB6 + :src:cff:cff.c \xB6 + :src:cid:type1cid.c \xB6 +# :src:gxvalid:gxvalid.c \xB6 + :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 + :src:lzw:ftlzw.c \xB6 + :src:otvalid:otvalid.c \xB6 + :src:pcf:pcf.c \xB6 + :src:pfr:pfr.c \xB6 + :src:psaux:psaux.c \xB6 + :src:pshinter:pshinter.c \xB6 + :src:psnames:psmodule.c \xB6 + :src:raster:raster.c \xB6 + :src:sfnt:sfnt.c \xB6 + :src:smooth:smooth.c \xB6 + :src:truetype:truetype.c \xB6 + :src:type1:type1.c \xB6 + :src:type42:type42.c \xB6 + :src:winfonts:winfnt.c + + +### Object Files ### + +ObjFiles-68K = \xB6 + "{ObjDir}autofit.c.o" \xB6 + "{ObjDir}ftbase.c.o" \xB6 + "{ObjDir}ftbbox.c.o" \xB6 + "{ObjDir}ftbdf.c.o" \xB6 + "{ObjDir}ftbitmap.c.o" \xB6 + "{ObjDir}ftdebug.c.o" \xB6 + "{ObjDir}ftfstype.c.o" \xB6 + "{ObjDir}ftglyph.c.o" \xB6 + "{ObjDir}ftgxval.c.o" \xB6 + "{ObjDir}ftinit.c.o" \xB6 + "{ObjDir}ftmm.c.o" \xB6 + "{ObjDir}ftotval.c.o" \xB6 + "{ObjDir}ftpfr.c.o" \xB6 + "{ObjDir}ftstroke.c.o" \xB6 + "{ObjDir}ftsynth.c.o" \xB6 + "{ObjDir}ftsystem.c.o" \xB6 + "{ObjDir}fttype1.c.o" \xB6 + "{ObjDir}ftwinfnt.c.o" \xB6 + "{ObjDir}ftcache.c.o" \xB6 + "{ObjDir}bdf.c.o" \xB6 + "{ObjDir}cff.c.o" \xB6 + "{ObjDir}type1cid.c.o" \xB6 +# "{ObjDir}gxvalid.c.o" \xB6 + "{ObjDir}ftgzip.c.o" \xB6 + "{ObjDir}ftbzip2.c.o" \xB6 + "{ObjDir}ftlzw.c.o" \xB6 + "{ObjDir}otvalid.c.o" \xB6 + "{ObjDir}pcf.c.o" \xB6 + "{ObjDir}pfr.c.o" \xB6 + "{ObjDir}psaux.c.o" \xB6 + "{ObjDir}pshinter.c.o" \xB6 + "{ObjDir}psmodule.c.o" \xB6 + "{ObjDir}raster.c.o" \xB6 + "{ObjDir}sfnt.c.o" \xB6 + "{ObjDir}smooth.c.o" \xB6 + "{ObjDir}truetype.c.o" \xB6 + "{ObjDir}type1.c.o" \xB6 + "{ObjDir}type42.c.o" \xB6 + "{ObjDir}winfnt.c.o" + + +### Libraries ### + +LibFiles-68K = + + +### Default Rules ### + +.c.o \xC4 .c {\xA5MondoBuild\xA5} + {C} {depDir}{default}.c -o {targDir}{default}.c.o {COptions} + + +### Build Rules ### + +:builds:mac:ftbase.c \xC4\xC4 :src:base:ftbase.c + Duplicate :src:base:ftbase.c :builds:mac:ftbase.c + +"{ObjDir}ftbase.c.o" \xC4\xC4 :builds:mac:ftbase.c + {C} :builds:mac:ftbase.c -o "{ObjDir}ftbase.c.o" \xB6 + -i :builds:mac: \xB6 + -i :src:base: \xB6 + {COptions} + +FreeType.m68k_cfm \xC4\xC4 FreeType.m68k_cfm.o + +FreeType.m68k_cfm.o \xC4\xC4 {ObjFiles-68K} {LibFiles-68K} {\xA5MondoBuild\xA5} + Lib \xB6 + -o {Targ} \xB6 + {ObjFiles-68K} \xB6 + {LibFiles-68K} \xB6 + {Sym-68K} \xB6 + -mf -d + + + +### Required Dependencies ### + +"{ObjDir}autofit.c.o" \xC4 :src:autofit:autofit.c +# "{ObjDir}ftbase.c.o" \xC4 :src:base:ftbase.c +"{ObjDir}ftbbox.c.o" \xC4 :src:base:ftbbox.c +"{ObjDir}ftbdf.c.o" \xC4 :src:base:ftbdf.c +"{ObjDir}ftbitmap.c.o" \xC4 :src:base:ftbitmap.c +"{ObjDir}ftdebug.c.o" \xC4 :src:base:ftdebug.c +"{ObjDir}ftfstype.c.o" \xC4 :src:base:ftfstype.c +"{ObjDir}ftglyph.c.o" \xC4 :src:base:ftglyph.c +"{ObjDir}ftgxval.c.o" \xC4 :src:base:ftgxval.c +"{ObjDir}ftinit.c.o" \xC4 :src:base:ftinit.c +"{ObjDir}ftmm.c.o" \xC4 :src:base:ftmm.c +"{ObjDir}ftotval.c.o" \xC4 :src:base:ftotval.c +"{ObjDir}ftpfr.c.o" \xC4 :src:base:ftpfr.c +"{ObjDir}ftstroke.c.o" \xC4 :src:base:ftstroke.c +"{ObjDir}ftsynth.c.o" \xC4 :src:base:ftsynth.c +"{ObjDir}ftsystem.c.o" \xC4 :src:base:ftsystem.c +"{ObjDir}fttype1.c.o" \xC4 :src:base:fttype1.c +"{ObjDir}ftwinfnt.c.o" \xC4 :src:base:ftwinfnt.c +"{ObjDir}ftcache.c.o" \xC4 :src:cache:ftcache.c +"{ObjDir}bdf.c.o" \xC4 :src:bdf:bdf.c +"{ObjDir}cff.c.o" \xC4 :src:cff:cff.c +"{ObjDir}type1cid.c.o" \xC4 :src:cid:type1cid.c +# "{ObjDir}gxvalid.c.o" \xC4 :src:gxvalid:gxvalid.c +"{ObjDir}ftgzip.c.o" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.o" \xC4 :src:bzip2:ftbzip2.c +"{ObjDir}ftlzw.c.o" \xC4 :src:lzw:ftlzw.c +"{ObjDir}otvalid.c.o" \xC4 :src:otvalid:otvalid.c +"{ObjDir}pcf.c.o" \xC4 :src:pcf:pcf.c +"{ObjDir}pfr.c.o" \xC4 :src:pfr:pfr.c +"{ObjDir}psaux.c.o" \xC4 :src:psaux:psaux.c +"{ObjDir}pshinter.c.o" \xC4 :src:pshinter:pshinter.c +"{ObjDir}psmodule.c.o" \xC4 :src:psnames:psmodule.c +"{ObjDir}raster.c.o" \xC4 :src:raster:raster.c +"{ObjDir}sfnt.c.o" \xC4 :src:sfnt:sfnt.c +"{ObjDir}smooth.c.o" \xC4 :src:smooth:smooth.c +"{ObjDir}truetype.c.o" \xC4 :src:truetype:truetype.c +"{ObjDir}type1.c.o" \xC4 :src:type1:type1.c +"{ObjDir}type42.c.o" \xC4 :src:type42:type42.c +"{ObjDir}winfnt.c.o" \xC4 :src:winfonts:winfnt.c + + +### Optional Dependencies ### +### Build this target to generate "include file" dependencies. ### + +Dependencies \xC4 $OutOfDate + MakeDepend \xB6 + -append {MAKEFILE} \xB6 + -ignore "{CIncludes}" \xB6 + -objdir "{ObjDir}" \xB6 + -objext .o \xB6 + {Includes} \xB6 + {SrcFiles} + + diff --git a/vendor/freetype/builds/mac/FreeType.m68k_far.make.txt b/vendor/freetype/builds/mac/FreeType.m68k_far.make.txt new file mode 100644 index 00000000000..d880ddbb7c6 --- /dev/null +++ b/vendor/freetype/builds/mac/FreeType.m68k_far.make.txt @@ -0,0 +1,208 @@ +# File: FreeType.m68k_far.make +# Target: FreeType.m68k_far +# Created: Tuesday, October 25, 2005 03:34:05 PM + + +MAKEFILE = FreeType.m68k_far.make +\xA5MondoBuild\xA5 = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified + +ObjDir = :objs: +Includes = \xB6 + -includes unix \xB6 + -i :include: \xB6 + -i :src: \xB6 + -i :include:freetype:config: + +Sym-68K = -sym off + +COptions = \xB6 + -d FT_MACINTOSH=1 \xB6 + -d HAVE_FSSPEC=1 \xB6 + -d HAVE_FSREF=0 \xB6 + -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 + -d HAVE_QUICKDRAW_CARBON=0 \xB6 + -d HAVE_ATS=0 \xB6 + -d FT2_BUILD_LIBRARY \xB6 + -d FT_CONFIG_CONFIG_H="" \xB6 + -d FT_CONFIG_MODULES_H="" \xB6 + {Includes} {Sym-68K} -model far + + +### Source Files ### + +SrcFiles = \xB6 + :src:autofit:autofit.c \xB6 + :builds:mac:ftbase.c \xB6 + :src:base:ftbbox.c \xB6 + :src:base:ftbdf.c \xB6 + :src:base:ftbitmap.c \xB6 + :src:base:ftdebug.c \xB6 + :src:base:ftfstype.c \xB6 + :src:base:ftglyph.c \xB6 + :src:base:ftgxval.c \xB6 + :src:base:ftinit.c \xB6 + :src:base:ftmm.c \xB6 + :src:base:ftotval.c \xB6 + :src:base:ftpfr.c \xB6 + :src:base:ftstroke.c \xB6 + :src:base:ftsynth.c \xB6 + :src:base:ftsystem.c \xB6 + :src:base:fttype1.c \xB6 + :src:base:ftwinfnt.c \xB6 + :src:cache:ftcache.c \xB6 + :src:bdf:bdf.c \xB6 + :src:cff:cff.c \xB6 + :src:cid:type1cid.c \xB6 + :src:gxvalid:gxvalid.c \xB6 + :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 + :src:lzw:ftlzw.c \xB6 + :src:otvalid:otvalid.c \xB6 + :src:pcf:pcf.c \xB6 + :src:pfr:pfr.c \xB6 + :src:psaux:psaux.c \xB6 + :src:pshinter:pshinter.c \xB6 + :src:psnames:psmodule.c \xB6 + :src:raster:raster.c \xB6 + :src:sfnt:sfnt.c \xB6 + :src:smooth:smooth.c \xB6 + :src:truetype:truetype.c \xB6 + :src:type1:type1.c \xB6 + :src:type42:type42.c \xB6 + :src:winfonts:winfnt.c + + +### Object Files ### + +ObjFiles-68K = \xB6 + "{ObjDir}autofit.c.o" \xB6 + "{ObjDir}ftbase.c.o" \xB6 + "{ObjDir}ftbbox.c.o" \xB6 + "{ObjDir}ftbdf.c.o" \xB6 + "{ObjDir}ftbitmap.c.o" \xB6 + "{ObjDir}ftdebug.c.o" \xB6 + "{ObjDir}ftfstype.c.o" \xB6 + "{ObjDir}ftglyph.c.o" \xB6 + "{ObjDir}ftgxval.c.o" \xB6 + "{ObjDir}ftinit.c.o" \xB6 + "{ObjDir}ftmm.c.o" \xB6 + "{ObjDir}ftotval.c.o" \xB6 + "{ObjDir}ftpfr.c.o" \xB6 + "{ObjDir}ftstroke.c.o" \xB6 + "{ObjDir}ftsynth.c.o" \xB6 + "{ObjDir}ftsystem.c.o" \xB6 + "{ObjDir}fttype1.c.o" \xB6 + "{ObjDir}ftwinfnt.c.o" \xB6 + "{ObjDir}ftcache.c.o" \xB6 + "{ObjDir}bdf.c.o" \xB6 + "{ObjDir}cff.c.o" \xB6 + "{ObjDir}type1cid.c.o" \xB6 + "{ObjDir}gxvalid.c.o" \xB6 + "{ObjDir}ftgzip.c.o" \xB6 + "{ObjDir}ftbzip2.c.o" \xB6 + "{ObjDir}ftlzw.c.o" \xB6 + "{ObjDir}otvalid.c.o" \xB6 + "{ObjDir}pcf.c.o" \xB6 + "{ObjDir}pfr.c.o" \xB6 + "{ObjDir}psaux.c.o" \xB6 + "{ObjDir}pshinter.c.o" \xB6 + "{ObjDir}psmodule.c.o" \xB6 + "{ObjDir}raster.c.o" \xB6 + "{ObjDir}sfnt.c.o" \xB6 + "{ObjDir}smooth.c.o" \xB6 + "{ObjDir}truetype.c.o" \xB6 + "{ObjDir}type1.c.o" \xB6 + "{ObjDir}type42.c.o" \xB6 + "{ObjDir}winfnt.c.o" + + +### Libraries ### + +LibFiles-68K = + + +### Default Rules ### + +.c.o \xC4 .c {\xA5MondoBuild\xA5} + {C} {depDir}{default}.c -o {targDir}{default}.c.o {COptions} \xB6 + -ansi strict + +### Build Rules ### + +:builds:mac:ftbase.c \xC4\xC4 :src:base:ftbase.c + Duplicate :src:base:ftbase.c :builds:mac:ftbase.c + +"{ObjDir}ftbase.c.o" \xC4\xC4 :builds:mac:ftbase.c + {C} :builds:mac:ftbase.c -o "{ObjDir}ftbase.c.o" \xB6 + -i :builds:mac: \xB6 + -i :src:base: \xB6 + {COptions} + +FreeType.m68k_far \xC4\xC4 FreeType.m68k_far.o + +FreeType.m68k_far.o \xC4\xC4 {ObjFiles-68K} {LibFiles-68K} {\xA5MondoBuild\xA5} + Lib \xB6 + -o {Targ} \xB6 + {ObjFiles-68K} \xB6 + {LibFiles-68K} \xB6 + {Sym-68K} \xB6 + -mf -d + + + +### Required Dependencies ### + +"{ObjDir}autofit.c.o" \xC4 :src:autofit:autofit.c +# "{ObjDir}ftbase.c.o" \xC4 :src:base:ftbase.c +"{ObjDir}ftbbox.c.o" \xC4 :src:base:ftbbox.c +"{ObjDir}ftbdf.c.o" \xC4 :src:base:ftbdf.c +"{ObjDir}ftbitmap.c.o" \xC4 :src:base:ftbitmap.c +"{ObjDir}ftdebug.c.o" \xC4 :src:base:ftdebug.c +"{ObjDir}ftfstype.c.o" \xC4 :src:base:ftfstype.c +"{ObjDir}ftglyph.c.o" \xC4 :src:base:ftglyph.c +"{ObjDir}ftgxval.c.o" \xC4 :src:base:ftgxval.c +"{ObjDir}ftinit.c.o" \xC4 :src:base:ftinit.c +"{ObjDir}ftmm.c.o" \xC4 :src:base:ftmm.c +"{ObjDir}ftotval.c.o" \xC4 :src:base:ftotval.c +"{ObjDir}ftpfr.c.o" \xC4 :src:base:ftpfr.c +"{ObjDir}ftstroke.c.o" \xC4 :src:base:ftstroke.c +"{ObjDir}ftsynth.c.o" \xC4 :src:base:ftsynth.c +"{ObjDir}ftsystem.c.o" \xC4 :src:base:ftsystem.c +"{ObjDir}fttype1.c.o" \xC4 :src:base:fttype1.c +"{ObjDir}ftwinfnt.c.o" \xC4 :src:base:ftwinfnt.c +"{ObjDir}ftcache.c.o" \xC4 :src:cache:ftcache.c +"{ObjDir}bdf.c.o" \xC4 :src:bdf:bdf.c +"{ObjDir}cff.c.o" \xC4 :src:cff:cff.c +"{ObjDir}type1cid.c.o" \xC4 :src:cid:type1cid.c +"{ObjDir}gxvalid.c.o" \xC4 :src:gxvalid:gxvalid.c +"{ObjDir}ftgzip.c.o" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.o" \xC4 :src:bzip2:ftbzip2.c +"{ObjDir}ftlzw.c.o" \xC4 :src:lzw:ftlzw.c +"{ObjDir}otvalid.c.o" \xC4 :src:otvalid:otvalid.c +"{ObjDir}pcf.c.o" \xC4 :src:pcf:pcf.c +"{ObjDir}pfr.c.o" \xC4 :src:pfr:pfr.c +"{ObjDir}psaux.c.o" \xC4 :src:psaux:psaux.c +"{ObjDir}pshinter.c.o" \xC4 :src:pshinter:pshinter.c +"{ObjDir}psmodule.c.o" \xC4 :src:psnames:psmodule.c +"{ObjDir}raster.c.o" \xC4 :src:raster:raster.c +"{ObjDir}sfnt.c.o" \xC4 :src:sfnt:sfnt.c +"{ObjDir}smooth.c.o" \xC4 :src:smooth:smooth.c +"{ObjDir}truetype.c.o" \xC4 :src:truetype:truetype.c +"{ObjDir}type1.c.o" \xC4 :src:type1:type1.c +"{ObjDir}type42.c.o" \xC4 :src:type42:type42.c +"{ObjDir}winfnt.c.o" \xC4 :src:winfonts:winfnt.c + + +### Optional Dependencies ### +### Build this target to generate "include file" dependencies. ### + +Dependencies \xC4 $OutOfDate + MakeDepend \xB6 + -append {MAKEFILE} \xB6 + -ignore "{CIncludes}" \xB6 + -objdir "{ObjDir}" \xB6 + -objext .o \xB6 + {Includes} \xB6 + {SrcFiles} + + diff --git a/vendor/freetype/builds/mac/FreeType.ppc_carbon.make.txt b/vendor/freetype/builds/mac/FreeType.ppc_carbon.make.txt new file mode 100644 index 00000000000..1fa8c307608 --- /dev/null +++ b/vendor/freetype/builds/mac/FreeType.ppc_carbon.make.txt @@ -0,0 +1,212 @@ +# File: FreeType.ppc_carbon.make +# Target: FreeType.ppc_carbon +# Created: Friday, October 28, 2005 03:40:06 PM + + +MAKEFILE = FreeType.ppc_carbon.make +\xA5MondoBuild\xA5 = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified + +ObjDir = :objs: +Includes = \xB6 + -ansi strict \xB6 + -includes unix \xB6 + -i :include: \xB6 + -i :src: \xB6 + -i :include:freetype:config: + +Sym-PPC = -sym off + +PPCCOptions = \xB6 + -d FT_MACINTOSH=1 \xB6 + -d HAVE_FSSPEC=1 \xB6 + -d HAVE_FSREF=1 \xB6 + -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 + -d HAVE_QUICKDRAW_CARBON=1 \xB6 + -d HAVE_ATS=0 \xB6 + -d FT2_BUILD_LIBRARY \xB6 + -d FT_CONFIG_CONFIG_H="" \xB6 + -d FT_CONFIG_MODULES_H="" \xB6 + {Includes} {Sym-PPC} -d TARGET_API_MAC_CARBON=1 + + +### Source Files ### + +SrcFiles = \xB6 + :src:autofit:autofit.c \xB6 + :builds:mac:ftbase.c \xB6 + :src:base:ftbbox.c \xB6 + :src:base:ftbdf.c \xB6 + :src:base:ftbitmap.c \xB6 + :src:base:ftdebug.c \xB6 + :src:base:ftfstype.c \xB6 + :src:base:ftglyph.c \xB6 + :src:base:ftgxval.c \xB6 + :src:base:ftinit.c \xB6 + :src:base:ftmm.c \xB6 + :src:base:ftotval.c \xB6 + :src:base:ftpfr.c \xB6 + :src:base:ftstroke.c \xB6 + :src:base:ftsynth.c \xB6 + :src:base:ftsystem.c \xB6 + :src:base:fttype1.c \xB6 + :src:base:ftwinfnt.c \xB6 + :src:cache:ftcache.c \xB6 + :src:bdf:bdf.c \xB6 + :src:cff:cff.c \xB6 + :src:cid:type1cid.c \xB6 + :src:gxvalid:gxvalid.c \xB6 + :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 + :src:lzw:ftlzw.c \xB6 + :src:otvalid:otvalid.c \xB6 + :src:pcf:pcf.c \xB6 + :src:pfr:pfr.c \xB6 + :src:psaux:psaux.c \xB6 + :src:pshinter:pshinter.c \xB6 + :src:psnames:psmodule.c \xB6 + :src:raster:raster.c \xB6 + :src:sfnt:sfnt.c \xB6 + :src:smooth:smooth.c \xB6 + :src:truetype:truetype.c \xB6 + :src:type1:type1.c \xB6 + :src:type42:type42.c \xB6 + :src:winfonts:winfnt.c + + +### Object Files ### + +ObjFiles-PPC = \xB6 + "{ObjDir}autofit.c.x" \xB6 + "{ObjDir}ftbase.c.x" \xB6 + "{ObjDir}ftbbox.c.x" \xB6 + "{ObjDir}ftbdf.c.x" \xB6 + "{ObjDir}ftbitmap.c.x" \xB6 + "{ObjDir}ftdebug.c.x" \xB6 + "{ObjDir}ftfstype.c.x" \xB6 + "{ObjDir}ftglyph.c.x" \xB6 + "{ObjDir}ftgxval.c.x" \xB6 + "{ObjDir}ftinit.c.x" \xB6 + "{ObjDir}ftmm.c.x" \xB6 + "{ObjDir}ftotval.c.x" \xB6 + "{ObjDir}ftpfr.c.x" \xB6 + "{ObjDir}ftstroke.c.x" \xB6 + "{ObjDir}ftsynth.c.x" \xB6 + "{ObjDir}ftsystem.c.x" \xB6 + "{ObjDir}fttype1.c.x" \xB6 + "{ObjDir}ftwinfnt.c.x" \xB6 + "{ObjDir}ftcache.c.x" \xB6 + "{ObjDir}bdf.c.x" \xB6 + "{ObjDir}cff.c.x" \xB6 + "{ObjDir}type1cid.c.x" \xB6 + "{ObjDir}gxvalid.c.x" \xB6 + "{ObjDir}ftgzip.c.x" \xB6 + "{ObjDir}ftbzip2.c.x" \xB6 + "{ObjDir}ftlzw.c.x" \xB6 + "{ObjDir}otvalid.c.x" \xB6 + "{ObjDir}pcf.c.x" \xB6 + "{ObjDir}pfr.c.x" \xB6 + "{ObjDir}psaux.c.x" \xB6 + "{ObjDir}pshinter.c.x" \xB6 + "{ObjDir}psmodule.c.x" \xB6 + "{ObjDir}raster.c.x" \xB6 + "{ObjDir}sfnt.c.x" \xB6 + "{ObjDir}smooth.c.x" \xB6 + "{ObjDir}truetype.c.x" \xB6 + "{ObjDir}type1.c.x" \xB6 + "{ObjDir}type42.c.x" \xB6 + "{ObjDir}winfnt.c.x" + + +### Libraries ### + +LibFiles-PPC = + + +### Default Rules ### + +.c.x \xC4 .c {\xA5MondoBuild\xA5} + {PPCC} {depDir}{default}.c -o {targDir}{default}.c.x {PPCCOptions} + + +### Build Rules ### + +:builds:mac:ftbase.c \xC4\xC4 :src:base:ftbase.c + Duplicate :src:base:ftbase.c :builds:mac:ftbase.c + +"{ObjDir}ftbase.c.x" \xC4\xC4 :builds:mac:ftbase.c + {PPCC} :builds:mac:ftbase.c -o {ObjDir}ftbase.c.x \xB6 + -i :builds:mac: \xB6 + -i :src:base: \xB6 + {PPCCOptions} + +FreeType.ppc_carbon \xC4\xC4 FreeType.ppc_carbon.o + +FreeType.ppc_carbon.o \xC4\xC4 {ObjFiles-PPC} {LibFiles-PPC} {\xA5MondoBuild\xA5} + PPCLink \xB6 + -o {Targ} \xB6 + {ObjFiles-PPC} \xB6 + {LibFiles-PPC} \xB6 + {Sym-PPC} \xB6 + -mf -d \xB6 + -t 'XCOF' \xB6 + -c 'MPS ' \xB6 + -xm l + + + +### Required Dependencies ### + +"{ObjDir}autofit.c.x" \xC4 :src:autofit:autofit.c +# "{ObjDir}ftbase.c.x" \xC4 :builds:mac:ftbase.c +"{ObjDir}ftbbox.c.x" \xC4 :src:base:ftbbox.c +"{ObjDir}ftbdf.c.x" \xC4 :src:base:ftbdf.c +"{ObjDir}ftbitmap.c.x" \xC4 :src:base:ftbitmap.c +"{ObjDir}ftdebug.c.x" \xC4 :src:base:ftdebug.c +"{ObjDir}ftfstype.c.x" \xC4 :src:base:ftfstype.c +"{ObjDir}ftglyph.c.x" \xC4 :src:base:ftglyph.c +"{ObjDir}ftgxval.c.x" \xC4 :src:base:ftgxval.c +"{ObjDir}ftinit.c.x" \xC4 :src:base:ftinit.c +"{ObjDir}ftmm.c.x" \xC4 :src:base:ftmm.c +"{ObjDir}ftotval.c.x" \xC4 :src:base:ftotval.c +"{ObjDir}ftpfr.c.x" \xC4 :src:base:ftpfr.c +"{ObjDir}ftstroke.c.x" \xC4 :src:base:ftstroke.c +"{ObjDir}ftsynth.c.x" \xC4 :src:base:ftsynth.c +"{ObjDir}ftsystem.c.x" \xC4 :src:base:ftsystem.c +"{ObjDir}fttype1.c.x" \xC4 :src:base:fttype1.c +"{ObjDir}ftwinfnt.c.x" \xC4 :src:base:ftwinfnt.c +"{ObjDir}ftcache.c.x" \xC4 :src:cache:ftcache.c +"{ObjDir}bdf.c.x" \xC4 :src:bdf:bdf.c +"{ObjDir}cff.c.x" \xC4 :src:cff:cff.c +"{ObjDir}type1cid.c.x" \xC4 :src:cid:type1cid.c +"{ObjDir}gxvalid.c.x" \xC4 :src:gxvalid:gxvalid.c +"{ObjDir}ftgzip.c.x" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.x" \xC4 :src:bzip2:ftbzip2.c +"{ObjDir}ftlzw.c.x" \xC4 :src:lzw:ftlzw.c +"{ObjDir}otvalid.c.x" \xC4 :src:otvalid:otvalid.c +"{ObjDir}pcf.c.x" \xC4 :src:pcf:pcf.c +"{ObjDir}pfr.c.x" \xC4 :src:pfr:pfr.c +"{ObjDir}psaux.c.x" \xC4 :src:psaux:psaux.c +"{ObjDir}pshinter.c.x" \xC4 :src:pshinter:pshinter.c +"{ObjDir}psmodule.c.x" \xC4 :src:psnames:psmodule.c +"{ObjDir}raster.c.x" \xC4 :src:raster:raster.c +"{ObjDir}sfnt.c.x" \xC4 :src:sfnt:sfnt.c +"{ObjDir}smooth.c.x" \xC4 :src:smooth:smooth.c +"{ObjDir}truetype.c.x" \xC4 :src:truetype:truetype.c +"{ObjDir}type1.c.x" \xC4 :src:type1:type1.c +"{ObjDir}type42.c.x" \xC4 :src:type42:type42.c +"{ObjDir}winfnt.c.x" \xC4 :src:winfonts:winfnt.c + + +### Optional Dependencies ### +### Build this target to generate "include file" dependencies. ### + +Dependencies \xC4 $OutOfDate + MakeDepend \xB6 + -append {MAKEFILE} \xB6 + -ignore "{CIncludes}" \xB6 + -objdir "{ObjDir}" \xB6 + -objext .x \xB6 + {Includes} \xB6 + {SrcFiles} + + diff --git a/vendor/freetype/builds/mac/FreeType.ppc_classic.make.txt b/vendor/freetype/builds/mac/FreeType.ppc_classic.make.txt new file mode 100644 index 00000000000..2550190cbf4 --- /dev/null +++ b/vendor/freetype/builds/mac/FreeType.ppc_classic.make.txt @@ -0,0 +1,213 @@ +# File: FreeType.ppc_classic.make +# Target: FreeType.ppc_classic +# Created: Thursday, October 27, 2005 07:42:43 PM + + +MAKEFILE = FreeType.ppc_classic.make +\xA5MondoBuild\xA5 = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified + +ObjDir = :objs: +Includes = \xB6 + -ansi strict \xB6 + -includes unix \xB6 + -i :include: \xB6 + -i :src: \xB6 + -i :include:freetype:config: + +Sym-PPC = -sym off + +PPCCOptions = \xB6 + -d FT_MACINTOSH=1 \xB6 + -d HAVE_FSSPEC=1 \xB6 + -d HAVE_FSREF=0 \xB6 + -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 + -d HAVE_QUICKDRAW_CARBON=0 \xB6 + -d HAVE_ATS=0 \xB6 + -d FT2_BUILD_LIBRARY \xB6 + -d FT_CONFIG_CONFIG_H="" \xB6 + -d FT_CONFIG_MODULES_H="" \xB6 + {Includes} {Sym-PPC} + + +### Source Files ### + +SrcFiles = \xB6 + :src:autofit:autofit.c \xB6 + :builds:mac:ftbase.c \xB6 + :src:base:ftbbox.c \xB6 + :src:base:ftbdf.c \xB6 + :src:base:ftbitmap.c \xB6 + :src:base:ftdebug.c \xB6 + :src:base:ftfstype.c \xB6 + :src:base:ftglyph.c \xB6 + :src:base:ftgxval.c \xB6 + :src:base:ftinit.c \xB6 + :src:base:ftmm.c \xB6 + :src:base:ftotval.c \xB6 + :src:base:ftpfr.c \xB6 + :src:base:ftstroke.c \xB6 + :src:base:ftsynth.c \xB6 + :src:base:ftsystem.c \xB6 + :src:base:fttype1.c \xB6 + :src:base:ftwinfnt.c \xB6 + :src:cache:ftcache.c \xB6 + :src:bdf:bdf.c \xB6 + :src:cff:cff.c \xB6 + :src:cid:type1cid.c \xB6 + :src:gxvalid:gxvalid.c \xB6 + :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 + :src:lzw:ftlzw.c \xB6 + :src:otvalid:otvalid.c \xB6 + :src:pcf:pcf.c \xB6 + :src:pfr:pfr.c \xB6 + :src:psaux:psaux.c \xB6 + :src:pshinter:pshinter.c \xB6 + :src:psnames:psmodule.c \xB6 + :src:raster:raster.c \xB6 + :src:sfnt:sfnt.c \xB6 + :src:smooth:smooth.c \xB6 + :src:truetype:truetype.c \xB6 + :src:type1:type1.c \xB6 + :src:type42:type42.c \xB6 + :src:winfonts:winfnt.c + + +### Object Files ### + +ObjFiles-PPC = \xB6 + "{ObjDir}autofit.c.x" \xB6 + "{ObjDir}ftbase.c.x" \xB6 + "{ObjDir}ftbbox.c.x" \xB6 + "{ObjDir}ftbdf.c.x" \xB6 + "{ObjDir}ftbitmap.c.x" \xB6 + "{ObjDir}ftdebug.c.x" \xB6 + "{ObjDir}ftfstype.c.x" \xB6 + "{ObjDir}ftglyph.c.x" \xB6 + "{ObjDir}ftgxval.c.x" \xB6 + "{ObjDir}ftinit.c.x" \xB6 + "{ObjDir}ftmm.c.x" \xB6 + "{ObjDir}ftotval.c.x" \xB6 + "{ObjDir}ftpfr.c.x" \xB6 + "{ObjDir}ftstroke.c.x" \xB6 + "{ObjDir}ftsynth.c.x" \xB6 + "{ObjDir}ftsystem.c.x" \xB6 + "{ObjDir}fttype1.c.x" \xB6 + "{ObjDir}ftwinfnt.c.x" \xB6 + "{ObjDir}ftcache.c.x" \xB6 + "{ObjDir}bdf.c.x" \xB6 + "{ObjDir}cff.c.x" \xB6 + "{ObjDir}type1cid.c.x" \xB6 + "{ObjDir}gxvalid.c.x" \xB6 + "{ObjDir}ftgzip.c.x" \xB6 + "{ObjDir}ftbzip2.c.x" \xB6 + "{ObjDir}ftlzw.c.x" \xB6 + "{ObjDir}otvalid.c.x" \xB6 + "{ObjDir}pcf.c.x" \xB6 + "{ObjDir}pfr.c.x" \xB6 + "{ObjDir}psaux.c.x" \xB6 + "{ObjDir}pshinter.c.x" \xB6 + "{ObjDir}psmodule.c.x" \xB6 + "{ObjDir}raster.c.x" \xB6 + "{ObjDir}sfnt.c.x" \xB6 + "{ObjDir}smooth.c.x" \xB6 + "{ObjDir}truetype.c.x" \xB6 + "{ObjDir}type1.c.x" \xB6 + "{ObjDir}type42.c.x" \xB6 + "{ObjDir}winfnt.c.x" + + +### Libraries ### + +LibFiles-PPC = + + +### Default Rules ### + +.c.x \xC4 .c {\xA5MondoBuild\xA5} + {PPCC} {depDir}{default}.c -o {targDir}{default}.c.x {PPCCOptions} + + +### Build Rules ### + +:builds:mac:ftbase.c \xC4\xC4 :src:base:ftbase.c + Duplicate :src:base:ftbase.c :builds:mac:ftbase.c + +"{ObjDir}ftbase.c.x" \xC4\xC4 :builds:mac:ftbase.c + {PPCC} :builds:mac:ftbase.c -o "{ObjDir}ftbase.c.x" \xB6 + -i :builds:mac: \xB6 + -i :src:base: \xB6 + {PPCCOptions} + +FreeType.ppc_classic \xC4\xC4 FreeType.ppc_classic.o + +FreeType.ppc_classic.o \xC4\xC4 {ObjFiles-PPC} {LibFiles-PPC} {\xA5MondoBuild\xA5} + PPCLink \xB6 + -o {Targ} \xB6 + {ObjFiles-PPC} \xB6 + {LibFiles-PPC} \xB6 + {Sym-PPC} \xB6 + -mf -d \xB6 + -t 'XCOF' \xB6 + -c 'MPS ' \xB6 + -xm l + + + +### Required Dependencies ### + +"{ObjDir}autofit.c.x" \xC4 :src:autofit:autofit.c +# "{ObjDir}ftbase.c.x" \xC4 :builds:mac:ftbase.c +"{ObjDir}ftbbox.c.x" \xC4 :src:base:ftbbox.c +"{ObjDir}ftbdf.c.x" \xC4 :src:base:ftbdf.c +"{ObjDir}ftbitmap.c.x" \xC4 :src:base:ftbitmap.c +"{ObjDir}ftdebug.c.x" \xC4 :src:base:ftdebug.c +"{ObjDir}ftfstype.c.x" \xC4 :src:base:ftfstype.c +"{ObjDir}ftglyph.c.x" \xC4 :src:base:ftglyph.c +"{ObjDir}ftgxval.c.x" \xC4 :src:base:ftgxval.c +"{ObjDir}ftinit.c.x" \xC4 :src:base:ftinit.c +"{ObjDir}ftmm.c.x" \xC4 :src:base:ftmm.c +"{ObjDir}ftotval.c.x" \xC4 :src:base:ftotval.c +"{ObjDir}ftpfr.c.x" \xC4 :src:base:ftpfr.c +"{ObjDir}ftstroke.c.x" \xC4 :src:base:ftstroke.c +"{ObjDir}ftsynth.c.x" \xC4 :src:base:ftsynth.c +"{ObjDir}ftsystem.c.x" \xC4 :src:base:ftsystem.c +"{ObjDir}fttype1.c.x" \xC4 :src:base:fttype1.c +"{ObjDir}ftwinfnt.c.x" \xC4 :src:base:ftwinfnt.c +"{ObjDir}ftcache.c.x" \xC4 :src:cache:ftcache.c +"{ObjDir}bdf.c.x" \xC4 :src:bdf:bdf.c +"{ObjDir}cff.c.x" \xC4 :src:cff:cff.c +"{ObjDir}type1cid.c.x" \xC4 :src:cid:type1cid.c +"{ObjDir}gxvalid.c.x" \xC4 :src:gxvalid:gxvalid.c +"{ObjDir}ftgzip.c.x" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.x" \xC4 :src:bzip2:ftbzip2.c +"{ObjDir}ftlzw.c.x" \xC4 :src:lzw:ftlzw.c +"{ObjDir}otvalid.c.x" \xC4 :src:otvalid:otvalid.c +"{ObjDir}pcf.c.x" \xC4 :src:pcf:pcf.c +"{ObjDir}pfr.c.x" \xC4 :src:pfr:pfr.c +"{ObjDir}psaux.c.x" \xC4 :src:psaux:psaux.c +"{ObjDir}pshinter.c.x" \xC4 :src:pshinter:pshinter.c +"{ObjDir}psmodule.c.x" \xC4 :src:psnames:psmodule.c +"{ObjDir}raster.c.x" \xC4 :src:raster:raster.c +"{ObjDir}sfnt.c.x" \xC4 :src:sfnt:sfnt.c +"{ObjDir}smooth.c.x" \xC4 :src:smooth:smooth.c +"{ObjDir}truetype.c.x" \xC4 :src:truetype:truetype.c +"{ObjDir}type1.c.x" \xC4 :src:type1:type1.c +"{ObjDir}type42.c.x" \xC4 :src:type42:type42.c +"{ObjDir}winfnt.c.x" \xC4 :src:winfonts:winfnt.c + + + +### Optional Dependencies ### +### Build this target to generate "include file" dependencies. ### + +Dependencies \xC4 $OutOfDate + MakeDepend \xB6 + -append {MAKEFILE} \xB6 + -ignore "{CIncludes}" \xB6 + -objdir "{ObjDir}" \xB6 + -objext .x \xB6 + {Includes} \xB6 + {SrcFiles} + + diff --git a/vendor/freetype/builds/mac/README b/vendor/freetype/builds/mac/README new file mode 100644 index 00000000000..06e3d51da86 --- /dev/null +++ b/vendor/freetype/builds/mac/README @@ -0,0 +1,393 @@ +This folder contains + + * Makefile skeletons for Apple MPW (Macintosh's Programmer's Workshop) + + * Python script to generate MPW makefile from skeleton + + * Metrowerks CodeWarrior 9.0 project file in XML format + +------------------------------------------------------------ + +1. What is this +--------------- + +Files in this directory are designed to build FreeType +running on classic MacOS. To build FreeType running on +Mac OS X, build as the system is UNIX. + +However, Mac OS X is most useful to manipulate files in +vanilla FreeType to fit classic MacOS. + +The information about MacOS specific API is written in +appendix of this document. + +2. Requirement +-------------- + +You can use MPW: a free-charged developer environment +by Apple, or CodeWarrior: a commercial developer +environment by Metrowerks. GCC for MPW and Symantec +"Think C" are not tested at present. + + + 2-1. Apple MPW + -------------- + + Following C compilers are tested: + + m68k target: Apple SC 8.9.0d3e1 + ppc target: Apple MrC 5.0.0d3c1 + + The final MPW-GM (official release on 1999/Dec) is too + old and cannot compile FreeType, because bundled C + compilers cannot search header files in sub directories. + Updating by the final MPW-PR (pre-release on 2001/Feb) + is required. + + Required files are downloadable from: + + http://macintoshgarden.org/apps/macintosh-programmers-workshop + + Also you can find documents how to update by MPW-PR. + + Python is required to restore MPW makefiles from the + skeletons. Python bundled to Mac OS X is enough. For + classic MacOS, MacPython is available: + + https://homepages.cwi.nl/~jack/macpython/ + + MPW requires all files are typed by resource fork. + ResEdit bundled to MPW is enough. In Mac OS X, + /Developer/Tools/SetFile of DevTool is useful to + manipulate from commandline. + + 2-2. Metrowerks CodeWarrior + --------------------------- + + XML project file is generated and tested by + CodeWarrior 9.0. Older versions are not tested + at all. At present, static library for ppc target + is available in the project file. + + +3. How to build +--------------- + + 3-1. Apple MPW + -------------- + Detailed building procedure by Apple MPW is + described in following. + + 3-1-1. Generate MPW makefiles from the skeletons + ------------------------------------------------ + + Here are 4 skeletons for following targets are + included. + + - FreeType.m68k_far.make.txt + Ancient 32bit binary executable format for + m68k MacOS: System 6, with 32bit addressing + mode (far-pointer-model) So-called "Toolbox" + API is used. + + - FreeType.m68k_cfm.make.txt + CFM binary executable format for m68k MacOS: + System 7. So-called "Toolbox" API is used. + + - FreeType.ppc_classic.make.txt + CFM binary executable format for ppc MacOS: + System 7, MacOS 8, MacOS 9. So-called "Toolbox" + API is used. + + - FreeType.ppc_carbon.make.txt + CFM binary executable format for ppc MacOS: + MacOS 9. Carbon API is used. + + At present, static library is only supported, + although targets except of m68k_far are capable + to use shared library. + + MPW makefile syntax uses 8bit characters. To keep + from violating them during version control, here + we store skeletons in pure ASCII format. You must + generate MPW makefile by Python script ascii2mpw.py. + + In Mac OS X terminal, you can convert as: + + python builds/mac/ascii2mpw.py \ + < builds/mac/FreeType.m68k_far.make.txt \ + > FreeType.m68k_far.make + + The skeletons are designed to use in the top + directory where there are builds, include, src etc. + You must name the generated MPW makefile by removing + ".txt" from source skeleton name. + + 3-1-2. Add resource forks to related files + ------------------------------------------ + + MPW's Make and C compilers cannot recognize files + without resource fork. You have to add resource + fork to the files that MPW uses. In Mac OS X + terminal of the system, you can do as: + + find . -name '*.[ch]' -exec \ + /Developer/Tools/SetFile -a l -c "MPS " -t TEXT \{\} \; + + find . -name '*.make' -exec \ + /Developer/Tools/SetFile -a l -c "MPS " -t TEXT \{\} \; + + + 3-1-3. Open MPW shell and build + ------------------------------- + + Open MPW shell and go to the top directory that + FreeType sources are extracted (MPW makefile must + be located in there), from "Set Directory" in + "Directory" menu. + + Choose "Build" from "Build" menu, and type the + name of project by removing ".make" from MPW + makefile, as: FreeType.m68k_far + + If building is successfully finished, you can find + built library in objs/ directory. + + + 3-2. Metrowerks CodeWarrior + --------------------------- + + Detailed building procedure by Metrowerks + CodeWarrior (CW) 9.0 is described in following. + + 3-2-1. Import XML project file + ------------------------------ + + CW XML project file is not ready for double- + click. Start CodeWarrior IDE, and choose + "Import project" in "File" menu. Choose XML + project file: builds/mac/ftlib.prj.xml. + In next, you will be asked where to save CW + native project file: you must choose + "builds/mac/ftlib.prj". The project file is + designed with relative path from there. After + CW native project file is generated, it is + automatically loaded, small project window + titled "ftlib.prj" is displayed. + + 3-2-2. Building + --------------- + Choose "Make" from "Project" menu. If building + is successfully finished, you can find built + library at objs/FreeTypeLib. + +4. TODO +------- + + 4-1. All modules should be included + ----------------------------------- + + At present, MPW makefiles and CW project file are + just updated versions of these by Leonard. Some + modules are added after the last maintenance, they + are not included. + + 4-2. Working test with ftdemos + ------------------------------ + + At present, MPW makefiles and CW project file can + build FreeType for classic MacOS. But their working + behaviours are not tested at all. Building ftdemos + for classic MacOS and working test is required. + + +APPENDIX I +---------- + + A-1. Framework dependencies + --------------------------- + + src/base/ftmac.c adds two Mac-specific features to + FreeType. These features are based on MacOS libraries. + + * accessing resource-fork font + The fonts for classic MacOS store their graphical data + in resource forks which cannot be accessed via ANSI C + functions. FreeType2 provides functions to handle such + resource fork fonts, they are based on File Manager + framework of MacOS. In addition, HFS and HFS+ file + system driver of Linux is supported. Following + functions are for this purpose. + + FT_New_Face_From_Resource() + FT_New_Face_From_FSSpec() + FT_New_Face_From_FSRef() + + * resolving font name to font file + The font menu of MacOS application prefers font name + written in FOND resource than sfnt resource. FreeType2 + provides functions to find font file by name in MacOS + application, they are based on QuickDraw Font Manager + and Apple Type Service framework of MacOS. + + FT_GetFile_From_Mac_Name() + FT_GetFile_From_Mac_ATS_Name() + + Working functions for each MacOS are summarized as + following. + + upto MacOS 6: + not tested (you have to obtain MPW 2.x) + + MacOS 7.x, 8.x, 9.x (without CarbonLib): + FT_GetFile_From_Mac_Name() + FT_New_Face_From_Resource() + FT_New_Face_From_FSSpec() + + MacOS 9.x (with CarbonLib): + FT_GetFile_From_Mac_Name() + FT_New_Face_From_Resource() + FT_New_Face_From_FSSpec() + FT_New_Face_From_FSRef() + + Mac OS X upto 10.4.x: + FT_GetFile_From_Mac_Name() deprecated + FT_New_Face_From_FSSpec() deprecated + FT_GetFile_From_Mac_ATS_Name() deprecated? + FT_New_Face_From_FSRef() + + A-2. Deprecated Functions + ------------------------- + + A-2-1. FileManager + ------------------ + + For convenience to write MacOS application, ftmac.c + provides functions to specify a file by FSSpec and FSRef, + because the file identification pathname had ever been + unrecommended method in MacOS programming. + + Toward to MacOS X 10.4 & 5, Carbon functions using FSSpec + datatype is noticed as deprecated, and recommended to + migrate to FSRef datatype. The big differences of FSRef + against FSSpec are explained in Apple TechNotes 2078. + + https://developer.apple.com/library/archive/technotes/tn2078/ + + - filename length: the max length of file + name of FSRef is 255 chars (it is limit of HFS+), + that of FSSpec is 31 chars (it is limit of HFS). + + - filename encoding: FSSpec is localized by + legacy encoding for each language system, + FSRef is Unicode enabled. + + A-2-2. FontManager + ------------------ + + Following functions receive QuickDraw fontname: + + FT_GetFile_From_Mac_Name() + + QuickDraw is deprecated and replaced by Quartz + since Mac OS X 10.4. They are still kept for + backward compatibility. By undefinition of + HAVE_QUICKDRAW in building, you can change these + functions to return FT_Err_Unimplemented always. + + Replacement functions are added for migration. + + FT_GetFile_From_Mac_ATS_Name() + + They are usable on Mac OS X only. On older systems, + these functions return FT_Err_Unimplemented always. + + The detailed incompatibilities and possibility + of FontManager emulation without QuickDraw is + explained in + + http://gyvern.ipc.hiroshima-u.ac.jp/~mpsuzuki/ats_benchmark.html + + A-3. Framework Availabilities + ----------------------------- + + The framework of MacOS are often revised, especially + when new format of binary executable is introduced. + Following table is the minimum version of frameworks + to use functions used in FreeType2. The table is + extracted from MPW header files for assembly language. + + *** NOTE *** + The conditional definition of available data type + in MPW compiler is insufficient. You can compile + program using FSRef data type for older systems + (MacOS 7, 8) that don't know FSRef data type. + + + +-------------------+-----------------------------+ + CPU | mc680x0 | PowerPC | + +---------+---------+---------+---------+---------+ + Binary Executable Format | Classic | 68K-CFM | CFM | CFM | Mach-O | + +---------+---------+---------+---------+---------+ + Framework API | Toolbox | Toolbox | Toolbox | Carbon | Carbon | + +---------+---------+---------+---------+---------+ + + +---------+---------+---------+---------+---------+ + | ?(*) |Interface|Interface|CarbonLib|Mac OS X | + | |Lib |Lib | | | +* Files.h +---------+---------+---------+---------+---------+ +PBGetFCBInfoSync() | o | 7.1- | 7.1- | 1.0- | o | +FSMakeFSSpec() | o | 7.1- | 7.1- | 1.0- | o | +FSGetForkCBInfo() | o | (**) | 9.0- | 1.0- | o | +FSpMakeFSRef() | o | (**) | 9.0- | 1.0- | o | +FSGetCatalogInfo() | o | (**) | 9.0- | 1.0- | -10.3 | +FSPathMakeRef() | x | x | x | 1.1- | -10.3 | + +---------+---------+---------+---------+---------+ + + +---------+---------+---------+---------+---------+ + | ?(*) |Font |Font |CarbonLib|Mac OS X | + | |Manager |Manager | | | +* Fonts.h +---------+---------+---------+---------+---------+ +FMCreateFontFamilyIterator() | x | x | 9.0- | 1.0- | -10.3 | +FMDisposeFontFamilyIterator() | x | x | 9.0- | 1.0- | -10.3 | +FMGetNextFontFamily() | x | x | 9.0- | 1.0- | -10.3 | +FMGetFontFamilyName() | x | x | 9.0- | 1.0- | -10.3 | +FMCreateFontFamilyInstanceIterator() | x | x | 9.0- | 1.0- | -10.3 | +FMDisposeFontFamilyInstanceIterator() | x | x | 9.0- | 1.0- | -10.3 | +FMGetNextFontFamilyInstance() | x | x | 9.0- | 1.0- | -10.3 | + +---------+---------+---------+---------+---------+ + + +---------+---------+---------+---------+---------+ + | - | - | - |CarbonLib|Mac OS X | +* ATSFont.h (***) +---------+---------+---------+---------+---------+ +ATSFontFindFromName() | x | x | x | x | o | +ATSFontGetFileSpecification() | x | x | x | x | o | + +---------+---------+---------+---------+---------+ + + (*) + In the "Classic": the original binary executable + format, these framework functions are directly + transformed to MacOS system call. Therefore, the + exact availability should be checked by running + system. + + (**) + InterfaceLib is bundled to MacOS and its version + is usually equal to MacOS. There's no separate + update for InterfaceLib. It is supposed that + there's no InterfaceLib 9.x for m68k platforms. + In fact, these functions are FSRef dependent. + + (***) + ATSUI framework is available on ATSUnicode 8.5 on + ppc Toolbox CFM, CarbonLib 1.0 too. But its base: + ATS font manager is not published in these versions. + +------------------------------------------------------------ +Last update: 2013-Nov-03. + +Currently maintained by + suzuki toshiya, +Originally prepared by + Leonard Rosenthol, + Just van Rossum, diff --git a/vendor/freetype/builds/mac/ascii2mpw.py b/vendor/freetype/builds/mac/ascii2mpw.py new file mode 100644 index 00000000000..ad32b219772 --- /dev/null +++ b/vendor/freetype/builds/mac/ascii2mpw.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +import sys +import string + +if len( sys.argv ) == 1 : + for asc_line in sys.stdin.readlines(): + mpw_line = string.replace(asc_line, "\\xA5", "\245") + mpw_line = string.replace(mpw_line, "\\xB6", "\266") + mpw_line = string.replace(mpw_line, "\\xC4", "\304") + mpw_line = string.replace(mpw_line, "\\xC5", "\305") + mpw_line = string.replace(mpw_line, "\\xFF", "\377") + mpw_line = string.replace(mpw_line, "\n", "\r") + mpw_line = string.replace(mpw_line, "\\n", "\n") + sys.stdout.write(mpw_line) +elif sys.argv[1] == "-r" : + for mpw_line in sys.stdin.readlines(): + asc_line = string.replace(mpw_line, "\n", "\\n") + asc_line = string.replace(asc_line, "\r", "\n") + asc_line = string.replace(asc_line, "\245", "\\xA5") + asc_line = string.replace(asc_line, "\266", "\\xB6") + asc_line = string.replace(asc_line, "\304", "\\xC4") + asc_line = string.replace(asc_line, "\305", "\\xC5") + asc_line = string.replace(asc_line, "\377", "\\xFF") + sys.stdout.write(asc_line) diff --git a/vendor/freetype/builds/mac/freetype-Info.plist b/vendor/freetype/builds/mac/freetype-Info.plist new file mode 100644 index 00000000000..344e5ac0b3a --- /dev/null +++ b/vendor/freetype/builds/mac/freetype-Info.plist @@ -0,0 +1,36 @@ + + + + + + + CFBundleDevelopmentRegion + English + + CFBundleExecutable + freetype + + CFBundleGetInfoString + FreeType ${PROJECT_VERSION} + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleName + FreeType + + CFBundlePackageType + FMWK + + CFBundleShortVersionString + ${PROJECT_VERSION} + + CFBundleSignature + ???? + + CFBundleVersion + ${PROJECT_VERSION} + + + diff --git a/vendor/freetype/builds/mac/ftlib.prj.xml b/vendor/freetype/builds/mac/ftlib.prj.xml new file mode 100644 index 00000000000..cbbc45ee55c --- /dev/null +++ b/vendor/freetype/builds/mac/ftlib.prj.xml @@ -0,0 +1,1194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + FreeTypeLib + + + + UserSourceTrees + + + AlwaysSearchUserPathstrue + InterpretDOSAndUnixPathstrue + RequireFrameworkStyleIncludesfalse + SourceRelativeIncludesfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::include: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::src: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine + MWRuntimeSettings_HostApplication + Path + PathFormatGeneric + PathRootAbsolute + + MWRuntimeSettings_EnvVars + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameFreeTypeLib + OutputDirectory + Path:::objs: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal PPC + EditLanguage + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + EditLanguageRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + FileExtension.o + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.ppob + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileExtension.rsrc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + + + CacheModDatestrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + BrowserGenerator1 + DebuggerAppPath + Path + PathFormatGeneric + PathRootAbsolute + + DebuggerCmdLineArgs + DebuggerWorkingDir + Path + PathFormatGeneric + PathRootAbsolute + + CodeCompletionPrefixFileNameMacHeaders.c + CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h + + + ConsoleEncoding0 + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPType0 + + + Enabledfalse + ConnectionName + DownloadPath + LaunchRemoteAppfalse + RemoteAppPath + CoreID0 + JTAGClockSpeed8000 + IsMultiCorefalse + OSDownloadfalse + UseGlobalOSDownloadfalse + OSDownloadConnectionName + OSDownloadPath + AltDownloadfalse + AltDownloadConnectionName + + + OtherExecutables + + + AnalyzerConnectionName + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions1 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI1 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_defer_codegen0 + MWFrontEnd_C_templateparser0 + MWFrontEnd_C_c990 + MWFrontEnd_C_bottomupinline1 + MWFrontEnd_C_gcc_extensions0 + MWFrontEnd_C_instance_manager0 + + + C_CPP_Preprocessor_EmitFiletrue + C_CPP_Preprocessor_EmitLinefalse + C_CPP_Preprocessor_EmitFullPathfalse + C_CPP_Preprocessor_KeepCommentsfalse + C_CPP_Preprocessor_PCHUsesPrefixTextfalse + C_CPP_Preprocessor_EmitPragmastrue + C_CPP_Preprocessor_KeepWhiteSpacefalse + C_CPP_Preprocessor_MultiByteEncodingencASCII_Unicode + C_CPP_Preprocessor_PrefixText/* settings imported from old "C/C++ Language" panel */ + +#if !__option(precompile) +#include "ftoption.h" /* was "Prefix file" */ +#endif + + + + MWWarning_C_warn_illpragma0 + MWWarning_C_warn_emptydecl0 + MWWarning_C_warn_possunwant0 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma0 + MWWarning_C_pedantic0 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual0 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + MWWarning_C_warn_missingreturn0 + MWWarning_C_warn_no_side_effect0 + MWWarning_C_warn_resultnotused0 + MWWarning_C_warn_padding0 + MWWarning_C_warn_impl_i2f_conv0 + MWWarning_C_warn_impl_f2i_conv0 + MWWarning_C_warn_impl_s2u_conv0 + MWWarning_C_warn_illtokenpasting0 + MWWarning_C_warn_filenamecaps0 + MWWarning_C_warn_filenamecapssystem0 + MWWarning_C_warn_undefmacro0 + MWWarning_C_warn_ptrintconv0 + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator???? + MWMerge_MacOS_outputTypeAPPL + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_flattenResource0 + MWMerge_MacOS_flatFileNamea.rsrc + MWMerge_MacOS_flatFileOutputPath + Path: + PathFormatMacOS + PathRootProject + + MWMerge_MacOS_skipResources + DLGX + ckid + Proj + WSPC + + + + FileLockedfalse + ResourcesMapIsReadOnlyfalse + PrinterDriverIsMultiFinderCompatiblefalse + Invisiblefalse + HasBundlefalse + NameLockedfalse + Stationeryfalse + HasCustomIconfalse + Sharedfalse + HasBeenInitedfalse + Label0 + Comments + HasCustomBadgefalse + HasRoutingInfofalse + + + MWCodeGen_PPC_structalignmentPPC_mw + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_function_align4 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_largetoc0 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_poolconst0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_linkerpoolsstrings0 + MWCodeGen_PPC_volatileasm0 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_altivec_move_block0 + MWCodeGen_PPC_strictIEEEfp0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_genfsel0 + MWCodeGen_PPC_orderedfpcmp0 + + + MWCodeGen_MachO_structalignmentPPC_mw + MWCodeGen_MachO_profiler_enumOff + MWCodeGen_MachO_processorGeneric + MWCodeGen_MachO_function_align4 + MWCodeGen_MachO_common0 + MWCodeGen_MachO_boolisint0 + MWCodeGen_MachO_peephole1 + MWCodeGen_MachO_readonlystrings0 + MWCodeGen_MachO_linkerpoolsstrings1 + MWCodeGen_MachO_volatileasm0 + MWCodeGen_MachO_schedule0 + MWCodeGen_MachO_altivec0 + MWCodeGen_MachO_vecmove0 + MWCodeGen_MachO_fp_ieee_strict0 + MWCodeGen_MachO_fpcontract1 + MWCodeGen_MachO_genfsel0 + MWCodeGen_MachO_fp_cmps_ordered0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_code_foldingNone + MWLinker_PPC_initname + MWLinker_PPC_mainname + MWLinker_PPC_termname + + + MWLinker_MacOSX_linksym1 + MWLinker_MacOSX_symfullpath0 + MWLinker_MacOSX_nolinkwarnings0 + MWLinker_MacOSX_linkmap0 + MWLinker_MacOSX_dontdeadstripinitcode0 + MWLinker_MacOSX_permitmultdefs0 + MWLinker_MacOSX_use_objectivec_semantics0 + MWLinker_MacOSX_strip_debug_symbols0 + MWLinker_MacOSX_split_segs0 + MWLinker_MacOSX_report_msl_overloads0 + MWLinker_MacOSX_objects_follow_linkorder0 + MWLinker_MacOSX_linkmodeNormal + MWLinker_MacOSX_exportsReferencedGlobals + MWLinker_MacOSX_sortcodeNone + MWLinker_MacOSX_mainname + MWLinker_MacOSX_initname + MWLinker_MacOSX_code_foldingNone + MWLinker_MacOSX_stabsgenNone + + + MWProject_MacOSX_typeExecutable + MWProject_MacOSX_outfile + MWProject_MacOSX_filecreator???? + MWProject_MacOSX_filetypeMEXE + MWProject_MacOSX_vmaddress4096 + MWProject_MacOSX_usedefaultvmaddr1 + MWProject_MacOSX_flatrsrc0 + MWProject_MacOSX_flatrsrcfilename + MWProject_MacOSX_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_MacOSX_installpath./ + MWProject_MacOSX_dont_prebind0 + MWProject_MacOSX_flat_namespace0 + MWProject_MacOSX_frameworkversionA + MWProject_MacOSX_currentversion0 + MWProject_MacOSX_flat_oldimpversion0 + MWProject_MacOSX_AddrMode1 + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeLibrary + MWProject_PPC_outfileFreeTypeLib + MWProject_PPC_filecreator???? + MWProject_PPC_filetype???? + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype???? + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + MWProject_PPC_flatrsrc0 + MWProject_PPC_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_PPC_flatrsrcfilename + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + PList_OutputTypeFile + PList_OutputEncodingUTF-8 + PList_PListVersion1.0 + PList_Prefix + PList_FileFilenameInfo.plist + PList_FileDirectory + Path: + PathFormatMacOS + PathRootProject + + PList_ResourceTypeplst + PList_ResourceID0 + PList_ResourceName + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + ftsystem.c + MacOS + Text + Debug + + + Name + ftbase.c + MacOS + Text + Debug + + + Name + ftinit.c + MacOS + Text + Debug + + + Name + sfnt.c + MacOS + Text + Debug + + + Name + psnames.c + MacOS + Text + Debug + + + Name + ftdebug.c + MacOS + Text + Debug + + + Name + type1cid.c + MacOS + Text + Debug + + + Name + cff.c + MacOS + Text + Debug + + + Name + smooth.c + MacOS + Text + Debug + + + Name + winfnt.c + MacOS + Text + Debug + + + Name + truetype.c + MacOS + Text + Debug + + + Name + ftmac.c + MacOS + Text + Debug + + + Name + psaux.c + MacOS + Text + + + + Name + ftcache.c + MacOS + Text + + + + Name + ftglyph.c + MacOS + Text + + + + Name + type1.c + MacOS + Text + Debug + + + Name + pshinter.c + MacOS + Text + Debug + + + Name + pcf.c + MacOS + Text + Debug + + + Name + ftraster.c + MacOS + Text + Debug + + + Name + ftrend1.c + MacOS + Text + Debug + + + + + Name + ftsystem.c + MacOS + + + Name + ftbase.c + MacOS + + + Name + ftinit.c + MacOS + + + Name + sfnt.c + MacOS + + + Name + psnames.c + MacOS + + + Name + ftdebug.c + MacOS + + + Name + type1cid.c + MacOS + + + Name + cff.c + MacOS + + + Name + smooth.c + MacOS + + + Name + winfnt.c + MacOS + + + Name + truetype.c + MacOS + + + Name + ftmac.c + MacOS + + + Name + psaux.c + MacOS + + + Name + ftcache.c + MacOS + + + Name + ftglyph.c + MacOS + + + Name + type1.c + MacOS + + + Name + pshinter.c + MacOS + + + Name + pcf.c + MacOS + + + Name + ftraster.c + MacOS + + + Name + ftrend1.c + MacOS + + + + + + + FreeTypeLib + + + + base + + FreeTypeLib + Name + ftbase.c + MacOS + + + FreeTypeLib + Name + ftdebug.c + MacOS + + + FreeTypeLib + Name + ftglyph.c + MacOS + + + FreeTypeLib + Name + ftinit.c + MacOS + + + FreeTypeLib + Name + ftsystem.c + MacOS + + + FreeTypeLib + Name + ftmac.c + MacOS + + + ftmodules + + FreeTypeLib + Name + cff.c + MacOS + + + FreeTypeLib + Name + ftcache.c + MacOS + + + FreeTypeLib + Name + psaux.c + MacOS + + + FreeTypeLib + Name + psnames.c + MacOS + + + FreeTypeLib + Name + sfnt.c + MacOS + + + FreeTypeLib + Name + smooth.c + MacOS + + + FreeTypeLib + Name + truetype.c + MacOS + + + FreeTypeLib + Name + type1cid.c + MacOS + + + FreeTypeLib + Name + winfnt.c + MacOS + + + FreeTypeLib + Name + type1.c + MacOS + + + FreeTypeLib + Name + pshinter.c + MacOS + + + FreeTypeLib + Name + pcf.c + MacOS + + + FreeTypeLib + Name + ftraster.c + MacOS + + + FreeTypeLib + Name + ftrend1.c + MacOS + + + + + diff --git a/vendor/freetype/builds/mac/ftmac.c b/vendor/freetype/builds/mac/ftmac.c new file mode 100644 index 00000000000..4e4ace33f99 --- /dev/null +++ b/vendor/freetype/builds/mac/ftmac.c @@ -0,0 +1,1542 @@ +/***************************************************************************/ +/* */ +/* ftmac.c */ +/* */ +/* Mac FOND support. Written by just@letterror.com. */ +/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */ +/* */ +/* Copyright (C) 1996-2024 by */ +/* Just van Rossum, 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. */ +/* */ +/***************************************************************************/ + + + /* + Notes + + Mac suitcase files can (and often do!) contain multiple fonts. To + support this I use the face_index argument of FT_(Open|New)_Face() + functions, and pretend the suitcase file is a collection. + + Warning: fbit and NFNT bitmap resources are not supported yet. In old + sfnt fonts, bitmap glyph data for each size is stored in each `NFNT' + resources instead of the `bdat' table in the sfnt resource. Therefore, + face->num_fixed_sizes is set to 0, because bitmap data in `NFNT' + resource is unavailable at present. + + The Mac FOND support works roughly like this: + + - Check whether the offered stream points to a Mac suitcase file. This + is done by checking the file type: it has to be 'FFIL' or 'tfil'. The + stream that gets passed to our init_face() routine is a stdio stream, + which isn't usable for us, since the FOND resources live in the + resource fork. So we just grab the stream->pathname field. + + - Read the FOND resource into memory, then check whether there is a + TrueType font and/or(!) a Type 1 font available. + + - If there is a Type 1 font available (as a separate `LWFN' file), read + its data into memory, massage it slightly so it becomes PFB data, wrap + it into a memory stream, load the Type 1 driver and delegate the rest + of the work to it by calling FT_Open_Face(). (XXX TODO: after this + has been done, the kerning data from the FOND resource should be + appended to the face: On the Mac there are usually no AFM files + available. However, this is tricky since we need to map Mac char + codes to ps glyph names to glyph ID's...) + + - If there is a TrueType font (an `sfnt' resource), read it into memory, + wrap it into a memory stream, load the TrueType driver and delegate + the rest of the work to it, by calling FT_Open_Face(). + + - Some suitcase fonts (notably Onyx) might point the `LWFN' file to + itself, even though it doesn't contains `POST' resources. To handle + this special case without opening the file an extra time, we just + ignore errors from the `LWFN' and fallback to the `sfnt' if both are + available. + */ + + +#include +#include +#include +#include "ftbase.h" + +#if defined( __GNUC__ ) || defined( __IBMC__ ) + /* This is for Mac OS X. Without redefinition, OS_INLINE */ + /* expands to `static inline' which doesn't survive the */ + /* -ansi compilation flag of GCC. */ +#if !HAVE_ANSI_OS_INLINE +#undef OS_INLINE +#define OS_INLINE static __inline__ +#endif +#include +#include +#include /* PATH_MAX */ +#else +#include +#include +#include +#include +#include +#include +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 /* same with Mac OS X's syslimits.h */ +#endif + +#if defined( __MWERKS__ ) && !TARGET_RT_MAC_MACHO +#include +#endif + +#define FT_DEPRECATED_ATTRIBUTE + +#include + + /* undefine blocking-macros in ftmac.h */ +#undef FT_GetFile_From_Mac_Name +#undef FT_GetFile_From_Mac_ATS_Name +#undef FT_New_Face_From_FOND +#undef FT_New_Face_From_FSSpec +#undef FT_New_Face_From_FSRef + + + /* FSSpec functions are deprecated since Mac OS X 10.4 */ +#ifndef HAVE_FSSPEC +#if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON +#define HAVE_FSSPEC 1 +#else +#define HAVE_FSSPEC 0 +#endif +#endif + + /* most FSRef functions were introduced since Mac OS 9 */ +#ifndef HAVE_FSREF +#if TARGET_API_MAC_OSX +#define HAVE_FSREF 1 +#else +#define HAVE_FSREF 0 +#endif +#endif + + /* QuickDraw is deprecated since Mac OS X 10.4 */ +#ifndef HAVE_QUICKDRAW_CARBON +#if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON +#define HAVE_QUICKDRAW_CARBON 1 +#else +#define HAVE_QUICKDRAW_CARBON 0 +#endif +#endif + + /* AppleTypeService is available since Mac OS X */ +#ifndef HAVE_ATS +#if TARGET_API_MAC_OSX +#define HAVE_ATS 1 +#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */ +#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault +#endif +#else +#define HAVE_ATS 0 +#endif +#endif + + /* `configure' checks the availability of `ResourceIndex' strictly */ + /* and sets HAVE_TYPE_RESOURCE_INDEX to 1 or 0 always. If it is */ + /* not set (e.g., a build without `configure'), the availability */ + /* is guessed from the SDK version. */ +#ifndef HAVE_TYPE_RESOURCE_INDEX +#if !defined( MAC_OS_X_VERSION_10_5 ) || \ + ( MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 ) +#define HAVE_TYPE_RESOURCE_INDEX 0 +#else +#define HAVE_TYPE_RESOURCE_INDEX 1 +#endif +#endif /* !HAVE_TYPE_RESOURCE_INDEX */ + +#if ( HAVE_TYPE_RESOURCE_INDEX == 0 ) +typedef short ResourceIndex; +#endif + + /* Set PREFER_LWFN to 1 if LWFN (Type 1) is preferred over + TrueType in case *both* are available (this is not common, + but it *is* possible). */ +#ifndef PREFER_LWFN +#define PREFER_LWFN 1 +#endif + +#ifdef FT_MACINTOSH + +#if !HAVE_QUICKDRAW_CARBON /* QuickDraw is deprecated since Mac OS X 10.4 */ + + FT_EXPORT_DEF( FT_Error ) + FT_GetFile_From_Mac_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + { + FT_UNUSED( fontName ); + FT_UNUSED( pathSpec ); + FT_UNUSED( face_index ); + + return FT_THROW( Unimplemented_Feature ); + } + +#else + + FT_EXPORT_DEF( FT_Error ) + FT_GetFile_From_Mac_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + { + OptionBits options = kFMUseGlobalScopeOption; + + FMFontFamilyIterator famIter; + OSStatus status = FMCreateFontFamilyIterator( NULL, NULL, + options, + &famIter ); + FMFont the_font = 0; + FMFontFamily family = 0; + + + if ( !fontName || !face_index ) + return FT_THROW( Invalid_Argument ); + + *face_index = 0; + while ( status == 0 && !the_font ) + { + status = FMGetNextFontFamily( &famIter, &family ); + if ( status == 0 ) + { + int stat2; + FMFontFamilyInstanceIterator instIter; + Str255 famNameStr; + char famName[256]; + + + /* get the family name */ + FMGetFontFamilyName( family, famNameStr ); + CopyPascalStringToC( famNameStr, famName ); + + /* iterate through the styles */ + FMCreateFontFamilyInstanceIterator( family, &instIter ); + + *face_index = 0; + stat2 = 0; + + while ( stat2 == 0 && !the_font ) + { + FMFontStyle style; + FMFontSize size; + FMFont font; + + + stat2 = FMGetNextFontFamilyInstance( &instIter, &font, + &style, &size ); + if ( stat2 == 0 && size == 0 ) + { + char fullName[256]; + + + /* build up a complete face name */ + ft_strcpy( fullName, famName ); + if ( style & bold ) + ft_strcat( fullName, " Bold" ); + if ( style & italic ) + ft_strcat( fullName, " Italic" ); + + /* compare with the name we are looking for */ + if ( ft_strcmp( fullName, fontName ) == 0 ) + { + /* found it! */ + the_font = font; + } + else + ++(*face_index); + } + } + + FMDisposeFontFamilyInstanceIterator( &instIter ); + } + } + + FMDisposeFontFamilyIterator( &famIter ); + + if ( the_font ) + { + FMGetFontContainer( the_font, pathSpec ); + return FT_Err_Ok; + } + else + return FT_THROW( Unknown_File_Format ); + } + +#endif /* HAVE_QUICKDRAW_CARBON */ + + +#if HAVE_ATS + + /* Private function. */ + /* The FSSpec type has been discouraged for a long time, */ + /* unfortunately an FSRef replacement API for */ + /* ATSFontGetFileSpecification() is only available in */ + /* Mac OS X 10.5 and later. */ + static OSStatus + FT_ATSFontGetFileReference( ATSFontRef ats_font_id, + FSRef* ats_font_ref ) + { + OSStatus err; + +#if !defined( MAC_OS_X_VERSION_10_5 ) || \ + MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + FSSpec spec; + + + err = ATSFontGetFileSpecification( ats_font_id, &spec ); + if ( noErr == err ) + err = FSpMakeFSRef( &spec, ats_font_ref ); +#else + err = ATSFontGetFileReference( ats_font_id, ats_font_ref ); +#endif + + return err; + } + + + static FT_Error + FT_GetFileRef_From_Mac_ATS_Name( const char* fontName, + FSRef* ats_font_ref, + FT_Long* face_index ) + { + CFStringRef cf_fontName; + ATSFontRef ats_font_id; + + + *face_index = 0; + + cf_fontName = CFStringCreateWithCString( NULL, fontName, + kCFStringEncodingMacRoman ); + ats_font_id = ATSFontFindFromName( cf_fontName, + kATSOptionFlagsUnRestrictedScope ); + CFRelease( cf_fontName ); + + if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL ) + return FT_THROW( Unknown_File_Format ); + + if ( noErr != FT_ATSFontGetFileReference( ats_font_id, ats_font_ref ) ) + return FT_THROW( Unknown_File_Format ); + + /* face_index calculation by searching preceding fontIDs */ + /* with same FSRef */ + { + ATSFontRef id2 = ats_font_id - 1; + FSRef ref2; + + + while ( id2 > 0 ) + { + if ( noErr != FT_ATSFontGetFileReference( id2, &ref2 ) ) + break; + if ( noErr != FSCompareFSRefs( ats_font_ref, &ref2 ) ) + break; + + id2--; + } + *face_index = ats_font_id - ( id2 + 1 ); + } + + return FT_Err_Ok; + } + +#endif + +#if !HAVE_ATS + + FT_EXPORT_DEF( FT_Error ) + FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, + UInt8* path, + UInt32 maxPathSize, + FT_Long* face_index ) + { + FT_UNUSED( fontName ); + FT_UNUSED( path ); + FT_UNUSED( maxPathSize ); + FT_UNUSED( face_index ); + + return FT_THROW( Unimplemented_Feature ); + } + +#else + + FT_EXPORT_DEF( FT_Error ) + FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, + UInt8* path, + UInt32 maxPathSize, + FT_Long* face_index ) + { + FSRef ref; + FT_Error err; + + + err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); + if ( err ) + return err; + + if ( noErr != FSRefMakePath( &ref, path, maxPathSize ) ) + return FT_THROW( Unknown_File_Format ); + + return FT_Err_Ok; + } + +#endif /* HAVE_ATS */ + + +#if !HAVE_FSSPEC || !HAVE_ATS + + FT_EXPORT_DEF( FT_Error ) + FT_GetFile_From_Mac_ATS_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + { + FT_UNUSED( fontName ); + FT_UNUSED( pathSpec ); + FT_UNUSED( face_index ); + + return FT_THROW( Unimplemented_Feature ); + } + +#else + + /* This function is deprecated because FSSpec is deprecated in Mac OS X. */ + FT_EXPORT_DEF( FT_Error ) + FT_GetFile_From_Mac_ATS_Name( const char* fontName, + FSSpec* pathSpec, + FT_Long* face_index ) + { + FSRef ref; + FT_Error err; + + + err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); + if ( err ) + return err; + + if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL, + pathSpec, NULL ) ) + return FT_THROW( Unknown_File_Format ); + + return FT_Err_Ok; + } + +#endif + + +#if defined( __MWERKS__ ) && !TARGET_RT_MAC_MACHO + +#define STREAM_FILE( stream ) ( (FT_FILE*)stream->descriptor.pointer ) + + + FT_CALLBACK_DEF( void ) + ft_FSp_stream_close( FT_Stream stream ) + { + ft_fclose( STREAM_FILE( stream ) ); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = NULL; + } + + + FT_CALLBACK_DEF( unsigned long ) + ft_FSp_stream_io( FT_Stream stream, + unsigned long offset, + unsigned char* buffer, + unsigned long count ) + { + FT_FILE* file; + + + file = STREAM_FILE( stream ); + + ft_fseek( file, offset, SEEK_SET ); + + return (unsigned long)ft_fread( buffer, 1, count, file ); + } + +#endif /* __MWERKS__ && !TARGET_RT_MAC_MACHO */ + + +#if HAVE_FSSPEC && !HAVE_FSREF + + /* isDirectory is a dummy to synchronize API with FSPathMakeRef() */ + static OSErr + FT_FSPathMakeSpec( const UInt8* pathname, + FSSpec* spec_p, + Boolean isDirectory ) + { + const char *p, *q; + short vRefNum; + long dirID; + Str255 nodeName; + OSErr err; + FT_UNUSED( isDirectory ); + + + p = q = (const char *)pathname; + dirID = 0; + vRefNum = 0; + + while ( 1 ) + { + int len = ft_strlen( p ); + + + if ( len > 255 ) + len = 255; + + q = p + len; + + if ( q == p ) + return 0; + + if ( 255 < ft_strlen( (char *)pathname ) ) + { + while ( p < q && *q != ':' ) + q--; + } + + if ( p < q ) + *(char *)nodeName = q - p; + else if ( ft_strlen( p ) < 256 ) + *(char *)nodeName = ft_strlen( p ); + else + return errFSNameTooLong; + + ft_strncpy( (char *)nodeName + 1, (char *)p, *(char *)nodeName ); + err = FSMakeFSSpec( vRefNum, dirID, nodeName, spec_p ); + if ( err || '\0' == *q ) + return err; + + vRefNum = spec_p->vRefNum; + dirID = spec_p->parID; + + p = q; + } + } + + + static OSErr + FT_FSpMakePath( const FSSpec* spec_p, + UInt8* path, + UInt32 maxPathSize ) + { + OSErr err; + FSSpec spec = *spec_p; + short vRefNum; + long dirID; + Str255 parDir_name; + + + FT_MEM_SET( path, 0, maxPathSize ); + while ( 1 ) + { + int child_namelen = ft_strlen( (char *)path ); + unsigned char node_namelen = spec.name[0]; + unsigned char* node_name = spec.name + 1; + + + if ( node_namelen + child_namelen > maxPathSize ) + return errFSNameTooLong; + + FT_MEM_MOVE( path + node_namelen + 1, path, child_namelen ); + FT_MEM_COPY( path, node_name, node_namelen ); + if ( child_namelen > 0 ) + path[node_namelen] = ':'; + + vRefNum = spec.vRefNum; + dirID = spec.parID; + parDir_name[0] = '\0'; + err = FSMakeFSSpec( vRefNum, dirID, parDir_name, &spec ); + if ( noErr != err || dirID == spec.parID ) + break; + } + return noErr; + } + +#endif /* HAVE_FSSPEC && !HAVE_FSREF */ + + + static OSErr + FT_FSPathMakeRes( const UInt8* pathname, + ResFileRefNum* res ) + { + +#if HAVE_FSREF + + OSErr err; + FSRef ref; + + + if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) ) + return FT_THROW( Cannot_Open_Resource ); + + /* at present, no support for dfont format */ + err = FSOpenResourceFile( &ref, 0, NULL, fsRdPerm, res ); + if ( noErr == err ) + return err; + + /* fallback to original resource-fork font */ + *res = FSOpenResFile( &ref, fsRdPerm ); + err = ResError(); + +#else + + OSErr err; + FSSpec spec; + + + if ( noErr != FT_FSPathMakeSpec( pathname, &spec, FALSE ) ) + return FT_THROW( Cannot_Open_Resource ); + + /* at present, no support for dfont format without FSRef */ + /* (see above), try original resource-fork font */ + *res = FSpOpenResFile( &spec, fsRdPerm ); + err = ResError(); + +#endif /* HAVE_FSREF */ + + return err; + } + + + /* Return the file type for given pathname */ + static OSType + get_file_type_from_path( const UInt8* pathname ) + { + +#if HAVE_FSREF + + FSRef ref; + FSCatalogInfo info; + + + if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) ) + return ( OSType ) 0; + + if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoFinderInfo, &info, + NULL, NULL, NULL ) ) + return ( OSType ) 0; + + return ((FInfo *)(info.finderInfo))->fdType; + +#else + + FSSpec spec; + FInfo finfo; + + + if ( noErr != FT_FSPathMakeSpec( pathname, &spec, FALSE ) ) + return ( OSType ) 0; + + if ( noErr != FSpGetFInfo( &spec, &finfo ) ) + return ( OSType ) 0; + + return finfo.fdType; + +#endif /* HAVE_FSREF */ + + } + + + /* Given a PostScript font name, create the Macintosh LWFN file name. */ + static void + create_lwfn_name( char* ps_name, + Str255 lwfn_file_name ) + { + int max = 5, count = 0; + FT_Byte* p = lwfn_file_name; + FT_Byte* q = (FT_Byte*)ps_name; + + + lwfn_file_name[0] = 0; + + while ( *q ) + { + if ( ft_isupper( *q ) ) + { + if ( count ) + max = 3; + count = 0; + } + if ( count < max && ( ft_isalnum( *q ) || *q == '_' ) ) + { + *++p = *q; + lwfn_file_name[0]++; + count++; + } + q++; + } + } + + + static short + count_faces_sfnt( char* fond_data ) + { + /* The count is 1 greater than the value in the FOND. */ + /* Isn't that cute? :-) */ + + return EndianS16_BtoN( *( (short*)( fond_data + + sizeof ( FamRec ) ) ) ) + 1; + } + + + static short + count_faces_scalable( char* fond_data ) + { + AsscEntry* assoc; + short i, face, face_all; + + + face_all = EndianS16_BtoN( *( (short *)( fond_data + + sizeof ( FamRec ) ) ) ) + 1; + assoc = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 ); + face = 0; + + for ( i = 0; i < face_all; i++ ) + { + if ( 0 == EndianS16_BtoN( assoc[i].fontSize ) ) + face++; + } + return face; + } + + + /* Look inside the FOND data, answer whether there should be an SFNT + resource, and answer the name of a possible LWFN Type 1 file. + + Thanks to Paul Miller (paulm@profoundeffects.com) for the fix + to load a face OTHER than the first one in the FOND! + */ + + static void + parse_fond( char* fond_data, + short* have_sfnt, + ResID* sfnt_id, + Str255 lwfn_file_name, + short face_index ) + { + AsscEntry* assoc; + AsscEntry* base_assoc; + FamRec* fond; + + + *sfnt_id = 0; + *have_sfnt = 0; + lwfn_file_name[0] = 0; + + fond = (FamRec*)fond_data; + assoc = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 ); + base_assoc = assoc; + + /* the maximum faces in a FOND is 48, size of StyleTable.indexes[] */ + if ( 47 < face_index ) + return; + + /* Let's do a little range checking before we get too excited here */ + if ( face_index < count_faces_sfnt( fond_data ) ) + { + assoc += face_index; /* add on the face_index! */ + + /* if the face at this index is not scalable, + fall back to the first one (old behavior) */ + if ( EndianS16_BtoN( assoc->fontSize ) == 0 ) + { + *have_sfnt = 1; + *sfnt_id = EndianS16_BtoN( assoc->fontID ); + } + else if ( base_assoc->fontSize == 0 ) + { + *have_sfnt = 1; + *sfnt_id = EndianS16_BtoN( base_assoc->fontID ); + } + } + + if ( EndianS32_BtoN( fond->ffStylOff ) ) + { + unsigned char* p = (unsigned char*)fond_data; + StyleTable* style; + unsigned short string_count; + char ps_name[256]; + unsigned char* names[64]; + int i; + + + p += EndianS32_BtoN( fond->ffStylOff ); + style = (StyleTable*)p; + p += sizeof ( StyleTable ); + string_count = EndianS16_BtoN( *(short*)(p) ); + string_count = FT_MIN( 64, string_count ); + p += sizeof ( short ); + + for ( i = 0; i < string_count; i++ ) + { + names[i] = p; + p += names[i][0]; + p++; + } + + { + size_t ps_name_len = (size_t)names[0][0]; + + + if ( ps_name_len != 0 ) + { + ft_memcpy(ps_name, names[0] + 1, ps_name_len); + ps_name[ps_name_len] = 0; + } + if ( style->indexes[face_index] > 1 && + style->indexes[face_index] <= string_count ) + { + unsigned char* suffixes = names[style->indexes[face_index] - 1]; + + + for ( i = 1; i <= suffixes[0]; i++ ) + { + unsigned char* s; + size_t j = suffixes[i] - 1; + + + if ( j < string_count && ( s = names[j] ) != NULL ) + { + size_t s_len = (size_t)s[0]; + + + if ( s_len != 0 && ps_name_len + s_len < sizeof ( ps_name ) ) + { + ft_memcpy( ps_name + ps_name_len, s + 1, s_len ); + ps_name_len += s_len; + ps_name[ps_name_len] = 0; + } + } + } + } + } + + create_lwfn_name( ps_name, lwfn_file_name ); + } + } + + + static FT_Error + lookup_lwfn_by_fond( const UInt8* path_fond, + ConstStr255Param base_lwfn, + UInt8* path_lwfn, + int path_size ) + { + +#if HAVE_FSREF + + FSRef ref, par_ref; + int dirname_len; + + + /* Pathname for FSRef can be in various formats: HFS, HFS+, and POSIX. */ + /* We should not extract parent directory by string manipulation. */ + + if ( noErr != FSPathMakeRef( path_fond, &ref, FALSE ) ) + return FT_THROW( Invalid_Argument ); + + if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, + NULL, NULL, NULL, &par_ref ) ) + return FT_THROW( Invalid_Argument ); + + if ( noErr != FSRefMakePath( &par_ref, path_lwfn, path_size ) ) + return FT_THROW( Invalid_Argument ); + + if ( ft_strlen( (char *)path_lwfn ) + 1 + base_lwfn[0] > path_size ) + return FT_THROW( Invalid_Argument ); + + /* now we have absolute dirname in path_lwfn */ + if ( path_lwfn[0] == '/' ) + ft_strcat( (char *)path_lwfn, "/" ); + else + ft_strcat( (char *)path_lwfn, ":" ); + + dirname_len = ft_strlen( (char *)path_lwfn ); + ft_strcat( (char *)path_lwfn, (char *)base_lwfn + 1 ); + path_lwfn[dirname_len + base_lwfn[0]] = '\0'; + + if ( noErr != FSPathMakeRef( path_lwfn, &ref, FALSE ) ) + return FT_THROW( Cannot_Open_Resource ); + + if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, + NULL, NULL, NULL, NULL ) ) + return FT_THROW( Cannot_Open_Resource ); + + return FT_Err_Ok; + +#else + + int i; + FSSpec spec; + + + /* pathname for FSSpec is always HFS format */ + if ( ft_strlen( (char *)path_fond ) > path_size ) + return FT_THROW( Invalid_Argument ); + + ft_strcpy( (char *)path_lwfn, (char *)path_fond ); + + i = ft_strlen( (char *)path_lwfn ) - 1; + while ( i > 0 && ':' != path_lwfn[i] ) + i--; + + if ( i + 1 + base_lwfn[0] > path_size ) + return FT_THROW( Invalid_Argument ); + + if ( ':' == path_lwfn[i] ) + { + ft_strcpy( (char *)path_lwfn + i + 1, (char *)base_lwfn + 1 ); + path_lwfn[i + 1 + base_lwfn[0]] = '\0'; + } + else + { + ft_strcpy( (char *)path_lwfn, (char *)base_lwfn + 1 ); + path_lwfn[base_lwfn[0]] = '\0'; + } + + if ( noErr != FT_FSPathMakeSpec( path_lwfn, &spec, FALSE ) ) + return FT_THROW( Cannot_Open_Resource ); + + return FT_Err_Ok; + +#endif /* HAVE_FSREF */ + + } + + + static short + count_faces( Handle fond, + const UInt8* pathname ) + { + ResID sfnt_id; + short have_sfnt, have_lwfn; + Str255 lwfn_file_name; + UInt8 buff[PATH_MAX]; + FT_Error err; + short num_faces; + + + have_sfnt = have_lwfn = 0; + + HLock( fond ); + parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, 0 ); + + if ( lwfn_file_name[0] ) + { + err = lookup_lwfn_by_fond( pathname, lwfn_file_name, + buff, sizeof ( buff ) ); + if ( !err ) + have_lwfn = 1; + } + + if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) ) + num_faces = 1; + else + num_faces = count_faces_scalable( *fond ); + + HUnlock( fond ); + return num_faces; + } + + + /* Read Type 1 data from the POST resources inside the LWFN file, + return a PFB buffer. This is somewhat convoluted because the FT2 + PFB parser wants the ASCII header as one chunk, and the LWFN + chunks are often not organized that way, so we glue chunks + of the same type together. */ + static FT_Error + read_lwfn( FT_Memory memory, + ResFileRefNum res, + FT_Byte** pfb_data, + FT_ULong* size ) + { + FT_Error error = FT_Err_Ok; + ResID res_id; + unsigned char *buffer, *p, *size_p = NULL; + FT_ULong total_size = 0; + FT_ULong old_total_size = 0; + FT_ULong post_size, pfb_chunk_size; + Handle post_data; + char code, last_code; + + + UseResFile( res ); + + /* First pass: load all POST resources, and determine the size of */ + /* the output buffer. */ + res_id = 501; + last_code = -1; + + for (;;) + { + post_data = Get1Resource( TTAG_POST, res_id++ ); + if ( post_data == NULL ) + break; /* we are done */ + + code = (*post_data)[0]; + + if ( code != last_code ) + { + if ( code == 5 ) + total_size += 2; /* just the end code */ + else + total_size += 6; /* code + 4 bytes chunk length */ + } + + total_size += GetHandleSize( post_data ) - 2; + last_code = code; + + /* detect integer overflows */ + if ( total_size < old_total_size ) + { + error = FT_ERR( Array_Too_Large ); + goto Error; + } + + old_total_size = total_size; + } + + if ( FT_QALLOC( buffer, (FT_Long)total_size ) ) + goto Error; + + /* Second pass: append all POST data to the buffer, add PFB fields. */ + /* Glue all consecutive chunks of the same type together. */ + p = buffer; + res_id = 501; + last_code = -1; + pfb_chunk_size = 0; + + for (;;) + { + post_data = Get1Resource( TTAG_POST, res_id++ ); + if ( post_data == NULL ) + break; /* we are done */ + + post_size = (FT_ULong)GetHandleSize( post_data ) - 2; + code = (*post_data)[0]; + + if ( code != last_code ) + { + if ( last_code != -1 ) + { + /* we are done adding a chunk, fill in the size field */ + if ( size_p != NULL ) + { + *size_p++ = (FT_Byte)( pfb_chunk_size & 0xFF ); + *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8 ) & 0xFF ); + *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 16 ) & 0xFF ); + *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 24 ) & 0xFF ); + } + pfb_chunk_size = 0; + } + + *p++ = 0x80; + if ( code == 5 ) + *p++ = 0x03; /* the end */ + else if ( code == 2 ) + *p++ = 0x02; /* binary segment */ + else + *p++ = 0x01; /* ASCII segment */ + + if ( code != 5 ) + { + size_p = p; /* save for later */ + p += 4; /* make space for size field */ + } + } + + ft_memcpy( p, *post_data + 2, post_size ); + pfb_chunk_size += post_size; + p += post_size; + last_code = code; + } + + *pfb_data = buffer; + *size = total_size; + + Error: + CloseResFile( res ); + return error; + } + + + /* Create a new FT_Face from a file spec to an LWFN file. */ + static FT_Error + FT_New_Face_From_LWFN( FT_Library library, + const UInt8* pathname, + FT_Long face_index, + FT_Face* aface ) + { + FT_Byte* pfb_data; + FT_ULong pfb_size; + FT_Error error; + ResFileRefNum res; + + + if ( noErr != FT_FSPathMakeRes( pathname, &res ) ) + return FT_THROW( Cannot_Open_Resource ); + + pfb_data = NULL; + pfb_size = 0; + error = read_lwfn( library->memory, res, &pfb_data, &pfb_size ); + CloseResFile( res ); /* PFB is already loaded, useless anymore */ + if ( error ) + return error; + + return open_face_from_buffer( library, + pfb_data, + pfb_size, + face_index, + "type1", + aface ); + } + + + /* Create a new FT_Face from an SFNT resource, specified by res ID. */ + static FT_Error + FT_New_Face_From_SFNT( FT_Library library, + ResID sfnt_id, + FT_Long face_index, + FT_Face* aface ) + { + Handle sfnt = NULL; + FT_Byte* sfnt_data; + size_t sfnt_size; + FT_Error error = FT_Err_Ok; + FT_Memory memory = library->memory; + int is_cff, is_sfnt_ps; + + + sfnt = GetResource( TTAG_sfnt, sfnt_id ); + if ( sfnt == NULL ) + return FT_THROW( Invalid_Handle ); + + sfnt_size = (FT_ULong)GetHandleSize( sfnt ); + if ( FT_QALLOC( sfnt_data, (FT_Long)sfnt_size ) ) + { + ReleaseResource( sfnt ); + return error; + } + + HLock( sfnt ); + ft_memcpy( sfnt_data, *sfnt, sfnt_size ); + HUnlock( sfnt ); + ReleaseResource( sfnt ); + + is_cff = sfnt_size > 4 && !ft_memcmp( sfnt_data, "OTTO", 4 ); + is_sfnt_ps = sfnt_size > 4 && !ft_memcmp( sfnt_data, "typ1", 4 ); + + if ( is_sfnt_ps ) + { + FT_Stream stream; + + + if ( FT_NEW( stream ) ) + goto Try_OpenType; + + FT_Stream_OpenMemory( stream, sfnt_data, sfnt_size ); + if ( !open_face_PS_from_sfnt_stream( library, + stream, + face_index, + 0, NULL, + aface ) ) + { + FT_Stream_Close( stream ); + FT_FREE( stream ); + FT_FREE( sfnt_data ); + goto Exit; + } + + FT_FREE( stream ); + } + Try_OpenType: + error = open_face_from_buffer( library, + sfnt_data, + sfnt_size, + face_index, + is_cff ? "cff" : "truetype", + aface ); + Exit: + return error; + } + + + /* Create a new FT_Face from a file spec to a suitcase file. */ + static FT_Error + FT_New_Face_From_Suitcase( FT_Library library, + const UInt8* pathname, + FT_Long face_index, + FT_Face* aface ) + { + FT_Error error = FT_ERR( Cannot_Open_Resource ); + ResFileRefNum res_ref; + ResourceIndex res_index; + Handle fond; + short num_faces_in_res; + + + if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) ) + return FT_THROW( Cannot_Open_Resource ); + + UseResFile( res_ref ); + if ( ResError() ) + return FT_THROW( Cannot_Open_Resource ); + + num_faces_in_res = 0; + for ( res_index = 1; ; ++res_index ) + { + short num_faces_in_fond; + + + fond = Get1IndResource( TTAG_FOND, res_index ); + if ( ResError() ) + break; + + num_faces_in_fond = count_faces( fond, pathname ); + num_faces_in_res += num_faces_in_fond; + + if ( 0 <= face_index && face_index < num_faces_in_fond && error ) + error = FT_New_Face_From_FOND( library, fond, face_index, aface ); + + face_index -= num_faces_in_fond; + } + + CloseResFile( res_ref ); + if ( !error && aface ) + (*aface)->num_faces = num_faces_in_res; + return error; + } + + + /* documentation is in ftmac.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_New_Face_From_FOND( FT_Library library, + Handle fond, + FT_Long face_index, + FT_Face* aface ) + { + short have_sfnt, have_lwfn = 0; + ResID sfnt_id, fond_id; + OSType fond_type; + Str255 fond_name; + Str255 lwfn_file_name; + UInt8 path_lwfn[PATH_MAX]; + OSErr err; + FT_Error error = FT_Err_Ok; + + + /* test for valid `aface' and `library' delayed to */ + /* `FT_New_Face_From_XXX' */ + + GetResInfo( fond, &fond_id, &fond_type, fond_name ); + if ( ResError() != noErr || fond_type != TTAG_FOND ) + return FT_THROW( Invalid_File_Format ); + + HLock( fond ); + parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index ); + HUnlock( fond ); + + if ( lwfn_file_name[0] ) + { + ResFileRefNum res; + + + res = HomeResFile( fond ); + if ( noErr != ResError() ) + goto found_no_lwfn_file; + +#if HAVE_FSREF + + { + UInt8 path_fond[PATH_MAX]; + FSRef ref; + + + err = FSGetForkCBInfo( res, kFSInvalidVolumeRefNum, + NULL, NULL, NULL, &ref, NULL ); + if ( noErr != err ) + goto found_no_lwfn_file; + + err = FSRefMakePath( &ref, path_fond, sizeof ( path_fond ) ); + if ( noErr != err ) + goto found_no_lwfn_file; + + error = lookup_lwfn_by_fond( path_fond, lwfn_file_name, + path_lwfn, sizeof ( path_lwfn ) ); + if ( !error ) + have_lwfn = 1; + } + +#elif HAVE_FSSPEC + + { + UInt8 path_fond[PATH_MAX]; + FCBPBRec pb; + Str255 fond_file_name; + FSSpec spec; + + + FT_MEM_SET( &spec, 0, sizeof ( FSSpec ) ); + FT_MEM_SET( &pb, 0, sizeof ( FCBPBRec ) ); + + pb.ioNamePtr = fond_file_name; + pb.ioVRefNum = 0; + pb.ioRefNum = res; + pb.ioFCBIndx = 0; + + err = PBGetFCBInfoSync( &pb ); + if ( noErr != err ) + goto found_no_lwfn_file; + + err = FSMakeFSSpec( pb.ioFCBVRefNum, pb.ioFCBParID, + fond_file_name, &spec ); + if ( noErr != err ) + goto found_no_lwfn_file; + + err = FT_FSpMakePath( &spec, path_fond, sizeof ( path_fond ) ); + if ( noErr != err ) + goto found_no_lwfn_file; + + error = lookup_lwfn_by_fond( path_fond, lwfn_file_name, + path_lwfn, sizeof ( path_lwfn ) ); + if ( !error ) + have_lwfn = 1; + } + +#endif /* HAVE_FSREF, HAVE_FSSPEC */ + + } + + if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) ) + error = FT_New_Face_From_LWFN( library, + path_lwfn, + face_index, + aface ); + else + error = FT_ERR( Unknown_File_Format ); + + found_no_lwfn_file: + if ( have_sfnt && error ) + error = FT_New_Face_From_SFNT( library, + sfnt_id, + face_index, + aface ); + + return error; + } + + + /* Common function to load a new FT_Face from a resource file. */ + static FT_Error + FT_New_Face_From_Resource( FT_Library library, + const UInt8* pathname, + FT_Long face_index, + FT_Face* aface ) + { + OSType file_type; + FT_Error error; + + + /* LWFN is a (very) specific file format, check for it explicitly */ + file_type = get_file_type_from_path( pathname ); + if ( file_type == TTAG_LWFN ) + return FT_New_Face_From_LWFN( library, pathname, face_index, aface ); + + /* Otherwise the file type doesn't matter (there are more than */ + /* `FFIL' and `tfil'). Just try opening it as a font suitcase; */ + /* if it works, fine. */ + + error = FT_New_Face_From_Suitcase( library, pathname, face_index, aface ); + if ( !error ) + return error; + + /* let it fall through to normal loader (.ttf, .otf, etc.); */ + /* we signal this by returning no error and no FT_Face */ + *aface = NULL; + return 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* FT_New_Face */ + /* */ + /* */ + /* This is the Mac-specific implementation of FT_New_Face. In */ + /* addition to the standard FT_New_Face() functionality, it also */ + /* accepts pathnames to Mac suitcase files. For further */ + /* documentation see the original FT_New_Face() in freetype.h. */ + /* */ + FT_EXPORT_DEF( FT_Error ) + FT_New_Face( FT_Library library, + const char* pathname, + FT_Long face_index, + FT_Face* aface ) + { + FT_Open_Args args; + FT_Error error; + + + /* test for valid `library' and `aface' delayed to FT_Open_Face() */ + if ( !pathname ) + return FT_THROW( Invalid_Argument ); + + *aface = NULL; + + /* try resourcefork based font: LWFN, FFIL */ + error = FT_New_Face_From_Resource( library, (UInt8 *)pathname, + face_index, aface ); + if ( error || *aface ) + return error; + + /* let it fall through to normal loader (.ttf, .otf, etc.) */ + args.flags = FT_OPEN_PATHNAME; + args.pathname = (char*)pathname; + return FT_Open_Face( library, &args, face_index, aface ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* FT_New_Face_From_FSRef */ + /* */ + /* */ + /* FT_New_Face_From_FSRef is identical to FT_New_Face except it */ + /* accepts an FSRef instead of a path. */ + /* */ + /* This function is deprecated because Carbon data types (FSRef) */ + /* are not cross-platform, and thus not suitable for the FreeType API. */ + FT_EXPORT_DEF( FT_Error ) + FT_New_Face_From_FSRef( FT_Library library, + const FSRef* ref, + FT_Long face_index, + FT_Face* aface ) + { + +#if !HAVE_FSREF + + FT_UNUSED( library ); + FT_UNUSED( ref ); + FT_UNUSED( face_index ); + FT_UNUSED( aface ); + + return FT_THROW( Unimplemented_Feature ); + +#else + + FT_Error error; + FT_Open_Args args; + OSErr err; + UInt8 pathname[PATH_MAX]; + + + /* test for valid `library' and `aface' delayed to `FT_Open_Face' */ + + if ( !ref ) + return FT_THROW( Invalid_Argument ); + + err = FSRefMakePath( ref, pathname, sizeof ( pathname ) ); + if ( err ) + error = FT_ERR( Cannot_Open_Resource ); + + error = FT_New_Face_From_Resource( library, pathname, face_index, aface ); + if ( error || *aface ) + return error; + + /* fallback to datafork font */ + args.flags = FT_OPEN_PATHNAME; + args.pathname = (char*)pathname; + return FT_Open_Face( library, &args, face_index, aface ); + +#endif /* HAVE_FSREF */ + + } + + + /*************************************************************************/ + /* */ + /* */ + /* FT_New_Face_From_FSSpec */ + /* */ + /* */ + /* FT_New_Face_From_FSSpec is identical to FT_New_Face except it */ + /* accepts an FSSpec instead of a path. */ + /* */ + /* This function is deprecated because Carbon data types (FSSpec) */ + /* are not cross-platform, and thus not suitable for the FreeType API. */ + FT_EXPORT_DEF( FT_Error ) + FT_New_Face_From_FSSpec( FT_Library library, + const FSSpec* spec, + FT_Long face_index, + FT_Face* aface ) + { + +#if HAVE_FSREF + + FSRef ref; + + + if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr ) + return FT_THROW( Invalid_Argument ); + else + return FT_New_Face_From_FSRef( library, &ref, face_index, aface ); + +#elif HAVE_FSSPEC + + FT_Error error; + FT_Open_Args args; + OSErr err; + UInt8 pathname[PATH_MAX]; + + + if ( !spec ) + return FT_THROW( Invalid_Argument ); + + err = FT_FSpMakePath( spec, pathname, sizeof ( pathname ) ); + if ( err ) + error = FT_ERR( Cannot_Open_Resource ); + + error = FT_New_Face_From_Resource( library, pathname, face_index, aface ); + if ( error || *aface ) + return error; + + /* fallback to datafork font */ + args.flags = FT_OPEN_PATHNAME; + args.pathname = (char*)pathname; + return FT_Open_Face( library, &args, face_index, aface ); + +#else + + FT_UNUSED( library ); + FT_UNUSED( spec ); + FT_UNUSED( face_index ); + FT_UNUSED( aface ); + + return FT_THROW( Unimplemented_Feature ); + +#endif /* HAVE_FSREF, HAVE_FSSPEC */ + + } + +#endif /* FT_MACINTOSH */ + + +/* END */ diff --git a/vendor/freetype/builds/meson/extract_freetype_version.py b/vendor/freetype/builds/meson/extract_freetype_version.py new file mode 100644 index 00000000000..c46ba36234a --- /dev/null +++ b/vendor/freetype/builds/meson/extract_freetype_version.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020-2024 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. + +"""Extract the FreeType version numbers from ``. + +This script parses the header to extract the version number defined there. +By default, the full dotted version number is printed, but `--major`, +`--minor` or `--patch` can be used to only print one of these values +instead. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# #define FREETYPE_MAJOR 2 +# #define FREETYPE_MINOR 10 +# #define FREETYPE_PATCH 2 +# ... + +RE_MAJOR = re.compile(r"^ \#define \s+ FREETYPE_MAJOR \s+ (.*) $", re.X) +RE_MINOR = re.compile(r"^ \#define \s+ FREETYPE_MINOR \s+ (.*) $", re.X) +RE_PATCH = re.compile(r"^ \#define \s+ FREETYPE_PATCH \s+ (.*) $", re.X) + + +def parse_freetype_header(header): + major = None + minor = None + patch = None + + for line in header.splitlines(): + line = line.rstrip() + m = RE_MAJOR.match(line) + if m: + assert major == None, "FREETYPE_MAJOR appears more than once!" + major = m.group(1) + continue + + m = RE_MINOR.match(line) + if m: + assert minor == None, "FREETYPE_MINOR appears more than once!" + minor = m.group(1) + continue + + m = RE_PATCH.match(line) + if m: + assert patch == None, "FREETYPE_PATCH appears more than once!" + patch = m.group(1) + continue + + assert ( + major and minor and patch + ), "This header is missing one of FREETYPE_MAJOR, FREETYPE_MINOR or FREETYPE_PATCH!" + + return (major, minor, patch) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + group = parser.add_mutually_exclusive_group() + group.add_argument( + "--major", + action="store_true", + help="Only print the major version number.", + ) + group.add_argument( + "--minor", + action="store_true", + help="Only print the minor version number.", + ) + group.add_argument( + "--patch", + action="store_true", + help="Only print the patch version number.", + ) + + parser.add_argument( + "input", + metavar="FREETYPE_H", + help="The input freetype.h header to parse.", + ) + + args = parser.parse_args() + with open(args.input) as f: + header = f.read() + + version = parse_freetype_header(header) + + if args.major: + print(version[0]) + elif args.minor: + print(version[1]) + elif args.patch: + print(version[2]) + else: + print("%s.%s.%s" % version) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/builds/meson/extract_libtool_version.py b/vendor/freetype/builds/meson/extract_libtool_version.py new file mode 100644 index 00000000000..8a25fcd68bc --- /dev/null +++ b/vendor/freetype/builds/meson/extract_libtool_version.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020-2024 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. + +"""Extract the libtool version from `configure.raw`. + +This script parses the `configure.raw` file to extract the libtool version +number. By default, the full dotted version number is printed, but +`--major`, `--minor` or `--patch` can be used to only print one of these +values instead. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# version_info='23:2:17' +# ... + +RE_VERSION_INFO = re.compile(r"^version_info='(\d+):(\d+):(\d+)'") + + +def parse_configure_raw(header): + major = None + minor = None + patch = None + + for line in header.splitlines(): + line = line.rstrip() + m = RE_VERSION_INFO.match(line) + if m: + assert major == None, "version_info appears more than once!" + major = m.group(1) + minor = m.group(2) + patch = m.group(3) + continue + + assert ( + major and minor and patch + ), "This input file is missing a version_info definition!" + + return (major, minor, patch) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + group = parser.add_mutually_exclusive_group() + group.add_argument( + "--major", + action="store_true", + help="Only print the major version number.", + ) + group.add_argument( + "--minor", + action="store_true", + help="Only print the minor version number.", + ) + group.add_argument( + "--patch", + action="store_true", + help="Only print the patch version number.", + ) + group.add_argument( + "--soversion", + action="store_true", + help="Only print the libtool library suffix.", + ) + + parser.add_argument( + "input", + metavar="CONFIGURE_RAW", + help="The input configure.raw file to parse.", + ) + + args = parser.parse_args() + with open(args.input) as f: + raw_file = f.read() + + version = parse_configure_raw(raw_file) + + if args.major: + print(version[0]) + elif args.minor: + print(version[1]) + elif args.patch: + print(version[2]) + elif args.soversion: + # Convert libtool version_info to the library suffix. + # (current,revision, age) -> (current - age, age, revision) + print( + "%d.%s.%s" + % (int(version[0]) - int(version[2]), version[2], version[1]) + ) + else: + print("%s.%s.%s" % version) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/builds/meson/generate_reference_docs.py b/vendor/freetype/builds/meson/generate_reference_docs.py new file mode 100644 index 00000000000..55340571099 --- /dev/null +++ b/vendor/freetype/builds/meson/generate_reference_docs.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020-2024 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. + +"""Generate FreeType reference documentation.""" + +from __future__ import print_function + +import argparse +import glob +import os +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--input-dir", + required=True, + help="Top-level FreeType source directory.", + ) + + parser.add_argument( + "--version", required=True, help='FreeType version (e.g. "2.x.y").' + ) + + parser.add_argument( + "--output-dir", required=True, help="Output directory." + ) + + args = parser.parse_args() + + # Get the list of input files of interest. + include_dir = os.path.join(args.input_dir, "include") + include_config_dir = os.path.join(include_dir, "config") + include_cache_dir = os.path.join(include_dir, "cache") + + all_headers = ( + glob.glob(os.path.join(args.input_dir, "include", "freetype", "*.h")) + + glob.glob( + os.path.join( + args.input_dir, "include", "freetype", "config", "*.h" + ) + ) + + glob.glob( + os.path.join( + args.input_dir, "include", "freetype", "cache", "*.h" + ) + ) + ) + + if not os.path.exists(args.output_dir): + os.makedirs(args.output_dir) + else: + assert os.path.isdir(args.output_dir), ( + "Not a directory: " + args.output_dir + ) + + cmds = [ + sys.executable, + "-m", + "docwriter", + "--prefix=ft2", + "--title=FreeType-" + args.version, + "--site=reference", + "--output=" + args.output_dir, + ] + all_headers + + print("Running docwriter...") + subprocess.check_call(cmds) + + print("Building static site...") + subprocess.check_call( + [sys.executable, "-m", "mkdocs", "build"], cwd=args.output_dir + ) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/builds/meson/parse_modules_cfg.py b/vendor/freetype/builds/meson/parse_modules_cfg.py new file mode 100644 index 00000000000..f56a5db7f8c --- /dev/null +++ b/vendor/freetype/builds/meson/parse_modules_cfg.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020-2024 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. + +"""Parse modules.cfg and dump its output either as ftmodule.h or a list of +base extensions. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# FONT_MODULES += +# HINTING_MODULES += +# RASTER_MODULES += +# AUX_MODULES += +# BASE_EXTENSIONS += +# ... + + +def parse_modules_cfg(input_file): + + lists = { + "FONT_MODULES": [], + "HINTING_MODULES": [], + "RASTER_MODULES": [], + "AUX_MODULES": [], + "BASE_EXTENSIONS": [], + } + + for line in input_file.splitlines(): + line = line.rstrip() + # Ignore empty lines and those that start with a comment. + if not line or line[0] == "#": + continue + + items = line.split() + assert len(items) == 3 and items[1] == "+=", ( + "Unexpected input line [%s]" % line + ) + assert items[0] in lists, ( + "Unexpected configuration variable name " + items[0] + ) + + lists[items[0]].append(items[2]) + + return lists + + +def generate_ftmodule(lists): + result = "/* This is a generated file. */\n" + for driver in lists["FONT_MODULES"]: + if driver == "sfnt": # Special case for the sfnt 'driver'. + result += "FT_USE_MODULE( FT_Module_Class, sfnt_module_class )\n" + continue + + name = { + "truetype": "tt", + "type1": "t1", + "cid": "t1cid", + "type42": "t42", + "winfonts": "winfnt", + }.get(driver, driver) + result += ( + "FT_USE_MODULE( FT_Driver_ClassRec, %s_driver_class )\n" % name + ) + + for module in lists["HINTING_MODULES"]: + result += ( + "FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module + ) + + for module in lists["RASTER_MODULES"]: + names = { + "raster": ("ft_raster1",), + "smooth": ("ft_smooth",), + "svg": ("ft_svg",), + "sdf": ("ft_sdf", "ft_bitmap_sdf"), + }.get(module) + for name in names: + result += ( + "FT_USE_MODULE( FT_Renderer_Class, %s_renderer_class )\n" % name + ) + + for module in lists["AUX_MODULES"]: + if module in ("psaux", "psnames", "otvalid", "gxvalid"): + name = { + "gxvalid": "gxv", + "otvalid": "otv", + }.get(module, module) + result += ( + "FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % name + ) + + result += "/* EOF */\n" + return result + + +def generate_main_modules(lists): + return "\n".join( + lists["FONT_MODULES"] + + lists["HINTING_MODULES"] + + lists["RASTER_MODULES"] + ) + + +def generate_aux_modules(lists): + return "\n".join(lists["AUX_MODULES"]) + + +def generate_base_extensions(lists): + return "\n".join(lists["BASE_EXTENSIONS"]) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--format", + required=True, + choices=( + "ftmodule.h", + "main-modules", + "aux-modules", + "base-extensions-list", + ), + help="Select output format.", + ) + + parser.add_argument( + "input", + metavar="CONFIGURE_RAW", + help="The input configure.raw file to parse.", + ) + + parser.add_argument("--output", help="Output file (default is stdout).") + + args = parser.parse_args() + with open(args.input) as f: + input_data = f.read() + + lists = parse_modules_cfg(input_data) + + if args.format == "ftmodule.h": + result = generate_ftmodule(lists) + elif args.format == "main-modules": + result = generate_main_modules(lists) + elif args.format == "aux-modules": + result = generate_aux_modules(lists) + elif args.format == "base-extensions-list": + result = generate_base_extensions(lists) + else: + assert False, "Invalid output format!" + + if args.output: + with open(args.output, "w") as f: + f.write(result) + else: + print(result) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/builds/meson/process_ftoption_h.py b/vendor/freetype/builds/meson/process_ftoption_h.py new file mode 100644 index 00000000000..cfb9d09a7d7 --- /dev/null +++ b/vendor/freetype/builds/meson/process_ftoption_h.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020-2024 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. + +"""Toggle settings in `ftoption.h` file based on command-line arguments. + +This script takes an `ftoption.h` file as input and rewrites +`#define`/`#undef` lines in it based on `--enable=CONFIG_VARNAME` or +`--disable=CONFIG_VARNAME` arguments passed to it, where `CONFIG_VARNAME` is +configuration variable name, such as `FT_CONFIG_OPTION_USE_LZW`, that may +appear in the file. + +Note that if one of `CONFIG_VARNAME` is not found in the input file, this +script exits with an error message listing the missing variable names. +""" + +import argparse +import os +import re +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "input", metavar="FTOPTION_H", help="Path to input ftoption.h file." + ) + + parser.add_argument("--output", help="Output to file instead of stdout.") + + parser.add_argument( + "--enable", + action="append", + default=[], + help="Enable a given build option (e.g. FT_CONFIG_OPTION_USE_LZW).", + ) + + parser.add_argument( + "--disable", + action="append", + default=[], + help="Disable a given build option.", + ) + + args = parser.parse_args() + + common_options = set(args.enable) & set(args.disable) + if common_options: + parser.error( + "Options cannot be both enabled and disabled: %s" + % sorted(common_options) + ) + return 1 + + with open(args.input) as f: + input_file = f.read() + + options_seen = set() + + new_lines = [] + for line in input_file.splitlines(): + # Expected formats: + # #define + # /* #define */ + # #undef + line = line.rstrip() + if line.startswith("/* #define ") and line.endswith(" */"): + option_name = line[11:-3].strip() + option_enabled = False + elif line.startswith("#define "): + option_name = line[8:].strip() + option_enabled = True + elif line.startswith("#undef "): + option_name = line[7:].strip() + option_enabled = False + else: + new_lines.append(line) + continue + + options_seen.add(option_name) + if option_enabled and option_name in args.disable: + line = "#undef " + option_name + elif not option_enabled and option_name in args.enable: + line = "#define " + option_name + new_lines.append(line) + + result = "\n".join(new_lines) + "\n" + + # Sanity check that all command-line options were actually processed. + cmdline_options = set(args.enable) | set(args.disable) + assert cmdline_options.issubset( + options_seen + ), "Could not find options in input file: " + ", ".join( + sorted(cmdline_options - options_seen) + ) + + if args.output: + with open(args.output, "w") as f: + f.write(result) + else: + print(result) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/builds/modules.mk b/vendor/freetype/builds/modules.mk new file mode 100644 index 00000000000..f98e9317137 --- /dev/null +++ b/vendor/freetype/builds/modules.mk @@ -0,0 +1,79 @@ +# +# FreeType 2 modules sub-Makefile +# + + +# Copyright (C) 1996-2024 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. + + +# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY +# OTHER MAKEFILES. + + +# This file is in charge of handling the generation of the modules list +# file. + + +# Build the modules list. +# +$(FTMODULE_H): $(MODULES_CFG) + $(FTMODULE_H_INIT) + $(FTMODULE_H_CREATE) + $(FTMODULE_H_DONE) + +ifneq ($(findstring $(PLATFORM),dos windows os2),) + OPEN_MODULE := @echo$(space) + CLOSE_MODULE := >> $(subst /,$(SEP),$(FTMODULE_H)) + REMOVE_MODULE := @-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H)) +else + OPEN_MODULE := @echo " + CLOSE_MODULE := " >> $(FTMODULE_H) + REMOVE_MODULE := @-$(DELETE) $(FTMODULE_H) +endif + + +define FTMODULE_H_INIT +$(REMOVE_MODULE) +$(info Generating modules list in $(FTMODULE_H)...) +$(OPEN_MODULE)/* This is a generated file. */$(CLOSE_MODULE) +endef + +# It is no mistake that the final closing parenthesis is on the +# next line -- it produces proper newlines during the expansion +# of `foreach'. +# +define FTMODULE_H_CREATE +$(foreach COMMAND,$(FTMODULE_H_COMMANDS),$($(COMMAND)) +) +endef + +define FTMODULE_H_DONE +$(OPEN_MODULE)/* EOF */$(CLOSE_MODULE) +$(info done.) +endef + + +# $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver +# in the `module.mk' rules file. +# +OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE( +CLOSE_DRIVER := )$(CLOSE_MODULE) + +ECHO_DRIVER := @echo "* module:$(space) +ECHO_DRIVER_DESC := ( +ECHO_DRIVER_DONE := )" + +# Each `module.mk' in the `src/*' subdirectories adds a variable with +# commands to $(FTMODULE_H_COMMANDS). Note that we can't use SRC_DIR here. +# +-include $(patsubst %,$(TOP_DIR)/src/%/module.mk,$(MODULES)) + + +# EOF diff --git a/vendor/freetype/builds/os2/detect.mk b/vendor/freetype/builds/os2/detect.mk new file mode 100644 index 00000000000..d4667b2085a --- /dev/null +++ b/vendor/freetype/builds/os2/detect.mk @@ -0,0 +1,81 @@ +# +# FreeType 2 configuration file to detect an OS/2 host platform. +# + + +# Copyright (C) 1996-2024 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. + + +.PHONY: setup + + +ifeq ($(PLATFORM),ansi) + + ifdef OS2_SHELL + + PLATFORM := os2 + + endif # test OS2_SHELL +endif + +ifeq ($(PLATFORM),os2) + + COPY := copy + DELETE := del + CAT := type + SEP := $(BACKSLASH) + + # gcc-emx by default + CONFIG_FILE := os2-gcc.mk + + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ + CONFIG_FILE := os2-icc.mk + CC := icc + + .PHONY: visualage + visualage: setup + @cd . + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := os2-wat.mk + CC := wcc386 + + .PHONY: watcom + watcom: setup + @cd . + endif + + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit + CONFIG_FILE := os2-bcc.mk + CC := bcc32 + + .PHONY: borlandc + borlandc: setup + @cd . + endif + + ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := os2-dev.mk + CC := gcc + + .PHONY: devel + devel: setup + @cd . + endif + + setup: std_setup + +endif # test PLATFORM os2 + + +# EOF diff --git a/vendor/freetype/builds/os2/os2-def.mk b/vendor/freetype/builds/os2/os2-def.mk new file mode 100644 index 00000000000..160ca1ba2f8 --- /dev/null +++ b/vendor/freetype/builds/os2/os2-def.mk @@ -0,0 +1,48 @@ +# +# FreeType 2 OS/2 specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +DELETE := del +CAT := type +SEP := $(strip \ ) +PLATFORM_DIR := $(TOP_DIR)/builds/os2 +PLATFORM := os2 + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := Scripts + +# The executable file extension (for tools), *with* leading dot. +# +E := .exe + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := $(PROJECT) + + +# The NO_OUTPUT macro is used to ignore the output of commands. +# +NO_OUTPUT = 2> nul + + +# EOF diff --git a/vendor/freetype/builds/os2/os2-dev.mk b/vendor/freetype/builds/os2/os2-dev.mk new file mode 100644 index 00000000000..9f401de4b17 --- /dev/null +++ b/vendor/freetype/builds/os2/os2-dev.mk @@ -0,0 +1,30 @@ +# +# FreeType 2 configuration rules for OS/2 + GCC +# +# Development version without optimizations. +# + + +# Copyright (C) 1996-2024 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. + + +DEVEL_DIR := $(TOP_DIR)/devel + +# include OS/2-specific definitions +include $(TOP_DIR)/builds/os2/os2-def.mk + +# include gcc-specific definitions +include $(TOP_DIR)/builds/compiler/gcc-dev.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/os2/os2-gcc.mk b/vendor/freetype/builds/os2/os2-gcc.mk new file mode 100644 index 00000000000..fd6f2ec9262 --- /dev/null +++ b/vendor/freetype/builds/os2/os2-gcc.mk @@ -0,0 +1,26 @@ +# +# FreeType 2 configuration rules for the OS/2 + gcc +# + + +# Copyright (C) 1996-2024 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 OS/2-specific definitions +include $(TOP_DIR)/builds/os2/os2-def.mk + +# include gcc-specific definitions +include $(TOP_DIR)/builds/compiler/gcc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/symbian/bld.inf b/vendor/freetype/builds/symbian/bld.inf new file mode 100644 index 00000000000..f2e67ffed57 --- /dev/null +++ b/vendor/freetype/builds/symbian/bld.inf @@ -0,0 +1,72 @@ +// +// FreeType 2 project for the symbian platform +// + +// Copyright (C) 2008-2024 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. + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +freetype.mmp + +PRJ_EXPORTS +../../include/freetype/ft2build.h +../../include/freetype/config/ftconfig.h config/ftconfig.h +../../include/freetype/config/ftheader.h config/ftheader.h +../../include/freetype/config/ftmodule.h config/ftmodule.h +../../include/freetype/config/ftoption.h config/ftoption.h +../../include/freetype/config/ftstdlib.h config/ftstdlib.h +../../include/freetype/freetype.h freetype.h +../../include/freetype/ftadvanc.h ftadvanc.h +../../include/freetype/ftautoh.h ftautoh.h +../../include/freetype/ftbbox.h ftbbox.h +../../include/freetype/ftbdf.h ftbdf.h +../../include/freetype/ftbitmap.h ftbitmap.h +../../include/freetype/ftbzip2.h ftbzip2.h +../../include/freetype/ftcache.h ftcache.h +../../include/freetype/ftcffdrv.h ftcffdrv.h +../../include/freetype/ftcid.h ftcid.h +../../include/freetype/fterrdef.h fterrdef.h +../../include/freetype/fterrors.h fterrors.h +../../include/freetype/ftfntfmt.h ftfntfmt.h +../../include/freetype/ftgasp.h ftgasp.h +../../include/freetype/ftglyph.h ftglyph.h +../../include/freetype/ftgxval.h ftgxval.h +../../include/freetype/ftgzip.h ftgzip.h +../../include/freetype/ftimage.h ftimage.h +../../include/freetype/ftincrem.h ftincrem.h +../../include/freetype/ftlcdfil.h ftlcdfil.h +../../include/freetype/ftlist.h ftlist.h +../../include/freetype/ftlzw.h ftlzw.h +../../include/freetype/ftmac.h ftmac.h +../../include/freetype/ftmm.h ftmm.h +../../include/freetype/ftmodapi.h ftmodapi.h +../../include/freetype/ftmoderr.h ftmoderr.h +../../include/freetype/ftotval.h ftotval.h +../../include/freetype/ftoutln.h ftoutln.h +../../include/freetype/ftparams.h ftparams.h +../../include/freetype/ftpcfdrv.h ftpcfdrv.h +../../include/freetype/ftpfr.h ftpfr.h +../../include/freetype/ftrender.h ftrender.h +../../include/freetype/ftsizes.h ftsizes.h +../../include/freetype/ftsnames.h ftsnames.h +../../include/freetype/ftstroke.h ftstroke.h +../../include/freetype/ftsynth.h ftsynth.h +../../include/freetype/ftsystem.h ftsystem.h +../../include/freetype/ftt1drv.h ftt1drv.h +../../include/freetype/fttrigon.h fttrigon.h +../../include/freetype/ftttdrv.h ftttdrv.h +../../include/freetype/fttypes.h fttypes.h +../../include/freetype/ftwinfnt.h ftwinfnt.h +../../include/freetype/t1tables.h t1tables.h +../../include/freetype/ttnameid.h ttnameid.h +../../include/freetype/tttables.h tttables.h +../../include/freetype/tttags.h tttags.h diff --git a/vendor/freetype/builds/symbian/freetype.mmp b/vendor/freetype/builds/symbian/freetype.mmp new file mode 100644 index 00000000000..ee948f0abd5 --- /dev/null +++ b/vendor/freetype/builds/symbian/freetype.mmp @@ -0,0 +1,146 @@ +// +// FreeType 2 makefile for the symbian platform +// + +// Copyright (C) 2008-2024 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. + +target freetype.lib +targettype lib + +macro NDEBUG +macro FT2_BUILD_LIBRARY + +sourcepath ..\..\src\autofit + +source autofit.c + +sourcepath ..\..\src\base + +source ftbase.c +source ftbbox.c +source ftbdf.c +source ftbitmap.c +source ftcid.c +source ftfstype.c +source ftgasp.c +source ftglyph.c +source ftgxval.c +source ftinit.c +source ftmm.c +source ftotval.c +source ftpatent.c +source ftpfr.c +source ftstroke.c +source ftsynth.c +source ftsystem.c +source fttype1.c +source ftwinfnt.c + +sourcepath ..\..\src\bdf + +source bdf.c + +sourcepath ..\..\src\bzip2 + +source ftbzip2.c + +sourcepath ..\..\src\cache + +source ftcache.c + +sourcepath ..\..\src\cff + +source cff.c + +sourcepath ..\..\src\cid + +source type1cid.c + +sourcepath ..\..\src\gzip + +source ftgzip.c + +sourcepath ..\..\src\lzw + +source ftlzw.c + +sourcepath ..\..\src\pcf + +source pcf.c + +sourcepath ..\..\src\pfr + +source pfr.c + +sourcepath ..\..\src\psaux + +source psaux.c + +sourcepath ..\..\src\pshinter + +source pshinter.c + +sourcepath ..\..\src\psnames + +source psmodule.c + +sourcepath ..\..\src\raster + +source raster.c + +sourcepath ..\..\src\sfnt + +source sfnt.c + +sourcepath ..\..\src\smooth + +source smooth.c + +sourcepath ..\..\src\truetype + +source truetype.c + +sourcepath ..\..\src\type1 + +source type1.c + +sourcepath ..\..\src\type42 + +source type42.c + +sourcepath ..\..\src\winfonts + +source winfnt.c + + +systeminclude ..\..\include +systeminclude \epoc32\include\stdapis +userinclude ..\..\src\autofit +userinclude ..\..\src\bdf +userinclude ..\..\src\bzip2 +userinclude ..\..\src\cache +userinclude ..\..\src\cff +userinclude ..\..\src\cid +userinclude ..\..\src\gxvalid +userinclude ..\..\src\gzip +userinclude ..\..\src\lzw +userinclude ..\..\src\otvalid +userinclude ..\..\src\pcf +userinclude ..\..\src\pfr +userinclude ..\..\src\psaux +userinclude ..\..\src\pshinter +userinclude ..\..\src\psnames +userinclude ..\..\src\raster +userinclude ..\..\src\sfnt +userinclude ..\..\src\smooth +userinclude ..\..\src\truetype +userinclude ..\..\src\type1 +userinclude ..\..\src\type42 +userinclude ..\..\src\winfonts diff --git a/vendor/freetype/builds/toplevel.mk b/vendor/freetype/builds/toplevel.mk new file mode 100644 index 00000000000..7a4c17ad276 --- /dev/null +++ b/vendor/freetype/builds/toplevel.mk @@ -0,0 +1,323 @@ +# +# FreeType build system -- top-level sub-Makefile +# + + +# Copyright (C) 1996-2024 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +# This file is designed for GNU Make, do not use it with another Make tool! +# +# It works as follows: +# +# - When invoked for the first time, this Makefile includes the rules found +# in `PROJECT/builds/detect.mk'. They are in charge of detecting the +# current platform. +# +# A summary of the detection is displayed, and the file `config.mk' is +# created in the current directory. +# +# - When invoked later, this Makefile includes the rules found in +# `config.mk'. This sub-Makefile defines some system-specific variables +# (like compiler, compilation flags, object suffix, etc.), then includes +# the rules found in `PROJECT/builds/PROJECT.mk', used to build the +# library. +# +# See the comments in `builds/detect.mk' and `builds/PROJECT.mk' for more +# details on host platform detection and library builds. + + +# First of all, check whether we have `$(value ...)'. We do this by testing +# for `$(eval ...)' which has been introduced in the same GNU make version. + +eval_available := +$(eval eval_available := T) +ifneq ($(eval_available),T) + $(error FreeType's build system needs a Make program which supports $$(value)) +endif + + +.PHONY: all dist distclean modules setup + + +# The `space' variable is used to avoid trailing spaces in defining the +# `T' variable later. +# +empty := +space := $(empty) $(empty) + + +# The main configuration file, defining the `XXX_MODULES' variables. We +# prefer a `modules.cfg' file in OBJ_DIR over TOP_DIR. +# +ifndef MODULES_CFG + MODULES_CFG := $(TOP_DIR)/modules.cfg + ifneq ($(wildcard $(OBJ_DIR)/modules.cfg),) + MODULES_CFG := $(OBJ_DIR)/modules.cfg + endif +endif + + +# FTMODULE_H, as its name suggests, indicates where the FreeType module +# class file resides. +# +FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h + + +include $(MODULES_CFG) + + +# The list of modules we are using. +# +MODULES := $(FONT_MODULES) \ + $(HINTING_MODULES) \ + $(RASTER_MODULES) \ + $(AUX_MODULES) + + +CONFIG_MK ?= config.mk + +# If no configuration sub-makefile is present, or if `setup' is the target +# to be built, run the auto-detection rules to figure out which +# configuration rules file to use. +# +# Note that the configuration file is put in the current directory, which is +# not necessarily $(TOP_DIR). + +# If `config.mk' is not present, set `check_platform'. +# +ifeq ($(wildcard $(CONFIG_MK)),) + check_platform := 1 +endif + +# If `setup' is one of the targets requested, set `check_platform'. +# +ifneq ($(findstring setup,$(MAKECMDGOALS)),) + check_platform := 1 +endif + + +# Include the automatic host platform detection rules when we need to +# check the platform. +# +ifdef check_platform + + all modules: setup + + include $(TOP_DIR)/builds/detect.mk + + # For builds directly from the git repository we need to copy files + # from `subprojects/dlg' to `src/dlg' and `include/dlg'. + # + ifeq ($(wildcard $(TOP_DIR)/src/dlg/dlg.*),) + ifeq ($(wildcard $(TOP_DIR)/subprojects/dlg/*),) + copy_submodule: check_out_submodule + endif + + setup: copy_submodule + endif + + # This rule makes sense for Unix only to remove files created by a run of + # the configure script which hasn't been successful (so that no + # `config.mk' has been created). It uses the built-in $(RM) command of + # GNU make. Similarly, `nul' is created if e.g. `make setup windows' has + # been erroneously used. + # + # Note: This test is duplicated in `builds/unix/detect.mk'. + # + is_unix := $(strip $(wildcard /sbin/init) \ + $(wildcard /usr/sbin/init) \ + $(wildcard /dev/null) \ + $(wildcard /hurd/auth)) + ifneq ($(is_unix),) + + distclean: + $(RM) $(TOP_DIR)/builds/unix/config.cache + $(RM) $(TOP_DIR)/builds/unix/config.log + $(RM) $(TOP_DIR)/builds/unix/config.status + $(RM) $(TOP_DIR)/builds/unix/unix-def.mk + $(RM) $(TOP_DIR)/builds/unix/unix-cc.mk + $(RM) $(TOP_DIR)/builds/unix/freetype2.pc + $(RM) nul + + endif # test is_unix + + # IMPORTANT: + # + # `setup' must be defined by the host platform detection rules to create + # the `config.mk' file in the current directory. + +else + + # A configuration sub-Makefile is present -- simply run it. + # + all: single + + BUILD_PROJECT := yes + include $(CONFIG_MK) + +endif # test check_platform + + +.PHONY: check_out_submodule copy_submodule + +check_out_submodule: + $(info Checking out submodule in `subprojects/dlg') + git -C $(TOP_DIR) submodule update --init + +copy_submodule: + $(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg') + ifeq ($(wildcard $(TOP_DIR)/include/dlg),) + mkdir $(subst /,$(SEP),$(TOP_DIR)/include/dlg) + endif + $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/output.h $(TOP_DIR)/include/dlg) + $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/dlg.h $(TOP_DIR)/include/dlg) + $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/src/dlg/dlg.c $(TOP_DIR)/src/dlg) + + +# We always need the list of modules in ftmodule.h. +# +all setup: $(FTMODULE_H) + + +# The `modules' target unconditionally rebuilds the module list. +# +modules: + $(FTMODULE_H_INIT) + $(FTMODULE_H_CREATE) + $(FTMODULE_H_DONE) + +include $(TOP_DIR)/builds/modules.mk + + +# get FreeType version string using built-in string functions +# +hash := \# + +work := $(strip $(shell $(CAT) \ + $(subst /,$(SEP),$(TOP_DIR)/include/freetype/freetype.h))) + +work := $(subst $(hash)define$(space)FREETYPE_MAJOR$(space),MAjOR=,$(work)) +work := $(subst $(hash)define$(space)FREETYPE_MINOR$(space),MInOR=,$(work)) +work := $(subst $(hash)define$(space)FREETYPE_PATCH$(space),PAtCH=,$(work)) + +major := $(subst MAjOR=,,$(filter MAjOR=%,$(work))) +minor := $(subst MInOR=,,$(filter MInOR=%,$(work))) +patch := $(subst PAtCH=,,$(filter PAtCH=%,$(work))) + +work := + +# ifneq ($(findstring x0x,x$(patch)x),) +# version := $(major).$(minor) +# winversion := $(major)$(minor) +# else + version := $(major).$(minor).$(patch) + winversion := $(major)$(minor)$(patch) + version_tag := VER-$(major)-$(minor)-$(patch) +# endif + + +# This target builds the tarballs. +# +# Not to be run by a normal user -- there are no attempts to make it +# generic. + +dist: + -rm -rf tmp + rm -f freetype-$(version).tar.gz + rm -f freetype-$(version).tar.xz + rm -f ft$(winversion).zip + + for d in `find . -wholename '*/.git' -prune \ + -o -type f \ + -o -print` ; do \ + mkdir -p tmp/$$d ; \ + done ; + + currdir=`pwd` ; \ + for f in `find . -wholename '*/.git' -prune \ + -o -name .gitattributes \ + -o -name .gitignore \ + -o -name .gitlab-ci.yml \ + -o -name .gitmodules \ + -o -name .mailmap \ + -o -type d \ + -o -print` ; do \ + ln -s $$currdir/$$f tmp/$$f ; \ + done + + cd tmp ; \ + $(MAKE) devel ; \ + $(MAKE) do-dist + + mv tmp freetype-$(version) + + tar -H ustar -chf - freetype-$(version) \ + | gzip -9 -c > freetype-$(version).tar.gz + tar -H ustar -chf - freetype-$(version) \ + | xz -c > freetype-$(version).tar.xz + + @# Use CR/LF for zip files. + zip -lr9 ft$(winversion).zip freetype-$(version) + + rm -fr freetype-$(version) + + +# The locations of the latest `config.guess' and `config.sub' versions (from +# GNU `config' git repository), relative to the `tmp' directory used during +# `make dist'. +# +# GNU_CONFIG_GIT_URL = git://git.savannah.gnu.org/config.git +GNU_CONFIG_GIT_URL = https://git.savannah.gnu.org/git/config.git +GNU_CONFIG_DESTDIR = $(TOP_DIR)/subprojects/gnu-config + +CONFIG_GUESS = $(GNU_CONFIG_DESTDIR)/config.guess +CONFIG_SUB = $(GNU_CONFIG_DESTDIR)/config.sub + +# We also use this repository to access the gnulib script that converts git +# commit messages to a ChangeLog file. +CHANGELOG_SCRIPT = $(GNU_CONFIG_DESTDIR)/gitlog-to-changelog + + +# Don't say `make do-dist'. Always use `make dist' instead. +# +.PHONY: do-dist + +do-dist: distclean refdoc + @# Without removing the files, `autoconf' and friends follow links. + rm -f $(TOP_DIR)/builds/unix/aclocal.m4 + rm -f $(TOP_DIR)/builds/unix/configure.ac + rm -f $(TOP_DIR)/builds/unix/configure + + sh autogen.sh + rm -rf $(TOP_DIR)/builds/unix/autom4te.cache + + rm -rf $(GNU_CONFIG_DESTDIR) + git clone https://git.savannah.gnu.org/git/config.git $(GNU_CONFIG_DESTDIR) + cp $(CONFIG_GUESS) $(TOP_DIR)/builds/unix + cp $(CONFIG_SUB) $(TOP_DIR)/builds/unix + + @# Generate `ChangeLog' file with commits since release 2.11.0 + @# (when we stopped creating this file manually). + $(CHANGELOG_SCRIPT) \ + --format='%B%n' \ + --no-cluster \ + -- VER-2-11-0..$(version_tag) \ + > ChangeLog + + @# Remove intermediate files created by the `refdoc' target. + rm -rf $(TOP_DIR)/docs/markdown + rm -f $(TOP_DIR)/docs/mkdocs.yml + + @# Remove more stuff related to git. + rm -rf $(TOP_DIR)/subprojects/dlg + rm -rf $(TOP_DIR)/subprojects/gnu-config + +# EOF diff --git a/vendor/freetype/builds/unix/.gitignore b/vendor/freetype/builds/unix/.gitignore new file mode 100644 index 00000000000..f89b226b81a --- /dev/null +++ b/vendor/freetype/builds/unix/.gitignore @@ -0,0 +1,18 @@ +aclocal.m4 +autom4te.cache +config.cache +config.guess +config.log +config.status +config.sub +configure +configure.ac +freetype2.pc +freetype-config +ftconfig.h +ftoption.h +install-sh +libtool +ltmain.sh +unix-cc.mk +unix-def.mk diff --git a/vendor/freetype/builds/unix/ax_compare_version.m4 b/vendor/freetype/builds/unix/ax_compare_version.m4 new file mode 100644 index 00000000000..ffb4997e8b1 --- /dev/null +++ b/vendor/freetype/builds/unix/ax_compare_version.m4 @@ -0,0 +1,177 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 13 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [invalid OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([invalid OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/vendor/freetype/builds/unix/ax_prog_python_version.m4 b/vendor/freetype/builds/unix/ax_prog_python_version.m4 new file mode 100644 index 00000000000..dbc3dbf1da6 --- /dev/null +++ b/vendor/freetype/builds/unix/ax_prog_python_version.m4 @@ -0,0 +1,66 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_python_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_PYTHON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# Makes sure that python supports the version indicated. If true the shell +# commands in ACTION-IF-TRUE are executed. If not the shell commands in +# ACTION-IF-FALSE are run. Note if $PYTHON is not set (for example by +# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail. +# +# Example: +# +# AC_PATH_PROG([PYTHON],[python]) +# AX_PROG_PYTHON_VERSION([2.4.4],[ ... ],[ ... ]) +# +# This will check to make sure that the python you have supports at least +# version 2.4.4. +# +# NOTE: This macro uses the $PYTHON variable to perform the check. +# AX_WITH_PYTHON can be used to set that variable prior to running this +# macro. The $PYTHON_VERSION variable will be valorized with the detected +# version. +# +# LICENSE +# +# Copyright (c) 2009 Francesco Salvestrini +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 12 + +AC_DEFUN([AX_PROG_PYTHON_VERSION],[ + AC_REQUIRE([AC_PROG_SED]) + AC_REQUIRE([AC_PROG_GREP]) + + AS_IF([test -n "$PYTHON"],[ + ax_python_version="$1" + + AC_MSG_CHECKING([for python version]) + changequote(<<,>>) + python_version=`$PYTHON -V 2>&1 | $GREP "^Python " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'` + changequote([,]) + AC_MSG_RESULT($python_version) + + AC_SUBST([PYTHON_VERSION],[$python_version]) + + AX_COMPARE_VERSION([$ax_python_version],[le],[$python_version],[ + : + $2 + ],[ + : + $3 + ]) + ],[ + AC_MSG_WARN([could not find the python interpreter]) + $3 + ]) +]) diff --git a/vendor/freetype/builds/unix/ax_pthread.m4 b/vendor/freetype/builds/unix/ax_pthread.m4 new file mode 100644 index 00000000000..e5858e50c3c --- /dev/null +++ b/vendor/freetype/builds/unix/ax_pthread.m4 @@ -0,0 +1,522 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# Copyright (c) 2019 Marc Stevens +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 30 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_TARGET]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $target_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +AS_IF([test "x$ax_pthread_clang" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread"]) + + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $target_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) + + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $target_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $target_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/vendor/freetype/builds/unix/configure.raw b/vendor/freetype/builds/unix/configure.raw new file mode 100644 index 00000000000..9a8d604f315 --- /dev/null +++ b/vendor/freetype/builds/unix/configure.raw @@ -0,0 +1,1234 @@ +# This file is part of the FreeType project. +# +# Process this file with autoconf to produce a configure script. +# +# Copyright (C) 2001-2024 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. + +AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype]) +AC_CONFIG_SRCDIR([ftconfig.h.in]) + + +# Don't forget to update `docs/VERSIONS.TXT'! + +version_info='26:2:20' +AC_SUBST([version_info]) +ft_version=`echo $version_info | tr : .` +AC_SUBST([ft_version]) + + +# checks for system type + +AC_CANONICAL_HOST + + +# checks for programs + +AC_PROG_CC +AC_PROG_CPP +AC_SUBST(EXEEXT) + +PKG_PROG_PKG_CONFIG([0.24]) + +LT_INIT(win32-dll) +AC_CHECK_HEADER([windows.h], [LT_PROG_RC]) + + +# checks for native programs to generate building tool + +if test ${cross_compiling} = yes; then + AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build}-gcc) + test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, gcc, gcc) + test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, cc, cc, , , /usr/ucb/cc) + test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, clang, clang) + test -z "${CC_BUILD}" && AC_MSG_ERROR([cannot find native C compiler]) + + AC_MSG_CHECKING([for suffix of native executables]) + rm -f a.* b.* a_out.exe conftest.* + echo > conftest.c "int main(void) { return 0;}" + ${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working]) + rm -f conftest.c + if test -x a.out -o -x b.out -o -x conftest; then + EXEEXT_BUILD="" + elif test -x a_out.exe -o -x conftest.exe; then + EXEEXT_BUILD=".exe" + elif test -x conftest.*; then + EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'` + fi + rm -f a.* b.* a_out.exe conftest.* + AC_MSG_RESULT($EXEEXT_BUILD) + CFLAGS_BUILD= + LDFLAGS_BUILD= +else + CC_BUILD=${CC} + CFLAGS_BUILD=${CFLAGS} + LDFLAGS_BUILD=${LDFLAGS} + EXEEXT_BUILD=${EXEEXT} +fi + +AC_SUBST(CC_BUILD) +AC_SUBST(CFLAGS_BUILD) +AC_SUBST(LDFLAGS_BUILD) +AC_SUBST(EXEEXT_BUILD) + + +# Since these files will be eventually called from another directory (namely +# from the top level) we make the path of the scripts absolute. +# +# This small code snippet has been taken from automake's `ylwrap' script. + +AC_PROG_INSTALL +case "$INSTALL" in +[[\\/]]* | ?:[[\\/]]*) + ;; +*[[\\/]]*) + INSTALL="`pwd`/$INSTALL" + ;; +esac + +AC_PROG_MKDIR_P +case "$MKDIR_P" in +[[\\/]]* | ?:[[\\/]]*) + ;; +*[[\\/]]*) + MKDIR_P="`pwd`/$MKDIR_P" + ;; +esac + + +# checks for header files + +AC_CHECK_HEADERS([fcntl.h unistd.h]) + + +# checks for typedefs, structures, and compiler characteristics + +AC_C_CONST + +AC_ARG_ENABLE([freetype-config], + AS_HELP_STRING([--enable-freetype-config], [install freetype-config]), + [case "${enableval}" in + yes) enable_freetype_config="TRUE" ;; + no) enable_freetype_config="FALSE" ;; + *) AC_MSG_ERROR([unknown value '${enableval}' passed with --enable-freetype-config]) ;; + esac], [enable_freetype_config="FALSE"]) + +AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config]) + +# checks for library functions + +AC_SYS_LARGEFILE + +# Here we check whether we can use our mmap file component. +# +# Note that `ftsystem.c` for Windows has its own mmap-like implementation +# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`. + +AC_ARG_ENABLE([mmap], + AS_HELP_STRING([--disable-mmap], + [do not check mmap() and do not use]), + [enable_mmap="no"], [enable_mmap="yes"]) +if test "x${enable_mmap}" != "xno"; then + case "$host" in + *-*-mingw*) + AC_MSG_CHECKING([for working mmap]) + AC_MSG_RESULT([using MapViewOfFile in Windows]) + FTSYS_SRC='$(TOP_DIR)/builds/windows/ftsystem.c' + ;; + *) + AC_FUNC_MMAP + if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then + FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c' + + AC_CHECK_DECLS([munmap], + [], + [], + [ + +#ifdef HAVE_UNISTD_H +#include +#endif +#include + + ]) + + FT_MUNMAP_PARAM + fi + ;; + esac +fi + +if test -z "$FTSYS_SRC"; then + FTSYS_SRC='$(BASE_DIR)/ftsystem.c' +fi +AC_SUBST([FTSYS_SRC]) + + +# get compiler flags right +# +# We try to make the compiler work for C99-strict source. Even if the +# C compiler is gcc and C99 flags are available, some system headers +# might be broken in C99 mode. We have to check whether compilation +# finishes successfully. +# +if test "x$GCC" = xyes; then + XX_CFLAGS="-Wall" + case "$host" in + *-*-mingw*) + XX_ANSIFLAGS="-pedantic" + ;; + *-*-aix*) + XX_ANSIFLAGS="-pedantic" + ;; + *) + XX_ANSIFLAGS="" + + for a in "-pedantic" "-std=c99" + do + AC_MSG_CHECKING([$CC compiler flag ${a} to assure ANSI C99 works correctly]) + orig_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +#include + + ], + [ + + { + puts( "" ); + return 0; + } + + ])], + [AC_MSG_RESULT([ok, adding to XX_ANSIFLAGS]) + XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}" + ], + [AC_MSG_RESULT([no])]) + CFLAGS="${orig_CFLAGS}" + done + ;; + esac +else + case "$host" in + *-dec-osf*) + CFLAGS= + XX_CFLAGS="-std1 -g3" + XX_ANSIFLAGS= + ;; + *) + XX_CFLAGS= + XX_ANSIFLAGS= + ;; + esac +fi +AC_SUBST([XX_CFLAGS]) +AC_SUBST([XX_ANSIFLAGS]) + + +# It is recommended that shared libraries hide symbols except those with +# explicit __attribute__((visibility("default"))). +# +found_visibility_flag=no +AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) +orig_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -fvisibility=hidden -Werror" +AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +__attribute__(( visibility( "default" ) )) int foo( void ); +__attribute__(( visibility( "hidden" ) )) int bar( void ); + +int foo( void ) { return 0; } +int bar( void ) { return 1; } + + ], + [])], + [found_visibility_flag=yes + CFLAGS="${orig_CFLAGS} -fvisibility=hidden" + AC_MSG_RESULT(yes) + ], + [CFLAGS="${orig_CFLAGS}" + AC_MSG_RESULT(no)]) + +if test "${found_visibility_flag}" = "no"; then + AC_MSG_CHECKING([for -xldscope=hidden compiler flag]) + orig_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} -xldscope=hidden" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [found_visibility_flag=yes + AC_MSG_RESULT(yes)], + [CFLAGS="${orig_CFLAGS}" + AC_MSG_RESULT(no)]) +fi + +# All library tests below try `pkg-config' first. If that fails, a function +# from the library is tested in the traditional autoconf way (zlib, bzip2), +# or a config script is called (libpng). +# +# The `xxx_reqpriv' variables are for the `Requires.private' field in +# `freetype2.pc'. The `xxx_libspriv' variables are for the `Libs.private' +# field in `freetype2.pc' if pkg-config doesn't find a proper .pc file. +# +# The `xxx_libsstaticconf' variables are for the `freetype-config' script. +# +# Note that a call to PKG_CHECK_MODULES(XXX, ...) sets and creates the +# output variables `XXX_CFLAGS' and `XXX_LIBS'. In case one or both are set +# for a library by the user, no entry for this library is added to +# `Requires.private'. Instead, it gets added to `Libs.private' + + +# check for system zlib + +AC_ARG_WITH([zlib], + [AS_HELP_STRING([--with-zlib=@<:@yes|no|auto@:>@], + [use system zlib instead of internal library @<:@default=auto@:>@])], + [], [with_zlib=auto]) + +have_zlib=no +if test x"$with_zlib" = xyes -o x"$with_zlib" = xauto; then + zlib_pkg="zlib" + have_zlib_pkg=no + + if test x"$ZLIB_CFLAGS" = x -a x"$ZLIB_LIBS" = x; then + PKG_CHECK_EXISTS([$zlib_pkg], [have_zlib_pkg=yes]) + fi + PKG_CHECK_MODULES([ZLIB], [$zlib_pkg], + [have_zlib="yes (pkg-config)"], [:]) + + if test $have_zlib_pkg = yes; then + # we have zlib.pc + zlib_reqpriv="$zlib_pkg" + zlib_libspriv= + zlib_libsstaticconf=`$PKG_CONFIG --static --libs "$zlib_pkg"` + else + zlib_reqpriv= + + if test "$have_zlib" != no; then + # ZLIB_CFLAGS and ZLIB_LIBS are set by the user + zlib_libspriv="$ZLIB_LIBS" + zlib_libsstaticconf="$ZLIB_LIBS" + have_zlib="yes (ZLIB_CFLAGS and ZLIB_LIBS)" + else + # fall back to standard autoconf test + AC_CHECK_LIB([z], + [gzsetparams], + [AC_CHECK_HEADER([zlib.h], + [have_zlib="yes (autoconf test)" + zlib_libspriv="-lz" + zlib_libsstaticconf="$zlib_libspriv" + ZLIB_LIBS="$zlib_libspriv"])]) + fi + fi +fi + +if test x"$with_zlib" = xyes -a "$have_zlib" = no; then + AC_MSG_ERROR([external zlib support requested but library not found]) +fi + +SYSTEM_ZLIB= +if test "$have_zlib" != no; then + SYSTEM_ZLIB=yes +fi +AC_SUBST([SYSTEM_ZLIB]) + + +# check for system libbz2 + +AC_ARG_WITH([bzip2], + [AS_HELP_STRING([--with-bzip2=@<:@yes|no|auto@:>@], + [support bzip2 compressed fonts @<:@default=auto@:>@])], + [], [with_bzip2=auto]) + +have_bzip2=no +if test x"$with_bzip2" = xyes -o x"$with_bzip2" = xauto; then + bzip2_pkg="bzip2" + have_bzip2_pkg=no + + if test x"$BZIP2_CFLAGS" = x -a x"$BZIP2_LIBS" = x; then + PKG_CHECK_EXISTS([$bzip2_pkg], [have_bzip2_pkg=yes]) + fi + PKG_CHECK_MODULES([BZIP2], [$bzip2_pkg], + [have_bzip2="yes (pkg-config)"], [:]) + + if test $have_bzip2_pkg = yes; then + # we have bzip2.pc + bzip2_reqpriv="$bzip2_pkg" + bzip2_libspriv= + bzip2_libsstaticconf=`$PKG_CONFIG --static --libs "$bzip2_pkg"` + else + bzip2_reqpriv= + + if test "$have_bzip2" != no; then + # BZIP2_CFLAGS and BZIP2_LIBS are set by the user + bzip2_libspriv="$BZIP2_LIBS" + bzip2_libsstaticconf="$BZIP2_LIBS" + have_bzip2="yes (BZIP2_CFLAGS and BZIP2_LIBS)" + else + # fall back to standard autoconf test + AC_CHECK_LIB([bz2], + [BZ2_bzDecompress], + [AC_CHECK_HEADER([bzlib.h], + [have_bzip2="yes (autoconf test)" + bzip2_libspriv="-lbz2" + bzip2_libsstaticconf="$bzip2_libspriv" + BZIP2_LIBS="$bzip2_libspriv"])]) + fi + fi +fi + +if test x"$with_bzip2" = xyes -a "$have_bzip2" = no; then + AC_MSG_ERROR([bzip2 support requested but library not found]) +fi + + +# check for system libpng + +AC_ARG_WITH([png], + [AS_HELP_STRING([--with-png=@<:@yes|no|auto@:>@], + [support png compressed OpenType embedded bitmaps @<:@default=auto@:>@])], + [], [with_png=auto]) + +have_libpng=no +if test x"$with_png" = xyes -o x"$with_png" = xauto; then + libpng_pkg="libpng" + have_libpng_pkg=no + + if test x"$LIBPNG_CFLAGS" = x -a x"$LIBPNG_LIBS" = x; then + PKG_CHECK_EXISTS([$libpng_pkg], [have_libpng_pkg=yes]) + fi + PKG_CHECK_MODULES([LIBPNG], [$libpng_pkg], + [have_libpng="yes (pkg-config)"], [:]) + + if test $have_libpng_pkg = yes; then + # we have libpng.pc + libpng_reqpriv="$libpng_pkg" + libpng_libspriv= + libpng_libsstaticconf=`$PKG_CONFIG --static --libs "$libpng_pkg"` + else + libpng_reqpriv= + + if test "$have_libpng" != no; then + # LIBPNG_CFLAGS and LIBPNG_LIBS are set by the user + libpng_libspriv="$LIBPNG_LIBS" + libpng_libsstaticconf="$LIBPNG_LIBS" + have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)" + else + # fall back to config script + AC_CHECK_PROG(have_libpng, [libpng-config], [yes (libpng-config)], [no]) + if test "$have_libpng" != no; then + LIBPNG_CFLAGS=`libpng-config --cflags` + LIBPNG_LIBS=`libpng-config --ldflags` + libpng_libspriv=`libpng-config --static --ldflags` + libpng_libsstaticconf="$libpng_libspriv" + fi + fi + fi +fi + +if test x"$with_png" = xyes -a "$have_libpng" = no; then + AC_MSG_ERROR([libpng support requested but library not found]) +fi + + +# check for system libharfbuzz + +AC_ARG_WITH([harfbuzz], + [AS_HELP_STRING([--with-harfbuzz=@<:@yes|dynamic|no|auto@:>@], + [improve auto-hinting of OpenType fonts @<:@default=auto@:>@])], + [], [with_harfbuzz=auto]) + +have_harfbuzz=no +if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then + harfbuzz_pkg="harfbuzz >= 2.0.0" + have_harfbuzz_pkg=no + + if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then + PKG_CHECK_EXISTS([$harfbuzz_pkg], [have_harfbuzz_pkg=yes]) + fi + PKG_CHECK_MODULES([HARFBUZZ], [$harfbuzz_pkg], + [have_harfbuzz="yes (pkg-config)"], [:]) + + if test $have_harfbuzz_pkg = yes; then + # we have harfbuzz.pc + harfbuzz_reqpriv="$harfbuzz_pkg" + harfbuzz_libspriv= + harfbuzz_libsstaticconf=`$PKG_CONFIG --static --libs "$harfbuzz_pkg"` + else + harfbuzz_reqpriv= + + if test "$have_harfbuzz" != no; then + # HARFBUZZ_CFLAGS and HARFBUZZ_LIBS are set by the user + harfbuzz_libspriv="$HARFBUZZ_LIBS" + harfbuzz_libsstaticconf="$HARFBUZZ_LIBS" + have_harfbuzz="yes (HARFBUZZ_CFLAGS and HARFBUZZ_LIBS)" + else + # since HarfBuzz is quite a new library we don't fall back to a + # different test; additionally, it has too many dependencies + : + fi + fi +fi + +have_harfbuzz_dynamic=no +if test x"$have_harfbuzz" = xno; then + if test x"$with_harfbuzz" = xdynamic -o x"$with_harfbuzz" = xauto; then + case "$host" in + *-*-mingw*) + # Windows uses its own LoadLibrary(), set variables to dynamic. + have_harfbuzz_dynamic=yes + have_harfbuzz="yes (dynamic)" + ;; + *) + # Check for libdl + AC_CHECK_LIB([c], + [dlopen], + [have_harfbuzz_dynamic=yes], + AC_CHECK_LIB([dl], + [dlopen], + [have_harfbuzz_dynamic=yes + need_libdl=yes])) + if test x"$have_harfbuzz_dynamic" = xyes; then + have_harfbuzz="yes (dynamic)" + HARFBUZZ_CFLAGS= + if test x"$need_libdl" = xyes; then + HARFBUZZ_LIBS="-ldl" + fi + fi + ;; + esac + fi +fi + +if test x"$have_harfbuzz" = xno; then + if test x"$with_harfbuzz" != xno -a "$with_harfbuzz" != xauto; then + AC_MSG_ERROR([harfbuzz support requested but library not found]) + fi +fi + +# check for system libbrotlidec + +AC_ARG_WITH([brotli], + [AS_HELP_STRING([--with-brotli=@<:@yes|no|auto@:>@], + [support decompression of WOFF2 streams @<:@default=auto@:>@])], + [], [with_brotli=auto]) + +have_brotli=no +if test x"$with_brotli" = xyes -o x"$with_brotli" = xauto; then + brotli_pkg="libbrotlidec" + have_brotli_pkg=no + + if test x"$BROTLI_CFLAGS" = x -a x"$BROTLI_LIBS" = x; then + PKG_CHECK_EXISTS([$brotli_pkg], [have_brotli_pkg=yes]) + fi + PKG_CHECK_MODULES([BROTLI], [$brotli_pkg], + [have_brotli="yes (pkg-config)"], [:]) + + if test $have_brotli_pkg = yes; then + # we have libbrotlidec.pc + brotli_reqpriv="$brotli_pkg" + brotli_libspriv= + brotli_libsstaticconf=`$PKG_CONFIG --static --libs "$brotli_pkg"` + else + brotli_reqpriv= + + if test "$have_brotli" != no; then + # BROTLI_CFLAGS and BROTLI_LIBS are set by the user + brotli_libspriv="$BROTLI_LIBS" + brotli_libsstaticconf="$BROTLI_LIBS" + have_brotli="yes (BROTLI_CFLAGS and BROTLI_LIBS)" + else + # since Brotli is quite a new library we don't fall back to a + # different test + : + fi + fi +fi + +if test x"$with_brotli" = xyes -a "$have_brotli" = no; then + AC_MSG_ERROR([brotli support requested but library not found]) +fi + + +# Checks for the demo programs. +# +# FreeType doesn't need this. However, since the demo program repository +# doesn't come with a `configure` script of its own, we integrate the tests +# here for simplicity. + +# We need `clock_gettime` from 'librt' for the `ftbench` demo program. +# +# The code is modeled after gnulib's file `clock_time.m4`, ignoring +# very old Solaris systems. +LIB_CLOCK_GETTIME= +AC_SEARCH_LIBS([clock_gettime], + [rt], + [test "$ac_cv_search_clock_gettime" = "none required" \ + || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + +FT_DEMO_CFLAGS="" +FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME" + +# 'librsvg' is needed to demonstrate SVG support. +AC_ARG_WITH([librsvg], + [AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@], + [support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])], + [], [with_librsvg=auto]) + +have_librsvg=no +if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then + PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0], + [have_librsvg="yes (pkg-config)"], [:]) + + if test "$have_librsvg" != no; then + FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG" + FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS" + fi +fi + +if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then + AC_MSG_ERROR([librsvg support requested but library not found]) +fi + +AC_SUBST([FT_DEMO_CFLAGS]) +AC_SUBST([FT_DEMO_LDFLAGS]) + + +# Some options handling SDKs/archs in CFLAGS should be copied +# to LDFLAGS. Apple TechNote 2137 recommends to include these +# options in CFLAGS but not in LDFLAGS. + +save_config_args=$* +set dummy ${CFLAGS} +i=1 +while test $i -le $# +do + c=$1 + + case "${c}" in + -isysroot|-arch) # options taking 1 argument + a=$2 + AC_MSG_CHECKING([whether CFLAGS and LDFLAGS share ${c} ${a}]) + if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null + then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, copy to LDFLAGS]) + LDFLAGS="${LDFLAGS} ${c} ${a}" + fi + shift 1 + ;; + -m32|-m64|-march=*|-mcpu=*) # options taking no argument + AC_MSG_CHECKING([whether CFLAGS and LDFLAGS share ${c}]) + if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null + then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, copy to LDFLAGS]) + LDFLAGS="${LDFLAGS} ${c}" + fi + ;; + # *) + # AC_MSG_RESULT([${c} is not copied to LDFLAGS]) + # ;; + esac + + shift 1 +done +set ${save_config_args} + + +# Whether to use Mac OS resource-based fonts. + +ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default + +AC_ARG_WITH([old-mac-fonts], + AS_HELP_STRING([--with-old-mac-fonts], + [allow Mac resource-based fonts to be used])) +if test x$with_old_mac_fonts = xyes; then + orig_LDFLAGS="${LDFLAGS}" + AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X]) + ft2_extra_libs="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices" + LDFLAGS="$LDFLAGS $ft2_extra_libs" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + short res = 0; + + + UseResFile( res ); + + ])], + [AC_MSG_RESULT([ok]) + ftmac_c='ftmac.c' + AC_MSG_CHECKING([whether OS_INLINE macro is ANSI compatible]) + orig_CFLAGS="$CFLAGS -DFT_MACINTOSH" + CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + /* OSHostByteOrder() is typed as OS_INLINE */ + int32_t os_byte_order = OSHostByteOrder(); + + + if ( OSBigEndian != os_byte_order ) + return 1; + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$orig_CFLAGS" + CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1" + ], + [AC_MSG_RESULT([no, ANSI incompatible]) + CFLAGS="$orig_CFLAGS" + ]) + AC_MSG_CHECKING([type ResourceIndex]) + orig_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +# include +#endif + + ], + [ + + ResourceIndex i = 0; + return i; + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$orig_CFLAGS" + CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=1" + ], + [AC_MSG_RESULT([no]) + CFLAGS="$orig_CFLAGS" + CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0" + ])], + [AC_MSG_RESULT([not found]) + ft2_extra_libs="" + LDFLAGS="${orig_LDFLAGS}" + CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"]) +else + case x$host_os in + xdarwin*) + dnl AC_MSG_WARN([host system is MacOS but configured to build without Carbon]) + CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" + ;; + *) + ;; + esac +fi + + +# Whether to use FileManager, which is deprecated since Mac OS X 10.4. + +AC_ARG_WITH([fsspec], + AS_HELP_STRING([--with-fsspec], + [use obsolete FSSpec API of MacOS, if available (default=yes)])) +if test x$with_fsspec = xno; then + CFLAGS="$CFLAGS -DHAVE_FSSPEC=0" +elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then + AC_MSG_CHECKING([FSSpec-based FileManager]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + FCBPBPtr paramBlock; + short vRefNum; + long dirID; + ConstStr255Param fileName; + FSSpec* spec; + + + /* FSSpec functions: deprecated since Mac OS X 10.4 */ + PBGetFCBInfoSync( paramBlock ); + FSMakeFSSpec( vRefNum, dirID, fileName, spec ); + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"], + [AC_MSG_RESULT([not found]) + CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"]) +fi + + +# Whether to use FileManager in Carbon since MacOS 9.x. + +AC_ARG_WITH([fsref], + AS_HELP_STRING([--with-fsref], + [use Carbon FSRef API of MacOS, if available (default=yes)])) +if test x$with_fsref = xno; then + AC_MSG_WARN([ +*** WARNING + FreeType2 built without FSRef API cannot load + data-fork fonts on MacOS, except of XXX.dfont. + ]) + CFLAGS="$CFLAGS -DHAVE_FSREF=0" +elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then + AC_MSG_CHECKING([FSRef-based FileManager]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + short vRefNum; + long dirID; + ConstStr255Param fileName; + + Boolean* isDirectory; + UInt8* path; + SInt16 desiredRefNum; + SInt16* iterator; + SInt16* actualRefNum; + HFSUniStr255* outForkName; + FSVolumeRefNum volume; + FSCatalogInfoBitmap whichInfo; + FSCatalogInfo* catalogInfo; + FSForkInfo* forkInfo; + FSRef* ref; + +#if HAVE_FSSPEC + FSSpec* spec; +#endif + + /* FSRef functions: no need to check? */ + FSGetForkCBInfo( desiredRefNum, volume, iterator, + actualRefNum, forkInfo, ref, + outForkName ); + FSPathMakeRef( path, ref, isDirectory ); + +#if HAVE_FSSPEC + FSpMakeFSRef ( spec, ref ); + FSGetCatalogInfo( ref, whichInfo, catalogInfo, + outForkName, spec, ref ); +#endif + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$CFLAGS -DHAVE_FSREF=1"], + [AC_MSG_RESULT([not found]) + CFLAGS="$CFLAGS -DHAVE_FSREF=0"]) +fi + + +# Whether to use QuickDraw API in ToolBox, which is deprecated since +# Mac OS X 10.4. + +AC_ARG_WITH([quickdraw-toolbox], + AS_HELP_STRING([--with-quickdraw-toolbox], + [use MacOS QuickDraw in ToolBox, if available (default=yes)])) +if test x$with_quickdraw_toolbox = xno; then + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0" +elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then + AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + Str255 familyName; + SInt16 familyID = 0; + FMInput* fmIn = NULL; + FMOutput* fmOut = NULL; + + + GetFontName( familyID, familyName ); + GetFNum( familyName, &familyID ); + fmOut = FMSwapFont( fmIn ); + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"], + [AC_MSG_RESULT([not found]) + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"]) +fi + + +# Whether to use QuickDraw API in Carbon, which is deprecated since +# Mac OS X 10.4. + +AC_ARG_WITH([quickdraw-carbon], + AS_HELP_STRING([--with-quickdraw-carbon], + [use MacOS QuickDraw in Carbon, if available (default=yes)])) +if test x$with_quickdraw_carbon = xno; then + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0" +elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then + AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + FMFontFamilyIterator famIter; + FMFontFamily family; + Str255 famNameStr; + FMFontFamilyInstanceIterator instIter; + FMFontStyle style; + FMFontSize size; + FMFont font; + FSSpec* pathSpec; + + + FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption, + &famIter ); + FMGetNextFontFamily( &famIter, &family ); + FMGetFontFamilyName( family, famNameStr ); + FMCreateFontFamilyInstanceIterator( family, &instIter ); + FMGetNextFontFamilyInstance( &instIter, &font, &style, &size ); + FMDisposeFontFamilyInstanceIterator( &instIter ); + FMDisposeFontFamilyIterator( &famIter ); + FMGetFontContainer( font, pathSpec ); + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"], + [AC_MSG_RESULT([not found]) + CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"]) +fi + + +# Whether to use AppleTypeService since Mac OS X. + +AC_ARG_WITH([ats], + AS_HELP_STRING([--with-ats], + [use AppleTypeService, if available (default=yes)])) +if test x$with_ats = xno; then + CFLAGS="$CFLAGS -DHAVE_ATS=0" +elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then + AC_MSG_CHECKING([AppleTypeService functions]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +#endif + + ], + [ + + FSSpec* pathSpec; + + + ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope ); +#if HAVE_FSSPEC + ATSFontGetFileSpecification( 0, pathSpec ); +#endif + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$CFLAGS -DHAVE_ATS=1"], + [AC_MSG_RESULT([not found]) + CFLAGS="$CFLAGS -DHAVE_ATS=0"]) +fi + +case "$CFLAGS" in + *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* ) + AC_MSG_WARN([ +*** WARNING + FSSpec/FSRef/QuickDraw/ATS options are explicitly given, + thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c. + ]) + CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/' + ;; + *) + ;; +esac + +# Check for pthreads + +AX_PTHREAD([have_pthread=yes], [have_pthread=no]) + +# Check for Python and docwriter +PYTHON_MIN_VERSION=3.5 +have_py3=no +have_docwriter=no +PIP=pip + +AC_CHECK_PROGS([PYTHON], [python3 python], [missing]) +if test "x$PYTHON" != "xmissing"; then + AX_PROG_PYTHON_VERSION([$PYTHON_MIN_VERSION], [have_py3=yes], []) + + if test "x$have_py3" = "xyes"; then + PIP="$PYTHON -m $PIP" + AC_MSG_CHECKING([for `docwriter' Python module]) + $PYTHON -m docwriter -h > /dev/null 2>&1 + if test "x$?" = "x0"; then + have_docwriter=yes + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +fi + + +# entries in Requires.private are separated by commas +PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \ + $bzip2_reqpriv, \ + $libpng_reqpriv, \ + $harfbuzz_reqpriv, \ + $brotli_reqpriv" +# beautify +PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \ + | sed -e 's/^ *//' \ + -e 's/ *$//' \ + -e 's/, */,/g' \ + -e 's/,,*/,/g' \ + -e 's/^,*//' \ + -e 's/,*$//' \ + -e 's/,/, /g'` + +PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \ + $bzip2_libspriv \ + $libpng_libspriv \ + $harfbuzz_libspriv \ + $brotli_libspriv \ + $ft2_extra_libs" +# beautify +PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \ + | sed -e 's/^ *//' \ + -e 's/ *$//' \ + -e 's/ */ /g'` + +LIBSSTATIC_CONFIG="-lfreetype \ + $zlib_libsstaticconf \ + $bzip2_libsstaticconf \ + $libpng_libsstaticconf \ + $harfbuzz_libsstaticconf \ + $brotli_libsstaticconf \ + $ft2_extra_libs" +# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later +# on if necessary; also beautify +LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \ + | sed -e 's|-L */usr/lib64/* | |g' \ + -e 's|-L */usr/lib/* | |g' \ + -e 's/^ *//' \ + -e 's/ *$//' \ + -e 's/ */ /g'` + +# If FreeType gets installed with `--disable-shared', don't use +# 'private' fields. `pkg-config' only looks into `.pc' files and is +# completely agnostic to whether shared libraries are actually present +# or not. As a consequence, the user had to specify `--static' while +# calling `pkg-config', which configure scripts are normally not +# prepared for. + +PKGCONFIG_REQUIRES= +PKGCONFIG_LIBS='-L${libdir} -lfreetype' + +if test $enable_shared = "no"; then + PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE" + PKGCONFIG_REQUIRES_PRIVATE= + PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE" + PKGCONFIG_LIBS_PRIVATE= +fi + +AC_SUBST([ftmac_c]) +AC_SUBST([PKGCONFIG_REQUIRES]) +AC_SUBST([PKGCONFIG_LIBS]) +AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE]) +AC_SUBST([PKGCONFIG_LIBS_PRIVATE]) +AC_SUBST([LIBSSTATIC_CONFIG]) + +AC_SUBST([hardcode_libdir_flag_spec]) +AC_SUBST([wl]) +AC_SUBST([build_libtool_libs]) + + +# changing LDFLAGS value should only be done after +# lt_cv_prog_compiler_static_works test + +ftoption_set() +{ + regexp="-e \\\"s|.*#.*def.*$1\>.*|#define $1|\\\"" + FTOPTION_H_SED="$FTOPTION_H_SED $regexp" +} + +ftoption_unset() +{ + regexp="-e \\\"s|.*#.*def.*$1\>.*|/* #undef $1 */|\\\"" + FTOPTION_H_SED="$FTOPTION_H_SED $regexp" +} + +if test "$have_zlib" != no; then + CFLAGS="$CFLAGS $ZLIB_CFLAGS" + LDFLAGS="$LDFLAGS $ZLIB_LIBS" + ftoption_set FT_CONFIG_OPTION_SYSTEM_ZLIB +else + ftoption_unset FT_CONFIG_OPTION_SYSTEM_ZLIB +fi +if test "$have_bzip2" != no; then + CFLAGS="$CFLAGS $BZIP2_CFLAGS" + LDFLAGS="$LDFLAGS $BZIP2_LIBS" + ftoption_set FT_CONFIG_OPTION_USE_BZIP2 +else + ftoption_unset FT_CONFIG_OPTION_USE_BZIP2 +fi +if test "$have_libpng" != no; then + CFLAGS="$CFLAGS $LIBPNG_CFLAGS" + LDFLAGS="$LDFLAGS $LIBPNG_LIBS" + ftoption_set FT_CONFIG_OPTION_USE_PNG +else + ftoption_unset FT_CONFIG_OPTION_USE_PNG +fi +if test "$have_harfbuzz" != no; then + CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS" + LDFLAGS="$LDFLAGS $HARFBUZZ_LIBS" + ftoption_set FT_CONFIG_OPTION_USE_HARFBUZZ +else + ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ +fi +if test "$have_harfbuzz_dynamic" != no; then + ftoption_set FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC +else + ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC +fi +if test "$have_brotli" != no; then + CFLAGS="$CFLAGS $BROTLI_CFLAGS" + LDFLAGS="$LDFLAGS $BROTLI_LIBS" + ftoption_set FT_CONFIG_OPTION_USE_BROTLI +else + ftoption_unset FT_CONFIG_OPTION_USE_BROTLI +fi + +if test "$have_pthread" != no; then + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS" +fi + +AC_SUBST([CFLAGS]) +AC_SUBST([LDFLAGS]) + +# We don't want to use a template file for `ftoption.h', since compilation +# should work without calling a configure script also. For this reason, we +# copy the `include/freetype/config/ftoption.h' file to the `unix/builds' +# directory (using a dummy `AC_CONFIG_FILES' call) and apply the just +# constructed $FTOPTION_H_SED regexp (using the post-action of +# `AC_CONFIG_FILES'); this is also the version that gets installed later on. +# +AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h], + [mv ftoption.h ftoption.tmp + eval "sed $FTOPTION_H_SED < ftoption.tmp > ftoption.h" + rm ftoption.tmp], + [FTOPTION_H_SED="$FTOPTION_H_SED"]) + +AC_CONFIG_HEADERS([ftconfig.h]) + +# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' +# and `builds/unix/unix-cc.mk' that will be used by the build system +# +AC_CONFIG_FILES([unix-cc.mk:unix-cc.in + unix-def.mk:unix-def.in]) + +AC_OUTPUT + +AC_MSG_NOTICE([ + +Library configuration: + external zlib: $have_zlib + bzip2: $have_bzip2 + libpng: $have_libpng + harfbuzz: $have_harfbuzz + brotli: $have_brotli + pthread: $have_pthread +]) + +# Warn if docwriter is not installed + +if test $have_docwriter = no; then + AC_MSG_WARN([ + `make refdoc' will fail since pip package `docwriter' is not installed. + To install, run `$PIP install docwriter', or to use a Python + virtual environment, run `make refdoc-venv' (requires pip package + `virtualenv'). These operations require Python >= $PYTHON_MIN_VERSION. + ]) +fi + +# Warn if pthread is not available + +if test $have_pthread = no; then + AC_MSG_WARN([ + `FT_DEBUG_LOGGING' will not work since the `pthread' library is not + available. This warning can be safely ignored if you don't plan to use + this configuration macro. + ]) +fi + +# end of configure.raw diff --git a/vendor/freetype/builds/unix/detect.mk b/vendor/freetype/builds/unix/detect.mk new file mode 100644 index 00000000000..28e6b74ecc6 --- /dev/null +++ b/vendor/freetype/builds/unix/detect.mk @@ -0,0 +1,99 @@ +# +# FreeType 2 configuration file to detect a UNIX host platform. +# + + +# Copyright (C) 1996-2024 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. + +.PHONY: setup + +ifeq ($(PLATFORM),ansi) + + # Note: this test is duplicated in "builds/toplevel.mk". + # + is_unix := $(strip $(wildcard /sbin/init) \ + $(wildcard /usr/sbin/init) \ + $(wildcard /dev/null) \ + $(wildcard /hurd/auth)) + ifneq ($(is_unix),) + + PLATFORM := unix + + endif # test is_unix +endif # test PLATFORM ansi + +ifeq ($(PLATFORM),unix) + COPY := cp + DELETE := rm -f + CAT := cat + + # If `devel' is the requested target, we use a special configuration + # file named `unix-dev.mk'. It disables optimization and libtool. + # + ifneq ($(findstring devel,$(MAKECMDGOALS)),) + CONFIG_FILE := unix-dev.mk + CC := gcc + + .PHONY: devel + devel: setup + @: + else + + # If `lcc' is the requested target, we use a special configuration + # file named `unix-lcc.mk'. It disables libtool for LCC. + # + ifneq ($(findstring lcc,$(MAKECMDGOALS)),) + CONFIG_FILE := unix-lcc.mk + CC := lcc + + .PHONY: lcc + lcc: setup + @: + else + + # If a Unix platform is detected, the configure script is called and + # `unix-def.mk' together with `unix-cc.mk' is created. + # + # Arguments to `configure' should be in the CFG variable. Example: + # + # make CFG="--prefix=/usr --disable-static" + # + # If you need to set CFLAGS or LDFLAGS, do it here also. + # + # Feel free to add support for other platform specific compilers in + # this directory (e.g. solaris.mk + changes here to detect the + # platform). + # + CONFIG_FILE := unix.mk + must_configure := 1 + + .PHONY: unix + unix: setup + @: + endif + endif + + have_Makefile := $(wildcard $(OBJ_DIR)/Makefile) + + setup: std_setup + ifdef must_configure + ifneq ($(have_Makefile),) + # we are building FT2 not in the src tree + $(TOP_DIR)/builds/unix/configure $(value CFG) + else + cd builds/unix; \ + ./configure $(value CFG) + endif + endif + +endif # test PLATFORM unix + + +# EOF diff --git a/vendor/freetype/builds/unix/freetype-config.in b/vendor/freetype/builds/unix/freetype-config.in new file mode 100644 index 00000000000..f9fd1cb80de --- /dev/null +++ b/vendor/freetype/builds/unix/freetype-config.in @@ -0,0 +1,211 @@ +#! /bin/sh +# +# Copyright (C) 2000-2024 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. + +LC_ALL=C +export LC_ALL + + +# if `pkg-config' is available, use values from `freetype2.pc' +%PKG_CONFIG% --atleast-pkgconfig-version 0.24 >/dev/null 2>&1 +if test $? -eq 0 ; then + # note that option `--variable' is not affected by the + # PKG_CONFIG_SYSROOT_DIR environment variable + if test "x$SYSROOT" != "x" ; then + PKG_CONFIG_SYSROOT_DIR="$SYSROOT" + export PKG_CONFIG_SYSROOT_DIR + fi + + prefix=`%PKG_CONFIG% --variable prefix freetype2` + exec_prefix=`%PKG_CONFIG% --variable exec_prefix freetype2` + + includedir=`%PKG_CONFIG% --variable includedir freetype2` + libdir=`%PKG_CONFIG% --variable libdir freetype2` + + version=`%PKG_CONFIG% --modversion freetype2` + + cflags=`%PKG_CONFIG% --cflags freetype2` + dynamic_libs=`%PKG_CONFIG% --libs freetype2` + static_libs=`%PKG_CONFIG% --static --libs freetype2` +else + prefix="%prefix%" + exec_prefix="%exec_prefix%" + + includedir="%includedir%" + libdir="%libdir%" + + version=%ft_version% + + cflags="-I${SYSROOT}$includedir/freetype2" + dynamic_libs="-lfreetype" + static_libs="%LIBSSTATIC_CONFIG%" + if test "${SYSROOT}$libdir" != "/usr/lib" && + test "${SYSROOT}$libdir" != "/usr/lib64" ; then + libs_L="-L${SYSROOT}$libdir" + fi +fi + +orig_prefix=$prefix +orig_exec_prefix=$exec_prefix + +orig_includedir=$includedir +orig_libdir=$libdir + +include_suffix=`echo $includedir | sed "s|$prefix||"` +lib_suffix=`echo $libdir | sed "s|$exec_prefix||"` + + +usage() +{ + cat <&2 +fi + + +while test $# -gt 0 ; do + case "$1" in + -*=*) + optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` + ;; + *) + optarg= + ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + local_prefix=yes + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + local_prefix=yes + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --version) + echo_version=yes + break + ;; + --ftversion) + echo_ft_version=yes + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + --libtool) + echo_libtool=yes + ;; + --static) + show_static=yes + ;; + --help) + usage 0 + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + + +if test "$local_prefix" = "yes" ; then + if test "$exec_prefix_set" != "yes" ; then + exec_prefix=$prefix + fi +fi + +if test "$local_prefix" = "yes" ; then + includedir=${prefix}${include_suffix} + if test "$exec_prefix_set" = "yes" ; then + libdir=${exec_prefix}${lib_suffix} + else + libdir=${prefix}${lib_suffix} + fi +fi + + +if test "$echo_version" = "yes" ; then + echo $version +fi + +if test "$echo_prefix" = "yes" ; then + echo ${SYSROOT}$prefix +fi + +if test "$echo_exec_prefix" = "yes" ; then + echo ${SYSROOT}$exec_prefix +fi + +if test "$echo_ft_version" = "yes" ; then + major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \ + | grep FREETYPE_MAJOR \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + minor=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \ + | grep FREETYPE_MINOR \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + patch=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \ + | grep FREETYPE_PATCH \ + | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'` + echo $major.$minor.$patch +fi + +if test "$echo_cflags" = "yes" ; then + echo $cflags | sed "s|$orig_includedir/freetype2|$includedir/freetype2|" +fi + +if test "$echo_libs" = "yes" ; then + if test "$show_static" = "yes" ; then + libs="$libs_L $static_libs" + else + libs="$libs_L $dynamic_libs" + fi + echo $libs | sed "s|$orig_libdir|$libdir|" +fi + +if test "$echo_libtool" = "yes" ; then + echo ${SYSROOT}$libdir/libfreetype.la +fi + +# EOF diff --git a/vendor/freetype/builds/unix/freetype2.in b/vendor/freetype/builds/unix/freetype2.in new file mode 100644 index 00000000000..fe389f4b6fe --- /dev/null +++ b/vendor/freetype/builds/unix/freetype2.in @@ -0,0 +1,14 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: FreeType 2 +URL: https://freetype.org +Description: A free, high-quality, and portable font engine. +Version: %ft_version% +Requires: %PKGCONFIG_REQUIRES% +Requires.private: %PKGCONFIG_REQUIRES_PRIVATE% +Libs: %PKGCONFIG_LIBS% +Libs.private: %PKGCONFIG_LIBS_PRIVATE% +Cflags: -I${includedir}/freetype2 diff --git a/vendor/freetype/builds/unix/freetype2.m4 b/vendor/freetype/builds/unix/freetype2.m4 new file mode 100644 index 00000000000..7fbda6b1f81 --- /dev/null +++ b/vendor/freetype/builds/unix/freetype2.m4 @@ -0,0 +1,194 @@ +# Configure paths for FreeType2 +# Marcelo Magallon 2001-10-26, based on `gtk.m4` by Owen Taylor +# +# Copyright (C) 2001-2024 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. +# +# As a special exception to the FreeType project license, this file may be +# distributed as part of a program that contains a configuration script +# generated by Autoconf, under the same distribution terms as the rest of +# that program. +# +# serial 7 + +# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. +# MINIMUM-VERSION is what libtool reports; the default is '7.0.1' (this is +# FreeType 2.0.4). +# +# To make this code work with older autoconf versions, `AS_HELP_STRING` is +# not quoted. +# +AC_DEFUN([AC_CHECK_FT2], + [# Get the cflags and libraries from the freetype-config script + # + AC_ARG_WITH([ft-prefix], + AS_HELP_STRING([--with-ft-prefix=PREFIX], + [Prefix where FreeType is installed (optional)]), + [ft_config_prefix="$withval"], + [ft_config_prefix=""]) + + AC_ARG_WITH([ft-exec-prefix], + AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], + [Exec prefix where FreeType is installed (optional)]), + [ft_config_exec_prefix="$withval"], + [ft_config_exec_prefix=""]) + + AC_ARG_ENABLE([freetypetest], + AS_HELP_STRING([--disable-freetypetest], + [Do not try to compile and run a test FreeType program]), + [], + [enable_fttest=yes]) + + if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi + fi + + if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi + fi + + if test "x$FT2_CONFIG" = x ; then + AC_PATH_TOOL([FT2_CONFIG], [freetype-config], [no]) + fi + + min_ft_version=m4_if([$1], [], [7.0.1], [$1]) + AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) + no_ft="" + if test "$FT2_CONFIG" = "no" ; then + no_ft=yes + else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else + if test $ft_config_minor_version -eq $ft_min_minor_version ; then + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" + + # + # Sanity checks for the results of freetype-config to some extent. + # + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ + +#include +#include +#include +#include + +int +main(void) +{ + FT_Library library; + FT_Error error; + + error = FT_Init_FreeType(&library); + + if (error) + return 1; + else + { + FT_Done_FreeType(library); + return 0; + } +} + + ]]) + ], + [], + [no_ft=yes], + [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi # test $ft_config_version -lt $ft_min_version + fi # test x$enable_fttest = xyes + fi # test "$FT2_CONFIG" = "no" + + if test x$no_ft = x ; then + AC_MSG_RESULT([yes]) + m4_if([$2], [], [:], [$2]) + else + AC_MSG_RESULT([no]) + if test "$FT2_CONFIG" = "no" ; then + AC_MSG_WARN([ + + The freetype-config script installed by FreeType 2 could not be found. + If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in + your path, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + ]) + else + if test x$ft_config_is_lt = xyes ; then + AC_MSG_WARN([ + + Your installed version of the FreeType 2 library is too old. + If you have different versions of FreeType 2, make sure that + correct values for --with-ft-prefix or --with-ft-exec-prefix + are used, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + ]) + else + AC_MSG_WARN([ + + The FreeType test program failed to run. If your system uses + shared libraries and they are installed outside the normal + system library path, make sure the variable LD_LIBRARY_PATH + (or whatever is appropriate for your system) is correctly set. + ]) + fi + fi + + FT2_CFLAGS="" + FT2_LIBS="" + m4_if([$3], [], [:], [$3]) + fi + + AC_SUBST([FT2_CFLAGS]) + AC_SUBST([FT2_LIBS])]) + +# end of freetype2.m4 diff --git a/vendor/freetype/builds/unix/ft-munmap.m4 b/vendor/freetype/builds/unix/ft-munmap.m4 new file mode 100644 index 00000000000..d398736a9e5 --- /dev/null +++ b/vendor/freetype/builds/unix/ft-munmap.m4 @@ -0,0 +1,32 @@ +## FreeType specific autoconf tests +# +# Copyright (C) 2002-2024 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. + +# serial 2 + +AC_DEFUN([FT_MUNMAP_PARAM], + [AC_MSG_CHECKING([for munmap's first parameter type]) + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + +#include +#include +int munmap(void *, size_t); + + ]]) + ], + [AC_MSG_RESULT([void *]) + AC_DEFINE([MUNMAP_USES_VOIDP], + [], + [Define to 1 if the first argument of munmap is of type void *])], + [AC_MSG_RESULT([char *])]) + ]) + +# end of ft-munmap.m4 diff --git a/vendor/freetype/builds/unix/ftconfig.h.in b/vendor/freetype/builds/unix/ftconfig.h.in new file mode 100644 index 00000000000..da0d22ca494 --- /dev/null +++ b/vendor/freetype/builds/unix/ftconfig.h.in @@ -0,0 +1,52 @@ +/**************************************************************************** + * + * ftconfig.h.in + * + * UNIX-specific configuration file (specification only). + * + * Copyright (C) 1996-2024 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 header file contains a number of macro definitions that are used by + * the rest of the engine. Most of the macros here are automatically + * determined at compile time, and you should not need to change it to port + * FreeType, except to compile the library with a non-ANSI compiler. + * + * Note however that if some specific modifications are needed, we advise + * you to place a modified copy in your build directory. + * + * The build directory is usually `builds/`, and contains + * system-specific files that are always included first when building the + * library. + * + */ + +#ifndef FTCONFIG_H_ +#define FTCONFIG_H_ + +#include +#include FT_CONFIG_OPTIONS_H +#include FT_CONFIG_STANDARD_LIBRARY_H + +#undef HAVE_UNISTD_H +#undef HAVE_FCNTL_H + +#include +#include +#include + +#endif /* FTCONFIG_H_ */ + + +/* END */ diff --git a/vendor/freetype/builds/unix/ftsystem.c b/vendor/freetype/builds/unix/ftsystem.c new file mode 100644 index 00000000000..42895e8f5ab --- /dev/null +++ b/vendor/freetype/builds/unix/ftsystem.c @@ -0,0 +1,436 @@ +/**************************************************************************** + * + * ftsystem.c + * + * Unix-specific FreeType low-level system interface (body). + * + * Copyright (C) 1996-2024 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 + /* we use our special ftconfig.h file, not the standard one */ +#include FT_CONFIG_CONFIG_H +#include +#include +#include +#include +#include + + /* memory-mapping includes and definitions */ +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +#ifndef MAP_FILE +#define MAP_FILE 0x00 +#endif + +#ifdef MUNMAP_USES_VOIDP +#define MUNMAP_ARG_CAST void * +#else +#define MUNMAP_ARG_CAST char * +#endif + +#ifdef NEED_MUNMAP_DECL + +#ifdef __cplusplus + extern "C" +#else + extern +#endif + int + munmap( char* addr, + int len ); + +#define MUNMAP_ARG_CAST char * + +#endif /* NEED_DECLARATION_MUNMAP */ + + +#include +#include + +#ifdef HAVE_FCNTL_H +#include +#endif + +#include +#include +#include +#include + + + /************************************************************************** + * + * 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_mem_alloc() or ft_mem_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 ); + } + + + /************************************************************************** + * + * @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 ); + } + + + /************************************************************************** + * + * @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 ); + } + + + /************************************************************************** + * + * 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 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 ) + + + /************************************************************************** + * + * @Function: + * ft_close_stream_by_munmap + * + * @Description: + * The function to close a stream which is opened by mmap. + * + * @Input: + * stream :: A pointer to the stream object. + */ + FT_CALLBACK_DEF( void ) + ft_close_stream_by_munmap( FT_Stream stream ) + { + munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size ); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = NULL; + } + + + /************************************************************************** + * + * @Function: + * ft_close_stream_by_free + * + * @Description: + * The function to close a stream which is created by ft_alloc. + * + * @Input: + * stream :: A pointer to the stream object. + */ + FT_CALLBACK_DEF( void ) + ft_close_stream_by_free( FT_Stream stream ) + { + ft_free( stream->memory, stream->descriptor.pointer ); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = NULL; + } + + + /* documentation is in ftobjs.h */ + + FT_BASE_DEF( FT_Error ) + FT_Stream_Open( FT_Stream stream, + const char* filepathname ) + { + int file; + struct stat stat_buf; + + + if ( !stream ) + return FT_THROW( Invalid_Stream_Handle ); + + /* open the file */ + file = open( filepathname, O_RDONLY ); + if ( file < 0 ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + return FT_THROW( Cannot_Open_Resource ); + } + + /* Here we ensure that a "fork" will _not_ duplicate */ + /* our opened input streams on Unix. This is critical */ + /* since it avoids some (possible) access control */ + /* issues and cleans up the kernel file table a bit. */ + /* */ +#ifdef F_SETFD +#ifdef FD_CLOEXEC + (void)fcntl( file, F_SETFD, FD_CLOEXEC ); +#else + (void)fcntl( file, F_SETFD, 1 ); +#endif /* FD_CLOEXEC */ +#endif /* F_SETFD */ + + if ( fstat( file, &stat_buf ) < 0 ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not `fstat' file `%s'\n", filepathname )); + goto Fail_Map; + } + + /* XXX: TODO -- real 64bit platform support */ + /* */ + /* `stream->size' is typedef'd to unsigned long (in `ftsystem.h'); */ + /* `stat_buf.st_size', however, is usually typedef'd to off_t */ + /* (in sys/stat.h). */ + /* On some platforms, the former is 32bit and the latter is 64bit. */ + /* To avoid overflow caused by fonts in huge files larger than */ + /* 2GB, do a test. Temporary fix proposed by Sean McBride. */ + /* */ + if ( stat_buf.st_size > LONG_MAX ) + { + FT_ERROR(( "FT_Stream_Open: file is too big\n" )); + goto Fail_Map; + } + else if ( stat_buf.st_size == 0 ) + { + FT_ERROR(( "FT_Stream_Open: zero-length file\n" )); + goto Fail_Map; + } + + /* This cast potentially truncates a 64bit to 32bit! */ + stream->size = (unsigned long)stat_buf.st_size; + stream->pos = 0; + stream->base = (unsigned char *)mmap( NULL, + stream->size, + PROT_READ, + MAP_FILE | MAP_PRIVATE, + file, + 0 ); + + if ( stream->base != MAP_FAILED ) + stream->close = ft_close_stream_by_munmap; + else + { + ssize_t total_read_count; + + + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not `mmap' file `%s'\n", filepathname )); + + stream->base = (unsigned char*)ft_alloc( stream->memory, stream->size ); + + if ( !stream->base ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not `alloc' memory\n" )); + goto Fail_Map; + } + + total_read_count = 0; + do + { + ssize_t read_count; + + + read_count = read( file, + stream->base + total_read_count, + stream->size - total_read_count ); + + if ( read_count <= 0 ) + { + if ( read_count == -1 && errno == EINTR ) + continue; + + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " error while `read'ing file `%s'\n", filepathname )); + goto Fail_Read; + } + + total_read_count += read_count; + + } while ( (unsigned long)total_read_count != stream->size ); + + stream->close = ft_close_stream_by_free; + } + + close( file ); + + stream->descriptor.pointer = stream->base; + stream->pathname.pointer = (char*)filepathname; + + stream->read = NULL; + + FT_TRACE1(( "FT_Stream_Open:" )); + FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n", + filepathname, stream->size )); + + return FT_Err_Ok; + + Fail_Read: + ft_free( stream->memory, stream->base ); + + Fail_Map: + close( file ); + + stream->base = NULL; + stream->size = 0; + stream->pos = 0; + + return FT_THROW( Cannot_Open_Stream ); + } + + +#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_BASE_DEF( FT_Memory ) + FT_New_Memory( void ) + { + FT_Memory memory; + + + memory = (FT_Memory)malloc( sizeof ( *memory ) ); + if ( memory ) + { + memory->user = NULL; + 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_BASE_DEF( void ) + FT_Done_Memory( FT_Memory memory ) + { +#ifdef FT_DEBUG_MEMORY + ft_mem_debug_done( memory ); +#endif + memory->free( memory, memory ); + } + + +/* END */ diff --git a/vendor/freetype/builds/unix/install.mk b/vendor/freetype/builds/unix/install.mk new file mode 100644 index 00000000000..e1d374a0cfa --- /dev/null +++ b/vendor/freetype/builds/unix/install.mk @@ -0,0 +1,102 @@ +# +# FreeType 2 installation instructions for Unix systems +# + + +# Copyright (C) 1996-2024 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. + +# If you say +# +# make install DESTDIR=/tmp/somewhere/ +# +# don't forget the final backslash (this command is mainly for package +# maintainers). + + +.PHONY: install uninstall check + +# Unix installation and deinstallation targets. +# +# Note that we remove any data found in `$(includedir)/freetype2' before +# installing new files to avoid interferences with files installed by +# previous FreeType versions (which use slightly different locations). +# +# We also remove `$(includedir)/ft2build.h' for the same reason. +# +# Note that some header files get handled twice for simplicity; a special, +# configured version overwrites the generic one. +# +install: $(PROJECT_LIBRARY) + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2 + -$(DELETE) $(DESTDIR)$(includedir)/ft2build.h + $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \ + $(DESTDIR)$(libdir)/pkgconfig \ + $(DESTDIR)$(includedir)/freetype2/freetype/config \ + $(DESTDIR)$(datadir)/aclocal +ifeq ($(INSTALL_FT2_CONFIG),TRUE) + $(MKINSTALLDIRS) $(DESTDIR)$(bindir) \ + $(DESTDIR)$(mandir)/man1 +endif + $(LIBTOOL) --mode=install $(INSTALL) \ + $(PROJECT_LIBRARY) $(DESTDIR)$(libdir) + -for P in $(PUBLIC_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype ; \ + done + -for P in $(CONFIG_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype/config ; \ + done + $(INSTALL_DATA) $(TOP_DIR)/include/ft2build.h \ + $(DESTDIR)$(includedir)/freetype2/ft2build.h + $(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h \ + $(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h + $(INSTALL_DATA) $(OBJ_DIR)/ftmodule.h \ + $(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h + $(INSTALL_DATA) $(OBJ_BUILD)/ftoption.h \ + $(DESTDIR)$(includedir)/freetype2/freetype/config/ftoption.h + $(INSTALL_SCRIPT) -m 644 $(PLATFORM_DIR)/freetype2.m4 \ + $(DESTDIR)$(datadir)/aclocal/freetype2.m4 + $(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \ + $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc +ifeq ($(INSTALL_FT2_CONFIG),TRUE) + $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \ + $(DESTDIR)$(bindir)/freetype-config + $(INSTALL_DATA) $(TOP_DIR)/docs/freetype-config.1 \ + $(DESTDIR)$(mandir)/man1/freetype-config.1 +endif + + +uninstall: + -$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(LIBRARY).$A + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2 + -$(DELETE) $(DESTDIR)$(bindir)/freetype-config + -$(DELETE) $(DESTDIR)$(datadir)/aclocal/freetype2.m4 + -$(DELETE) $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc + -$(DELETE) $(DESTDIR)$(mandir)/man1/freetype-config.1 + + +check: + $(info There is no validation suite for this package.) + + +.PHONY: clean_project_unix distclean_project_unix + +# Unix cleaning and distclean rules. +# +clean_project_unix: + -$(LIBTOOL) --mode=clean $(RM) $(OBJECTS_LIST) + -$(DELETE) $(CLEAN) + +distclean_project_unix: clean_project_unix + -$(LIBTOOL) --mode=clean $(RM) $(PROJECT_LIBRARY) + -$(DELETE) *.orig *~ core *.core $(DISTCLEAN) + +# EOF diff --git a/vendor/freetype/builds/unix/pkg.m4 b/vendor/freetype/builds/unix/pkg.m4 new file mode 100644 index 00000000000..260e1fb9221 --- /dev/null +++ b/vendor/freetype/builds/unix/pkg.m4 @@ -0,0 +1,199 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurrence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR diff --git a/vendor/freetype/builds/unix/unix-cc.in b/vendor/freetype/builds/unix/unix-cc.in new file mode 100644 index 00000000000..54e7e55a5b2 --- /dev/null +++ b/vendor/freetype/builds/unix/unix-cc.in @@ -0,0 +1,134 @@ +# +# FreeType 2 template for Unix-specific compiler definitions +# + +# Copyright (C) 1996-2024 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. + + +CC := @CC@ +COMPILER_SEP := $(SEP) +FT_LIBTOOL_DIR ?= $(PLATFORM_DIR) + +LIBTOOL := $(FT_LIBTOOL_DIR)/libtool + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := lo +SO := o + + +# The executable file extension. Although most Unix platforms use no +# extension, we copy the extension detected by autoconf. Useful for cross +# building on Unix systems for non-Unix systems. +# +E := @EXEEXT@ + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := la +SA := a + + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := lib$(PROJECT) + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -o$(space) + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enforce +# ANSI compliance. +# +# We use our own FreeType configuration files overriding defaults. +# +CPPFLAGS := @CPPFLAGS@ +CFLAGS := -c @XX_CFLAGS@ @CFLAGS@ \ + $DFT_CONFIG_CONFIG_H="" \ + $DFT_CONFIG_MODULES_H="" \ + $DFT_CONFIG_OPTIONS_H="" + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS := @XX_ANSIFLAGS@ + +# C compiler to use -- we use libtool! +# +# CC might be set on the command line; we store this value in `CCraw'. +# Consequently, we use the `override' directive to ensure that the +# libtool call is always prepended. +# +CCraw := $(CC) +override CC := $(LIBTOOL) --mode=compile $(CCraw) + +# Resource compiler to use on Cygwin/MinGW, usually windres. +# +RCraw := @RC@ +ifneq ($(RCraw),) + RC := $(LIBTOOL) --tag=RC --mode=compile $(RCraw) +endif + +# Linker flags. +# +LDFLAGS := @LDFLAGS@ + +# export symbols +# +CCraw_build := @CC_BUILD@ # native CC of building system +E_BUILD := @EXEEXT_BUILD@ # extension for executable on + # building system +EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym +CCexe := $(CCraw_build) # used to compile `apinames` only, + # see `exports.mk` +CCexe_CFLAGS := @CFLAGS_BUILD@ # ditto +CCexe_LDFLAGS := @LDFLAGS_BUILD@ # ditto + + +# Library linking. +# +LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \ + -rpath $(libdir) -version-info $(version_info) \ + $(LDFLAGS) -no-undefined \ + -export-symbols $(EXPORTS_LIST) + +# For the demo programs. +FT_DEMO_CFLAGS := @FT_DEMO_CFLAGS@ +FT_DEMO_LDFLAGS := @FT_DEMO_LDFLAGS@ + +# EOF diff --git a/vendor/freetype/builds/unix/unix-def.in b/vendor/freetype/builds/unix/unix-def.in new file mode 100644 index 00000000000..451880e4f33 --- /dev/null +++ b/vendor/freetype/builds/unix/unix-def.in @@ -0,0 +1,163 @@ +# +# FreeType 2 configuration rules templates for Unix + configure +# + + +# Copyright (C) 1996-2024 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. + +SHELL := @SHELL@ + +TOP_DIR := $(shell cd $(TOP_DIR); pwd) + +DELETE := rm -f +DELDIR := rm -rf +CAT := cat +SEP := / + +# This is used for `make refdoc' and `make refdoc-venv' +# +PYTHON := @PYTHON@ +BIN := bin + +# this is used for `make distclean' and `make install' +OBJ_BUILD ?= $(PLATFORM_DIR) + +# don't use `:=' here since the path stuff will be included after this file +# +FTSYS_SRC = @FTSYS_SRC@ + +INSTALL := @INSTALL@ +INSTALL_DATA := @INSTALL_DATA@ +INSTALL_PROGRAM := @INSTALL_PROGRAM@ +INSTALL_SCRIPT := @INSTALL_SCRIPT@ +MKINSTALLDIRS := @MKDIR_P@ + +CLEAN += $(OBJ_BUILD)/freetype-config \ + $(OBJ_BUILD)/freetype2.pc + +DISTCLEAN += $(OBJ_BUILD)/config.cache \ + $(OBJ_BUILD)/config.log \ + $(OBJ_BUILD)/config.status \ + $(OBJ_BUILD)/unix-def.mk \ + $(OBJ_BUILD)/unix-cc.mk \ + $(OBJ_BUILD)/ftconfig.h \ + $(OBJ_BUILD)/ftoption.h \ + $(LIBTOOL) \ + $(OBJ_BUILD)/Makefile + + +# Standard installation variables. +# +prefix := @prefix@ +exec_prefix := @exec_prefix@ +libdir := @libdir@ +bindir := @bindir@ +includedir := @includedir@ +datarootdir := @datarootdir@ +datadir := @datadir@ +mandir := @mandir@ + +version_info := @version_info@ + +# Variables needed for `freetype-config' and `freetype.pc'. +# +PKG_CONFIG := @PKG_CONFIG@ +PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@ +PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@ +PKGCONFIG_LIBS := @PKGCONFIG_LIBS@ +PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@ +LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@ +build_libtool_libs := @build_libtool_libs@ +ft_version := @ft_version@ + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + +# The BASE_SRC macro lists all source files that should be included in +# src/base/ftbase.c. When configure sets up CFLAGS to build ftmac.c, +# ftmac.c should be added to BASE_SRC. +ftmac_c := @ftmac_c@ + +# The SYSTEM_ZLIB macro is defined if the user wishes to link dynamically +# with its system wide zlib. If SYSTEM_ZLIB is 'yes', the zlib part of the +# ftgzip module is not compiled in. +SYSTEM_ZLIB := @SYSTEM_ZLIB@ + + +# The NO_OUTPUT macro is appended to command lines in order to ignore +# the output of some programs. +# +NO_OUTPUT := 2> /dev/null + + +# To support calls like +# +# configure --includedir='${libdir}'/freetype2/include +# +# we generate `freetype-config' and `freetype.pc' at compile time so that +# those variables are properly expanded. + +$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in + rm -f $@ $@.tmp + sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \ + -e 's|%PKG_CONFIG%|$(PKG_CONFIG)|' \ + -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ + -e 's|%exec_prefix%|$(exec_prefix)|' \ + -e 's|%ft_version%|$(ft_version)|' \ + -e 's|%includedir%|$(includedir)|' \ + -e 's|%libdir%|$(libdir)|' \ + -e 's|%prefix%|$(prefix)|' \ + $< \ + > $@.tmp + chmod +x $@.tmp + chmod go-w $@.tmp + mv $@.tmp $@ + +# To support directory names with spaces (as might easily happen on Windows +# platforms), the right solution would be to surround the pkg-variables in +# `freetype2.pc' with double quotes. However, doing so ironically disables +# the prefix override mechanism especially written for Windows. This is a +# bug in pkg-config version 0.28 and earlier. +# +# For this reason, we escape spaces with backslashes. + +exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix)) +includedir_x := $(subst $(space),\\$(space),$(includedir)) +libdir_x := $(subst $(space),\\$(space),$(libdir)) +prefix_x := $(subst $(space),\\$(space),$(prefix)) + +$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in + rm -f $@ $@.tmp + sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \ + -e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \ + -e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \ + -e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \ + -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ + -e 's|%exec_prefix%|$(exec_prefix_x)|' \ + -e 's|%ft_version%|$(ft_version)|' \ + -e 's|%includedir%|$(includedir_x)|' \ + -e 's|%libdir%|$(libdir_x)|' \ + -e 's|%prefix%|$(prefix_x)|' \ + $< \ + > $@.tmp + chmod a-w $@.tmp + mv $@.tmp $@ + +# defines whether we should install `freetype-config' or not +INSTALL_FT2_CONFIG = @INSTALL_FT2_CONFIG@ + +all install: $(OBJ_BUILD)/freetype-config \ + $(OBJ_BUILD)/freetype2.pc + +# EOF diff --git a/vendor/freetype/builds/unix/unix-dev.mk b/vendor/freetype/builds/unix/unix-dev.mk new file mode 100644 index 00000000000..6603a51269f --- /dev/null +++ b/vendor/freetype/builds/unix/unix-dev.mk @@ -0,0 +1,26 @@ +# +# FreeType 2 Configuration rules for Unix + GCC +# +# Development version without optimizations & libtool +# and no installation. +# + + +# Copyright (C) 1996-2024 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. + + +DEVEL_DIR := $(TOP_DIR)/devel + +include $(TOP_DIR)/builds/unix/unixddef.mk +include $(TOP_DIR)/builds/compiler/gcc-dev.mk +include $(TOP_DIR)/builds/link_std.mk + + +# EOF diff --git a/vendor/freetype/builds/unix/unix-lcc.mk b/vendor/freetype/builds/unix/unix-lcc.mk new file mode 100644 index 00000000000..7b3dd9dd86b --- /dev/null +++ b/vendor/freetype/builds/unix/unix-lcc.mk @@ -0,0 +1,24 @@ +# +# FreeType 2 Configuration rules for Unix + LCC +# +# Development version without optimizations & libtool +# and no installation. +# + + +# Copyright (C) 1996-2024 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 $(TOP_DIR)/builds/unix/unixddef.mk +include $(TOP_DIR)/builds/compiler/unix-lcc.mk +include $(TOP_DIR)/builds/link_std.mk + + +# EOF diff --git a/vendor/freetype/builds/unix/unix.mk b/vendor/freetype/builds/unix/unix.mk new file mode 100644 index 00000000000..a8b62db13dc --- /dev/null +++ b/vendor/freetype/builds/unix/unix.mk @@ -0,0 +1,62 @@ +# +# FreeType 2 configuration rules for UNIX platforms +# + + +# Copyright (C) 1996-2024 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. + +# We need these declarations here since unix-def.mk is a generated file. +PLATFORM_DIR := $(TOP_DIR)/builds/unix +PLATFORM := unix + +have_mk := $(wildcard $(OBJ_DIR)/unix-def.mk) +ifneq ($(have_mk),) + # We are building FreeType 2 not in the src tree. + include $(OBJ_DIR)/unix-def.mk + include $(OBJ_DIR)/unix-cc.mk +else + include $(PLATFORM_DIR)/unix-def.mk + include $(PLATFORM_DIR)/unix-cc.mk +endif + +ifdef BUILD_PROJECT + + .PHONY: clean_project distclean_project + + # Now include the main sub-makefile. It contains all the rules used to + # build the library with the previous variables defined. + # + include $(TOP_DIR)/builds/$(PROJECT).mk + + + # The cleanup targets. + # + clean_project: clean_project_unix + distclean_project: distclean_project_unix + + + # This final rule is used to link all object files into a single library. + # It is part of the system-specific sub-Makefile because not all + # librarians accept a simple syntax like + # + # librarian library_file {list of object files} + # + $(PROJECT_LIBRARY): $(OBJECTS_LIST) + ifdef CLEAN_LIBRARY + -$(CLEAN_LIBRARY) $(NO_OUTPUT) + endif + $(LINK_LIBRARY) + + include $(TOP_DIR)/builds/unix/install.mk + +endif + + +# EOF diff --git a/vendor/freetype/builds/unix/unixddef.mk b/vendor/freetype/builds/unix/unixddef.mk new file mode 100644 index 00000000000..17f6b0ee5c0 --- /dev/null +++ b/vendor/freetype/builds/unix/unixddef.mk @@ -0,0 +1,46 @@ +# +# FreeType 2 configuration rules templates for +# development under Unix with no configure script (gcc only) +# + + +# Copyright (C) 1996-2024 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. + + +TOP_DIR := $(shell cd $(TOP_DIR); pwd) +OBJ_DIR := $(shell cd $(OBJ_DIR); pwd) + +PLATFORM := unix + +DELETE := rm -f +CAT := cat +SEP := / + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := bin + + +# library file name +# +LIBRARY := lib$(PROJECT) + + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + + +NO_OUTPUT := 2> /dev/null + +# EOF diff --git a/vendor/freetype/builds/vms/apinames_vms.bash b/vendor/freetype/builds/vms/apinames_vms.bash new file mode 100644 index 00000000000..1928d21ae73 --- /dev/null +++ b/vendor/freetype/builds/vms/apinames_vms.bash @@ -0,0 +1,2 @@ +src/tools/apinames -wV include/freetype/*.h > freetype_vms0.opt +/gnu/bin/mv freetype_vms0.opt freetype_vms.opt diff --git a/vendor/freetype/builds/vms/ftconfig.h b/vendor/freetype/builds/vms/ftconfig.h new file mode 100644 index 00000000000..d96543411dc --- /dev/null +++ b/vendor/freetype/builds/vms/ftconfig.h @@ -0,0 +1,58 @@ +/**************************************************************************** + * + * ftconfig.h + * + * VMS-specific configuration file (specification only). + * + * Copyright (C) 1996-2024 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 header file contains a number of macro definitions that are used by + * the rest of the engine. Most of the macros here are automatically + * determined at compile time, and you should not need to change it to port + * FreeType, except to compile the library with a non-ANSI compiler. + * + * Note however that if some specific modifications are needed, we advise + * you to place a modified copy in your build directory. + * + * The build directory is usually `builds/`, and contains + * system-specific files that are always included first when building the + * library. + * + */ + +#ifndef FTCONFIG_H_ +#define FTCONFIG_H_ + +#include +#include FT_CONFIG_OPTIONS_H +#include FT_CONFIG_STANDARD_LIBRARY_H + +#define HAVE_UNISTD_H 1 +#define HAVE_FCNTL_H 1 + +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 + +#define FT_SIZEOF_INT 4 +#define FT_SIZEOF_LONG 4 + +#include +#include +#include + +#endif /* FTCONFIG_H_ */ + + +/* END */ diff --git a/vendor/freetype/builds/vms/ftsystem.c b/vendor/freetype/builds/vms/ftsystem.c new file mode 100644 index 00000000000..a61e8ea209a --- /dev/null +++ b/vendor/freetype/builds/vms/ftsystem.c @@ -0,0 +1,328 @@ +/***************************************************************************/ +/* */ +/* ftsystem.c */ +/* */ +/* VMS-specific FreeType low-level system interface (body). */ +/* */ +/* Copyright (C) 1996-2024 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 + /* we use our special ftconfig.h file, not the standard one */ +#include +#include +#include +#include +#include +#include + + /* memory-mapping includes and definitions */ +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +#ifndef MAP_FILE +#define MAP_FILE 0x00 +#endif + +#ifdef MUNMAP_USES_VOIDP +#define MUNMAP_ARG_CAST void * +#else +#define MUNMAP_ARG_CAST char * +#endif + +#ifdef NEED_MUNMAP_DECL + +#ifdef __cplusplus + extern "C" +#else + extern +#endif + int + munmap( char* addr, + int len ); + +#define MUNMAP_ARG_CAST char * + +#endif /* NEED_DECLARATION_MUNMAP */ + + +#include +#include + +#ifdef HAVE_FCNTL_H +#include +#endif + +#include +#include +#include + + + /*************************************************************************/ + /* */ + /* MEMORY MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* ft_alloc */ + /* */ + /* */ + /* The memory allocation function. */ + /* */ + /* */ + /* memory :: A pointer to the memory object. */ + /* */ + /* size :: The requested size in bytes. */ + /* */ + /* */ + /* The address of newly allocated block. */ + /* */ + FT_CALLBACK_DEF( void* ) + ft_alloc( FT_Memory memory, + long size ) + { + FT_UNUSED( memory ); + + return malloc( size ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_realloc */ + /* */ + /* */ + /* The memory reallocation function. */ + /* */ + /* */ + /* 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. */ + /* */ + /* */ + /* 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 ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_free */ + /* */ + /* */ + /* The memory release function. */ + /* */ + /* */ + /* 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 ); + } + + + /*************************************************************************/ + /* */ + /* 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 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 ) + + + /*************************************************************************/ + /* */ + /* */ + /* ft_close_stream */ + /* */ + /* */ + /* The function to close a stream. */ + /* */ + /* */ + /* stream :: A pointer to the stream object. */ + /* */ + FT_CALLBACK_DEF( void ) + ft_close_stream( FT_Stream stream ) + { + munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size ); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = NULL; + } + + + /* documentation is in ftobjs.h */ + + FT_BASE_DEF( FT_Error ) + FT_Stream_Open( FT_Stream stream, + const char* filepathname ) + { + int file; + struct stat stat_buf; + + + if ( !stream ) + return FT_THROW( Invalid_Stream_Handle ); + + /* open the file */ + file = open( filepathname, O_RDONLY ); + if ( file < 0 ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + return FT_THROW( Cannot_Open_Resource ); + } + + if ( fstat( file, &stat_buf ) < 0 ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not `fstat' file `%s'\n", filepathname )); + goto Fail_Map; + } + + stream->size = stat_buf.st_size; + if ( !stream->size ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " opened `%s' but zero-sized\n", filepathname )); + goto Fail_Map; + } + + stream->pos = 0; + stream->base = (unsigned char *)mmap( NULL, + stream->size, + PROT_READ, + MAP_FILE | MAP_PRIVATE, + file, + 0 ); + + if ( stream->base == MAP_FAILED ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not `mmap' file `%s'\n", filepathname )); + goto Fail_Map; + } + + close( file ); + + stream->descriptor.pointer = stream->base; + stream->pathname.pointer = (char*)filepathname; + + stream->close = ft_close_stream; + stream->read = NULL; + + FT_TRACE1(( "FT_Stream_Open:" )); + FT_TRACE1(( " opened `%s' (%d bytes) successfully\n", + filepathname, stream->size )); + + return FT_Err_Ok; + + Fail_Map: + close( file ); + + stream->base = NULL; + stream->size = 0; + stream->pos = 0; + + return FT_THROW( Cannot_Open_Stream ); + } + + +#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_BASE_DEF( FT_Memory ) + FT_New_Memory( void ) + { + FT_Memory memory; + + + memory = (FT_Memory)malloc( sizeof ( *memory ) ); + if ( memory ) + { + memory->user = NULL; + 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_BASE_DEF( void ) + FT_Done_Memory( FT_Memory memory ) + { +#ifdef FT_DEBUG_MEMORY + ft_mem_debug_done( memory ); +#endif + memory->free( memory, memory ); + } + + +/* END */ diff --git a/vendor/freetype/builds/wince/ftdebug.c b/vendor/freetype/builds/wince/ftdebug.c new file mode 100644 index 00000000000..2e9a1dcdb52 --- /dev/null +++ b/vendor/freetype/builds/wince/ftdebug.c @@ -0,0 +1,353 @@ +/**************************************************************************** + * + * ftdebug.c + * + * Debugging and logging component for WinCE (body). + * + * Copyright (C) 1996-2024 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 +#include + + +#ifdef FT_DEBUG_LEVEL_ERROR + +#include +#include +#include + +#include + + + static void + OutputDebugStringEx( const char* str ) + { + static WCHAR buf[8192]; + + int sz = MultiByteToWideChar( CP_ACP, 0, str, -1, buf, + sizeof ( buf ) / sizeof ( *buf ) ); + + + if ( !sz ) + lstrcpyW( buf, L"OutputDebugStringEx: MultiByteToWideChar failed" ); + + OutputDebugStringW( buf ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Message( const char* fmt, + ... ) + { + static char buf[8192]; + va_list ap; + + + va_start( ap, fmt ); + vfprintf( stderr, fmt, ap ); + /* send the string to the debugger as well */ + vsprintf( buf, fmt, ap ); + OutputDebugStringEx( buf ); + va_end( ap ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Panic( const char* fmt, + ... ) + { + static char buf[8192]; + va_list ap; + + + va_start( ap, fmt ); + vsprintf( buf, fmt, ap ); + OutputDebugStringEx( buf ); + va_end( ap ); + + exit( EXIT_FAILURE ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( int ) + FT_Throw( FT_Error error, + int line, + const char* file ) + { +#if 0 + /* activating the code in this block makes FreeType very chatty */ + fprintf( stderr, + "%s:%d: error 0x%02x: %s\n", + file, + line, + error, + FT_Error_String( error ) ); +#else + FT_UNUSED( error ); + FT_UNUSED( line ); + FT_UNUSED( file ); +#endif + + return 0; + } + +#endif /* FT_DEBUG_LEVEL_ERROR */ + + +#ifdef FT_DEBUG_LEVEL_TRACE + + /* array of trace levels, initialized to 0; */ + /* this gets adjusted at run-time */ + static int ft_trace_levels_enabled[trace_count]; + + /* array of trace levels, always initialized to 0 */ + static int ft_trace_levels_disabled[trace_count]; + + /* a pointer to either `ft_trace_levels_enabled' */ + /* or `ft_trace_levels_disabled' */ + int* ft_trace_levels; + + /* define array of trace toggle names */ +#define FT_TRACE_DEF( x ) #x , + + static const char* ft_trace_toggles[trace_count + 1] = + { +#include + NULL + }; + +#undef FT_TRACE_DEF + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( FT_Int ) + FT_Trace_Get_Count( void ) + { + return trace_count; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( const char * ) + FT_Trace_Get_Name( FT_Int idx ) + { + int max = FT_Trace_Get_Count(); + + + if ( idx < max ) + return ft_trace_toggles[idx]; + else + return NULL; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Disable( void ) + { + ft_trace_levels = ft_trace_levels_disabled; + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Enable( void ) + { + ft_trace_levels = ft_trace_levels_enabled; + } + + + /************************************************************************** + * + * Initialize the tracing sub-system. This is done by retrieving the + * value of the `FT2_DEBUG' environment variable. It must be a list of + * toggles, separated by spaces, `;', or `,'. Example: + * + * export FT2_DEBUG="any:3 memory:7 stream:5" + * + * This requests that all levels be set to 3, except the trace level for + * the memory and stream components which are set to 7 and 5, + * respectively. + * + * See the file `include/freetype/internal/fttrace.h' for details of + * the available toggle names. + * + * The level must be between 0 and 7; 0 means quiet (except for serious + * runtime errors), and 7 means _very_ verbose. + */ + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* Windows Mobile doesn't have environment API: */ + /* GetEnvironmentStrings, GetEnvironmentVariable, getenv. */ + /* */ + /* FIXME!!! How to set debug mode? */ + + /* const char* ft2_debug = getenv( "FT2_DEBUG" ); */ + + const char* ft2_debug = NULL; + + + 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 ) + break; + + if ( *p == ':' && p > q ) + { + FT_Int n, i, len = (FT_Int)( p - q ); + FT_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 > 7 ) + 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_enabled[n] = level; + } + else + ft_trace_levels_enabled[found] = level; + } + } + } + } + + ft_trace_levels = ft_trace_levels_enabled; + } + + +#else /* !FT_DEBUG_LEVEL_TRACE */ + + + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* nothing */ + } + + + FT_BASE_DEF( FT_Int ) + FT_Trace_Get_Count( void ) + { + return 0; + } + + + FT_BASE_DEF( const char * ) + FT_Trace_Get_Name( FT_Int idx ) + { + FT_UNUSED( idx ); + + return NULL; + } + + + FT_BASE_DEF( void ) + FT_Trace_Disable( void ) + { + /* nothing */ + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Trace_Enable( void ) + { + /* nothing */ + } + + +#endif /* !FT_DEBUG_LEVEL_TRACE */ + + +/* END */ diff --git a/vendor/freetype/builds/wince/vc2005-ce/freetype.sln b/vendor/freetype/builds/wince/vc2005-ce/freetype.sln new file mode 100644 index 00000000000..32241846183 --- /dev/null +++ b/vendor/freetype/builds/wince/vc2005-ce/freetype.sln @@ -0,0 +1,157 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + LIB Debug Multithreaded|Pocket PC 2003 (ARMV4) = LIB Debug Multithreaded|Pocket PC 2003 (ARMV4) + LIB Debug Multithreaded|Smartphone 2003 (ARMV4) = LIB Debug Multithreaded|Smartphone 2003 (ARMV4) + LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4) = LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4) + LIB Debug Singlethreaded|Smartphone 2003 (ARMV4) = LIB Debug Singlethreaded|Smartphone 2003 (ARMV4) + LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Debug|Pocket PC 2003 (ARMV4) = LIB Debug|Pocket PC 2003 (ARMV4) + LIB Debug|Smartphone 2003 (ARMV4) = LIB Debug|Smartphone 2003 (ARMV4) + LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release Multithreaded|Pocket PC 2003 (ARMV4) = LIB Release Multithreaded|Pocket PC 2003 (ARMV4) + LIB Release Multithreaded|Smartphone 2003 (ARMV4) = LIB Release Multithreaded|Smartphone 2003 (ARMV4) + LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release Singlethreaded|Pocket PC 2003 (ARMV4) = LIB Release Singlethreaded|Pocket PC 2003 (ARMV4) + LIB Release Singlethreaded|Smartphone 2003 (ARMV4) = LIB Release Singlethreaded|Smartphone 2003 (ARMV4) + LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release|Pocket PC 2003 (ARMV4) = LIB Release|Pocket PC 2003 (ARMV4) + LIB Release|Smartphone 2003 (ARMV4) = LIB Release|Smartphone 2003 (ARMV4) + LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release|Windows Mobile 6 Standard SDK (ARMV4I) + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).Build.0 = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).ActiveCfg = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).Build.0 = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).Deploy.0 = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).Build.0 = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).ActiveCfg = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).Build.0 = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).Deploy.0 = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).Build.0 = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).ActiveCfg = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).Build.0 = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).Deploy.0 = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).Build.0 = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).ActiveCfg = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).Build.0 = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).Deploy.0 = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/freetype/builds/wince/vc2005-ce/freetype.vcproj b/vendor/freetype/builds/wince/vc2005-ce/freetype.vcproj new file mode 100644 index 00000000000..238ffc6acbd --- /dev/null +++ b/vendor/freetype/builds/wince/vc2005-ce/freetype.vcproj @@ -0,0 +1,878 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/wince/vc2005-ce/index.html b/vendor/freetype/builds/wince/vc2005-ce/index.html new file mode 100644 index 00000000000..2505d776205 --- /dev/null +++ b/vendor/freetype/builds/wince/vc2005-ce/index.html @@ -0,0 +1,47 @@ + +
+ + FreeType 2 Project Files for VS.NET 2005 + (Pocket PC) + + + +

+ FreeType 2 Project Files for VS.NET 2005 + (Pocket PC) +

+ +

This directory contains project files for Visual C++, named +freetype.vcproj, and Visual Studio, called freetype.sln for +the following targets: + +

    +
  • PPC/SP 2003 (Pocket PC 2003)
  • +
  • PPC/SP WM5 (Windows Mobile 5)
  • +
  • PPC/SP WM6 (Windows Mobile 6)
  • +
+ +It compiles the following libraries from the FreeType 2.13.3 sources:

+ +
    +
    +    freetype.lib     - release build; single threaded
    +    freetype_D.lib   - debug build;   single threaded
    +    freetypeMT.lib   - release build; multi-threaded
    +    freetypeMT_D.lib - debug build;   multi-threaded
    +
+ +

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP +archives are already stored this way, so no further action is required. If +you use some .tar.*z archives, be sure to configure your extracting +tool to convert the line endings. For example, with WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider +using the unix2dos or u2d utilities that are floating +around, which specifically deal with this particular problem. + +

Build directories are placed in the top-level objs +directory.

+ + + diff --git a/vendor/freetype/builds/wince/vc2008-ce/freetype.sln b/vendor/freetype/builds/wince/vc2008-ce/freetype.sln new file mode 100644 index 00000000000..a8010f0903c --- /dev/null +++ b/vendor/freetype/builds/wince/vc2008-ce/freetype.sln @@ -0,0 +1,157 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + LIB Debug Multithreaded|Pocket PC 2003 (ARMV4) = LIB Debug Multithreaded|Pocket PC 2003 (ARMV4) + LIB Debug Multithreaded|Smartphone 2003 (ARMV4) = LIB Debug Multithreaded|Smartphone 2003 (ARMV4) + LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4) = LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4) + LIB Debug Singlethreaded|Smartphone 2003 (ARMV4) = LIB Debug Singlethreaded|Smartphone 2003 (ARMV4) + LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Debug|Pocket PC 2003 (ARMV4) = LIB Debug|Pocket PC 2003 (ARMV4) + LIB Debug|Smartphone 2003 (ARMV4) = LIB Debug|Smartphone 2003 (ARMV4) + LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release Multithreaded|Pocket PC 2003 (ARMV4) = LIB Release Multithreaded|Pocket PC 2003 (ARMV4) + LIB Release Multithreaded|Smartphone 2003 (ARMV4) = LIB Release Multithreaded|Smartphone 2003 (ARMV4) + LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release Singlethreaded|Pocket PC 2003 (ARMV4) = LIB Release Singlethreaded|Pocket PC 2003 (ARMV4) + LIB Release Singlethreaded|Smartphone 2003 (ARMV4) = LIB Release Singlethreaded|Smartphone 2003 (ARMV4) + LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + LIB Release|Pocket PC 2003 (ARMV4) = LIB Release|Pocket PC 2003 (ARMV4) + LIB Release|Smartphone 2003 (ARMV4) = LIB Release|Smartphone 2003 (ARMV4) + LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + LIB Release|Windows Mobile 6 Professional SDK (ARMV4I) = LIB Release|Windows Mobile 6 Professional SDK (ARMV4I) + LIB Release|Windows Mobile 6 Standard SDK (ARMV4I) = LIB Release|Windows Mobile 6 Standard SDK (ARMV4I) + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).Build.0 = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Debug Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).ActiveCfg = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).Build.0 = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Smartphone 2003 (ARMV4).Deploy.0 = Debug Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).Build.0 = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Debug Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).ActiveCfg = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).Build.0 = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Smartphone 2003 (ARMV4).Deploy.0 = Debug Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).Build.0 = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Release Multithreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).ActiveCfg = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).Build.0 = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Smartphone 2003 (ARMV4).Deploy.0 = Release Multithreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release Multithreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).ActiveCfg = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).Build.0 = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Pocket PC 2003 (ARMV4).Deploy.0 = Release Singlethreaded|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).ActiveCfg = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).Build.0 = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Smartphone 2003 (ARMV4).Deploy.0 = Release Singlethreaded|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release Singlethreaded|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.LIB Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/freetype/builds/wince/vc2008-ce/freetype.vcproj b/vendor/freetype/builds/wince/vc2008-ce/freetype.vcproj new file mode 100644 index 00000000000..8404684af45 --- /dev/null +++ b/vendor/freetype/builds/wince/vc2008-ce/freetype.vcproj @@ -0,0 +1,3517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/wince/vc2008-ce/index.html b/vendor/freetype/builds/wince/vc2008-ce/index.html new file mode 100644 index 00000000000..80a30eb16a1 --- /dev/null +++ b/vendor/freetype/builds/wince/vc2008-ce/index.html @@ -0,0 +1,47 @@ + +
+ + FreeType 2 Project Files for VS.NET 2008 + (Pocket PC) + + + +

+ FreeType 2 Project Files for VS.NET 2008 + (Pocket PC) +

+ +

This directory contains project files for Visual C++, named +freetype.dsp, and Visual Studio, called freetype.sln for +the following targets: + +

    +
  • PPC/SP 2003 (Pocket PC 2003)
  • +
  • PPC/SP WM5 (Windows Mobile 5)
  • +
  • PPC/SP WM6 (Windows Mobile 6)
  • +
+ +It compiles the following libraries from the FreeType 2.13.3 sources:

+ +
    +
    +    freetype.lib     - release build; single threaded
    +    freetype_D.lib   - debug build;   single threaded
    +    freetypeMT.lib   - release build; multi-threaded
    +    freetypeMT_D.lib - debug build;   multi-threaded
    +
+ +

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP +archives are already stored this way, so no further action is required. If +you use some .tar.*z archives, be sure to configure your extracting +tool to convert the line endings. For example, with WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider +using the unix2dos or u2d utilities that are floating +around, which specifically deal with this particular problem. + +

Build directories are placed in the top-level objs +directory.

+ + + diff --git a/vendor/freetype/builds/windows/.gitignore b/vendor/freetype/builds/windows/.gitignore new file mode 100644 index 00000000000..41456a48a13 --- /dev/null +++ b/vendor/freetype/builds/windows/.gitignore @@ -0,0 +1,5 @@ +# user-specific cache/settings files +*.opensdf +*.sdf +*.suo +*.user diff --git a/vendor/freetype/builds/windows/detect.mk b/vendor/freetype/builds/windows/detect.mk new file mode 100644 index 00000000000..e452eaac9ab --- /dev/null +++ b/vendor/freetype/builds/windows/detect.mk @@ -0,0 +1,202 @@ +# +# FreeType 2 configuration file to detect a Win32 host platform. +# + + +# Copyright (C) 1996-2024 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. + + +.PHONY: setup + + +ifeq ($(PLATFORM),ansi) + + # Detecting Windows NT is easy, as the OS variable must be defined and + # contains `Windows_NT'. This also works with Windows 2000 and XP. + # + ifeq ($(OS),Windows_NT) + + PLATFORM := windows + + else + + # Detecting Windows 9X + + # We used to run the `ver' command to see if its output contains the + # word `Windows'. If this is true, we are running Windows 95 or later: + # + # ifdef COMSPEC + # # First, check if we have the COMSPEC environment variable, which + # # indicates we can use COMMAND.COM's internal commands + # is_windows := $(findstring Windows,$(strip $(shell ver))) + # endif + # + # Unfortunately, this also detects the case when one is running + # DOS 7.x (the MS-DOS version that lies below Windows) without actually + # launching the GUI. + # + # A better test is to check whether there are both the environment + # variables `winbootdir' and `windir'. The first indicates an + # underlying DOS 7.x, while the second is set only if windows is + # available. + # + # Note that on Windows NT, such an environment variable will not be seen + # from DOS-based tools like DJGPP's make; this is not actually a problem + # since NT is detected independently above. But do not try to be clever! + # + ifdef winbootdir + ifdef windir + + PLATFORM := windows + + endif + endif + + endif # test NT + +endif # test PLATFORM ansi + +ifeq ($(PLATFORM),windows) + + DELETE := del + CAT := type + SEP := $(BACKSLASH) + + # Setting COPY is a bit trickier. Plain COPY on NT will not work + # correctly, because it will uppercase 8.3 filenames, creating a + # `CONFIG.MK' file which isn't found later on by `make'. + # Since we do not want that, we need to force execution of CMD.EXE. + # Unfortunately, CMD.EXE is not available on Windows 9X. + # So we need to hack. + # + # Kudos to Eli Zaretskii (DJGPP guru) that helped debug it. + # Details are available in threads of the FreeType mailing list + # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23). + # + ifeq ($(OS),Windows_NT) + COPY := >nul cmd.exe /c copy + else + COPY := >nul copy + endif # test NT + + + # gcc Makefile by default + CONFIG_FILE := w32-gcc.mk + ifeq ($(firstword $(CC)),cc) + CC := gcc + endif + + ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list" target + dump_target_list: + $(info ) + $(info $(PROJECT_TITLE) build system -- supported compilers) + $(info ) + $(info Several command-line compilers are supported on Win32:) + $(info ) + $(info $(empty) make setup gcc (with Mingw)) + $(info $(empty) make setup visualc Microsoft Visual C++) + $(info $(empty) make setup bcc32 Borland C/C++) + $(info $(empty) make setup lcc Win32-LCC) + $(info $(empty) make setup intelc Intel C/C++) + $(info ) + + setup: dump_target_list + .PHONY: dump_target_list list + else + setup: std_setup + endif + + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++ + CONFIG_FILE := w32-vcc.mk + CC := cl + + .PHONY: visualc + visualc: setup + @cd . + endif + + ifneq ($(findstring intelc,$(MAKECMDGOALS)),) # Intel C/C++ + CONFIG_FILE := w32-intl.mk + CC := cl + + .PHONY: intelc + visualc: setup + @cd . + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := w32-wat.mk + CC := wcc386 + + .PHONY: watcom + watcom: setup + @cd . + endif + + ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ + CONFIG_FILE := w32-icc.mk + CC := icc + + .PHONY: visualage + visualage: setup + @cd . + endif + + ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32 + CONFIG_FILE := w32-lcc.mk + CC := lcc + + .PHONY: lcc + lcc: setup + @cd . + endif + + ifneq ($(findstring mingw32,$(MAKECMDGOALS)),) # mingw32 + CONFIG_FILE := w32-mingw32.mk + CC := gcc + + .PHONY: mingw32 + mingw32: setup + @cd . + endif + + ifneq ($(findstring bcc32,$(MAKECMDGOALS)),) # Borland C++ + CONFIG_FILE := w32-bcc.mk + CC := bcc32 + + .PHONY: bcc32 + bcc32: setup + @cd . + endif + + ifneq ($(findstring devel-bcc,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := w32-bccd.mk + CC := bcc32 + + .PHONY: devel-bcc + devel-bcc: setup + @cd . + endif + + ifneq ($(findstring devel-gcc,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := w32-dev.mk + CC := gcc + + .PHONY: devel-gcc + devel-gcc: setup + @cd . + endif + +endif # test PLATFORM windows + + +# EOF diff --git a/vendor/freetype/builds/windows/vc2010/freetype.user.props b/vendor/freetype/builds/windows/vc2010/freetype.user.props new file mode 100644 index 00000000000..78310d46316 --- /dev/null +++ b/vendor/freetype/builds/windows/vc2010/freetype.user.props @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/windows/vc2010/freetype.vcxproj b/vendor/freetype/builds/windows/vc2010/freetype.vcxproj new file mode 100644 index 00000000000..4cddc916fb6 --- /dev/null +++ b/vendor/freetype/builds/windows/vc2010/freetype.vcxproj @@ -0,0 +1,525 @@ + + + + + + Debug + Win32 + + + Debug + ARM64 + + + Debug + x64 + + + Debug Static + Win32 + + + Debug Static + ARM64 + + + Debug Static + x64 + + + Release + Win32 + + + Release + ARM64 + + + Release + x64 + + + Release Static + Win32 + + + Release Static + ARM64 + + + Release Static + x64 + + + + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} + FreeType + + + + $(DefaultPlatformToolset) + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + StaticLibrary + NotSet + + + StaticLibrary + NotSet + + + StaticLibrary + NotSet + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + DynamicLibrary + NotSet + + + StaticLibrary + NotSet + + + StaticLibrary + NotSet + + + StaticLibrary + NotSet + + + + + + ..\..\..\objs\$(Platform)\$(Configuration)\ + ..\..\..\objs\$(Platform)\$(Configuration)\ + AllRules.ruleset + + + freetype + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + false + Level4 + ProgramDatabase + Default + 4001 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + false + Level4 + ProgramDatabase + Default + 4001;4267 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + MachineARM64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + false + Level4 + ProgramDatabase + Default + 4001;4267 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + false + Level4 + ProgramDatabase + Default + 4001 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + false + Level4 + ProgramDatabase + Default + 4001;4267 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineARM64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + false + Level4 + ProgramDatabase + Default + 4001;4267 + true + $(OutDir)$(TargetName).pdb + Disabled + + + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + true + true + Level4 + Default + 4001 + true + StreamingSIMDExtensions2 + true + + + NDEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + true + true + Level4 + Default + 4001;4267 + true + NotSet + true + + + NDEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + true + MachineARM64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + MultiThreadedDLL + true + true + Level4 + Default + 4001;4267 + true + true + + + NDEBUG;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + true + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + MultiThreaded + true + true + Level4 + Default + 4001 + true + StreamingSIMDExtensions2 + true + + + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + MultiThreaded + true + true + Level4 + Default + 4001;4267 + true + NotSet + true + + + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineARM64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + MultiThreaded + true + true + Level4 + Default + 4001;4267 + true + true + + + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) + 0x0409 + + + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + ..\..\..\include\dlg\output.h + + + ..\..\..\include\dlg\dlg.h + + + ..\..\..\src\dlg\dlg.c + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/windows/vc2010/freetype.vcxproj.filters b/vendor/freetype/builds/windows/vc2010/freetype.vcxproj.filters new file mode 100644 index 00000000000..08e4cdeb8d2 --- /dev/null +++ b/vendor/freetype/builds/windows/vc2010/freetype.vcxproj.filters @@ -0,0 +1,149 @@ + + + + + {b4c15893-ec11-491d-9507-0ac184f9cc78} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {4d3e4eff-3fbc-4b20-b413-2743b23b7109} + + + {e6cf6a0f-0404-4024-8bf8-ff5b29f35657} + h;hpp;hxx;hm;inl + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files + + + Source Files + + + + + Source Files + + + diff --git a/vendor/freetype/builds/windows/vc2010/index.html b/vendor/freetype/builds/windows/vc2010/index.html new file mode 100644 index 00000000000..03149d22391 --- /dev/null +++ b/vendor/freetype/builds/windows/vc2010/index.html @@ -0,0 +1,40 @@ + +
+ + FreeType 2 Project Files for Visual C++ 2010 or newer + + + +

+ FreeType 2 Project Files for Visual C++ 2010 or newer +

+ +

This directory contains solution and project files for +Visual C++ 2010 or newer, named freetype.sln, +and freetype.vcxproj. It compiles the following libraries +from the FreeType 2.13.3 sources:

+ +
    +
  • freetype.dll using 'Release' or 'Debug' configurations
  • +
  • freetype.lib using 'Release Static' or 'Debug Static' configurations
  • +
+ +

Both Win32 and x64 builds are supported. Build directories and target +files are placed in the top-level objs directory.

+ +

Customization of the FreeType library is done by editing the +ftoption.h header file in the top-level devel path. +Alternatively, you may copy the file to another directory and change the +include directory in freetype.users.props.

+ +

To configure library dependencies like zlib and libpng, +edit the freetype.users.props file in this directory. It also +simplifies automated (command-line) builds using msbuild.

+ +

To link your executable with FreeType DLL, you may want to define +DLL_IMPORT so that the imported functions are appropriately +attributed with dllimport.

+ + + diff --git a/vendor/freetype/builds/windows/visualc/freetype.dsp b/vendor/freetype/builds/windows/visualc/freetype.dsp new file mode 100644 index 00000000000..451fab28b7e --- /dev/null +++ b/vendor/freetype/builds/windows/visualc/freetype.dsp @@ -0,0 +1,354 @@ +# Microsoft Developer Studio Project File - Name="freetype" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=freetype - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "freetype - Win32 Release Static" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug Static" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "freetype - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\Win32\Release" +# PROP Intermediate_Dir "..\..\..\objs\Win32\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /Za /MD /W3 /O2 /Oi /D "WIN32" /I "..\..\..\include" /D "_CRT_SECURE_NO_WARNINGS" /D "NDEBUG" /D "FT2_BUILD_LIBRARY" /D "DLL_EXPORT" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" /d "DLL_EXPORT" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 /nologo /dll /machine:I386 /opt:REF,ICF /out:"$(OutDir)\freetype.dll" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\Win32\Debug" +# PROP Intermediate_Dir "..\..\..\objs\Win32\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /Za /MDd /W3 /Gm /ZI /Od /I "..\..\..\include" /D "WIN32" /D "_CRT_SECURE_NO_WARNINGS" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "FT2_BUILD_LIBRARY" /D "DLL_EXPORT" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" /d "DLL_EXPORT" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"$(OutDir)\freetype.dll" /pdbtype:sept + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release Static" +# PROP BASE Intermediate_Dir "Release Static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\Win32\Release Static" +# PROP Intermediate_Dir "..\..\..\objs\Win32\Release Static" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /Za /MD /W3 /O2 /Oi /D "WIN32" /I "..\..\..\include" /D "_CRT_SECURE_NO_WARNINGS" /D "NDEBUG" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"$(OutDir)\freetype.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Static" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug Static" +# PROP BASE Intermediate_Dir "Debug Static" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\Win32\Debug Static" +# PROP Intermediate_Dir "..\..\..\objs\Win32\Debug Static" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /Za /MDd /W3 /Gm /ZI /Od /I "..\..\..\include" /D "WIN32" /D "_CRT_SECURE_NO_WARNINGS" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "FT2_BUILD_LIBRARY" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"$(OutDir)\freetype.lib" + +!ENDIF + +# Begin Target + +# Name "freetype - Win32 Release" +# Name "freetype - Win32 Debug" +# Name "freetype - Win32 Release Static" +# Name "freetype - Win32 Debug Static" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\autofit\autofit.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\bdf\bdf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cff\cff.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbase.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbbox.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbdf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbitmap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftcid.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftpatent.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftfstype.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgasp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cache\ftcache.c +# End Source File +# Begin Source File + +SOURCE=..\ftdebug.c +# ADD CPP /Ze +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftglyph.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgxval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\gzip\ftgzip.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftinit.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\lzw\ftlzw.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftmm.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftotval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftpfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftstroke.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsynth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsystem.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\fttype1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftwinfnt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pcf\pcf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pfr\pfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psaux\psaux.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pshinter\pshinter.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psnames\psmodule.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\raster\raster.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\sfnt\sfnt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\smooth\smooth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\truetype\truetype.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type1\type1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cid\type1cid.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type42\type42.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\winfonts\winfnt.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\ft2build.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftconfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftheader.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftmodule.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftoption.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftstdlib.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" +# Begin Source File + +SOURCE=..\..\..\src\base\ftver.rc +# End Source File +# End Group +# End Target +# End Project diff --git a/vendor/freetype/builds/windows/visualc/freetype.dsw b/vendor/freetype/builds/windows/visualc/freetype.dsw new file mode 100644 index 00000000000..b1b375dbbc9 --- /dev/null +++ b/vendor/freetype/builds/windows/visualc/freetype.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "freetype"=.\freetype.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/vendor/freetype/builds/windows/visualc/freetype.sln b/vendor/freetype/builds/windows/visualc/freetype.sln new file mode 100644 index 00000000000..d96607216b9 --- /dev/null +++ b/vendor/freetype/builds/windows/visualc/freetype.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +# Visual C++ 2002-2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Static|Win32 = Debug Static|Win32 + Debug|Win32 = Debug|Win32 + Release Static|Win32 = Release Static|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.ActiveCfg = Debug Static|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.Build.0 = Debug Static|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.ActiveCfg = Release Static|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.Build.0 = Release Static|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/freetype/builds/windows/visualc/freetype.vcproj b/vendor/freetype/builds/windows/visualc/freetype.vcproj new file mode 100644 index 00000000000..85c5f1ca70d --- /dev/null +++ b/vendor/freetype/builds/windows/visualc/freetype.vcproj @@ -0,0 +1,587 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/windows/visualc/index.html b/vendor/freetype/builds/windows/visualc/index.html new file mode 100644 index 00000000000..b3102e575f7 --- /dev/null +++ b/vendor/freetype/builds/windows/visualc/index.html @@ -0,0 +1,38 @@ + +
+ + FreeType 2 Project Files for Visual C++ 6.0 and 2002-2008 + + + +

+ FreeType 2 Project Files for Visual C++ 6.0 and 2002-2008 +

+ +

This directory contains project files freetype.dsp for +Visual C++ 6.0, and freetype.vcproj for Visual C++ 2002 +through 2008, which you might need to upgrade automatically. +It compiles the following libraries from the FreeType 2.13.3 sources:

+ +
    +
  • freetype.dll using 'Release' or 'Debug' configurations
  • +
  • freetype.lib using 'Release Static' or 'Debug Static' configurations
  • +
+ +

Build directories and target files are placed in the top-level +objs directory.

+ +

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP +archives are already stored this way, so no further action is required. If +you use some .tar.*z archives, be sure to configure your extracting +tool to convert the line endings. For example, with WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider +using the unix2dos or u2d utilities that are floating +around, which specifically deal with this particular problem. + +

Build directories are placed in the top-level objs +directory.

+ + + diff --git a/vendor/freetype/builds/windows/visualce/freetype.dsp b/vendor/freetype/builds/windows/visualce/freetype.dsp new file mode 100644 index 00000000000..11d59f9c371 --- /dev/null +++ b/vendor/freetype/builds/windows/visualce/freetype.dsp @@ -0,0 +1,391 @@ +# Microsoft Developer Studio Project File - Name="freetype" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=freetype - Win32 Debug Singlethreaded +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "freetype - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release" +# PROP Intermediate_Dir "..\..\..\objs\release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /MD /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug" +# PROP Intermediate_Dir "..\..\..\objs\debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /MDd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype_D.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "freetype___Win32_Debug_Multithreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Multithreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug_mt" +# PROP Intermediate_Dir "..\..\..\objs\debug_mt" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c +# SUBTRACT BASE CPP /X +# ADD CPP /MTd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"lib\freetype_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetypeMT_D.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "freetype___Win32_Release_Multithreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Release_Multithreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release_mt" +# PROP Intermediate_Dir "..\..\..\objs\release_mt" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c +# ADD CPP /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"lib\freetype.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetypeMT.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "freetype___Win32_Release_Singlethreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Release_Singlethreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release_st" +# PROP Intermediate_Dir "..\..\..\objs\release_st" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype.lib" +# ADD LIB32 /out:"..\..\..\objs\freetypeST.lib" +# SUBTRACT LIB32 /nologo + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "freetype___Win32_Debug_Singlethreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Singlethreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug_st" +# PROP Intermediate_Dir "..\..\..\objs\debug_st" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c +# SUBTRACT BASE CPP /X /YX +# ADD CPP /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetypeST_D.lib" + +!ENDIF + +# Begin Target + +# Name "freetype - Win32 Release" +# Name "freetype - Win32 Debug" +# Name "freetype - Win32 Debug Multithreaded" +# Name "freetype - Win32 Release Multithreaded" +# Name "freetype - Win32 Release Singlethreaded" +# Name "freetype - Win32 Debug Singlethreaded" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\autofit\autofit.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\bdf\bdf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cff\cff.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbase.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbbox.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbdf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbitmap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftcid.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftfstype.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgasp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cache\ftcache.c +# End Source File +# Begin Source File + +SOURCE=..\ftdebug.c +# ADD CPP /Ze +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftglyph.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgxval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\gzip\ftgzip.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftinit.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\lzw\ftlzw.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftmm.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftotval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftpatent.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftpfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftstroke.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsynth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsystem.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\fttype1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftwinfnt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pcf\pcf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pfr\pfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psaux\psaux.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pshinter\pshinter.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psnames\psmodule.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\raster\raster.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\sfnt\sfnt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\smooth\smooth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\truetype\truetype.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type1\type1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cid\type1cid.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type42\type42.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\winfonts\winfnt.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\ft2build.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftconfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftheader.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftmodule.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftoption.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftstdlib.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" +# Begin Source File + +SOURCE=..\..\..\src\base\ftver.rc +# End Source File +# End Group +# End Target +# End Project diff --git a/vendor/freetype/builds/windows/visualce/freetype.dsw b/vendor/freetype/builds/windows/visualce/freetype.dsw new file mode 100644 index 00000000000..b1b375dbbc9 --- /dev/null +++ b/vendor/freetype/builds/windows/visualce/freetype.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "freetype"=.\freetype.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/vendor/freetype/builds/windows/visualce/freetype.vcproj b/vendor/freetype/builds/windows/visualce/freetype.vcproj new file mode 100644 index 00000000000..f0f74c77ffa --- /dev/null +++ b/vendor/freetype/builds/windows/visualce/freetype.vcproj @@ -0,0 +1,3706 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/freetype/builds/windows/visualce/index.html b/vendor/freetype/builds/windows/visualce/index.html new file mode 100644 index 00000000000..db9246c0a43 --- /dev/null +++ b/vendor/freetype/builds/windows/visualce/index.html @@ -0,0 +1,47 @@ + +
+ + FreeType 2 Project Files for Visual C++ and VS.NET 2005 + (Pocket PC) + + + +

+ FreeType 2 Project Files for Visual C++ and VS.NET 2005 + (Pocket PC) +

+ +

This directory contains project files for Visual C++, named +freetype.dsp, and Visual Studio, called freetype.sln for +the following targets: + +

    +
  • PPC/SP 2003 (Pocket PC 2003)
  • +
  • PPC/SP WM5 (Windows Mobile 5)
  • +
  • PPC/SP WM6 (Windows Mobile 6)
  • +
+ +It compiles the following libraries from the FreeType 2.13.3 sources:

+ +
    +
    +    freetype.lib     - release build; single threaded
    +    freetype_D.lib   - debug build;   single threaded
    +    freetypeMT.lib   - release build; multi-threaded
    +    freetypeMT_D.lib - debug build;   multi-threaded
    +
+ +

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP +archives are already stored this way, so no further action is required. If +you use some .tar.*z archives, be sure to configure your extracting +tool to convert the line endings. For example, with WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider +using the unix2dos or u2d utilities that are floating +around, which specifically deal with this particular problem. + +

Build directories are placed in the top-level objs +directory.

+ + + diff --git a/vendor/freetype/builds/windows/w32-bcc.mk b/vendor/freetype/builds/windows/w32-bcc.mk new file mode 100644 index 00000000000..a68656fc9d7 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-bcc.mk @@ -0,0 +1,28 @@ +# +# FreeType 2 Borland C++ on Win32 +# + + +# Copyright (C) 1996-2024 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. + +# default definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = /DEF:$(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -wB + +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/bcc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-bccd.mk b/vendor/freetype/builds/windows/w32-bccd.mk new file mode 100644 index 00000000000..484aefc0531 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-bccd.mk @@ -0,0 +1,26 @@ +# +# FreeType 2 Borland C++ on Win32 + debugging +# + + +# Copyright (C) 1996-2024 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. + + +DEVEL_DIR := $(TOP_DIR)/devel + +include $(TOP_DIR)/builds/windows/win32-def.mk + +include $(TOP_DIR)/builds/compiler/bcc-dev.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-dev.mk b/vendor/freetype/builds/windows/w32-dev.mk new file mode 100644 index 00000000000..6ae6d9fa67e --- /dev/null +++ b/vendor/freetype/builds/windows/w32-dev.mk @@ -0,0 +1,32 @@ +# +# FreeType 2 configuration rules for Win32 + GCC +# +# Development version without optimizations. +# + + +# Copyright (C) 1996-2024 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. + + +# NOTE: This version requires that GNU Make is invoked from the Windows +# Shell (_not_ Cygwin BASH)! +# + +DEVEL_DIR := $(TOP_DIR)/devel + +include $(TOP_DIR)/builds/windows/win32-def.mk + +include $(TOP_DIR)/builds/compiler/gcc-dev.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-gcc.mk b/vendor/freetype/builds/windows/w32-gcc.mk new file mode 100644 index 00000000000..f1dace5b5d1 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-gcc.mk @@ -0,0 +1,31 @@ +# +# FreeType 2 configuration rules for Win32 + GCC +# + + +# Copyright (C) 1996-2024 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. + +# default definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = $(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -w + +# include Win32-specific definitions +include $(TOP_DIR)/builds/windows/win32-def.mk + +# include gcc-specific definitions +include $(TOP_DIR)/builds/compiler/gcc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-icc.mk b/vendor/freetype/builds/windows/w32-icc.mk new file mode 100644 index 00000000000..e331c5dbec2 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-icc.mk @@ -0,0 +1,28 @@ +# +# FreeType 2 configuration rules for Win32 + IBM Visual Age C++ +# + + +# Copyright (C) 1996-2024 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. + +# default definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = /DEF:$(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -w + +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/visualage.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-intl.mk b/vendor/freetype/builds/windows/w32-intl.mk new file mode 100644 index 00000000000..440b48d868b --- /dev/null +++ b/vendor/freetype/builds/windows/w32-intl.mk @@ -0,0 +1,28 @@ +# +# FreeType 2 configuration rules for Intel C/C++ on Win32 +# + + +# Copyright (C) 1996-2024 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. + +# default definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = /DEF:$(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -w + +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/intelc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-lcc.mk b/vendor/freetype/builds/windows/w32-lcc.mk new file mode 100644 index 00000000000..d34bcd52927 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-lcc.mk @@ -0,0 +1,24 @@ +# +# FreeType 2 configuration rules for Win32 + LCC +# + + +# Copyright (C) 1996-2024 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. + + +SEP := / +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/win-lcc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + +# EOF + diff --git a/vendor/freetype/builds/windows/w32-mingw32.mk b/vendor/freetype/builds/windows/w32-mingw32.mk new file mode 100644 index 00000000000..c5b19f7d80a --- /dev/null +++ b/vendor/freetype/builds/windows/w32-mingw32.mk @@ -0,0 +1,33 @@ +# +# FreeType 2 configuration rules for mingw32 +# + + +# Copyright (C) 1996-2024 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. + +# default definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = $(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -w + +# include Win32-specific definitions +include $(TOP_DIR)/builds/windows/win32-def.mk + +LIBRARY := lib$(PROJECT) + +# include gcc-specific definitions +include $(TOP_DIR)/builds/compiler/gcc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-vcc.mk b/vendor/freetype/builds/windows/w32-vcc.mk new file mode 100644 index 00000000000..bfba2adac62 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-vcc.mk @@ -0,0 +1,28 @@ +# +# FreeType 2 Visual C++ on Win32 +# + + +# Copyright (C) 1996-2024 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. + +# definitions of the export list +# +EXPORTS_LIST = $(OBJ_DIR)/freetype.def +EXPORTS_OPTIONS = /DEF:$(EXPORTS_LIST) +APINAMES_OPTIONS := -dfreetype.dll -w + +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/visualc.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/w32-wat.mk b/vendor/freetype/builds/windows/w32-wat.mk new file mode 100644 index 00000000000..665ef49b964 --- /dev/null +++ b/vendor/freetype/builds/windows/w32-wat.mk @@ -0,0 +1,28 @@ +# +# FreeType 2 configuration rules for Watcom C/C++ +# + + +# Copyright (C) 1996-2024 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. + +# redefine export symbol definitions +# +EXPORTS_LIST = $(OBJ_DIR)/watcom-ftexports.lbc +EXPORTS_OPTIONS = -\"export @$(EXPORTS_LIST)\"- +APINAMES_OPTIONS := -wW + +include $(TOP_DIR)/builds/windows/win32-def.mk +include $(TOP_DIR)/builds/compiler/watcom.mk + +# include linking instructions +include $(TOP_DIR)/builds/link_dos.mk + + +# EOF diff --git a/vendor/freetype/builds/windows/win32-def.mk b/vendor/freetype/builds/windows/win32-def.mk new file mode 100644 index 00000000000..af4e8b57533 --- /dev/null +++ b/vendor/freetype/builds/windows/win32-def.mk @@ -0,0 +1,51 @@ +# +# FreeType 2 Win32 specific definitions +# + + +# Copyright (C) 1996-2024 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. + + +DELETE := del +CAT := type +SEP := $(strip \ ) +PLATFORM_DIR := $(TOP_DIR)/builds/windows +PLATFORM := windows + +# This is used for `make refdoc' and `make refdoc-venv' +# +BIN := Scripts + +# The executable file extension (for tools). NOTE: WE INCLUDE THE DOT HERE !! +# +E := .exe +E_BUILD := .exe + + +# The directory where all library files are placed. +# +# By default, this is the same as $(OBJ_DIR); however, this can be changed +# to suit particular needs. +# +LIB_DIR := $(OBJ_DIR) + + +# The name of the final library file. Note that the DOS-specific Makefile +# uses a shorter (8.3) name. +# +LIBRARY := $(PROJECT) + + +# The NO_OUTPUT macro is used to ignore the output of commands. +# +NO_OUTPUT = 2> nul + + +# EOF diff --git a/vendor/freetype/include/freetype/config/ftoption.h b/vendor/freetype/include/freetype/config/ftoption.h index eb4e32d80a6..2a1eddb443b 100644 --- a/vendor/freetype/include/freetype/config/ftoption.h +++ b/vendor/freetype/include/freetype/config/ftoption.h @@ -158,12 +158,12 @@ FT_BEGIN_HEADER /************************************************************************** * - * If this macro is defined, try to use an inlined assembler version of the - * @FT_MulFix function, which is a 'hotspot' when loading and hinting - * glyphs, and which should be executed as fast as possible. + * If this macro is defined, try to use an inlined 64-bit or assembler + * version of the @FT_MulFix function, which is a 'hotspot' when loading + * and hinting glyphs, and which should be executed as fast as possible. * - * Note that if your compiler or CPU is not supported, this will default to - * the standard and portable implementation found in `ftcalc.c`. + * If your compiler is not C99-compliant or CPU assembly is not supported, + * you can disable this option. */ #define FT_CONFIG_OPTION_INLINE_MULFIX @@ -293,6 +293,31 @@ FT_BEGIN_HEADER /* #define FT_CONFIG_OPTION_USE_HARFBUZZ */ + /************************************************************************** + * + * HarfBuzz dynamic support. + * + * Define this macro if you want the HarfBuzz library to be loaded at + * runtime instead of being linked to FreeType. + * + * This option has no effect if `FT_CONFIG_OPTION_USE_HARFBUZZ` is not + * defined. + * + * When this option is enabled, FreeType will try to load the HarfBuzz + * library at runtime, using `dlopen` or `LoadLibrary`, depending on the + * platform. On Microsoft platforms, the library name looked up is + * `libharfbuzz-0.dll`. On Apple platforms, the library name looked up + * is `libharfbuzz.0.dylib`. On all other platforms, the library name + * looked up is `libharfbuzz.so.0`. This name can be overridden by + * defining the macro `FT_LIBHARFBUZZ` at FreeType compilation time. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */ + + /************************************************************************** * * Brotli support. @@ -679,7 +704,7 @@ FT_BEGIN_HEADER * defined. * * [1] - * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx + * https://learn.microsoft.com/typography/cleartype/truetypecleartype */ #define TT_CONFIG_OPTION_SUBPIXEL_HINTING @@ -697,7 +722,7 @@ FT_BEGIN_HEADER * flags array which can be used to disambiguate, but old fonts will not * have them. * - * https://www.microsoft.com/typography/otspec/glyf.htm + * https://learn.microsoft.com/typography/opentype/spec/glyf * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */ #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED @@ -760,10 +785,10 @@ FT_BEGIN_HEADER /************************************************************************** * * Option `TT_CONFIG_OPTION_GPOS_KERNING` enables a basic GPOS kerning - * implementation (for TrueType fonts only). With this defined, FreeType - * is able to get kerning pair data from the GPOS 'kern' feature as well as - * legacy 'kern' tables; without this defined, FreeType will only be able - * to use legacy 'kern' tables. + * implementation (for TrueType and OpenType fonts only). With this + * defined, FreeType is able to get kerning pair data from the GPOS 'kern' + * feature as well as legacy 'kern' tables; without this defined, FreeType + * will only be able to use legacy 'kern' tables. * * Note that FreeType does not support more advanced GPOS layout features; * even the 'kern' feature implemented here doesn't handle more diff --git a/vendor/freetype/include/freetype/config/integer-types.h b/vendor/freetype/include/freetype/config/integer-types.h index c27505ffc4b..36a0bbc22dc 100644 --- a/vendor/freetype/include/freetype/config/integer-types.h +++ b/vendor/freetype/include/freetype/config/integer-types.h @@ -17,6 +17,8 @@ #ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_ #define FREETYPE_CONFIG_INTEGER_TYPES_H_ +FT_BEGIN_HEADER + /* There are systems (like the Texas Instruments 'C54x) where a `char` */ /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */ /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */ @@ -242,9 +244,34 @@ #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ #ifdef FT_INT64 + typedef FT_INT64 FT_Int64; typedef FT_UINT64 FT_UInt64; -#endif +# define FT_INT64_ZERO 0 + +#else /* !FT_INT64 */ + + /* we need to emulate 64-bit data types if none are available */ + + typedef struct FT_Int64_ + { + FT_UInt32 lo; + FT_UInt32 hi; + + } FT_Int64; + + typedef struct FT_UInt64_ + { + FT_UInt32 lo; + FT_UInt32 hi; + + } FT_UInt64; + +# define FT_INT64_ZERO { 0, 0 } + +#endif /* !FT_INT64 */ + +FT_END_HEADER #endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */ diff --git a/vendor/freetype/include/freetype/config/public-macros.h b/vendor/freetype/include/freetype/config/public-macros.h index f56581a6ee7..4aba639d904 100644 --- a/vendor/freetype/include/freetype/config/public-macros.h +++ b/vendor/freetype/include/freetype/config/public-macros.h @@ -62,8 +62,8 @@ FT_BEGIN_HEADER * because it is needed by `FT_EXPORT`. */ - /* Visual C, mingw */ -#if defined( _WIN32 ) + /* Visual C, MinGW, Cygwin */ +#if defined( _WIN32 ) || defined( __CYGWIN__ ) #if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT ) #define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport ) diff --git a/vendor/freetype/include/freetype/freetype.h b/vendor/freetype/include/freetype/freetype.h index 58fc33dfe60..c52fb831ba6 100644 --- a/vendor/freetype/include/freetype/freetype.h +++ b/vendor/freetype/include/freetype/freetype.h @@ -811,7 +811,7 @@ FT_BEGIN_HEADER * FT_ENCODING_MS_SYMBOL :: * Microsoft Symbol encoding, used to encode mathematical symbols and * wingdings. For more information, see - * 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts', + * 'https://learn.microsoft.com/typography/opentype/spec/recom#non-standard-symbol-fonts', * 'http://www.kostis.net/charsets/symbol.htm', and * 'http://www.kostis.net/charsets/wingding.htm'. * @@ -1068,12 +1068,12 @@ FT_BEGIN_HEADER * the face in the font file (starting with value~0). They are set * to~0 if there is only one face in the font file. * - * [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation - * fonts only, holding the named instance index for the current face - * index (starting with value~1; value~0 indicates font access without - * a named instance). For non-variation fonts, bits 16-30 are ignored. - * If we have the third named instance of face~4, say, `face_index` is - * set to 0x00030004. + * [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType + * Font Variations only, holding the named instance index for the + * current face index (starting with value~1; value~0 indicates font + * access without a named instance). For non-variation fonts, bits + * 16-30 are ignored. If we have the third named instance of face~4, + * say, `face_index` is set to 0x00030004. * * Bit 31 is always zero (that is, `face_index` is always a positive * value). @@ -1092,10 +1092,10 @@ FT_BEGIN_HEADER * the face; see @FT_STYLE_FLAG_XXX for the details. * * [Since 2.6.1] Bits 16-30 hold the number of named instances - * available for the current face if we have a GX or OpenType variation - * (sub)font. Bit 31 is always zero (that is, `style_flags` is always - * a positive value). Note that a variation font has always at least - * one named instance, namely the default instance. + * available for the current face if we have a TrueType GX or OpenType + * Font Variation. Bit 31 is always zero (that is, `style_flags` is + * always a positive value). Note that a variation font has always at + * least one named instance, namely the default instance. * * num_glyphs :: * The number of glyphs in the face. If the face is scalable and has @@ -1159,7 +1159,7 @@ FT_BEGIN_HEADER * Note that the bounding box might be off by (at least) one pixel for * hinted fonts. See @FT_Size_Metrics for further discussion. * - * Note that the bounding box does not vary in OpenType variation fonts + * Note that the bounding box does not vary in OpenType Font Variations * and should only be used in relation to the default instance. * * units_per_EM :: @@ -1218,7 +1218,7 @@ FT_BEGIN_HEADER * Fields may be changed after a call to @FT_Attach_File or * @FT_Attach_Stream. * - * For an OpenType variation font, the values of the following fields can + * For OpenType Font Variations, the values of the following fields can * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if * the font contains an 'MVAR' table: `ascender`, `descender`, `height`, * `underline_position`, and `underline_thickness`. @@ -1336,7 +1336,7 @@ FT_BEGIN_HEADER * FT_FACE_FLAG_MULTIPLE_MASTERS :: * The face contains multiple masters and is capable of interpolating * between them. Supported formats are Adobe MM, TrueType GX, and - * OpenType variation fonts. + * OpenType Font Variations. * * See section @multiple_masters for API details. * @@ -1609,7 +1609,7 @@ FT_BEGIN_HEADER * * @description: * A macro that returns true whenever a face object is a named instance - * of a GX or OpenType variation font. + * of a TrueType GX or OpenType Font Variations. * * [Since 2.9] Changing the design coordinates with * @FT_Set_Var_Design_Coordinates or @FT_Set_Var_Blend_Coordinates does @@ -2147,7 +2147,7 @@ FT_BEGIN_HEADER * freed. * * [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of - * OpenType variation fonts for a selected instance are internally + * OpenType Font Variations for a selected instance are internally * handled as 26.6 fractional font units but returned as (rounded) * integers, as expected. To get unrounded font units, don't use * @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and @@ -2640,14 +2640,14 @@ FT_BEGIN_HEADER * the face in the font file (starting with value~0). Set it to~0 if * there is only one face in the font file. * - * [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation - * fonts only, specifying the named instance index for the current face - * index (starting with value~1; value~0 makes FreeType ignore named - * instances). For non-variation fonts, bits 16-30 are ignored. - * Assuming that you want to access the third named instance in face~4, - * `face_index` should be set to 0x00030004. If you want to access - * face~4 without variation handling, simply set `face_index` to - * value~4. + * [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType + * Font Variations only, specifying the named instance index for the + * current face index (starting with value~1; value~0 makes FreeType + * ignore named instances). For non-variation fonts, bits 16-30 are + * ignored. Assuming that you want to access the third named instance + * in face~4, `face_index` should be set to 0x00030004. If you want + * to access face~4 without variation handling, simply set + * `face_index` to value~4. * * `FT_Open_Face` and its siblings can be used to quickly check whether * the font format of a given font resource is supported by FreeType. @@ -2914,11 +2914,11 @@ FT_BEGIN_HEADER * of the available glyphs at a given ppem value is available. FreeType * silently uses outlines if there is no bitmap for a given glyph index. * - * For GX and OpenType variation fonts, a bitmap strike makes sense only - * if the default instance is active (that is, no glyph variation takes - * place); otherwise, FreeType simply ignores bitmap strikes. The same - * is true for all named instances that are different from the default - * instance. + * For TrueType GX and OpenType Font Variations, a bitmap strike makes + * sense only if the default instance is active (that is, no glyph + * variation takes place); otherwise, FreeType simply ignores bitmap + * strikes. The same is true for all named instances that are different + * from the default instance. * * Don't use this function if you are using the FreeType cache API. */ @@ -3078,7 +3078,7 @@ FT_BEGIN_HEADER * is dependent entirely on how the size is defined in the source face. * The font designer chooses the final size of each glyph relative to * this size. For more information refer to - * 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'. + * 'https://freetype.org/freetype2/docs/glyphs/glyphs-2.html'. * * Contrary to @FT_Set_Char_Size, this function doesn't have special code * to normalize zero-valued widths, heights, or resolutions, which are @@ -3441,8 +3441,10 @@ FT_BEGIN_HEADER * blending of the color glyph layers associated with the glyph index, * using the same bitmap format as embedded color bitmap images. This * is mainly for convenience and works only for glyphs in 'COLR' v0 - * tables (or glyphs in 'COLR' v1 tables that exclusively use v0 - * features). For full control of color layers use + * tables. **There is no rendering support for 'COLR' v1** (with the + * exception of v1 tables that exclusively use v0 features)! You need + * a graphics library like Skia or Cairo to interpret the graphics + * commands stored in v1 tables. For full control of color layers use * @FT_Get_Color_Glyph_Layer and FreeType's color functions like * @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering * so that the client application can handle blending by itself. @@ -3895,8 +3897,10 @@ FT_BEGIN_HEADER * * This process can cost performance. There is an approximation that * does not need to know about the background color; see - * https://bel.fi/alankila/lcd/ and - * https://bel.fi/alankila/lcd/alpcor.html for details. + * https://web.archive.org/web/20211019204945/https://bel.fi/alankila/lcd/ + * and + * https://web.archive.org/web/20210211002939/https://bel.fi/alankila/lcd/alpcor.html + * for details. * * **ATTENTION**: Linear blending is even more important when dealing * with subpixel-rendered glyphs to prevent color-fringing! A @@ -3993,13 +3997,13 @@ FT_BEGIN_HEADER * out of the scope of this API function -- they can be implemented * through format-specific interfaces. * - * Note that, for TrueType fonts only, this can extract data from both - * the 'kern' table and the basic, pair-wise kerning feature from the - * GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), though - * FreeType does not support the more advanced GPOS layout features; use - * a library like HarfBuzz for those instead. If a font has both a - * 'kern' table and kern features of a GPOS table, the 'kern' table will - * be used. + * Note that, for TrueType and OpenType fonts only, this can extract data + * from both the 'kern' table and the basic, pair-wise kerning feature + * from the GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), + * though FreeType does not support the more advanced GPOS layout + * features; use a library like HarfBuzz for those instead. If a font + * has both a 'kern' table and kern features of a GPOS table, the 'kern' + * table will be used. * * Also note for right-to-left scripts, the functionality may differ for * fonts with GPOS tables vs. 'kern' tables. For GPOS, right-to-left @@ -4530,7 +4534,7 @@ FT_BEGIN_HEADER * table description in the OpenType specification for the meaning of the * various flags (which get synthesized for non-OpenType subglyphs). * - * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description + * https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description * * @values: * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: @@ -4593,7 +4597,7 @@ FT_BEGIN_HEADER * interpreted depending on the flags returned in `*p_flags`. See the * OpenType specification for details. * - * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description + * https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description * */ FT_EXPORT( FT_Error ) @@ -4619,7 +4623,7 @@ FT_BEGIN_HEADER * associated with a font. * * See - * https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf + * https://adobe-type-tools.github.io/font-tech-notes/pdfs/AcrobatDC_FontPolicies.pdf * for more details. * * @values: diff --git a/vendor/freetype/include/freetype/ftcolor.h b/vendor/freetype/include/freetype/ftcolor.h index 002d6c133a3..8d0a77a669f 100644 --- a/vendor/freetype/include/freetype/ftcolor.h +++ b/vendor/freetype/include/freetype/ftcolor.h @@ -317,6 +317,15 @@ FT_BEGIN_HEADER * @description: * The functions described here allow access of colored glyph layer data * in OpenType's 'COLR' tables. + * + * Note that FreeType does *not* provide rendering in general of glyphs + * that use a 'COLR' table! While FreeType has very limited rendering + * support for 'COLR' v0 tables (without a possibility to change the + * color palette) via @FT_Render_Glyph, there is no such convenience + * code for 'COLR' v1 tables -- while it appears that v1 is simply an + * 'improved' version of v0, this is not the case: it is a completely + * different color font format, and you need a dedicated graphics + * library like Skia or Cairo to handle a v1 table's drawing commands. */ @@ -359,7 +368,7 @@ FT_BEGIN_HEADER * iteratively retrieve the colored glyph layers associated with the * current glyph slot. * - * https://docs.microsoft.com/en-us/typography/opentype/spec/colr + * https://learn.microsoft.com/typography/opentype/spec/colr * * The glyph layer data for a given glyph index, if present, provides an * alternative, multi-color glyph representation: Instead of rendering diff --git a/vendor/freetype/include/freetype/ftdriver.h b/vendor/freetype/include/freetype/ftdriver.h index 1b7f539f5e2..3e84687a2b1 100644 --- a/vendor/freetype/include/freetype/ftdriver.h +++ b/vendor/freetype/include/freetype/ftdriver.h @@ -282,7 +282,7 @@ FT_BEGIN_HEADER * minimize hinting techniques that were problematic with the extra * resolution of ClearType; see * http://rastertragedy.com/RTRCh4.htm#Sec1 and - * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx. + * https://learn.microsoft.com/typography/cleartype/truetypecleartype. * This technique is not to be confused with ClearType compatible widths. * ClearType backward compatibility has no direct impact on changing * advance widths, but there might be an indirect impact on disabling @@ -784,7 +784,7 @@ FT_BEGIN_HEADER * * Details on subpixel hinting and some of the necessary tweaks can be * found in Greg Hitchcock's whitepaper at - * 'https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'. + * 'https://learn.microsoft.com/typography/cleartype/truetypecleartype'. * Note that FreeType currently doesn't really 'subpixel hint' (6x1, 6x2, * or 6x5 supersampling) like discussed in the paper. Depending on the * chosen interpreter, it simply ignores instructions on vertical stems diff --git a/vendor/freetype/include/freetype/ftimage.h b/vendor/freetype/include/freetype/ftimage.h index 33070fb125c..894dbdcbdc0 100644 --- a/vendor/freetype/include/freetype/ftimage.h +++ b/vendor/freetype/include/freetype/ftimage.h @@ -443,7 +443,7 @@ FT_BEGIN_HEADER * rasterizer; see the `tags` field in @FT_Outline. * * Please refer to the description of the 'SCANTYPE' instruction in the - * [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#scantype) + * [OpenType specification](https://learn.microsoft.com/typography/opentype/spec/tt_instructions#scantype) * how simple drop-outs, smart drop-outs, and stubs are defined. */ #define FT_OUTLINE_NONE 0x0 diff --git a/vendor/freetype/include/freetype/ftmm.h b/vendor/freetype/include/freetype/ftmm.h index 35ed039c89b..81f1b42b5b6 100644 --- a/vendor/freetype/include/freetype/ftmm.h +++ b/vendor/freetype/include/freetype/ftmm.h @@ -2,7 +2,7 @@ * * ftmm.h * - * FreeType Multiple Master font interface (specification). + * FreeType variation font interface (specification). * * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. @@ -37,24 +37,79 @@ FT_BEGIN_HEADER * multiple_masters * * @title: - * Multiple Masters + * OpenType Font Variations, TrueType GX, and Adobe MM Fonts * * @abstract: - * How to manage Multiple Masters fonts. + * How to manage variable fonts with multiple design axes. * * @description: - * The following types and functions are used to manage Multiple Master - * fonts, i.e., the selection of specific design instances by setting - * design axis coordinates. - * - * Besides Adobe MM fonts, the interface supports Apple's TrueType GX and - * OpenType variation fonts. Some of the routines only work with Adobe - * MM fonts, others will work with all three types. They are similar - * enough that a consistent interface makes sense. - * - * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and - * OpenType variation fonts, it returns true. - * + * The following types and functions manage OpenType Font Variations, + * Adobe Multiple Master (MM) fonts, and Apple TrueType GX fonts. These + * formats have in common that they allow the selection of specific + * design instances by setting design coordinates for one or more axes + * like font weight or width. + * + * For historical reasons there are two interfaces. The first, older one + * can be used with Adobe MM fonts only, and the second, newer one is a + * unified interface that handles all three font formats. However, some + * differences remain and are documented accordingly; in particular, + * Adobe MM fonts don't have named instances (see below). + * + * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For TrueType GX + * and OpenType Font Variations, it returns true. + * + * We use mostly the terminology of the OpenType standard. Here are some + * important technical terms. + * + * * A 'named instance' is a tuple of design coordinates that has a + * string ID (i.e., an index into the font's 'name' table) associated + * with it. The font can tell the user that, for example, + * [Weight=700,Width=110] is 'Bold'. Another name for 'named instance' + * is 'named style'. + * + * Adobe MM fonts don't have named instances. + * + * * The 'default instance' of a variation font is that instance for + * which the nth axis coordinate is equal to the nth default axis + * coordinate (i.e., `axis[n].def` as specified in the @FT_MM_Var + * structure), with~n covering all axes. In TrueType GX and OpenType + * Font Variations, the default instance is explicitly given. In Adobe + * MM fonts, the `WeightVector` entry as found in the font file is + * taken as the default instance. + * + * For TrueType GX and OpenType Font Variations, FreeType synthesizes + * a named instance for the default instance if the font does not + * contain such an entry. + * + * * 'Design coordinates' are the axis values found in a variation font + * file. Their meaning is specified by the font designer and the + * values are rather arbitrary. + * + * For example, the 'weight' axis in design coordinates might vary + * between 100 (thin) and 900 (heavy) in font~A, while font~B + * contains values between 400 (normal) and 800 (extra bold). + * + * * 'Normalized coordinates' are design coordinates mapped to a standard + * range; they are also called 'blend coordinates'. + * + * For TrueType GX and OpenType Font Variations, the range is [-1;1], + * with the minimum mapped to value~-1, the default mapped to + * value~0, and the maximum mapped to value~1, and all other + * coordinates mapped to intervening points. Please look up the + * [OpenType + * specification](https://learn.microsoft.com/en-us/typography/opentype/spec/otvaroverview) + * on how this mapping works in detail. + * + * For Adobe MM fonts, this standard range is [0;1], with the minimum + * mapped to value~0 and the maximum mapped to value~1, and all other + * coordinates mapped to intervening points. Please look up [Adobe + * TechNote + * #5015](https://adobe-type-tools.github.io/font-tech-notes/pdfs/5015.Type1_Supp.pdf) + * on how this mapping works in detail. + * + * Assuming that the two fonts in the previous example are OpenType + * Font Variations, both font~A's [100;900] and font~B's [400;800] + * coordinate ranges get mapped to [-1;1]. */ @@ -64,14 +119,14 @@ FT_BEGIN_HEADER * T1_MAX_MM_XXX * * @description: - * Multiple Masters limits as defined in their specifications. + * Adobe MM font limits as defined in their specifications. * * @values: * T1_MAX_MM_AXIS :: - * The maximum number of Multiple Masters axes. + * The maximum number of Adobe MM font axes. * * T1_MAX_MM_DESIGNS :: - * The maximum number of Multiple Masters designs. + * The maximum number of Adobe MM font designs. * * T1_MAX_MM_MAP_POINTS :: * The maximum number of elements in a design map. @@ -88,11 +143,10 @@ FT_BEGIN_HEADER * FT_MM_Axis * * @description: - * A structure to model a given axis in design space for Multiple Masters - * fonts. + * A structure to model a given axis in design space for Adobe MM fonts. * - * This structure can't be used for TrueType GX or OpenType variation - * fonts. + * This structure can't be used with TrueType GX or OpenType Font + * Variations. * * @fields: * name :: @@ -119,17 +173,17 @@ FT_BEGIN_HEADER * FT_Multi_Master * * @description: - * A structure to model the axes and space of a Multiple Masters font. + * A structure to model the axes and space of an Adobe MM font. * - * This structure can't be used for TrueType GX or OpenType variation - * fonts. + * This structure can't be used with TrueType GX or OpenType Font + * Variations. * * @fields: * num_axis :: * Number of axes. Cannot exceed~4. * * num_designs :: - * Number of designs; should be normally 2^num_axis even though the + * Number of designs; should be normally `2^num_axis` even though the * Type~1 specification strangely allows for intermediate designs to be * present. This number cannot exceed~16. * @@ -151,13 +205,13 @@ FT_BEGIN_HEADER * FT_Var_Axis * * @description: - * A structure to model a given axis in design space for Multiple - * Masters, TrueType GX, and OpenType variation fonts. + * A structure to model a given axis in design space for Adobe MM fonts, + * TrueType GX, and OpenType Font Variations. * * @fields: * name :: * The axis's name. Not always meaningful for TrueType GX or OpenType - * variation fonts. + * Font Variations. * * minimum :: * The axis's minimum design coordinate. @@ -171,17 +225,17 @@ FT_BEGIN_HEADER * * tag :: * The axis's tag (the equivalent to 'name' for TrueType GX and - * OpenType variation fonts). FreeType provides default values for + * OpenType Font Variations). FreeType provides default values for * Adobe MM fonts if possible. * * strid :: * The axis name entry in the font's 'name' table. This is another * (and often better) version of the 'name' field for TrueType GX or - * OpenType variation fonts. Not meaningful for Adobe MM fonts. + * OpenType Font Variations. Not meaningful for Adobe MM fonts. * * @note: * The fields `minimum`, `def`, and `maximum` are 16.16 fractional values - * for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the + * for TrueType GX and OpenType Font Variations. For Adobe MM fonts, the * values are whole numbers (i.e., the fractional part is zero). */ typedef struct FT_Var_Axis_ @@ -205,7 +259,7 @@ FT_BEGIN_HEADER * * @description: * A structure to model a named instance in a TrueType GX or OpenType - * variation font. + * Font Variations. * * This structure can't be used for Adobe MM fonts. * @@ -215,11 +269,11 @@ FT_BEGIN_HEADER * entry for each axis. * * strid :: - * The entry in 'name' table identifying this instance. + * An index into the 'name' table identifying this instance. * * psid :: - * The entry in 'name' table identifying a PostScript name for this - * instance. Value 0xFFFF indicates a missing entry. + * An index into the 'name' table identifying a PostScript name for + * this instance. Value 0xFFFF indicates a missing entry. */ typedef struct FT_Var_Named_Style_ { @@ -236,39 +290,33 @@ FT_BEGIN_HEADER * FT_MM_Var * * @description: - * A structure to model the axes and space of an Adobe MM, TrueType GX, - * or OpenType variation font. + * A structure to model the axes and space of Adobe MM fonts, TrueType + * GX, or OpenType Font Variations. * * Some fields are specific to one format and not to the others. * * @fields: * num_axis :: * The number of axes. The maximum value is~4 for Adobe MM fonts; no - * limit in TrueType GX or OpenType variation fonts. + * limit in TrueType GX or OpenType Font Variations. * * num_designs :: - * The number of designs; should be normally 2^num_axis for Adobe MM - * fonts. Not meaningful for TrueType GX or OpenType variation fonts + * The number of designs; should be normally `2^num_axis` for Adobe MM + * fonts. Not meaningful for TrueType GX or OpenType Font Variations * (where every glyph could have a different number of designs). * * num_namedstyles :: - * The number of named styles; a 'named style' is a tuple of design - * coordinates that has a string ID (in the 'name' table) associated - * with it. The font can tell the user that, for example, - * [Weight=1.5,Width=1.1] is 'Bold'. Another name for 'named style' is - * 'named instance'. - * - * For Adobe Multiple Masters fonts, this value is always zero because - * the format does not support named styles. + * The number of named instances. For Adobe MM fonts, this value is + * always zero. * * axis :: - * An axis descriptor table. TrueType GX and OpenType variation fonts + * An axis descriptor table. TrueType GX and OpenType Font Variations * contain slightly more data than Adobe MM fonts. Memory management * of this pointer is done internally by FreeType. * * namedstyle :: - * A named style (instance) table. Only meaningful for TrueType GX and - * OpenType variation fonts. Memory management of this pointer is done + * An array of named instances. Only meaningful for TrueType GX and + * OpenType Font Variations. Memory management of this pointer is done * internally by FreeType. */ typedef struct FT_MM_Var_ @@ -290,8 +338,8 @@ FT_BEGIN_HEADER * @description: * Retrieve a variation descriptor of a given Adobe MM font. * - * This function can't be used with TrueType GX or OpenType variation - * fonts. + * This function can't be used with TrueType GX or OpenType Font + * Variations. * * @input: * face :: @@ -299,7 +347,7 @@ FT_BEGIN_HEADER * * @output: * amaster :: - * The Multiple Masters descriptor. + * The Adobe MM font's variation descriptor. * * @return: * FreeType error code. 0~means success. @@ -366,8 +414,8 @@ FT_BEGIN_HEADER * For Adobe MM fonts, choose an interpolated font design through design * coordinates. * - * This function can't be used with TrueType GX or OpenType variation - * fonts. + * This function can't be used with TrueType GX or OpenType Font + * Variations. * * @inout: * face :: @@ -428,7 +476,7 @@ FT_BEGIN_HEADER * * @note: * The design coordinates are 16.16 fractional values for TrueType GX and - * OpenType variation fonts. For Adobe MM fonts, the values are supposed + * OpenType Font Variations. For Adobe MM fonts, the values are supposed * to be whole numbers (i.e., the fractional part is zero). * * [Since 2.8.1] To reset all axes to the default values, call the @@ -440,6 +488,12 @@ FT_BEGIN_HEADER * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero, * this bit flag gets unset. + * + * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit + * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION will return + * true) if any of the provided coordinates is different from the face's + * default value for the corresponding axis, that is, the set up face is + * not at its default position. */ FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates( FT_Face face, @@ -468,14 +522,14 @@ FT_BEGIN_HEADER * * @output: * coords :: - * The design coordinates array. + * The design coordinates array, which must be allocated by the user. * * @return: * FreeType error code. 0~means success. * * @note: * The design coordinates are 16.16 fractional values for TrueType GX and - * OpenType variation fonts. For Adobe MM fonts, the values are whole + * OpenType Font Variations. For Adobe MM fonts, the values are whole * numbers (i.e., the fractional part is zero). * * @since: @@ -493,8 +547,7 @@ FT_BEGIN_HEADER * FT_Set_MM_Blend_Coordinates * * @description: - * Choose an interpolated font design through normalized blend - * coordinates. + * Choose an interpolated font design through normalized coordinates. * * This function works with all supported variation formats. * @@ -509,9 +562,10 @@ FT_BEGIN_HEADER * the number of axes, use default values for the remaining axes. * * coords :: - * The design coordinates array. Each element is a 16.16 fractional - * value and must be between 0 and 1.0 for Adobe MM fonts, and between - * -1.0 and 1.0 for TrueType GX and OpenType variation fonts. + * The normalized coordinates array. Each element is a 16.16 + * fractional value and must be between 0 and 1.0 for Adobe MM fonts, + * and between -1.0 and 1.0 for TrueType GX and OpenType Font + * Variations. * * @return: * FreeType error code. 0~means success. @@ -526,6 +580,12 @@ FT_BEGIN_HEADER * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero, * this bit flag gets unset. + * + * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit + * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION will return + * true) if any of the provided coordinates is different from the face's + * default value for the corresponding axis, that is, the set up face is + * not at its default position. */ FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates( FT_Face face, @@ -539,8 +599,8 @@ FT_BEGIN_HEADER * FT_Get_MM_Blend_Coordinates * * @description: - * Get the normalized blend coordinates of the currently selected - * interpolated font. + * Get the normalized coordinates of the currently selected interpolated + * font. * * This function works with all supported variation formats. * @@ -549,14 +609,14 @@ FT_BEGIN_HEADER * A handle to the source face. * * num_coords :: - * The number of normalized blend coordinates to retrieve. If it is - * larger than the number of axes, set the excess values to~0.5 for - * Adobe MM fonts, and to~0 for TrueType GX and OpenType variation - * fonts. + * The number of normalized coordinates to retrieve. If it is larger + * than the number of axes, set the excess values to~0.5 for Adobe MM + * fonts, and to~0 for TrueType GX and OpenType Font Variations. * * @output: * coords :: - * The normalized blend coordinates array (as 16.16 fractional values). + * The normalized coordinates array (as 16.16 fractional values), which + * must be allocated by the user. * * @return: * FreeType error code. 0~means success. @@ -610,8 +670,8 @@ FT_BEGIN_HEADER * For Adobe MM fonts, choose an interpolated font design by directly * setting the weight vector. * - * This function can't be used with TrueType GX or OpenType variation - * fonts. + * This function can't be used with TrueType GX or OpenType Font + * Variations. * * @inout: * face :: @@ -630,8 +690,8 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * Adobe Multiple Master fonts limit the number of designs, and thus the - * length of the weight vector to 16~elements. + * Adobe MM fonts limit the number of designs, and thus the length of the + * weight vector, to 16~elements. * * If `len` is larger than zero, this function sets the * @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e., @@ -639,7 +699,7 @@ FT_BEGIN_HEADER * is unset and the weight vector array is reset to the default values. * * The Adobe documentation also states that the values in the - * WeightVector array must total 1.0 +/-~0.001. In practice this does + * `WeightVector` array must total 1.0 +/-~0.001. In practice this does * not seem to be enforced, so is not enforced here, either. * * @since: @@ -659,8 +719,8 @@ FT_BEGIN_HEADER * @description: * For Adobe MM fonts, retrieve the current weight vector of the font. * - * This function can't be used with TrueType GX or OpenType variation - * fonts. + * This function can't be used with TrueType GX or OpenType Font + * Variations. * * @inout: * face :: @@ -677,14 +737,14 @@ FT_BEGIN_HEADER * * @output: * weightvector :: - * An array to be filled. + * An array to be filled; it must be allocated by the user. * * @return: * FreeType error code. 0~means success. * * @note: - * Adobe Multiple Master fonts limit the number of designs, and thus the - * length of the WeightVector to~16. + * Adobe MM fonts limit the number of designs, and thus the length of the + * weight vector, to~16 elements. * * @since: * 2.10 @@ -760,8 +820,8 @@ FT_BEGIN_HEADER * A handle to the source face. * * instance_index :: - * The index of the requested instance, starting with value 1. If set - * to value 0, FreeType switches to font access without a named + * The index of the requested instance, starting with value~1. If set + * to value~0, FreeType switches to font access without a named * instance. * * @return: @@ -771,11 +831,11 @@ FT_BEGIN_HEADER * The function uses the value of `instance_index` to set bits 16-30 of * the face's `face_index` field. It also resets any variation applied * to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's - * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION will - * return false). + * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION returns + * false). * - * For Adobe MM fonts (which don't have named instances) this function - * simply resets the current face to the default instance. + * For Adobe MM fonts, this function resets the current face to the + * default instance. * * @since: * 2.9 @@ -794,10 +854,6 @@ FT_BEGIN_HEADER * Retrieve the index of the default named instance, to be used with * @FT_Set_Named_Instance. * - * The default instance of a variation font is that instance for which - * the nth axis coordinate is equal to `axis[n].def` (as specified in the - * @FT_MM_Var structure), with~n covering all axes. - * * FreeType synthesizes a named instance for the default instance if the * font does not contain such an entry. * @@ -813,8 +869,8 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * For Adobe MM fonts (which don't have named instances) this function - * always returns zero for `instance_index`. + * For Adobe MM fonts, this function always returns zero for + * `instance_index`. * * @since: * 2.13.1 diff --git a/vendor/freetype/include/freetype/ftwinfnt.h b/vendor/freetype/include/freetype/ftwinfnt.h index 2591e58866d..ffc064598ac 100644 --- a/vendor/freetype/include/freetype/ftwinfnt.h +++ b/vendor/freetype/include/freetype/ftwinfnt.h @@ -93,8 +93,7 @@ FT_BEGIN_HEADER * second default codepage that most international versions of Windows * have. It is one of the OEM codepages from * - * https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers - * , + * https://learn.microsoft.com/windows/win32/intl/code-page-identifiers , * * and is used for the 'DOS boxes', to support legacy applications. A * German Windows version for example usually uses ANSI codepage 1252 diff --git a/vendor/freetype/include/freetype/internal/compiler-macros.h b/vendor/freetype/include/freetype/internal/compiler-macros.h index 876f66e2561..876a98de22f 100644 --- a/vendor/freetype/include/freetype/internal/compiler-macros.h +++ b/vendor/freetype/include/freetype/internal/compiler-macros.h @@ -128,8 +128,8 @@ FT_BEGIN_HEADER * before a function declaration. */ - /* Visual C, mingw */ -#if defined( _WIN32 ) + /* Visual C, MinGW, Cygwin */ +#if defined( _WIN32 ) || defined( __CYGWIN__ ) #define FT_INTERNAL_FUNCTION_ATTRIBUTE /* empty */ /* gcc, clang */ diff --git a/vendor/freetype/include/freetype/internal/ftcalc.h b/vendor/freetype/include/freetype/internal/ftcalc.h index 71128a2df90..4317ffdf62b 100644 --- a/vendor/freetype/include/freetype/internal/ftcalc.h +++ b/vendor/freetype/include/freetype/internal/ftcalc.h @@ -27,17 +27,93 @@ FT_BEGIN_HEADER + /* + * The following macros have two purposes. + * + * - Tag places where overflow is expected and harmless. + * + * - Avoid run-time undefined behavior sanitizer errors. + * + * Use with care! + */ +#define ADD_INT( a, b ) \ + (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) ) +#define SUB_INT( a, b ) \ + (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) ) +#define MUL_INT( a, b ) \ + (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) ) +#define NEG_INT( a ) \ + (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) ) + +#define ADD_LONG( a, b ) \ + (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) ) +#define SUB_LONG( a, b ) \ + (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) ) +#define MUL_LONG( a, b ) \ + (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) ) +#define NEG_LONG( a ) \ + (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) ) + +#define ADD_INT32( a, b ) \ + (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) ) +#define SUB_INT32( a, b ) \ + (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) ) +#define MUL_INT32( a, b ) \ + (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) ) +#define NEG_INT32( a ) \ + (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) ) + +#ifdef FT_INT64 + +#define ADD_INT64( a, b ) \ + (FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) ) +#define SUB_INT64( a, b ) \ + (FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) ) +#define MUL_INT64( a, b ) \ + (FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) ) +#define NEG_INT64( a ) \ + (FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) ) + +#endif /* FT_INT64 */ + + /************************************************************************** * * FT_MulDiv() and FT_MulFix() are declared in freetype.h. * */ -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ +#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ +#ifdef FT_INT64 + + static inline FT_Long + FT_MulFix_64( FT_Long a, + FT_Long b ) + { + FT_Int64 ab = MUL_INT64( a, b ); + + + ab = ADD_INT64( ab, 0x8000 + ( ab >> 63 ) ); /* rounding phase */ + + return (FT_Long)( ab >> 16 ); + } + + +#ifdef __VMS +# ifdef FT_MulFix +# undef FT_MulFix +# endif +#endif + +#define FT_MulFix( a, b ) FT_MulFix_64( a, b ) + +#elif !defined( FT_CONFIG_OPTION_NO_ASSEMBLER ) + /* Provide 32-bit assembler fragments for optimized FT_MulFix. */ + /* These must be defined `static __inline__' or similar. */ + +#if defined( __arm__ ) && \ + ( defined( __thumb2__ ) || !defined( __thumb__ ) ) #define FT_MULFIX_ASSEMBLER FT_MulFix_arm @@ -49,6 +125,7 @@ FT_BEGIN_HEADER { FT_Int32 t, t2; +#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ __asm { @@ -60,28 +137,8 @@ FT_BEGIN_HEADER mov a, t2, lsr #16 /* a = t2 >> 16 */ orr a, a, t, lsl #16 /* a |= t << 16 */ } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && \ - ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - FT_Int32 t, t2; +#elif defined( __GNUC__ ) __asm__ __volatile__ ( "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ @@ -98,26 +155,25 @@ FT_BEGIN_HEADER : "=r"(a), "=&r"(t2), "=&r"(t) : "r"(a), "r"(b) : "cc" ); - return a; - } -#endif /* __arm__ && */ - /* ( __thumb2__ || !__thumb__ ) && */ - /* !( __CC_ARM || __ARMCC__ ) */ +#endif + return a; + } -#if defined( __i386__ ) +#elif defined( __i386__ ) || defined( _M_IX86 ) #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 /* documentation is in freetype.h */ - static __inline__ FT_Int32 + static __inline FT_Int32 FT_MulFix_i386( FT_Int32 a, FT_Int32 b ) { FT_Int32 result; +#if defined( __GNUC__ ) __asm__ __volatile__ ( "imul %%edx\n" @@ -132,27 +188,8 @@ FT_BEGIN_HEADER : "=a"(result), "=d"(b) : "a"(a), "d"(b) : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - FT_Int32 result; +#elif defined( _MSC_VER) __asm { @@ -169,82 +206,22 @@ FT_BEGIN_HEADER add eax, edx mov result, eax } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - - -#if defined( __GNUC__ ) && defined( __x86_64__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 - - static __inline__ FT_Int32 - FT_MulFix_x86_64( FT_Int32 a, - FT_Int32 b ) - { - /* Temporarily disable the warning that C90 doesn't support */ - /* `long long'. */ -#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlong-long" -#endif - -#if 1 - /* Technically not an assembly fragment, but GCC does a really good */ - /* job at inlining it and generating good machine code for it. */ - long long ret, tmp; - - - ret = (long long)a * b; - tmp = ret >> 63; - ret += 0x8000 + tmp; - - return (FT_Int32)( ret >> 16 ); -#else - - /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ - /* code from the lines below. The main issue is that `wide_a' is not */ - /* properly initialized by sign-extending `a'. Instead, the generated */ - /* machine code assumes that the register that contains `a' on input */ - /* can be used directly as a 64-bit value, which is wrong most of the */ - /* time. */ - long long wide_a = (long long)a; - long long wide_b = (long long)b; - long long result; - - - __asm__ __volatile__ ( - "imul %2, %1\n" - "mov %1, %0\n" - "sar $63, %0\n" - "lea 0x8000(%1, %0), %0\n" - "sar $16, %0\n" - : "=&r"(result), "=&r"(wide_a) - : "r"(wide_b) - : "cc" ); - return (FT_Int32)result; #endif -#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 ) -#pragma GCC diagnostic pop -#endif + return result; } -#endif /* __GNUC__ && __x86_64__ */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ +#endif /* __i386__ || _M_IX86 */ - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX #ifdef FT_MULFIX_ASSEMBLER #define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) ) -#endif #endif +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ + +#endif /* FT_CONFIG_OPTION_INLINE_MULFIX */ + /************************************************************************** * @@ -278,40 +255,6 @@ FT_BEGIN_HEADER FT_Long c ); - /************************************************************************** - * - * @function: - * FT_MulAddFix - * - * @description: - * Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is - * usually a 16.16 scalar. - * - * @input: - * s :: - * The array of scalars. - * f :: - * The array of factors. - * count :: - * The number of entries in the array. - * - * @return: - * The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`. - * - * @note: - * This function is currently used for the scaled delta computation of - * variation stores. It internally uses 64-bit data types when - * available, otherwise it emulates 64-bit math by using 32-bit - * operations, which produce a correct result but most likely at a slower - * performance in comparison to the implementation base on `int64_t`. - * - */ - FT_BASE( FT_Int32 ) - FT_MulAddFix( FT_Fixed* s, - FT_Int32* f, - FT_UInt count ); - - /* * A variant of FT_Matrix_Multiply which scales its result afterwards. The * idea is that both `a' and `b' are scaled by factors of 10 so that the @@ -455,6 +398,10 @@ FT_BEGIN_HEADER #define FT_MSB( x ) FT_MSB_i386( x ) +#elif defined( __CC_ARM ) + +#define FT_MSB( x ) ( 31 - __clz( x ) ) + #elif defined( __SunOS_5_11 ) #include @@ -526,55 +473,6 @@ FT_BEGIN_HEADER #define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 ) - /* - * The following macros have two purposes. - * - * - Tag places where overflow is expected and harmless. - * - * - Avoid run-time sanitizer errors. - * - * Use with care! - */ -#define ADD_INT( a, b ) \ - (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) ) -#define SUB_INT( a, b ) \ - (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) ) -#define MUL_INT( a, b ) \ - (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) ) -#define NEG_INT( a ) \ - (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) ) - -#define ADD_LONG( a, b ) \ - (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) ) -#define SUB_LONG( a, b ) \ - (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) ) -#define MUL_LONG( a, b ) \ - (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) ) -#define NEG_LONG( a ) \ - (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) ) - -#define ADD_INT32( a, b ) \ - (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) ) -#define SUB_INT32( a, b ) \ - (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) ) -#define MUL_INT32( a, b ) \ - (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) ) -#define NEG_INT32( a ) \ - (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) ) - -#ifdef FT_INT64 - -#define ADD_INT64( a, b ) \ - (FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) ) -#define SUB_INT64( a, b ) \ - (FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) ) -#define MUL_INT64( a, b ) \ - (FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) ) -#define NEG_INT64( a ) \ - (FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) ) - -#endif /* FT_INT64 */ - FT_END_HEADER diff --git a/vendor/freetype/include/freetype/internal/fthash.h b/vendor/freetype/include/freetype/internal/fthash.h index 622ec76bb9a..642d21e21c6 100644 --- a/vendor/freetype/include/freetype/internal/fthash.h +++ b/vendor/freetype/include/freetype/internal/fthash.h @@ -117,6 +117,18 @@ FT_BEGIN_HEADER FT_Hash hash, FT_Memory memory ); + FT_Error + ft_hash_str_insert_no_overwrite( const char* key, + size_t data, + FT_Hash hash, + FT_Memory memory ); + + FT_Error + ft_hash_num_insert_no_overwrite( FT_Int num, + size_t data, + FT_Hash hash, + FT_Memory memory ); + size_t* ft_hash_str_lookup( const char* key, FT_Hash hash ); @@ -125,6 +137,17 @@ FT_BEGIN_HEADER ft_hash_num_lookup( FT_Int num, FT_Hash hash ); + FT_Bool + ft_hash_num_iterator( FT_UInt *idx, + FT_Int *key, + size_t *value, + FT_Hash hash ); + + FT_Bool + ft_hash_str_iterator( FT_UInt *idx, + const char* *key, + size_t *value, + FT_Hash hash ); FT_END_HEADER diff --git a/vendor/freetype/include/freetype/internal/ftobjs.h b/vendor/freetype/include/freetype/internal/ftobjs.h index a1e93298fdb..136aa81060b 100644 --- a/vendor/freetype/include/freetype/internal/ftobjs.h +++ b/vendor/freetype/include/freetype/internal/ftobjs.h @@ -275,6 +275,28 @@ FT_BEGIN_HEADER FT_GlyphSlot slot, FT_Render_Mode mode ); + + /************************************************************************** + * + * @Function: + * find_unicode_charmap + * + * @Description: + * This function finds a Unicode charmap, if there is one. And if there + * is more than one, it tries to favour the more extensive one, i.e., one + * that supports UCS-4 against those which are limited to the BMP (UCS-2 + * encoding.) + * + * If a unicode charmap is found, `face->charmap` is set to it. + * + * This function is called from `open_face`, from `FT_Select_Charmap(..., + * FT_ENCODING_UNICODE)`, and also from `afadjust.c` in the 'autofit' + * module. + */ + FT_BASE( FT_Error ) + find_unicode_charmap( FT_Face face ); + + #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap, diff --git a/vendor/freetype/include/freetype/internal/fttrace.h b/vendor/freetype/include/freetype/internal/fttrace.h index f1ed813432a..bf0b60796a2 100644 --- a/vendor/freetype/include/freetype/internal/fttrace.h +++ b/vendor/freetype/include/freetype/internal/fttrace.h @@ -159,6 +159,7 @@ FT_TRACE_DEF( gxvprop ) FT_TRACE_DEF( gxvtrak ) /* autofit components */ +FT_TRACE_DEF( afadjust ) FT_TRACE_DEF( afcjk ) FT_TRACE_DEF( afglobal ) FT_TRACE_DEF( afhints ) diff --git a/vendor/freetype/include/freetype/internal/services/svmetric.h b/vendor/freetype/include/freetype/internal/services/svmetric.h index 8b3563b25ca..5a0dc4d5cce 100644 --- a/vendor/freetype/include/freetype/internal/services/svmetric.h +++ b/vendor/freetype/include/freetype/internal/services/svmetric.h @@ -77,7 +77,7 @@ FT_BEGIN_HEADER typedef void (*FT_Metrics_Adjust_Func)( FT_Face face ); - typedef FT_Error + typedef void (*FT_Size_Reset_Func)( FT_Size size ); diff --git a/vendor/freetype/include/freetype/internal/tttypes.h b/vendor/freetype/include/freetype/internal/tttypes.h index 7053e656a7e..dba8eadde29 100644 --- a/vendor/freetype/include/freetype/internal/tttypes.h +++ b/vendor/freetype/include/freetype/internal/tttypes.h @@ -1276,10 +1276,6 @@ FT_BEGIN_HEADER * * If varied by the `CVAR' table, non-integer values are possible. * - * interpreter :: - * A pointer to the TrueType bytecode interpreters field is also used - * to hook the debugger in 'ttdebug'. - * * extra :: * Reserved for third-party font drivers. * @@ -1521,10 +1517,6 @@ FT_BEGIN_HEADER FT_ULong cvt_size; FT_Int32* cvt; - /* A pointer to the bytecode interpreter to use. This is also */ - /* used to hook the debugger for the `ttdebug' utility. */ - TT_Interpreter interpreter; - /************************************************************************ * @@ -1582,11 +1574,6 @@ FT_BEGIN_HEADER FT_UInt32 kern_avail_bits; FT_UInt32 kern_order_bits; -#ifdef TT_CONFIG_OPTION_GPOS_KERNING - FT_Byte* gpos_table; - FT_Bool gpos_kerning_available; -#endif - #ifdef TT_CONFIG_OPTION_BDF TT_BDFRec bdf; #endif /* TT_CONFIG_OPTION_BDF */ @@ -1608,6 +1595,15 @@ FT_BEGIN_HEADER /* since 2.12 */ void* svg; +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + /* since 2.13.3 */ + FT_Byte* gpos_table; + /* since 2.14 */ + /* This is actually an array of GPOS lookup subtables. */ + FT_UInt32* gpos_lookups_kerning; + FT_UInt num_gpos_lookups_kerning; +#endif + } TT_FaceRec; @@ -1621,15 +1617,6 @@ FT_BEGIN_HEADER * coordinates. * * @fields: - * memory :: - * A handle to the memory manager. - * - * max_points :: - * The maximum size in points of the zone. - * - * max_contours :: - * Max size in links contours of the zone. - * * n_points :: * The current number of points in the zone. * @@ -1653,9 +1640,6 @@ FT_BEGIN_HEADER */ typedef struct TT_GlyphZoneRec_ { - FT_Memory memory; - FT_UShort max_points; - FT_UShort max_contours; FT_UShort n_points; /* number of points in zone */ FT_UShort n_contours; /* number of contours */ @@ -1714,7 +1698,6 @@ FT_BEGIN_HEADER TT_GlyphZoneRec zone; TT_ExecContext exec; - FT_Byte* instructions; FT_ULong ins_pos; /* for possible extensibility in other formats */ diff --git a/vendor/freetype/include/freetype/ttnameid.h b/vendor/freetype/include/freetype/ttnameid.h index d5d470e380f..0beeca25dea 100644 --- a/vendor/freetype/include/freetype/ttnameid.h +++ b/vendor/freetype/include/freetype/ttnameid.h @@ -436,7 +436,7 @@ FT_BEGIN_HEADER * * The canonical source for Microsoft's IDs is * - * https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , + * https://learn.microsoft.com/windows/win32/intl/language-identifier-constants-and-strings , * * however, we only provide macros for language identifiers present in * the OpenType specification: Microsoft has abandoned the concept of @@ -847,113 +847,113 @@ FT_BEGIN_HEADER /* --------------- */ /* Bit 0 Basic Latin */ -#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ +#define TT_UCR_BASIC_LATIN (1UL << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ -#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ +#define TT_UCR_LATIN1_SUPPLEMENT (1UL << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ -#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ +#define TT_UCR_LATIN_EXTENDED_A (1UL << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ -#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ +#define TT_UCR_LATIN_EXTENDED_B (1UL << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ -#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ +#define TT_UCR_IPA_EXTENSIONS (1UL << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ -#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ +#define TT_UCR_SPACING_MODIFIER (1UL << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ -#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ +#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1UL << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ -#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ +#define TT_UCR_GREEK (1UL << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ -#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ +#define TT_UCR_COPTIC (1UL << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ -#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ +#define TT_UCR_CYRILLIC (1UL << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ -#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ +#define TT_UCR_ARMENIAN (1UL << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ -#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ +#define TT_UCR_HEBREW (1UL << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ -#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ +#define TT_UCR_VAI (1UL << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ -#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ +#define TT_UCR_ARABIC (1UL << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ -#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ +#define TT_UCR_NKO (1UL << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ -#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ - /* Bit 16 Bengali */ -#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ +#define TT_UCR_DEVANAGARI (1UL << 15) /* U+0900-U+097F */ + /* Bit 16 Bangla (Bengali) */ +#define TT_UCR_BENGALI (1UL << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ -#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ +#define TT_UCR_GURMUKHI (1UL << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ -#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ - /* Bit 19 Oriya */ -#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ +#define TT_UCR_GUJARATI (1UL << 18) /* U+0A80-U+0AFF */ + /* Bit 19 Oriya (Odia) */ +#define TT_UCR_ORIYA (1UL << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ -#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ +#define TT_UCR_TAMIL (1UL << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ -#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ +#define TT_UCR_TELUGU (1UL << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ -#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ +#define TT_UCR_KANNADA (1UL << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ -#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ +#define TT_UCR_MALAYALAM (1UL << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ -#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ +#define TT_UCR_THAI (1UL << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ -#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ +#define TT_UCR_LAO (1UL << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ -#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ +#define TT_UCR_GEORGIAN (1UL << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ -#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ +#define TT_UCR_BALINESE (1UL << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ -#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ +#define TT_UCR_HANGUL_JAMO (1UL << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ -#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ +#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1UL << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ -#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ +#define TT_UCR_GREEK_EXTENDED (1UL << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ -#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ +#define TT_UCR_GENERAL_PUNCTUATION (1UL << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ -#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ +#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1UL << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ -#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ +#define TT_UCR_CURRENCY_SYMBOLS (1UL << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ #define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ - (1L << 2) /* U+20D0-U+20FF */ + (1UL << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ -#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ +#define TT_UCR_LETTERLIKE_SYMBOLS (1UL << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ -#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ +#define TT_UCR_NUMBER_FORMS (1UL << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ -#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ +#define TT_UCR_ARROWS (1UL << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ @@ -961,52 +961,52 @@ FT_BEGIN_HEADER /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ -#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ +#define TT_UCR_MATHEMATICAL_OPERATORS (1UL << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ -#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ +#define TT_UCR_MISCELLANEOUS_TECHNICAL (1UL << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ -#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ +#define TT_UCR_CONTROL_PICTURES (1UL << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ -#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ +#define TT_UCR_OCR (1UL << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ -#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ +#define TT_UCR_ENCLOSED_ALPHANUMERICS (1UL << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ -#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ +#define TT_UCR_BOX_DRAWING (1UL << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ -#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ +#define TT_UCR_BLOCK_ELEMENTS (1UL << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ -#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ +#define TT_UCR_GEOMETRIC_SHAPES (1UL << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ -#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ +#define TT_UCR_MISCELLANEOUS_SYMBOLS (1UL << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ -#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ +#define TT_UCR_DINGBATS (1UL << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ -#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ +#define TT_UCR_CJK_SYMBOLS (1UL << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ -#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ +#define TT_UCR_HIRAGANA (1UL << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ -#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ +#define TT_UCR_KATAKANA (1UL << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ -#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ +#define TT_UCR_BOPOMOFO (1UL << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ -#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ +#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1UL << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ -#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ -#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ -#define TT_UCR_PHAGSPA +#define TT_UCR_PHAGSPA (1UL << 21) /* U+A840-U+A87F */ +#define TT_UCR_KANBUN TT_UCR_PHAGSPA /* deprecated */ +#define TT_UCR_CJK_MISC TT_UCR_PHAGSPA /* deprecated */ /* Bit 54 Enclosed CJK Letters and Months */ -#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ +#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1UL << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ -#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ +#define TT_UCR_CJK_COMPATIBILITY (1UL << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ -#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ +#define TT_UCR_HANGUL (1UL << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ @@ -1017,12 +1017,12 @@ FT_BEGIN_HEADER /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ -#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ +#define TT_UCR_SURROGATES (1UL << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ #define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ -#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ +#define TT_UCR_PHOENICIAN (1UL << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ @@ -1030,7 +1030,7 @@ FT_BEGIN_HEADER /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ -#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ +#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1UL << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ @@ -1038,178 +1038,178 @@ FT_BEGIN_HEADER /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ -#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ +#define TT_UCR_PRIVATE_USE (1UL << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ -#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ +#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1UL << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ -#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ +#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1UL << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ -#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ +#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1UL << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ -#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ +#define TT_UCR_COMBINING_HALF_MARKS (1UL << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ -#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ +#define TT_UCR_CJK_COMPATIBILITY_FORMS (1UL << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ -#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ +#define TT_UCR_SMALL_FORM_VARIANTS (1UL << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ -#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ +#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1UL << 3) /* U+FE70-U+FEFF */ /* Bit 68 Halfwidth and Fullwidth Forms */ -#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ +#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1UL << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ -#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ +#define TT_UCR_SPECIALS (1UL << 5) /* U+FFF0-U+FFFF */ /* Bit 70 Tibetan */ -#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ +#define TT_UCR_TIBETAN (1UL << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ -#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ +#define TT_UCR_SYRIAC (1UL << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ -#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ +#define TT_UCR_THAANA (1UL << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ -#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ +#define TT_UCR_SINHALA (1UL << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ -#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ +#define TT_UCR_MYANMAR (1UL << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ -#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ +#define TT_UCR_ETHIOPIC (1UL << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ -#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ +#define TT_UCR_CHEROKEE (1UL << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ -#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ +#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1UL << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ -#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ +#define TT_UCR_OGHAM (1UL << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ -#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ +#define TT_UCR_RUNIC (1UL << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ -#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ +#define TT_UCR_KHMER (1UL << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ -#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ +#define TT_UCR_MONGOLIAN (1UL << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ -#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ +#define TT_UCR_BRAILLE (1UL << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ -#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ +#define TT_UCR_YI (1UL << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ -#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ +#define TT_UCR_PHILIPPINE (1UL << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ -#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ +#define TT_UCR_OLD_ITALIC (1UL << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ -#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ +#define TT_UCR_GOTHIC (1UL << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ -#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ +#define TT_UCR_DESERET (1UL << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ -#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ +#define TT_UCR_MUSICAL_SYMBOLS (1UL << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ -#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ +#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1UL << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ -#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ +#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1UL << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ -#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ +#define TT_UCR_VARIATION_SELECTORS (1UL << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ -#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ +#define TT_UCR_TAGS (1UL << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ -#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ +#define TT_UCR_LIMBU (1UL << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ -#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ +#define TT_UCR_TAI_LE (1UL << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ -#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ +#define TT_UCR_NEW_TAI_LUE (1UL << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ -#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ +#define TT_UCR_BUGINESE (1UL << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ -#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ +#define TT_UCR_GLAGOLITIC (1UL << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ -#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ +#define TT_UCR_TIFINAGH (1UL << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ -#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ +#define TT_UCR_YIJING (1UL << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ -#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ +#define TT_UCR_SYLOTI_NAGRI (1UL << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ -#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ +#define TT_UCR_LINEAR_B (1UL << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ -#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ +#define TT_UCR_ANCIENT_GREEK_NUMBERS (1UL << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ -#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ +#define TT_UCR_UGARITIC (1UL << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ -#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ +#define TT_UCR_OLD_PERSIAN (1UL << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ -#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ +#define TT_UCR_SHAVIAN (1UL << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ -#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ +#define TT_UCR_OSMANYA (1UL << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ -#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ +#define TT_UCR_CYPRIOT_SYLLABARY (1UL << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ -#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ +#define TT_UCR_KHAROSHTHI (1UL << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ -#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ +#define TT_UCR_TAI_XUAN_JING (1UL << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ -#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ +#define TT_UCR_CUNEIFORM (1UL << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ -#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ +#define TT_UCR_COUNTING_ROD_NUMERALS (1UL << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ -#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ +#define TT_UCR_SUNDANESE (1UL << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ -#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ +#define TT_UCR_LEPCHA (1UL << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ -#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ +#define TT_UCR_OL_CHIKI (1UL << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ -#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ +#define TT_UCR_SAURASHTRA (1UL << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ -#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ +#define TT_UCR_KAYAH_LI (1UL << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ -#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ +#define TT_UCR_REJANG (1UL << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ -#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ +#define TT_UCR_CHAM (1UL << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ -#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ +#define TT_UCR_ANCIENT_SYMBOLS (1UL << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ -#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ +#define TT_UCR_PHAISTOS_DISC (1UL << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ -#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ +#define TT_UCR_OLD_ANATOLIAN (1UL << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ -#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ +#define TT_UCR_GAME_TILES (1UL << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ diff --git a/vendor/freetype/include/freetype/tttables.h b/vendor/freetype/include/freetype/tttables.h index 2cf0ff1bc61..08daa7813a2 100644 --- a/vendor/freetype/include/freetype/tttables.h +++ b/vendor/freetype/include/freetype/tttables.h @@ -192,7 +192,7 @@ FT_BEGIN_HEADER * A pointer into the 'hmtx' table. * * @note: - * For an OpenType variation font, the values of the following fields can + * For OpenType Font Variations, the values of the following fields can * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if * the font contains an 'MVAR' table: `caret_Slope_Rise`, * `caret_Slope_Run`, and `caret_Offset`. @@ -310,7 +310,7 @@ FT_BEGIN_HEADER * A pointer into the 'vmtx' table. * * @note: - * For an OpenType variation font, the values of the following fields can + * For OpenType Font Variations, the values of the following fields can * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if * the font contains an 'MVAR' table: `Ascender`, `Descender`, * `Line_Gap`, `caret_Slope_Rise`, `caret_Slope_Run`, and `caret_Offset`. @@ -359,7 +359,7 @@ FT_BEGIN_HEADER * table. In this case, the `version` field is always set to 0xFFFF. * * @note: - * For an OpenType variation font, the values of the following fields can + * For OpenType Font Variations, the values of the following fields can * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if * the font contains an 'MVAR' table: `sCapHeight`, `sTypoAscender`, * `sTypoDescender`, `sTypoLineGap`, `sxHeight`, `usWinAscent`, @@ -442,7 +442,7 @@ FT_BEGIN_HEADER * them. * * @note: - * For an OpenType variation font, the values of the following fields can + * For OpenType Font Variations, the values of the following fields can * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if * the font contains an 'MVAR' table: `underlinePosition` and * `underlineThickness`. @@ -705,6 +705,9 @@ FT_BEGIN_HEADER * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new * one with @FT_MAKE_TAG. * + * [Since 2.14] Use value~1 if you want to access the table directory + * of the (currently selected) font. + * * offset :: * The starting offset in the table (or file if tag~==~0). * diff --git a/vendor/freetype/src/autofit/afadjust.c b/vendor/freetype/src/autofit/afadjust.c new file mode 100644 index 00000000000..3d6f8484a3b --- /dev/null +++ b/vendor/freetype/src/autofit/afadjust.c @@ -0,0 +1,1611 @@ +/**************************************************************************** + * + * afadjust.c + * + * Auto-fitter routines to adjust components based on charcode (body). + * + * Copyright (C) 2023-2024 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * Written by Craig White . + * + * 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 "afadjust.h" +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ +# include "afgsub.h" +#endif + +#include +#include +#include +#include + +#define AF_ADJUSTMENT_DATABASE_LENGTH \ + ( sizeof ( adjustment_database ) / \ + sizeof ( adjustment_database[0] ) ) + +#undef FT_COMPONENT +#define FT_COMPONENT afadjust + + + typedef struct AF_AdjustmentDatabaseEntry_ + { + FT_UInt32 codepoint; + FT_UInt32 flags; + + } AF_AdjustmentDatabaseEntry; + + + /* + All entries in this list must be sorted by ascending Unicode code + points. The table entries are 3 numbers consisting of: + + - Unicode code point. + - The vertical adjustment type. This should be a combination of the + AF_ADJUST_XXX and AF_IGNORE_XXX macros. + */ + static AF_AdjustmentDatabaseEntry adjustment_database[] = + { + /* C0 Controls and Basic Latin */ + { 0x21, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ! */ + { 0x51, AF_IGNORE_CAPITAL_BOTTOM } , /* Q */ + { 0x3F, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ? */ + { 0x69, AF_ADJUST_UP }, /* i */ + { 0x6A, AF_ADJUST_UP }, /* j */ +#if 0 + /* XXX TODO */ + { 0x7E, AF_ADJUST_TILDE_TOP }, /* ~ */ +#endif + + /* C1 Controls and Latin-1 Supplement */ + { 0xA1, AF_ADJUST_UP }, /* ¡ */ + { 0xA6, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ¦ */ + { 0xAA, AF_ADJUST_UP }, /* ª */ + { 0xBA, AF_ADJUST_UP }, /* º */ + { 0xBF, AF_ADJUST_UP }, /* ¿ */ + + { 0xC0, AF_ADJUST_UP }, /* À */ + { 0xC1, AF_ADJUST_UP }, /* à */ + { 0xC2, AF_ADJUST_UP }, /*  */ + { 0xC3, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* à */ + { 0xC4, AF_ADJUST_UP }, /* Ä */ + { 0xC5, AF_ADJUST_UP }, /* Ã… */ + { 0xC7, AF_IGNORE_CAPITAL_BOTTOM }, /* Ç */ + { 0xC8, AF_ADJUST_UP }, /* È */ + { 0xC9, AF_ADJUST_UP }, /* É */ + { 0xCA, AF_ADJUST_UP }, /* Ê */ + { 0xCB, AF_ADJUST_UP }, /* Ë */ + { 0xCC, AF_ADJUST_UP }, /* ÃŒ */ + { 0xCD, AF_ADJUST_UP }, /* à */ + { 0xCE, AF_ADJUST_UP }, /* ÃŽ */ + { 0xCF, AF_ADJUST_UP }, /* à */ + + { 0xD1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ñ */ + { 0xD2, AF_ADJUST_UP }, /* Ã’ */ + { 0xD3, AF_ADJUST_UP }, /* Ó */ + { 0xD4, AF_ADJUST_UP }, /* Ô */ + { 0xD5, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Õ */ + { 0xD6, AF_ADJUST_UP }, /* Ö */ + { 0xD8, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ø */ + { 0xD9, AF_ADJUST_UP }, /* Ù */ + { 0xDA, AF_ADJUST_UP }, /* Ú */ + { 0xDB, AF_ADJUST_UP }, /* Û */ + { 0xDC, AF_ADJUST_UP }, /* Ü */ + { 0xDD, AF_ADJUST_UP }, /* à */ + + { 0xE0, AF_ADJUST_UP }, /* à */ + { 0xE1, AF_ADJUST_UP }, /* á */ + { 0xE2, AF_ADJUST_UP }, /* â */ + { 0xE3, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ã */ + { 0xE4, AF_ADJUST_UP }, /* ä */ + { 0xE5, AF_ADJUST_UP }, /* Ã¥ */ + { 0xE7, AF_IGNORE_SMALL_BOTTOM }, /* ç */ + { 0xE8, AF_ADJUST_UP }, /* è */ + { 0xE9, AF_ADJUST_UP }, /* é */ + { 0xEA, AF_ADJUST_UP }, /* ê */ + { 0xEB, AF_ADJUST_UP }, /* ë */ + { 0xEC, AF_ADJUST_UP }, /* ì */ + { 0xED, AF_ADJUST_UP }, /* í */ + { 0xEE, AF_ADJUST_UP }, /* î */ + { 0xEF, AF_ADJUST_UP }, /* ï */ + + { 0xF1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ñ */ + { 0xF2, AF_ADJUST_UP }, /* ò */ + { 0xF3, AF_ADJUST_UP }, /* ó */ + { 0xF4, AF_ADJUST_UP }, /* ô */ + { 0xF5, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* õ */ + { 0xF6, AF_ADJUST_UP }, /* ö */ + { 0xF8, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* ø */ + { 0xF9, AF_ADJUST_UP }, /* ù */ + { 0xFA, AF_ADJUST_UP }, /* ú */ + { 0xFB, AF_ADJUST_UP }, /* û */ + { 0xFC, AF_ADJUST_UP }, /* ü */ + { 0xFD, AF_ADJUST_UP }, /* ý */ + { 0xFF, AF_ADJUST_UP }, /* ÿ */ + + /* Latin Extended-A */ + { 0x100, AF_ADJUST_UP }, /* Ä€ */ + { 0x101, AF_ADJUST_UP }, /* Ä */ + { 0x102, AF_ADJUST_UP }, /* Ä‚ */ + { 0x103, AF_ADJUST_UP }, /* ă */ + { 0x104, AF_IGNORE_CAPITAL_BOTTOM }, /* Ä„ */ + { 0x105, AF_IGNORE_SMALL_BOTTOM }, /* Ä… */ + { 0x106, AF_ADJUST_UP }, /* Ć */ + { 0x107, AF_ADJUST_UP }, /* ć */ + { 0x108, AF_ADJUST_UP }, /* Ĉ */ + { 0x109, AF_ADJUST_UP }, /* ĉ */ + { 0x10A, AF_ADJUST_UP }, /* ÄŠ */ + { 0x10B, AF_ADJUST_UP }, /* Ä‹ */ + { 0x10C, AF_ADJUST_UP }, /* ÄŒ */ + { 0x10D, AF_ADJUST_UP }, /* Ä */ + { 0x10E, AF_ADJUST_UP }, /* ÄŽ */ + + { 0x112, AF_ADJUST_UP }, /* Ä’ */ + { 0x113, AF_ADJUST_UP }, /* Ä“ */ + { 0x114, AF_ADJUST_UP }, /* Ä” */ + { 0x115, AF_ADJUST_UP }, /* Ä• */ + { 0x116, AF_ADJUST_UP }, /* Ä– */ + { 0x117, AF_ADJUST_UP }, /* Ä— */ + { 0x118, AF_IGNORE_CAPITAL_BOTTOM }, /* Ę */ + { 0x119, AF_IGNORE_SMALL_BOTTOM }, /* Ä™ */ + { 0x11A, AF_ADJUST_UP }, /* Äš */ + { 0x11B, AF_ADJUST_UP }, /* Ä› */ + { 0x11C, AF_ADJUST_UP }, /* Äœ */ + { 0x11D, AF_ADJUST_UP }, /* Ä */ + { 0x11E, AF_ADJUST_UP }, /* Äž */ + { 0x11F, AF_ADJUST_UP }, /* ÄŸ */ + + { 0x120, AF_ADJUST_UP }, /* Ä  */ + { 0x121, AF_ADJUST_UP }, /* Ä¡ */ + { 0x122, AF_ADJUST_DOWN }, /* Ä¢ */ + { 0x123, AF_ADJUST_UP }, /* Ä£ */ + { 0x124, AF_ADJUST_UP }, /* Ĥ */ + { 0x125, AF_ADJUST_UP }, /* Ä¥ */ + { 0x128, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ĩ */ + { 0x129, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ä© */ + { 0x12A, AF_ADJUST_UP }, /* Ī */ + { 0x12B, AF_ADJUST_UP }, /* Ä« */ + { 0x12C, AF_ADJUST_UP }, /* Ĭ */ + { 0x12D, AF_ADJUST_UP }, /* Ä­ */ + { 0x12E, AF_IGNORE_CAPITAL_BOTTOM }, /* Ä® */ + { 0x12F, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* į */ + + { 0x130, AF_ADJUST_UP }, /* İ */ + { 0x133, AF_ADJUST_UP }, /* ij */ + { 0x134, AF_ADJUST_UP }, /* Ä´ */ + { 0x135, AF_ADJUST_UP }, /* ĵ */ + { 0x136, AF_ADJUST_DOWN }, /* Ķ */ + { 0x137, AF_ADJUST_DOWN }, /* Ä· */ + { 0x139, AF_ADJUST_UP }, /* Ĺ */ + { 0x13A, AF_ADJUST_UP }, /* ĺ */ + { 0x13B, AF_ADJUST_DOWN }, /* Ä» */ + { 0x13C, AF_ADJUST_DOWN }, /* ļ */ + + { 0x143, AF_ADJUST_UP }, /* Ń */ + { 0x144, AF_ADJUST_UP }, /* Å„ */ + { 0x145, AF_ADJUST_DOWN }, /* Å… */ + { 0x146, AF_ADJUST_DOWN }, /* ņ */ + { 0x147, AF_ADJUST_UP }, /* Ň */ + { 0x148, AF_ADJUST_UP }, /* ň */ + { 0x14C, AF_ADJUST_UP }, /* ÅŒ */ + { 0x14D, AF_ADJUST_UP }, /* Å */ + { 0x14E, AF_ADJUST_UP }, /* ÅŽ */ + { 0x14F, AF_ADJUST_UP }, /* Å */ + + { 0x150, AF_ADJUST_UP }, /* Å */ + { 0x151, AF_ADJUST_UP }, /* Å‘ */ + { 0x154, AF_ADJUST_UP }, /* Å” */ + { 0x155, AF_ADJUST_UP }, /* Å• */ + { 0x156, AF_ADJUST_DOWN }, /* Å– */ + { 0x157, AF_ADJUST_DOWN }, /* Å— */ + { 0x158, AF_ADJUST_UP }, /* Ř */ + { 0x159, AF_ADJUST_UP }, /* Å™ */ + { 0x15A, AF_ADJUST_UP }, /* Åš */ + { 0x15B, AF_ADJUST_UP }, /* Å› */ + { 0x15C, AF_ADJUST_UP }, /* Åœ */ + { 0x15D, AF_ADJUST_UP }, /* Å */ + { 0x15E, AF_IGNORE_CAPITAL_BOTTOM }, /* Åž */ + { 0x15F, AF_IGNORE_SMALL_BOTTOM }, /* ÅŸ */ + + { 0x160, AF_ADJUST_UP }, /* Å  */ + { 0x161, AF_ADJUST_UP }, /* Å¡ */ + { 0x162, AF_IGNORE_CAPITAL_BOTTOM }, /* Å¢ */ + { 0x163, AF_IGNORE_SMALL_BOTTOM }, /* Å£ */ + { 0x164, AF_ADJUST_UP }, /* Ť */ + { 0x168, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ũ */ + { 0x169, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Å© */ + { 0x16A, AF_ADJUST_UP }, /* Ū */ + { 0x16B, AF_ADJUST_UP }, /* Å« */ + { 0x16C, AF_ADJUST_UP }, /* Ŭ */ + { 0x16D, AF_ADJUST_UP }, /* Å­ */ + { 0x16E, AF_ADJUST_UP }, /* Å® */ + { 0x16F, AF_ADJUST_UP }, /* ů */ + + { 0x170, AF_ADJUST_UP }, /* Ű */ + { 0x171, AF_ADJUST_UP }, /* ű */ + { 0x172, AF_IGNORE_CAPITAL_BOTTOM }, /* Ų */ + { 0x173, AF_IGNORE_SMALL_BOTTOM }, /* ų */ + { 0x174, AF_ADJUST_UP }, /* Å´ */ + { 0x175, AF_ADJUST_UP }, /* ŵ */ + { 0x176, AF_ADJUST_UP }, /* Ŷ */ + { 0x177, AF_ADJUST_UP }, /* Å· */ + { 0x178, AF_ADJUST_UP }, /* Ÿ */ + { 0x179, AF_ADJUST_UP }, /* Ź */ + { 0x17A, AF_ADJUST_UP }, /* ź */ + { 0x17B, AF_ADJUST_UP }, /* Å» */ + { 0x17C, AF_ADJUST_UP }, /* ż */ + { 0x17D, AF_ADJUST_UP }, /* Ž */ + { 0x17E, AF_ADJUST_UP }, /* ž */ + + /* Latin Extended-B */ + { 0x187, AF_IGNORE_CAPITAL_TOP }, /* Ƈ */ + { 0x188, AF_IGNORE_SMALL_TOP }, /* ƈ */ + + { 0x1A0, AF_IGNORE_CAPITAL_TOP }, /* Æ  */ + { 0x1A1, AF_IGNORE_SMALL_TOP }, /* Æ¡ */ + { 0x1A5, AF_IGNORE_SMALL_TOP }, /* Æ¥ */ + { 0x1AB, AF_IGNORE_SMALL_BOTTOM }, /* Æ« */ + { 0x1AE, AF_IGNORE_CAPITAL_BOTTOM }, /* Æ® */ + { 0x1AF, AF_IGNORE_CAPITAL_TOP }, /* Ư */ + + { 0x1B0, AF_IGNORE_SMALL_TOP }, /* ư */ + { 0x1B4, AF_IGNORE_SMALL_TOP }, /* Æ´ */ + + { 0x1C3, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ǃ */ + { 0x1C4, AF_ADJUST_UP }, /* Ç„ */ +#if 0 + { 0x1C5, AF_ADJUST_UP }, /* Ç… */ + { 0x1C6, AF_ADJUST_UP }, /* dž */ + { 0x1C8, AF_ADJUST_UP }, /* Lj */ + { 0x1C9, AF_ADJUST_UP }, /* lj */ + { 0x1CB, AF_ADJUST_UP }, /* Ç‹ */ +#endif + { 0x1CC, AF_ADJUST_UP }, /* ÇŒ */ + { 0x1CD, AF_ADJUST_UP }, /* Ç */ + { 0x1CE, AF_ADJUST_UP }, /* ÇŽ */ + { 0x1CF, AF_ADJUST_UP }, /* Ç */ + + { 0x1D0, AF_ADJUST_UP }, /* Ç */ + { 0x1D1, AF_ADJUST_UP }, /* Ç‘ */ + { 0x1D2, AF_ADJUST_UP }, /* Ç’ */ + { 0x1D3, AF_ADJUST_UP }, /* Ç“ */ + { 0x1D4, AF_ADJUST_UP }, /* Ç” */ + { 0x1D5, AF_ADJUST_UP2 }, /* Ç• */ + { 0x1D6, AF_ADJUST_UP2 }, /* Ç– */ + { 0x1D7, AF_ADJUST_UP2 }, /* Ç— */ + { 0x1D8, AF_ADJUST_UP2 }, /* ǘ */ + { 0x1D9, AF_ADJUST_UP2 }, /* Ç™ */ + { 0x1DA, AF_ADJUST_UP2 }, /* Çš */ + { 0x1DB, AF_ADJUST_UP2 }, /* Ç› */ + { 0x1DC, AF_ADJUST_UP2 }, /* Çœ */ + { 0x1DE, AF_ADJUST_UP2 }, /* Çž */ + { 0x1DF, AF_ADJUST_UP2 }, /* ÇŸ */ + + { 0x1E0, AF_ADJUST_UP2 }, /* Ç  */ + { 0x1E1, AF_ADJUST_UP2 }, /* Ç¡ */ + { 0x1E2, AF_ADJUST_UP }, /* Ç¢ */ + { 0x1E3, AF_ADJUST_UP }, /* Ç£ */ + { 0x1E6, AF_ADJUST_UP }, /* Ǧ */ + { 0x1E7, AF_ADJUST_UP }, /* ǧ */ + { 0x1E8, AF_ADJUST_UP }, /* Ǩ */ + { 0x1E9, AF_ADJUST_UP }, /* Ç© */ + { 0x1EA, AF_IGNORE_CAPITAL_BOTTOM }, /* Ǫ */ + { 0x1EB, AF_IGNORE_SMALL_BOTTOM }, /* Ç« */ + { 0x1EC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ǭ */ + { 0x1ED, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* Ç­ */ + { 0x1EE, AF_ADJUST_UP }, /* Ç® */ + { 0x1EF, AF_ADJUST_UP }, /* ǯ */ + + { 0x1F0, AF_ADJUST_UP }, /* ǰ */ + { 0x1F4, AF_ADJUST_UP }, /* Ç´ */ + { 0x1F5, AF_ADJUST_UP }, /* ǵ */ + { 0x1F8, AF_ADJUST_UP }, /* Ǹ */ + { 0x1F9, AF_ADJUST_UP }, /* ǹ */ + { 0x1FA, AF_ADJUST_UP2 }, /* Ǻ */ + { 0x1FB, AF_ADJUST_UP2 }, /* Ç» */ + { 0x1FC, AF_ADJUST_UP }, /* Ǽ */ + { 0x1FD, AF_ADJUST_UP }, /* ǽ */ + { 0x1FE, AF_ADJUST_UP }, /* Ǿ */ + { 0x1FF, AF_ADJUST_UP }, /* Ç¿ */ + + { 0x200, AF_ADJUST_UP }, /* È€ */ + { 0x201, AF_ADJUST_UP }, /* È */ + { 0x202, AF_ADJUST_UP }, /* È‚ */ + { 0x203, AF_ADJUST_UP }, /* ȃ */ + { 0x204, AF_ADJUST_UP }, /* È„ */ + { 0x205, AF_ADJUST_UP }, /* È… */ + { 0x206, AF_ADJUST_UP }, /* Ȇ */ + { 0x207, AF_ADJUST_UP }, /* ȇ */ + { 0x208, AF_ADJUST_UP }, /* Ȉ */ + { 0x209, AF_ADJUST_UP }, /* ȉ */ + { 0x20A, AF_ADJUST_UP }, /* ÈŠ */ + { 0x20B, AF_ADJUST_UP }, /* È‹ */ + { 0x20C, AF_ADJUST_UP }, /* ÈŒ */ + { 0x20D, AF_ADJUST_UP }, /* È */ + { 0x20E, AF_ADJUST_UP }, /* ÈŽ */ + { 0x20F, AF_ADJUST_UP }, /* È */ + + { 0x210, AF_ADJUST_UP }, /* È */ + { 0x211, AF_ADJUST_UP }, /* È‘ */ + { 0x212, AF_ADJUST_UP }, /* È’ */ + { 0x213, AF_ADJUST_UP }, /* È“ */ + { 0x214, AF_ADJUST_UP }, /* È” */ + { 0x215, AF_ADJUST_UP }, /* È• */ + { 0x216, AF_ADJUST_UP }, /* È– */ + { 0x217, AF_ADJUST_UP }, /* È— */ + { 0x218, AF_ADJUST_DOWN }, /* Ș */ + { 0x219, AF_ADJUST_DOWN }, /* È™ */ + { 0x21A, AF_ADJUST_DOWN }, /* Èš */ + { 0x21B, AF_ADJUST_DOWN }, /* È› */ + { 0x21E, AF_ADJUST_UP }, /* Èž */ + { 0x21F, AF_ADJUST_UP }, /* ÈŸ */ + + { 0x224, AF_IGNORE_CAPITAL_BOTTOM }, /* Ȥ */ + { 0x225, AF_IGNORE_SMALL_BOTTOM }, /* È¥ */ + { 0x226, AF_ADJUST_UP }, /* Ȧ */ + { 0x227, AF_ADJUST_UP }, /* ȧ */ + { 0x228, AF_IGNORE_CAPITAL_BOTTOM }, /* Ȩ */ + { 0x229, AF_IGNORE_SMALL_BOTTOM }, /* È© */ + { 0x22A, AF_ADJUST_UP2 }, /* Ȫ */ + { 0x22B, AF_ADJUST_UP2 }, /* È« */ + { 0x22C, AF_ADJUST_UP2 }, /* Ȭ */ + { 0x22D, AF_ADJUST_UP2 }, /* È­ */ + { 0x22E, AF_ADJUST_UP }, /* È® */ + { 0x22F, AF_ADJUST_UP }, /* ȯ */ + + { 0x230, AF_ADJUST_UP2 }, /* Ȱ */ + { 0x231, AF_ADJUST_UP2 }, /* ȱ */ + { 0x232, AF_ADJUST_UP }, /* Ȳ */ + { 0x233, AF_ADJUST_UP }, /* ȳ */ + { 0x23A, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ⱥ */ + { 0x23B, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* È» */ + { 0x23F, AF_IGNORE_SMALL_BOTTOM }, /* È¿ */ + + { 0x240, AF_IGNORE_SMALL_BOTTOM }, /* É€ */ + { 0x249, AF_ADJUST_UP }, /* ɉ */ + + /* IPA Extensions */ + { 0x256, AF_IGNORE_SMALL_BOTTOM }, /* É– */ + + { 0x260, AF_IGNORE_SMALL_TOP }, /* É  */ + { 0x267, AF_IGNORE_SMALL_BOTTOM }, /* ɧ */ + { 0x268, AF_ADJUST_UP }, /* ɨ */ + + { 0x272, AF_IGNORE_SMALL_BOTTOM }, /* ɲ */ + { 0x273, AF_IGNORE_SMALL_BOTTOM }, /* ɳ */ + { 0x27B, AF_IGNORE_SMALL_BOTTOM }, /* É» */ + { 0x27D, AF_IGNORE_SMALL_BOTTOM }, /* ɽ */ + + { 0x282, AF_IGNORE_SMALL_BOTTOM }, /* Ê‚ */ + { 0x288, AF_IGNORE_SMALL_BOTTOM }, /* ʈ */ + + { 0x290, AF_IGNORE_SMALL_BOTTOM }, /* Ê */ + { 0x29B, AF_IGNORE_SMALL_TOP }, /* Ê› */ + + { 0x2A0, AF_IGNORE_SMALL_TOP }, /* Ê  */ + + /* Spacing Modifier Letters */ + { 0x2B2, AF_ADJUST_UP }, /* ʲ */ + { 0x2B5, AF_IGNORE_SMALL_BOTTOM }, /* ʵ */ + + /* Greek and Coptic */ + { 0x390, AF_ADJUST_UP2 }, /* Î */ + + { 0x3AA, AF_ADJUST_UP }, /* Ϊ */ + { 0x3AB, AF_ADJUST_UP }, /* Ϋ */ + { 0x3AC, AF_ADJUST_UP }, /* ά */ + { 0x3AD, AF_ADJUST_UP }, /* έ */ + { 0x3AE, AF_ADJUST_UP }, /* ή */ + { 0x3AF, AF_ADJUST_UP }, /* ί */ + + { 0x3B0, AF_ADJUST_UP2 }, /* ΰ */ + + { 0x3CA, AF_ADJUST_UP }, /* ÏŠ */ + { 0x3CB, AF_ADJUST_UP }, /* Ï‹ */ + { 0x3CC, AF_ADJUST_UP }, /* ÏŒ */ + { 0x3CD, AF_ADJUST_UP }, /* Ï */ + { 0x3CE, AF_ADJUST_UP }, /* ÏŽ */ + { 0x3CF, AF_IGNORE_CAPITAL_BOTTOM }, /* Ï */ + + { 0x3D4, AF_ADJUST_UP }, /* Ï” */ + { 0x3D7, AF_IGNORE_SMALL_BOTTOM }, /* Ï— */ + { 0x3D9, AF_IGNORE_SMALL_BOTTOM }, /* Ï™ */ + + { 0x3E2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ï¢ */ + { 0x3E3, AF_IGNORE_SMALL_BOTTOM }, /* Ï£ */ + + { 0x3F3, AF_ADJUST_UP }, /* ϳ */ + + /* Cyrillic */ + { 0x400, AF_ADJUST_UP }, /* Ѐ */ + { 0x401, AF_ADJUST_UP }, /* Ð */ + { 0x403, AF_ADJUST_UP }, /* Ѓ */ + { 0x407, AF_ADJUST_UP }, /* Ї */ + { 0x40C, AF_ADJUST_UP }, /* ÐŒ */ + { 0x40D, AF_ADJUST_UP }, /* Ð */ + { 0x40E, AF_ADJUST_UP }, /* ÐŽ */ + { 0x40F, AF_IGNORE_CAPITAL_BOTTOM }, /* Ð */ + + { 0x419, AF_ADJUST_UP }, /* Й */ + + { 0x426, AF_IGNORE_CAPITAL_BOTTOM }, /* Ц */ + { 0x429, AF_IGNORE_CAPITAL_BOTTOM }, /* Щ */ + + { 0x439, AF_ADJUST_UP }, /* й */ + + { 0x446, AF_IGNORE_SMALL_BOTTOM }, /* ц */ + { 0x449, AF_IGNORE_SMALL_BOTTOM }, /* щ */ + + { 0x450, AF_ADJUST_UP }, /* Ñ */ + { 0x451, AF_ADJUST_UP }, /* Ñ‘ */ + { 0x453, AF_ADJUST_UP }, /* Ñ“ */ + { 0x456, AF_ADJUST_UP }, /* Ñ– */ + { 0x457, AF_ADJUST_UP }, /* Ñ— */ + { 0x458, AF_ADJUST_UP }, /* ј */ + { 0x45C, AF_ADJUST_UP }, /* Ñœ */ + { 0x45D, AF_ADJUST_UP }, /* Ñ */ + { 0x45E, AF_ADJUST_UP }, /* Ñž */ + { 0x45F, AF_IGNORE_SMALL_BOTTOM }, /* ÑŸ */ + + { 0x476, AF_ADJUST_UP }, /* Ѷ */ + { 0x477, AF_ADJUST_UP }, /* Ñ· */ + { 0x47C, AF_ADJUST_UP2 }, /* Ѽ */ + { 0x47D, AF_ADJUST_UP2 }, /* ѽ */ + { 0x47E, AF_ADJUST_UP }, /* Ѿ */ + { 0x47F, AF_ADJUST_UP }, /* Ñ¿ */ + + { 0x480, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò€ */ + { 0x481, AF_IGNORE_SMALL_BOTTOM }, /* Ò */ + { 0x48A, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* ÒŠ */ + { 0x48B, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* Ò‹ */ + + { 0x490, AF_IGNORE_CAPITAL_TOP }, /* Ò */ + { 0x491, AF_IGNORE_SMALL_TOP }, /* Ò‘ */ + { 0x496, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò– */ + { 0x497, AF_IGNORE_SMALL_BOTTOM }, /* Ò— */ + { 0x498, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò˜ */ + { 0x499, AF_IGNORE_SMALL_BOTTOM }, /* Ò™ */ + { 0x49A, AF_IGNORE_CAPITAL_BOTTOM }, /* Òš */ + { 0x49B, AF_IGNORE_SMALL_BOTTOM }, /* Ò› */ + + { 0x4A2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò¢ */ + { 0x4A3, AF_IGNORE_SMALL_BOTTOM }, /* Ò£ */ + { 0x4AA, AF_IGNORE_CAPITAL_BOTTOM }, /* Òª */ + { 0x4AB, AF_IGNORE_SMALL_BOTTOM }, /* Ò« */ + { 0x4AC, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò¬ */ + { 0x4AD, AF_IGNORE_SMALL_BOTTOM }, /* Ò­ */ + + { 0x4B2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò² */ + { 0x4B3, AF_IGNORE_SMALL_BOTTOM }, /* Ò³ */ + { 0x4B4, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò´ */ + { 0x4B5, AF_IGNORE_SMALL_BOTTOM }, /* Òµ */ + { 0x4B6, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò¶ */ + { 0x4B7, AF_IGNORE_SMALL_BOTTOM }, /* Ò· */ + { 0x4BE, AF_IGNORE_CAPITAL_BOTTOM }, /* Ò¾ */ + { 0x4BF, AF_IGNORE_SMALL_BOTTOM }, /* Ò¿ */ + + { 0x4C1, AF_ADJUST_UP }, /* Ó */ + { 0x4C2, AF_ADJUST_UP }, /* Ó‚ */ + { 0x4C5, AF_IGNORE_CAPITAL_BOTTOM }, /* Ó… */ + { 0x4C6, AF_IGNORE_SMALL_BOTTOM }, /* Ó† */ + { 0x4C9, AF_IGNORE_CAPITAL_BOTTOM }, /* Ó‰ */ + { 0x4CA, AF_IGNORE_SMALL_BOTTOM }, /* ÓŠ */ + { 0x4CB, AF_IGNORE_CAPITAL_BOTTOM }, /* Ó‹ */ + { 0x4CC, AF_IGNORE_SMALL_BOTTOM }, /* ÓŒ */ + { 0x4CD, AF_IGNORE_CAPITAL_BOTTOM }, /* Ó */ + { 0x4CE, AF_IGNORE_SMALL_BOTTOM }, /* ÓŽ */ + + { 0x4D0, AF_ADJUST_UP }, /* Ó */ + { 0x4D1, AF_ADJUST_UP }, /* Ó‘ */ + { 0x4D2, AF_ADJUST_UP }, /* Ó’ */ + { 0x4D3, AF_ADJUST_UP }, /* Ó“ */ + { 0x4D6, AF_ADJUST_UP }, /* Ó– */ + { 0x4D7, AF_ADJUST_UP }, /* Ó— */ + { 0x4DA, AF_ADJUST_UP }, /* Óš */ + { 0x4DB, AF_ADJUST_UP }, /* Ó› */ + { 0x4DC, AF_ADJUST_UP }, /* Óœ */ + { 0x4DD, AF_ADJUST_UP }, /* Ó */ + { 0x4DE, AF_ADJUST_UP }, /* Óž */ + { 0x4DF, AF_ADJUST_UP }, /* ÓŸ */ + + { 0x4E2, AF_ADJUST_UP }, /* Ó¢ */ + { 0x4E3, AF_ADJUST_UP }, /* Ó£ */ + { 0x4E4, AF_ADJUST_UP }, /* Ó¤ */ + { 0x4E5, AF_ADJUST_UP }, /* Ó¥ */ + { 0x4E6, AF_ADJUST_UP }, /* Ó¦ */ + { 0x4E7, AF_ADJUST_UP }, /* Ó§ */ + { 0x4EA, AF_ADJUST_UP }, /* Óª */ + { 0x4EB, AF_ADJUST_UP }, /* Ó« */ + { 0x4EC, AF_ADJUST_UP }, /* Ó¬ */ + { 0x4ED, AF_ADJUST_UP }, /* Ó­ */ + { 0x4EE, AF_ADJUST_UP }, /* Ó® */ + { 0x4EF, AF_ADJUST_UP }, /* Ó¯ */ + + { 0x4F0, AF_ADJUST_UP }, /* Ó° */ + { 0x4F1, AF_ADJUST_UP }, /* Ó± */ + { 0x4F2, AF_ADJUST_UP }, /* Ó² */ + { 0x4F3, AF_ADJUST_UP }, /* Ó³ */ + { 0x4F4, AF_ADJUST_UP }, /* Ó´ */ + { 0x4F5, AF_ADJUST_UP }, /* Óµ */ + { 0x4F6, AF_IGNORE_CAPITAL_BOTTOM }, /* Ó¶ */ + { 0x4F7, AF_IGNORE_SMALL_BOTTOM }, /* Ó· */ + { 0x4F8, AF_ADJUST_UP }, /* Ó¸ */ + { 0x4F9, AF_ADJUST_UP }, /* Ó¹ */ + { 0x4FA, AF_IGNORE_CAPITAL_BOTTOM }, /* Óº */ + { 0x4FB, AF_IGNORE_SMALL_BOTTOM }, /* Ó» */ + + /* Cyrillic Supplement */ + { 0x506, AF_IGNORE_CAPITAL_BOTTOM }, /* Ô† */ + { 0x507, AF_IGNORE_SMALL_BOTTOM }, /* Ô‡ */ + + { 0x524, AF_IGNORE_CAPITAL_BOTTOM }, /* Ô¤ */ + { 0x525, AF_IGNORE_SMALL_BOTTOM }, /* Ô¥ */ + { 0x526, AF_IGNORE_CAPITAL_BOTTOM }, /* Ô¦ */ + { 0x527, AF_IGNORE_SMALL_BOTTOM }, /* Ô§ */ + { 0x52E, AF_IGNORE_CAPITAL_BOTTOM }, /* Ô® */ + { 0x52F, AF_IGNORE_SMALL_BOTTOM }, /* Ô¯ */ + + /* Cherokee */ + { 0x13A5, AF_ADJUST_UP }, /* Ꭵ */ + + /* Phonetic Extensions */ + { 0x1D09, AF_ADJUST_DOWN }, /* á´‰ */ + + { 0x1D4E, AF_ADJUST_DOWN }, /* ᵎ */ + + { 0x1D51, AF_IGNORE_SMALL_BOTTOM }, /* ᵑ */ + + { 0x1D62, AF_ADJUST_UP }, /* áµ¢ */ + + /* Phonetic Extensions Supplement */ + { 0x1D80, AF_IGNORE_SMALL_BOTTOM }, /* á¶€ */ + { 0x1D81, AF_IGNORE_SMALL_BOTTOM }, /* á¶ */ + { 0x1D82, AF_IGNORE_SMALL_BOTTOM }, /* á¶‚ */ + { 0x1D84, AF_IGNORE_SMALL_BOTTOM }, /* á¶„ */ + { 0x1D85, AF_IGNORE_SMALL_BOTTOM }, /* á¶… */ + { 0x1D86, AF_IGNORE_SMALL_BOTTOM }, /* ᶆ */ + { 0x1D87, AF_IGNORE_SMALL_BOTTOM }, /* ᶇ */ + { 0x1D89, AF_IGNORE_SMALL_BOTTOM }, /* ᶉ */ + { 0x1D8A, AF_IGNORE_SMALL_BOTTOM }, /* á¶Š */ + { 0x1D8C, AF_IGNORE_SMALL_BOTTOM }, /* á¶Œ */ + { 0x1D8D, AF_IGNORE_SMALL_BOTTOM }, /* á¶ */ + { 0x1D8E, AF_IGNORE_SMALL_BOTTOM }, /* á¶Ž */ + { 0x1D8F, AF_IGNORE_SMALL_BOTTOM }, /* á¶ */ + + { 0x1D90, AF_IGNORE_SMALL_BOTTOM }, /* á¶ */ + { 0x1D91, AF_IGNORE_SMALL_BOTTOM }, /* á¶‘ */ + { 0x1D92, AF_IGNORE_SMALL_BOTTOM }, /* á¶’ */ + { 0x1D93, AF_IGNORE_SMALL_BOTTOM }, /* á¶“ */ + { 0x1D94, AF_IGNORE_SMALL_BOTTOM }, /* á¶” */ + { 0x1D95, AF_IGNORE_SMALL_BOTTOM }, /* á¶• */ + { 0x1D96, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* á¶– */ + { 0x1D97, AF_IGNORE_SMALL_BOTTOM }, /* á¶— */ + { 0x1D98, AF_IGNORE_SMALL_BOTTOM }, /* ᶘ */ + { 0x1D99, AF_IGNORE_SMALL_BOTTOM }, /* á¶™ */ + { 0x1D9A, AF_IGNORE_SMALL_BOTTOM }, /* á¶š */ + + { 0x1DA4, AF_ADJUST_UP }, /* ᶤ */ + { 0x1DA8, AF_ADJUST_UP }, /* ᶨ */ + { 0x1DA9, AF_IGNORE_SMALL_BOTTOM }, /* á¶© */ + { 0x1DAA, AF_IGNORE_SMALL_BOTTOM }, /* ᶪ */ + { 0x1DAC, AF_IGNORE_SMALL_BOTTOM }, /* ᶬ */ + { 0x1DAE, AF_IGNORE_SMALL_BOTTOM }, /* á¶® */ + { 0x1DAF, AF_IGNORE_SMALL_BOTTOM }, /* ᶯ */ + + { 0x1DB3, AF_IGNORE_SMALL_BOTTOM }, /* á¶³ */ + { 0x1DB5, AF_IGNORE_SMALL_BOTTOM }, /* á¶µ */ + { 0x1DBC, AF_IGNORE_SMALL_BOTTOM }, /* á¶¼ */ + + /* Latin Extended Additional */ + { 0x1E00, AF_ADJUST_DOWN }, /* Ḁ */ + { 0x1E01, AF_ADJUST_DOWN }, /* Ḡ*/ + { 0x1E02, AF_ADJUST_UP }, /* Ḃ */ + { 0x1E03, AF_ADJUST_UP }, /* ḃ */ + { 0x1E04, AF_ADJUST_DOWN }, /* Ḅ */ + { 0x1E05, AF_ADJUST_DOWN }, /* ḅ */ + { 0x1E06, AF_ADJUST_DOWN }, /* Ḇ */ + { 0x1E07, AF_ADJUST_DOWN }, /* ḇ */ + { 0x1E08, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ḉ */ + { 0x1E09, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ḉ */ + { 0x1E0A, AF_ADJUST_UP }, /* Ḋ */ + { 0x1E0B, AF_ADJUST_UP }, /* ḋ */ + { 0x1E0C, AF_ADJUST_DOWN }, /* Ḍ */ + { 0x1E0D, AF_ADJUST_DOWN }, /* Ḡ*/ + { 0x1E0E, AF_ADJUST_DOWN }, /* Ḏ */ + { 0x1E0F, AF_ADJUST_DOWN }, /* Ḡ*/ + + { 0x1E10, AF_ADJUST_DOWN }, /* Ḡ*/ + { 0x1E11, AF_ADJUST_DOWN }, /* ḑ */ + { 0x1E12, AF_ADJUST_DOWN }, /* Ḓ */ + { 0x1E13, AF_ADJUST_DOWN }, /* ḓ */ + { 0x1E14, AF_ADJUST_UP2 }, /* Ḕ */ + { 0x1E15, AF_ADJUST_UP2 }, /* ḕ */ + { 0x1E16, AF_ADJUST_UP2 }, /* Ḗ */ + { 0x1E17, AF_ADJUST_UP2 }, /* ḗ */ + { 0x1E18, AF_ADJUST_DOWN }, /* Ḙ */ + { 0x1E19, AF_ADJUST_DOWN }, /* ḙ */ + { 0x1E1A, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* Ḛ */ + { 0x1E1B, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* ḛ */ + { 0x1E1C, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ḝ */ + { 0x1E1D, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* Ḡ*/ + { 0x1E1E, AF_ADJUST_UP }, /* Ḟ */ + { 0x1E1F, AF_ADJUST_UP }, /* ḟ */ + + { 0x1E20, AF_ADJUST_UP }, /* Ḡ */ + { 0x1E21, AF_ADJUST_UP }, /* ḡ */ + { 0x1E22, AF_ADJUST_UP }, /* Ḣ */ + { 0x1E23, AF_ADJUST_UP }, /* ḣ */ + { 0x1E24, AF_ADJUST_DOWN }, /* Ḥ */ + { 0x1E25, AF_ADJUST_DOWN }, /* ḥ */ + { 0x1E26, AF_ADJUST_UP }, /* Ḧ */ + { 0x1E27, AF_ADJUST_UP }, /* ḧ */ + { 0x1E28, AF_IGNORE_CAPITAL_BOTTOM }, /* Ḩ */ + { 0x1E29, AF_IGNORE_SMALL_BOTTOM }, /* ḩ */ + { 0x1E2A, AF_ADJUST_DOWN }, /* Ḫ */ + { 0x1E2B, AF_ADJUST_DOWN }, /* ḫ */ + { 0x1E2C, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* Ḭ */ + { 0x1E2D, AF_ADJUST_UP | AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* ḭ */ + { 0x1E2E, AF_ADJUST_UP2 }, /* Ḯ */ + { 0x1E2F, AF_ADJUST_UP2 }, /* ḯ */ + + { 0x1E30, AF_ADJUST_UP }, /* Ḱ */ + { 0x1E31, AF_ADJUST_UP }, /* ḱ */ + { 0x1E32, AF_ADJUST_DOWN }, /* Ḳ */ + { 0x1E33, AF_ADJUST_DOWN }, /* ḳ */ + { 0x1E34, AF_ADJUST_DOWN }, /* Ḵ */ + { 0x1E35, AF_ADJUST_DOWN }, /* ḵ */ + { 0x1E36, AF_ADJUST_DOWN }, /* Ḷ */ + { 0x1E37, AF_ADJUST_DOWN }, /* ḷ */ + { 0x1E38, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ḹ */ + { 0x1E39, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ḹ */ + { 0x1E3A, AF_ADJUST_DOWN }, /* Ḻ */ + { 0x1E3B, AF_ADJUST_DOWN }, /* ḻ */ + { 0x1E3C, AF_ADJUST_DOWN }, /* Ḽ */ + { 0x1E3D, AF_ADJUST_DOWN }, /* ḽ */ + { 0x1E3E, AF_ADJUST_UP }, /* Ḿ */ + { 0x1E3F, AF_ADJUST_UP }, /* ḿ */ + + { 0x1E40, AF_ADJUST_UP }, /* á¹€ */ + { 0x1E41, AF_ADJUST_UP }, /* á¹ */ + { 0x1E42, AF_ADJUST_DOWN }, /* Ṃ */ + { 0x1E43, AF_ADJUST_DOWN }, /* ṃ */ + { 0x1E44, AF_ADJUST_UP }, /* Ṅ */ + { 0x1E45, AF_ADJUST_UP }, /* á¹… */ + { 0x1E46, AF_ADJUST_DOWN }, /* Ṇ */ + { 0x1E47, AF_ADJUST_DOWN }, /* ṇ */ + { 0x1E48, AF_ADJUST_DOWN }, /* Ṉ */ + { 0x1E49, AF_ADJUST_DOWN }, /* ṉ */ + { 0x1E4A, AF_ADJUST_DOWN }, /* Ṋ */ + { 0x1E4B, AF_ADJUST_DOWN }, /* ṋ */ + { 0x1E4C, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṍ */ + { 0x1E4D, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* á¹ */ + { 0x1E4E, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṏ */ + { 0x1E4F, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* á¹ */ + + { 0x1E50, AF_ADJUST_UP2 }, /* á¹ */ + { 0x1E51, AF_ADJUST_UP2 }, /* ṑ */ + { 0x1E52, AF_ADJUST_UP2 }, /* á¹’ */ + { 0x1E53, AF_ADJUST_UP2 }, /* ṓ */ + { 0x1E54, AF_ADJUST_UP }, /* á¹” */ + { 0x1E55, AF_ADJUST_UP }, /* ṕ */ + { 0x1E56, AF_ADJUST_UP }, /* á¹– */ + { 0x1E57, AF_ADJUST_UP }, /* á¹— */ + { 0x1E58, AF_ADJUST_UP }, /* Ṙ */ + { 0x1E59, AF_ADJUST_UP }, /* á¹™ */ + { 0x1E5A, AF_ADJUST_DOWN }, /* Ṛ */ + { 0x1E5B, AF_ADJUST_DOWN }, /* á¹› */ + { 0x1E5C, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ṝ */ + { 0x1E5D, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¹ */ + { 0x1E5E, AF_ADJUST_DOWN }, /* Ṟ */ + { 0x1E5F, AF_ADJUST_DOWN }, /* ṟ */ + + { 0x1E60, AF_ADJUST_UP }, /* á¹  */ + { 0x1E61, AF_ADJUST_UP }, /* ṡ */ + { 0x1E62, AF_ADJUST_DOWN }, /* á¹¢ */ + { 0x1E63, AF_ADJUST_DOWN }, /* á¹£ */ + { 0x1E64, AF_ADJUST_UP }, /* Ṥ */ + { 0x1E65, AF_ADJUST_UP }, /* á¹¥ */ + { 0x1E66, AF_ADJUST_UP }, /* Ṧ */ + { 0x1E67, AF_ADJUST_UP }, /* á¹§ */ + { 0x1E68, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ṩ */ + { 0x1E69, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ṩ */ + { 0x1E6A, AF_ADJUST_UP }, /* Ṫ */ + { 0x1E6B, AF_ADJUST_UP }, /* ṫ */ + { 0x1E6C, AF_ADJUST_DOWN }, /* Ṭ */ + { 0x1E6D, AF_ADJUST_DOWN }, /* á¹­ */ + { 0x1E6E, AF_ADJUST_DOWN }, /* á¹® */ + { 0x1E6F, AF_ADJUST_DOWN }, /* ṯ */ + + { 0x1E70, AF_ADJUST_DOWN }, /* á¹° */ + { 0x1E71, AF_ADJUST_DOWN }, /* á¹± */ + { 0x1E72, AF_ADJUST_DOWN }, /* á¹² */ + { 0x1E73, AF_ADJUST_DOWN }, /* á¹³ */ + { 0x1E74, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* á¹´ */ + { 0x1E75, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* á¹µ */ + { 0x1E76, AF_ADJUST_DOWN }, /* á¹¶ */ + { 0x1E77, AF_ADJUST_DOWN }, /* á¹· */ + { 0x1E78, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṹ */ + { 0x1E79, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* á¹¹ */ + { 0x1E7A, AF_ADJUST_UP2 }, /* Ṻ */ + { 0x1E7B, AF_ADJUST_UP2 }, /* á¹» */ + { 0x1E7C, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* á¹¼ */ + { 0x1E7D, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* á¹½ */ + { 0x1E7E, AF_ADJUST_DOWN }, /* á¹¾ */ + { 0x1E7F, AF_ADJUST_DOWN }, /* ṿ */ + + { 0x1E80, AF_ADJUST_UP }, /* Ẁ */ + { 0x1E81, AF_ADJUST_UP }, /* Ạ*/ + { 0x1E82, AF_ADJUST_UP }, /* Ẃ */ + { 0x1E83, AF_ADJUST_UP }, /* ẃ */ + { 0x1E84, AF_ADJUST_UP }, /* Ẅ */ + { 0x1E85, AF_ADJUST_UP }, /* ẅ */ + { 0x1E86, AF_ADJUST_UP }, /* Ẇ */ + { 0x1E87, AF_ADJUST_UP }, /* ẇ */ + { 0x1E88, AF_ADJUST_DOWN }, /* Ẉ */ + { 0x1E89, AF_ADJUST_DOWN }, /* ẉ */ + { 0x1E8A, AF_ADJUST_UP }, /* Ẋ */ + { 0x1E8B, AF_ADJUST_UP }, /* ẋ */ + { 0x1E8C, AF_ADJUST_UP }, /* Ẍ */ + { 0x1E8D, AF_ADJUST_UP }, /* Ạ*/ + { 0x1E8E, AF_ADJUST_UP }, /* Ẏ */ + { 0x1E8F, AF_ADJUST_UP }, /* Ạ*/ + + { 0x1E90, AF_ADJUST_UP }, /* Ạ*/ + { 0x1E91, AF_ADJUST_UP }, /* ẑ */ + { 0x1E92, AF_ADJUST_DOWN }, /* Ẓ */ + { 0x1E93, AF_ADJUST_DOWN }, /* ẓ */ + { 0x1E94, AF_ADJUST_DOWN }, /* Ẕ */ + { 0x1E95, AF_ADJUST_DOWN }, /* ẕ */ + { 0x1E96, AF_ADJUST_DOWN }, /* ẖ */ + { 0x1E97, AF_ADJUST_UP }, /* ẗ */ + { 0x1E98, AF_ADJUST_UP }, /* ẘ */ + { 0x1E99, AF_ADJUST_UP }, /* ẙ */ + { 0x1E9A, AF_ADJUST_UP }, /* ẚ */ + { 0x1E9B, AF_ADJUST_UP }, /* ẛ */ + + { 0x1EA0, AF_ADJUST_DOWN }, /* Ạ */ + { 0x1EA1, AF_ADJUST_DOWN }, /* ạ */ + { 0x1EA2, AF_ADJUST_UP }, /* Ả */ + { 0x1EA3, AF_ADJUST_UP }, /* ả */ + { 0x1EA4, AF_ADJUST_UP2 }, /* Ấ */ + { 0x1EA5, AF_ADJUST_UP2 }, /* ấ */ + { 0x1EA6, AF_ADJUST_UP2 }, /* Ầ */ + { 0x1EA7, AF_ADJUST_UP2 }, /* ầ */ + { 0x1EA8, AF_ADJUST_UP2 }, /* Ẩ */ + { 0x1EA9, AF_ADJUST_UP2 }, /* ẩ */ + { 0x1EAA, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ẫ */ + { 0x1EAB, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ẫ */ + { 0x1EAC, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ậ */ + { 0x1EAD, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ậ */ + { 0x1EAE, AF_ADJUST_UP2 }, /* Ắ */ + { 0x1EAF, AF_ADJUST_UP2 }, /* ắ */ + + { 0x1EB0, AF_ADJUST_UP2 }, /* Ằ */ + { 0x1EB1, AF_ADJUST_UP2 }, /* ằ */ + { 0x1EB2, AF_ADJUST_UP2 }, /* Ẳ */ + { 0x1EB3, AF_ADJUST_UP2 }, /* ẳ */ + { 0x1EB4, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ẵ */ + { 0x1EB5, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ẵ */ + { 0x1EB6, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ặ */ + { 0x1EB7, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ặ */ + { 0x1EB8, AF_ADJUST_DOWN }, /* Ẹ */ + { 0x1EB9, AF_ADJUST_DOWN }, /* ẹ */ + { 0x1EBA, AF_ADJUST_UP }, /* Ẻ */ + { 0x1EBB, AF_ADJUST_UP }, /* ẻ */ + { 0x1EBC, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ẽ */ + { 0x1EBD, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ẽ */ + { 0x1EBE, AF_ADJUST_UP2 }, /* Ế */ + { 0x1EBF, AF_ADJUST_UP2 }, /* ế */ + + { 0x1EC0, AF_ADJUST_UP2 }, /* Ề */ + { 0x1EC1, AF_ADJUST_UP2 }, /* á» */ + { 0x1EC2, AF_ADJUST_UP2 }, /* Ể */ + { 0x1EC3, AF_ADJUST_UP2 }, /* ể */ + { 0x1EC4, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ễ */ + { 0x1EC5, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á»… */ + { 0x1EC6, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ệ */ + { 0x1EC7, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ệ */ + { 0x1EC8, AF_ADJUST_UP }, /* Ỉ */ + { 0x1EC9, AF_ADJUST_UP }, /* ỉ */ + { 0x1ECA, AF_ADJUST_DOWN }, /* Ị */ + { 0x1ECB, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ị */ + { 0x1ECC, AF_ADJUST_DOWN }, /* Ọ */ + { 0x1ECD, AF_ADJUST_DOWN }, /* á» */ + { 0x1ECE, AF_ADJUST_UP }, /* Ỏ */ + { 0x1ECF, AF_ADJUST_UP }, /* á» */ + + { 0x1ED0, AF_ADJUST_UP2 }, /* á» */ + { 0x1ED1, AF_ADJUST_UP2 }, /* ố */ + { 0x1ED2, AF_ADJUST_UP2 }, /* á»’ */ + { 0x1ED3, AF_ADJUST_UP2 }, /* ồ */ + { 0x1ED4, AF_ADJUST_UP2 }, /* á»” */ + { 0x1ED5, AF_ADJUST_UP2 }, /* ổ */ + { 0x1ED6, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á»– */ + { 0x1ED7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á»— */ + { 0x1ED8, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ộ */ + { 0x1ED9, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á»™ */ + { 0x1EDA, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ớ */ + { 0x1EDB, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* á»› */ + { 0x1EDC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ờ */ + { 0x1EDD, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* á» */ + { 0x1EDE, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ở */ + { 0x1EDF, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ở */ + + { 0x1EE0, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_CAPITAL_TOP }, /* á»  */ + { 0x1EE1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_SMALL_TOP }, /* ỡ */ + { 0x1EE2, AF_ADJUST_DOWN | AF_IGNORE_CAPITAL_TOP }, /* Ợ */ + { 0x1EE3, AF_ADJUST_DOWN | AF_IGNORE_SMALL_TOP }, /* ợ */ + { 0x1EE4, AF_ADJUST_DOWN }, /* Ụ */ + { 0x1EE5, AF_ADJUST_DOWN }, /* ụ */ + { 0x1EE6, AF_ADJUST_UP }, /* Ủ */ + { 0x1EE7, AF_ADJUST_UP }, /* á»§ */ + { 0x1EE8, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ứ */ + { 0x1EE9, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ứ */ + { 0x1EEA, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ừ */ + { 0x1EEB, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ừ */ + { 0x1EEC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ử */ + { 0x1EED, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* á»­ */ + { 0x1EEE, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_CAPITAL_TOP }, /* á»® */ + { 0x1EEF, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_SMALL_TOP }, /* ữ */ + + { 0x1EF0, AF_ADJUST_DOWN | AF_IGNORE_CAPITAL_TOP }, /* á»° */ + { 0x1EF1, AF_ADJUST_DOWN | AF_IGNORE_SMALL_TOP }, /* á»± */ + { 0x1EF2, AF_ADJUST_UP }, /* Ỳ */ + { 0x1EF3, AF_ADJUST_UP }, /* ỳ */ + { 0x1EF4, AF_ADJUST_DOWN }, /* á»´ */ + { 0x1EF5, AF_ADJUST_DOWN }, /* ỵ */ + { 0x1EF6, AF_ADJUST_UP }, /* á»¶ */ + { 0x1EF7, AF_ADJUST_UP }, /* á»· */ + { 0x1EF8, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ỹ */ + { 0x1EF9, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ỹ */ + + /* Greek Extended */ + { 0x1F00, AF_ADJUST_UP }, /* á¼€ */ + { 0x1F01, AF_ADJUST_UP }, /* á¼ */ + { 0x1F02, AF_ADJUST_UP }, /* ἂ */ + { 0x1F03, AF_ADJUST_UP }, /* ἃ */ + { 0x1F04, AF_ADJUST_UP }, /* ἄ */ + { 0x1F05, AF_ADJUST_UP }, /* á¼… */ + { 0x1F06, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἆ */ + { 0x1F07, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἇ */ + + { 0x1F10, AF_ADJUST_UP }, /* á¼ */ + { 0x1F11, AF_ADJUST_UP }, /* ἑ */ + { 0x1F12, AF_ADJUST_UP }, /* á¼’ */ + { 0x1F13, AF_ADJUST_UP }, /* ἓ */ + { 0x1F14, AF_ADJUST_UP }, /* á¼” */ + { 0x1F15, AF_ADJUST_UP }, /* ἕ */ + + { 0x1F20, AF_ADJUST_UP }, /* á¼  */ + { 0x1F21, AF_ADJUST_UP }, /* ἡ */ + { 0x1F22, AF_ADJUST_UP }, /* á¼¢ */ + { 0x1F23, AF_ADJUST_UP }, /* á¼£ */ + { 0x1F24, AF_ADJUST_UP }, /* ἤ */ + { 0x1F25, AF_ADJUST_UP }, /* á¼¥ */ + { 0x1F26, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἦ */ + { 0x1F27, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á¼§ */ + + { 0x1F30, AF_ADJUST_UP }, /* á¼° */ + { 0x1F31, AF_ADJUST_UP }, /* á¼± */ + { 0x1F32, AF_ADJUST_UP }, /* á¼² */ + { 0x1F33, AF_ADJUST_UP }, /* á¼³ */ + { 0x1F34, AF_ADJUST_UP }, /* á¼´ */ + { 0x1F35, AF_ADJUST_UP }, /* á¼µ */ + { 0x1F36, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á¼¶ */ + { 0x1F37, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á¼· */ + + { 0x1F40, AF_ADJUST_UP }, /* á½€ */ + { 0x1F41, AF_ADJUST_UP }, /* á½ */ + { 0x1F42, AF_ADJUST_UP }, /* ὂ */ + { 0x1F43, AF_ADJUST_UP }, /* ὃ */ + { 0x1F44, AF_ADJUST_UP }, /* ὄ */ + { 0x1F45, AF_ADJUST_UP }, /* á½… */ + + { 0x1F50, AF_ADJUST_UP }, /* á½ */ + { 0x1F51, AF_ADJUST_UP }, /* ὑ */ + { 0x1F52, AF_ADJUST_UP }, /* á½’ */ + { 0x1F53, AF_ADJUST_UP }, /* ὓ */ + { 0x1F54, AF_ADJUST_UP }, /* á½” */ + { 0x1F55, AF_ADJUST_UP }, /* ὕ */ + { 0x1F56, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á½– */ + { 0x1F57, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á½— */ + + { 0x1F60, AF_ADJUST_UP }, /* á½  */ + { 0x1F61, AF_ADJUST_UP }, /* ὡ */ + { 0x1F62, AF_ADJUST_UP }, /* á½¢ */ + { 0x1F63, AF_ADJUST_UP }, /* á½£ */ + { 0x1F64, AF_ADJUST_UP }, /* ὤ */ + { 0x1F65, AF_ADJUST_UP }, /* á½¥ */ + { 0x1F66, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ὦ */ + { 0x1F67, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á½§ */ + + { 0x1F70, AF_ADJUST_UP }, /* á½° */ + { 0x1F71, AF_ADJUST_UP }, /* á½± */ + { 0x1F72, AF_ADJUST_UP }, /* á½² */ + { 0x1F73, AF_ADJUST_UP }, /* á½³ */ + { 0x1F74, AF_ADJUST_UP }, /* á½´ */ + { 0x1F75, AF_ADJUST_UP }, /* á½µ */ + { 0x1F76, AF_ADJUST_UP }, /* á½¶ */ + { 0x1F77, AF_ADJUST_UP }, /* á½· */ + { 0x1F78, AF_ADJUST_UP }, /* ὸ */ + { 0x1F79, AF_ADJUST_UP }, /* á½¹ */ + { 0x1F7A, AF_ADJUST_UP }, /* ὺ */ + { 0x1F7B, AF_ADJUST_UP }, /* á½» */ + { 0x1F7C, AF_ADJUST_UP }, /* á½¼ */ + { 0x1F7D, AF_ADJUST_UP }, /* á½½ */ + + { 0x1F80, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾€ */ + { 0x1F81, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾ */ + { 0x1F82, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾂ */ + { 0x1F83, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾃ */ + { 0x1F84, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾄ */ + { 0x1F85, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾… */ + { 0x1F86, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾆ */ + { 0x1F87, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾇ */ + { 0x1F88, AF_ADJUST_DOWN }, /* ᾈ */ + { 0x1F89, AF_ADJUST_DOWN }, /* ᾉ */ + { 0x1F8A, AF_ADJUST_DOWN }, /* ᾊ */ + { 0x1F8B, AF_ADJUST_DOWN }, /* ᾋ */ + { 0x1F8C, AF_ADJUST_DOWN }, /* ᾌ */ + { 0x1F8D, AF_ADJUST_DOWN }, /* á¾ */ + { 0x1F8E, AF_ADJUST_DOWN }, /* ᾎ */ + { 0x1F8F, AF_ADJUST_DOWN }, /* á¾ */ + + { 0x1F90, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾ */ + { 0x1F91, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾑ */ + { 0x1F92, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾’ */ + { 0x1F93, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾓ */ + { 0x1F94, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾” */ + { 0x1F95, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾕ */ + { 0x1F96, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* á¾– */ + { 0x1F97, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* á¾— */ + { 0x1F98, AF_ADJUST_DOWN }, /* ᾘ */ + { 0x1F99, AF_ADJUST_DOWN }, /* á¾™ */ + { 0x1F9A, AF_ADJUST_DOWN }, /* ᾚ */ + { 0x1F9B, AF_ADJUST_DOWN }, /* á¾› */ + { 0x1F9C, AF_ADJUST_DOWN }, /* ᾜ */ + { 0x1F9D, AF_ADJUST_DOWN }, /* á¾ */ + { 0x1F9E, AF_ADJUST_DOWN }, /* ᾞ */ + { 0x1F9F, AF_ADJUST_DOWN }, /* ᾟ */ + + { 0x1FA0, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾  */ + { 0x1FA1, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾡ */ + { 0x1FA2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾¢ */ + { 0x1FA3, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾£ */ + { 0x1FA4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾤ */ + { 0x1FA5, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾¥ */ + { 0x1FA6, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾦ */ + { 0x1FA7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* á¾§ */ + { 0x1FA8, AF_ADJUST_DOWN }, /* ᾨ */ + { 0x1FA9, AF_ADJUST_DOWN }, /* ᾩ */ + { 0x1FAA, AF_ADJUST_DOWN }, /* ᾪ */ + { 0x1FAB, AF_ADJUST_DOWN }, /* ᾫ */ + { 0x1FAC, AF_ADJUST_DOWN }, /* ᾬ */ + { 0x1FAD, AF_ADJUST_DOWN }, /* á¾­ */ + { 0x1FAE, AF_ADJUST_DOWN }, /* á¾® */ + { 0x1FAF, AF_ADJUST_DOWN }, /* ᾯ */ + + { 0x1FB0, AF_ADJUST_UP }, /* á¾° */ + { 0x1FB1, AF_ADJUST_UP }, /* á¾± */ + { 0x1FB2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾² */ + { 0x1FB3, AF_ADJUST_DOWN }, /* á¾³ */ + { 0x1FB4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¾´ */ + { 0x1FB6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* á¾¶ */ + { 0x1FB7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* á¾· */ + { 0x1FB8, AF_ADJUST_UP }, /* Ᾰ */ + { 0x1FB9, AF_ADJUST_UP }, /* á¾¹ */ + { 0x1FBC, AF_ADJUST_DOWN }, /* á¾¼ */ + + { 0x1FC2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¿‚ */ + { 0x1FC3, AF_ADJUST_DOWN }, /* ῃ */ + { 0x1FC4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¿„ */ + { 0x1FC6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῆ */ + { 0x1FC7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ῇ */ + { 0x1FCC, AF_ADJUST_DOWN }, /* ῌ */ + + { 0x1FD0, AF_ADJUST_UP }, /* á¿ */ + { 0x1FD1, AF_ADJUST_UP }, /* á¿‘ */ + { 0x1FD2, AF_ADJUST_UP2 }, /* á¿’ */ + { 0x1FD3, AF_ADJUST_UP2 }, /* á¿“ */ + { 0x1FD6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* á¿– */ + { 0x1FD7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á¿— */ + { 0x1FD8, AF_ADJUST_UP }, /* Ῐ */ + { 0x1FD9, AF_ADJUST_UP }, /* á¿™ */ + + { 0x1FE0, AF_ADJUST_UP }, /* á¿  */ + { 0x1FE1, AF_ADJUST_UP }, /* á¿¡ */ + { 0x1FE2, AF_ADJUST_UP2 }, /* á¿¢ */ + { 0x1FE3, AF_ADJUST_UP2 }, /* á¿£ */ + { 0x1FE4, AF_ADJUST_UP }, /* ῤ */ + { 0x1FE5, AF_ADJUST_UP }, /* á¿¥ */ + { 0x1FE6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῦ */ + { 0x1FE7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* á¿§ */ + { 0x1FE8, AF_ADJUST_UP }, /* Ῠ */ + { 0x1FE9, AF_ADJUST_UP }, /* á¿© */ + { 0x1FF2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ῲ */ + { 0x1FF3, AF_ADJUST_DOWN }, /* ῳ */ + { 0x1FF4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* á¿´ */ + { 0x1FF6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* á¿¶ */ + { 0x1FF7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* á¿· */ + { 0x1FFC, AF_ADJUST_DOWN }, /* ῼ */ + + /* General Punctuation */ + { 0x203C, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ‼ */ + { 0x203D, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ‽ */ + + { 0x2047, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⇠*/ + { 0x2048, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ∠*/ + { 0x2049, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ≠*/ + + /* Superscripts and Subscripts */ + { 0x2071, AF_ADJUST_UP }, /* â± */ + + /* Currency Symbols */ + { 0x20AB, AF_ADJUST_DOWN }, /* â‚« */ + + { 0x20C0, AF_ADJUST_DOWN }, /* ⃀ */ + + /* Number Forms */ + { 0x2170, AF_ADJUST_UP }, /* â…° */ + { 0x2171, AF_ADJUST_UP }, /* â…± */ + { 0x2172, AF_ADJUST_UP }, /* â…² */ + { 0x2173, AF_ADJUST_UP }, /* â…³ */ + { 0x2175, AF_ADJUST_UP }, /* â…µ */ + { 0x2176, AF_ADJUST_UP }, /* â…¶ */ + { 0x2177, AF_ADJUST_UP }, /* â…· */ + { 0x2178, AF_ADJUST_UP }, /* â…¸ */ + { 0x217A, AF_ADJUST_UP }, /* â…º */ + { 0x217B, AF_ADJUST_UP }, /* â…» */ + + /* Latin Extended-C */ + { 0x2C64, AF_IGNORE_CAPITAL_BOTTOM } , /* Ɽ */ + { 0x2C67, AF_IGNORE_CAPITAL_BOTTOM } , /* â±§ */ + { 0x2C68, AF_IGNORE_SMALL_BOTTOM } , /* ⱨ */ + { 0x2C69, AF_IGNORE_CAPITAL_BOTTOM } , /* Ⱪ */ + { 0x2C6A, AF_IGNORE_SMALL_BOTTOM } , /* ⱪ */ + { 0x2C6B, AF_IGNORE_CAPITAL_BOTTOM } , /* Ⱬ */ + { 0x2C6C, AF_IGNORE_SMALL_BOTTOM } , /* ⱬ */ + { 0x2C6E, AF_IGNORE_CAPITAL_BOTTOM } , /* â±® */ + + { 0x2C7C, AF_ADJUST_UP }, /* â±¼ */ + { 0x2C7E, AF_IGNORE_CAPITAL_BOTTOM } , /* â±¾ */ + { 0x2C7F, AF_IGNORE_CAPITAL_BOTTOM } , /* Ɀ */ + + /* Coptic */ + { 0x2CC2, AF_ADJUST_UP }, /* Ⳃ */ + { 0x2CC3, AF_ADJUST_UP }, /* ⳃ */ + + /* Supplemental Punctuation */ + { 0x2E18, AF_ADJUST_UP }, /* ⸘ */ + + { 0x2E2E, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⸮ */ + + /* Cyrillic Extended-B */ + { 0xA640, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꙁ */ + { 0xA641, AF_IGNORE_SMALL_BOTTOM } , /* ê™ */ + { 0xA642, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꙃ */ + { 0xA643, AF_IGNORE_SMALL_BOTTOM } , /* ꙃ */ + + { 0xA680, AF_IGNORE_CAPITAL_TOP } , /* Ꚁ */ + { 0xA681, AF_IGNORE_SMALL_TOP } , /* êš */ + { 0xA688, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚉ */ + { 0xA689, AF_IGNORE_SMALL_BOTTOM } , /* ꚉ */ + { 0xA68A, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚋ */ + { 0xA68B, AF_IGNORE_SMALL_BOTTOM } , /* êš‹ */ + { 0xA68E, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚏ */ + { 0xA68F, AF_IGNORE_SMALL_BOTTOM } , /* êš */ + + { 0xA690, AF_IGNORE_CAPITAL_BOTTOM } , /* êš */ + { 0xA691, AF_IGNORE_SMALL_BOTTOM } , /* êš‘ */ + { 0xA696, AF_IGNORE_CAPITAL_BOTTOM } , /* êš– */ + { 0xA697, AF_IGNORE_SMALL_BOTTOM } , /* êš— */ + + /* Latin Extended-D */ + { 0xA726, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꜧ */ + { 0xA727, AF_IGNORE_SMALL_BOTTOM } , /* ꜧ */ + + { 0xA756, AF_IGNORE_CAPITAL_BOTTOM } , /* ê– */ + { 0xA758, AF_IGNORE_CAPITAL_BOTTOM } , /* ê˜ */ + + { 0xA771, AF_IGNORE_SMALL_BOTTOM } , /* ê± */ + { 0xA772, AF_IGNORE_SMALL_BOTTOM } , /* ê² */ + { 0xA773, AF_IGNORE_SMALL_BOTTOM } , /* ê³ */ + { 0xA774, AF_IGNORE_SMALL_BOTTOM } , /* ê´ */ + { 0xA776, AF_IGNORE_SMALL_BOTTOM } , /* ê¶ */ + + { 0xA790, AF_IGNORE_CAPITAL_BOTTOM } , /* êž */ + { 0xA791, AF_IGNORE_SMALL_BOTTOM } , /* êž‘ */ + { 0xA794, AF_IGNORE_SMALL_BOTTOM } , /* êž” */ + { 0xA795, AF_IGNORE_SMALL_BOTTOM } , /* êž• */ + + { 0xA7C0, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ꟁ */ + { 0xA7C1, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* êŸ */ + { 0xA7C4, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꞔ */ + { 0xA7C5, AF_IGNORE_CAPITAL_BOTTOM } , /* Ʂ */ + { 0xA7C6, AF_IGNORE_CAPITAL_BOTTOM } , /* Ᶎ */ + { 0xA7CC, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ꟍ */ + { 0xA7CD, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* êŸ */ + + /* Latin Extended-E */ + { 0xAB3C, AF_IGNORE_SMALL_BOTTOM } , /* ꬼ */ + + { 0xAB46, AF_IGNORE_SMALL_BOTTOM } , /* ê­† */ + + { 0xAB5C, AF_IGNORE_SMALL_BOTTOM } , /* ê­œ */ + + { 0xAB66, AF_IGNORE_SMALL_BOTTOM } , /* ê­¦ */ + { 0xAB67, AF_IGNORE_SMALL_BOTTOM } , /* ê­§ */ + }; + + + FT_LOCAL_DEF( FT_UInt32 ) + af_adjustment_database_lookup( FT_UInt32 codepoint ) + { + /* Binary search for database entry */ + FT_Offset low = 0; + FT_Offset high = AF_ADJUSTMENT_DATABASE_LENGTH - 1; + + + while ( high >= low ) + { + FT_Offset mid = ( low + high ) / 2; + FT_UInt32 mid_codepoint = adjustment_database[mid].codepoint; + + + if ( mid_codepoint < codepoint ) + low = mid + 1; + else if ( mid_codepoint > codepoint ) + high = mid - 1; + else + return adjustment_database[mid].flags; + } + + return 0; + } + + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + + static FT_Error + add_substitute( FT_Int glyph_idx, + size_t value, + FT_UInt32 codepoint, + FT_Hash reverse_map, + FT_Hash subst_map, + FT_Memory memory ) + { + FT_Error error; + + FT_Int first_substitute = (FT_Int)( value & 0xFFFF ); + + FT_UInt used = reverse_map->used; + + + /* + OpenType features like 'unic' map lowercase letter glyphs to uppercase + forms (and vice versa), which could lead to the use of wrong entries + in the adjustment database. For this reason we don't overwrite, + prioritizing cmap entries. + + XXX Note, however, that this cannot cover all cases since there might + be contradictory entries for glyphs not in the cmap. A possible + solution might be to specially mark pairs of related lowercase and + uppercase characters in the adjustment database that have diacritics + on different vertical sides (for example, U+0122 'Ä¢' and U+0123 'Ä£'). + The auto-hinter could then perform a topological analysis to do the + right thing. + */ + error = ft_hash_num_insert_no_overwrite( first_substitute, codepoint, + reverse_map, memory ); + if ( error ) + return error; + + if ( reverse_map->used > used ) + { + size_t* subst = ft_hash_num_lookup( first_substitute, subst_map ); + + + if ( subst ) + { + error = add_substitute( first_substitute, *subst, codepoint, + reverse_map, subst_map, memory ); + if ( error ) + return error; + } + } + + /* The remaining substitutes. */ + if ( value & 0xFFFF0000U ) + { + FT_UInt num_substitutes = value >> 16; + + FT_UInt i; + + + for ( i = 1; i <= num_substitutes; i++ ) + { + FT_Int idx = glyph_idx + (FT_Int)( i << 16 ); + size_t* substitute = ft_hash_num_lookup( idx, subst_map ); + + + used = reverse_map->used; + + error = ft_hash_num_insert_no_overwrite( *substitute, + codepoint, + reverse_map, + memory ); + if ( error ) + return error; + + if ( reverse_map->used > used ) + { + size_t* subst = ft_hash_num_lookup( *substitute, subst_map ); + + + if ( subst ) + { + error = add_substitute( *substitute, *subst, codepoint, + reverse_map, subst_map, memory ); + if ( error ) + return error; + } + } + } + } + + return FT_Err_Ok; + } + +#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */ + + + /* Construct a 'reverse cmap' (i.e., a mapping from glyph indices to */ + /* character codes) for all glyphs that an input code point could turn */ + /* into. */ + /* */ + /* If HarfBuzz support is not available, this is the direct inversion */ + /* of the cmap table, otherwise the mapping gets extended with data */ + /* from the 'GSUB' table. */ + FT_LOCAL_DEF( FT_Error ) + af_reverse_character_map_new( FT_Hash *map, + AF_StyleMetrics metrics ) + { + FT_Error error; + + AF_FaceGlobals globals = metrics->globals; + FT_Face face = globals->face; + FT_Memory memory = face->memory; + + FT_CharMap old_charmap; + + FT_UInt32 codepoint; + FT_Offset i; + + + FT_TRACE4(( "af_reverse_character_map_new:" + " building reverse character map (style `%s')\n", + af_style_names[metrics->style_class->style] )); + + /* Search for a unicode charmap. */ + /* If there isn't one, create a blank map. */ + + /* Back up `face->charmap` because `find_unicode_charmap` sets it. */ + old_charmap = face->charmap; + + if ( ( error = find_unicode_charmap( face ) ) ) + goto Exit; + + *map = NULL; + if ( FT_QNEW( *map ) ) + goto Exit; + + error = ft_hash_num_init( *map, memory ); + if ( error ) + goto Exit; + + /* Initialize reverse cmap with data directly from the cmap table. */ + for ( i = 0; i < AF_ADJUSTMENT_DATABASE_LENGTH; i++ ) + { + FT_Int cmap_glyph; + + + /* + We cannot restrict `codepoint` to character ranges; we have no + control what data the script-specific portion of the GSUB table + actually holds. + + An example is `arial.ttf` version 7.00; in this font, there are + lookups for Cyrillic (lookup 43), Greek (lookup 44), and Latin + (lookup 45) that map capital letter glyphs to small capital glyphs. + It is tempting to expect that script-specific versions of the 'c2sc' + feature only use script-specific lookups. However, this is not the + case in this font: the feature uses all three lookups regardless of + the script. + + The auto-hinter, while assigning glyphs to styles, uses the first + coverage result it encounters for a particular glyph. For example, + if the coverage for Cyrillic is tested before Latin (as is currently + the case), glyphs without a cmap entry that are covered in 'c2sc' + are treated as Cyrillic. + + If we now look at glyph 3498, which is a small-caps version of the + Latin character 'A grave' (U+00C0, glyph 172), we can see that it is + registered as belonging to a Cyrillic style due to the algorithm + just described. As a result, checking only for characters from the + Latin range would miss this glyph; we thus have to test all + character codes in the database. + */ + codepoint = adjustment_database[i].codepoint; + + cmap_glyph = (FT_Int)FT_Get_Char_Index( face, codepoint ); + if ( cmap_glyph == 0 ) + continue; + + error = ft_hash_num_insert( cmap_glyph, codepoint, *map, memory ); + if ( error ) + goto Exit; + } + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + + { + hb_font_t *hb_font; + hb_face_t *hb_face; + + hb_set_t *gsub_lookups; + hb_script_t script; + + unsigned int script_count = 1; + hb_tag_t script_tags[2] = { HB_TAG_NONE, HB_TAG_NONE }; + + FT_Hash subst_map = NULL; + + hb_codepoint_t idx; + FT_UInt hash_idx; + FT_Int glyph_idx; + size_t value; + + + /* No need to check whether HarfBuzz has allocation issues; */ + /* it continues to work in such cases and simply returns */ + /* 'empty' objects that do nothing. */ + + hb_font = globals->hb_font; + hb_face = hb( font_get_face )( hb_font ); + + gsub_lookups = hb( set_create )(); + + script = af_hb_scripts[metrics->style_class->script]; + + hb( ot_tags_from_script_and_language )( script, NULL, + &script_count, script_tags, + NULL, NULL ); + + /* Compute set of all script-specific GSUB lookups. */ + hb( ot_layout_collect_lookups )( hb_face, + HB_OT_TAG_GSUB, + script_tags, NULL, NULL, + gsub_lookups ); + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_Bool have_idx = FALSE; + + + FT_TRACE4(( " GSUB lookups to check:\n" )); + + FT_TRACE4(( " " )); + idx = HB_SET_VALUE_INVALID; + while ( hb( set_next )( gsub_lookups, &idx ) ) + if ( globals->gsub_lookups_single_alternate[idx] ) + { + have_idx = TRUE; + FT_TRACE4(( " %u", idx )); + } + if ( !have_idx ) + FT_TRACE4(( " (none)" )); + FT_TRACE4(( "\n" )); + + FT_TRACE4(( "\n" )); + } +#endif + + if ( FT_QNEW( subst_map ) ) + goto Exit_HarfBuzz; + + error = ft_hash_num_init( subst_map, memory ); + if ( error ) + goto Exit_HarfBuzz; + + idx = HB_SET_VALUE_INVALID; + while ( hb( set_next )( gsub_lookups, &idx ) ) + { + FT_UInt32 offset = globals->gsub_lookups_single_alternate[idx]; + + + /* Put all substitutions into a single hash table. Note that */ + /* the hash values usually contain more than a single character */ + /* code; this can happen if different 'SingleSubst' subtables */ + /* map a given glyph index to different substitutions, or if */ + /* 'AlternateSubst' subtable entries are present. */ + if ( offset ) + af_map_lookup( globals, subst_map, offset ); + } + + /* + Now iterate over the collected substitution data in `subst_map` + (using recursion to resolve one-to-many mappings) and insert the + data into the reverse cmap. + + As an example, suppose we have the following cmap and substitution + data: + + cmap: X -> a + Y -> b + Z -> c + + substitutions: a -> b + b -> c, d + d -> e + + The reverse map now becomes as follows. + + a -> X + b -> Y + c -> Z (via cmap, ignoring mapping from 'b') + d -> Y (via 'b') + e -> Y (via 'b' and 'd') + */ + + hash_idx = 0; + while ( ft_hash_num_iterator( &hash_idx, + &glyph_idx, + &value, + subst_map ) ) + { + size_t* val; + + + /* Ignore keys that do not point to the first substitute. */ + if ( (FT_UInt)glyph_idx & 0xFFFF0000U ) + continue; + + /* Ignore glyph indices that are not related to accents. */ + val = ft_hash_num_lookup( glyph_idx, *map ); + if ( !val ) + continue; + + codepoint = *val; + + error = add_substitute( glyph_idx, value, codepoint, + *map, subst_map, memory ); + if ( error ) + break; + } + + Exit_HarfBuzz: + hb( set_destroy )( gsub_lookups ); + + ft_hash_num_free( subst_map, memory ); + FT_FREE( subst_map ); + + if ( error ) + goto Exit; + } + +#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */ + + FT_TRACE4(( " reverse character map built successfully" + " with %u entries\n", ( *map )->used )); + +#ifdef FT_DEBUG_LEVEL_TRACE + + { + FT_UInt cnt; + + + FT_TRACE7(( " gidx code flags\n" )); + /* " XXXXX 0xXXXX XXXXXXXXXXX..." */ + FT_TRACE7(( " ------------------------------\n" )); + + for ( cnt = 0; cnt < globals->glyph_count; cnt++ ) + { + size_t* val; + FT_UInt32 adj_type; + + const char* flag_names[] = + { + "up", /* AF_ADJUST_UP */ + "down", /* AF_ADJUST_DOWN */ + "double up", /* AF_ADJUST_UP2 */ + "double down", /* AF_ADJUST_DOWN2 */ + + "top tilde", /* AF_ADJUST_TILDE_TOP */ + "bottom tilde", /* AF_ADJUST_TILDE_BOTTOM */ + "below-top tilde", /* AF_ADJUST_TILDE_TOP2 */ + "above-bottom tilde", /* AF_ADJUST_TILDE_BOTTOM2 */ + + "ignore capital top", /* AF_IGNORE_CAPITAL_TOP */ + "ignore capital bottom", /* AF_IGNORE_CAPITAL_BOTTOM */ + "ignore small top", /* AF_IGNORE_SMALL_TOP */ + "ignore small bottom", /* AF_IGNORE_SMALL_BOTTOM */ + }; + size_t flag_names_size = sizeof ( flag_names ) / sizeof ( char* ); + + char flag_str[256]; + int need_comma; + + size_t j; + + + val = ft_hash_num_lookup( (FT_Int)cnt, *map ); + if ( !val ) + continue; + codepoint = *val; + + adj_type = af_adjustment_database_lookup( codepoint ); + if ( !adj_type ) + continue; + + flag_str[0] = '\0'; + need_comma = 0; + + for ( j = 0; j < flag_names_size; j++ ) + { + if ( adj_type & (1 << j ) ) + { + if ( !need_comma ) + need_comma = 1; + else + strcat( flag_str, ", " ); + strcat( flag_str, flag_names[j] ); + } + } + + FT_TRACE7(( " %5u 0x%04X %s\n", cnt, codepoint, flag_str )); + } + } + +#endif /* FT_DEBUG_LEVEL_TRACE */ + + + Exit: + face->charmap = old_charmap; + + if ( error ) + { + FT_TRACE4(( " error while building reverse character map." + " Using blank map.\n" )); + + if ( *map ) + ft_hash_num_free( *map, memory ); + + FT_FREE( *map ); + *map = NULL; + return error; + } + + return FT_Err_Ok; + } + + + FT_LOCAL_DEF( FT_Error ) + af_reverse_character_map_done( FT_Hash map, + FT_Memory memory ) + { + if ( map ) + ft_hash_num_free( map, memory ); + FT_FREE( map ); + + return FT_Err_Ok; + } + + +/* END */ diff --git a/vendor/freetype/src/autofit/afadjust.h b/vendor/freetype/src/autofit/afadjust.h new file mode 100644 index 00000000000..3ef5614c406 --- /dev/null +++ b/vendor/freetype/src/autofit/afadjust.h @@ -0,0 +1,130 @@ +/**************************************************************************** + * + * afadjust.h + * + * Auto-fitter routines to adjust components based on charcode (header). + * + * Copyright (C) 2023-2024 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * Written by Craig White . + * + * 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. + * + */ + + +#ifndef AFADJUST_H_ +#define AFADJUST_H_ + +#include + +#include "afglobal.h" +#include "aftypes.h" + + +FT_BEGIN_HEADER + + /* + * Adjustment type flags. + * + * They also specify topological constraints that the auto-hinter relies + * on. For example, using `AF_ADJUST_UP` implies that we have two + * enclosing contours, one for the base glyph and one for the diacritic + * above, and no other contour inbetween or above. With 'enclosing' it is + * meant that such a contour can contain more inner contours. + * + */ + + /* Find the topmost contour and push it up until its lowest point is */ + /* one pixel above the highest point not enclosed by that contour. */ +#define AF_ADJUST_UP 0x01 + + /* Find the bottommost contour and push it down until its highest point */ + /* is one pixel below the lowest point not enclosed by that contour. */ +#define AF_ADJUST_DOWN 0x02 + + /* Find the contour below the topmost contour and push it up, together */ + /* with the topmost contour, until its lowest point is one pixel above */ + /* the highest point not enclosed by that contour. This flag is */ + /* mutually exclusive with `AF_ADJUST_UP`. */ +#define AF_ADJUST_UP2 0x04 + + /* Find the contour above the bottommost contour and push it down, */ + /* together with the bottommost contour, until its highest point is */ + /* one pixel below the lowest point not enclosed by that contour. */ + /* This flag is mutually exclusive with `AF_ADJUST_DOWN`. */ +#define AF_ADJUST_DOWN2 0x08 + + /* The topmost contour is a tilde. Enlarge it vertically so that it */ + /* stays legible at small sizes, not degenerating to a horizontal line. */ +#define AF_ADJUST_TILDE_TOP 0x10 + + /* The bottommost contour is a tilde. Enlarge it vertically so that it */ + /* stays legible at small sizes, not degenerating to a horizontal line. */ +#define AF_ADJUST_TILDE_BOTTOM 0x20 + + /* The contour below the topmost contour is a tilde. Enlarge it */ + /* vertically so that it stays legible at small sizes, not degenerating */ + /* to a horizontal line. To be used with `AF_ADJUST_UP2` only. */ +#define AF_ADJUST_TILDE_TOP2 0x40 + + /* The contour above the bottommost contour is a tilde. Enlarge it */ + /* vertically so that it stays legible at small sizes, not degenerating */ + /* to a horizontal line. To be used with `AF_ADJUST_DOWN2` only. */ +#define AF_ADJUST_TILDE_BOTTOM2 0x80 + + /* Make the auto-hinter ignore any diacritic (either a separate contour */ + /* or part of the base character outline) that is attached to the top */ + /* of an uppercase base character. */ +#define AF_IGNORE_CAPITAL_TOP 0x100 + + /* Make the auto-hinter ignore any diacritic (either a separate contour */ + /* or part of the base character outline) that is attached to the */ + /* bottom of an uppercase base character. */ +#define AF_IGNORE_CAPITAL_BOTTOM 0x200 + + /* Make the auto-hinter ignore any diacritic (either a separate contour */ + /* or part of the base character outline) that is attached to the top */ + /* of a lowercase base character. */ +#define AF_IGNORE_SMALL_TOP 0x400 + + /* Make the auto-hinter ignore any diacritic (either a separate contour */ + /* or part of the base character outline) that is attached to the */ + /* bottom of a lowercase base character. */ +#define AF_IGNORE_SMALL_BOTTOM 0x800 + + /* By default, the AF_ADJUST_XXX flags are applied only if diacritics */ + /* have a 'small' height (based on some heuristic checks). If this */ + /* flag is set, no such check is performed. */ +#define AF_ADJUST_NO_HEIGHT_CHECK 0x1000 + + /* No adjustment, i.e., no flag is set. */ +#define AF_ADJUST_NONE 0x00 + + + FT_LOCAL( FT_UInt32 ) + af_adjustment_database_lookup( FT_UInt32 codepoint ); + + /* Allocate and populate the reverse character map, */ + /* using the character map within the face. */ + FT_LOCAL( FT_Error ) + af_reverse_character_map_new( FT_Hash *map, + AF_StyleMetrics metrics ); + + /* Free the reverse character map. */ + FT_LOCAL( FT_Error ) + af_reverse_character_map_done( FT_Hash map, + FT_Memory memory ); + + +FT_END_HEADER + +#endif /* AFADJUST_H_ */ + + +/* END */ diff --git a/vendor/freetype/src/autofit/afblue.c b/vendor/freetype/src/autofit/afblue.c index ea83969cdc9..96d8c81851c 100644 --- a/vendor/freetype/src/autofit/afblue.c +++ b/vendor/freetype/src/autofit/afblue.c @@ -467,24 +467,24 @@ af_blue_stringsets[] = { /* */ - { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }, { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -508,14 +508,14 @@ { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 }, { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }, { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_CARIAN_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -527,24 +527,24 @@ { AF_BLUE_STRING_CHEROKEE_SMALL, 0 }, { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 }, { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_CYPRIOT_SMALL, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }, - { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }, + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | @@ -553,12 +553,12 @@ { AF_BLUE_STRING_DEVANAGARI_BASE, 0 }, { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -578,23 +578,23 @@ { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_GREEK_SMALL, 0 }, - { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GREEK_SMALL, 0 }, + { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 }, @@ -643,45 +643,45 @@ { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_LAO_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }, - { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }, + { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }, - { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }, + { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_LISU_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -691,12 +691,12 @@ { AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_NKO_BOTTOM, 0 }, + { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_NKO_BOTTOM, 0 }, { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_NKO_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_OL_CHIKI, 0 }, @@ -704,15 +704,15 @@ { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }, - { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }, + { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }, + { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -723,13 +723,13 @@ { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }, - { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }, + { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }, + { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }, { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_SINHALA_BOTTOM, 0 }, { AF_BLUE_STRING_SINHALA_DESCENDER, 0 }, diff --git a/vendor/freetype/src/autofit/afblue.dat b/vendor/freetype/src/autofit/afblue.dat index 88bab2632ab..eae39e0ebf6 100644 --- a/vendor/freetype/src/autofit/afblue.dat +++ b/vendor/freetype/src/autofit/afblue.dat @@ -699,12 +699,12 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: AF_BLUE_STRINGSET_ADLM - { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_ARAB { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -713,14 +713,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_ARMN - { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_AVST { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -756,14 +756,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CANS - { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CARI { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -781,12 +781,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_COPT - { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CPRT { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -796,13 +796,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CYRL - { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } - { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_DEVA { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -815,12 +815,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_DSRT - { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_ETHI { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -848,12 +848,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_GLAG - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_GOTH { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -861,14 +861,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_GREK - { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GREEK_SMALL, 0 } - { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GREEK_SMALL, 0 } + { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_GUJR { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | @@ -935,34 +935,34 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LATN - { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LATB - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 } - { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LATP - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 } - { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_LISU { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -975,15 +975,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_MEDF - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_MONG { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP } @@ -999,12 +999,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_NKOO - { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_NKO_BOTTOM, 0 } + { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_NKO_BOTTOM, 0 } { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_NKO_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_NONE { AF_BLUE_STRING_MAX, 0 } @@ -1020,15 +1020,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_OSGE - { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 } - { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM } + { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 } + { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_OSMA { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -1047,13 +1047,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_SHAW - { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 } - { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 } + { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 } + { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 } { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_SINH { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } diff --git a/vendor/freetype/src/autofit/afblue.h b/vendor/freetype/src/autofit/afblue.h index 2aa9d0984ef..0b289eab107 100644 --- a/vendor/freetype/src/autofit/afblue.h +++ b/vendor/freetype/src/autofit/afblue.h @@ -314,14 +314,17 @@ FT_BEGIN_HEADER /* Properties are specific to a writing system. We assume that a given */ /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ -#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must be value 1 */ #define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) #define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) -#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ -#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ +#define AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM ( 1U << 5 ) +#define AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM ( 1U << 6 ) + +#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must be value 1 */ +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must be value 2 */ #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP diff --git a/vendor/freetype/src/autofit/afblue.hin b/vendor/freetype/src/autofit/afblue.hin index 38031505a85..7bf96c8098d 100644 --- a/vendor/freetype/src/autofit/afblue.hin +++ b/vendor/freetype/src/autofit/afblue.hin @@ -99,14 +99,17 @@ FT_BEGIN_HEADER /* Properties are specific to a writing system. We assume that a given */ /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ -#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must be value 1 */ #define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) #define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) -#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ -#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ +#define AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM ( 1U << 5 ) +#define AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM ( 1U << 6 ) + +#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must be value 1 */ +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must be value 2 */ #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP diff --git a/vendor/freetype/src/autofit/afcjk.c b/vendor/freetype/src/autofit/afcjk.c index d24ad821fc9..9c95138c161 100644 --- a/vendor/freetype/src/autofit/afcjk.c +++ b/vendor/freetype/src/autofit/afcjk.c @@ -90,12 +90,8 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif const char* p; @@ -105,9 +101,8 @@ p = script_class->standard_charstring; -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); /* We check a list of standard characters. The first match wins. */ @@ -144,7 +139,7 @@ break; } - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); if ( !glyph_index ) goto Exit; @@ -152,7 +147,7 @@ if ( !glyph_index ) goto Exit; - FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n", + FT_TRACE5(( "standard character: U+%04lX (glyph index %lu)\n", ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); @@ -297,12 +292,8 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif /* we walk over the blue character strings as specified in the */ @@ -313,9 +304,8 @@ FT_TRACE5(( "==========================\n" )); FT_TRACE5(( "\n" )); -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { @@ -340,7 +330,7 @@ }; - FT_TRACE5(( "blue zone %d (%s):\n", + FT_TRACE5(( "blue zone %u (%s):\n", axis->blue_count, cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) | AF_CJK_IS_TOP_BLUE( bs ) ] )); @@ -553,7 +543,7 @@ } /* end for loop */ - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); FT_TRACE5(( "\n" )); @@ -572,23 +562,20 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif /* in all supported charmaps, digits have character codes 0x30-0x39 */ const char digits[] = "0 1 2 3 4 5 6 7 8 9"; const char* p; + FT_UNUSED( face ); + p = digits; -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); while ( *p ) { @@ -624,7 +611,7 @@ } } - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); metrics->root.digits_have_same_width = same_width; } @@ -710,7 +697,7 @@ FT_Pos delta1, delta2; - blue->ref.fit = FT_PIX_ROUND( blue->ref.cur ); + blue->ref.fit = FT_PIX_ROUND( blue->ref.cur ); /* shoot is under shoot for cjk */ delta1 = FT_DivFix( blue->ref.fit, scale ) - blue->shoot.org; @@ -736,7 +723,7 @@ blue->shoot.fit = blue->ref.fit - delta2; - FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]:\n", + FT_TRACE5(( ">> active cjk blue zone %c%u[%ld/%ld]:\n", ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V', nn, blue->ref.org, blue->shoot.org )); FT_TRACE5(( " ref: cur=%.2f fit=%.2f\n", @@ -2185,7 +2172,7 @@ af_cjk_align_edge_points( AF_GlyphHints hints, AF_Dimension dim ) { - AF_AxisHints axis = & hints->axis[dim]; + AF_AxisHints axis = &hints->axis[dim]; AF_Edge edges = axis->edges; AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); AF_Edge edge; diff --git a/vendor/freetype/src/autofit/afglobal.c b/vendor/freetype/src/autofit/afglobal.c index b7403fa65e1..f82d249ee34 100644 --- a/vendor/freetype/src/autofit/afglobal.c +++ b/vendor/freetype/src/autofit/afglobal.c @@ -22,6 +22,11 @@ #include "afws-decl.h" #include +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ +# include "afgsub.h" +# include "ft-hb-ft.h" +#endif + /************************************************************************** * @@ -184,7 +189,7 @@ if ( gindex != 0 && gindex < globals->glyph_count && ( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED ) - gstyles[gindex] = ss; + gstyles[gindex] = ss | AF_HAS_CMAP_ENTRY; for (;;) { @@ -195,7 +200,7 @@ if ( gindex < globals->glyph_count && ( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED ) - gstyles[gindex] = ss; + gstyles[gindex] = ss | AF_HAS_CMAP_ENTRY; } } @@ -301,7 +306,7 @@ if ( !( count % 10 ) ) FT_TRACE4(( " " )); - FT_TRACE4(( " %d", idx )); + FT_TRACE4(( " %u", idx )); count++; if ( !( count % 10 ) ) @@ -356,8 +361,21 @@ globals->scale_down_factor = 0; #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - globals->hb_font = hb_ft_font_create_( face, NULL ); - globals->hb_buf = hb_buffer_create(); + if ( ft_hb_enabled ( globals ) ) + { + globals->hb_font = ft_hb_ft_font_create( globals ); + globals->hb_buf = hb( buffer_create )(); + + af_parse_gsub( globals ); + } + else + { + globals->hb_font = NULL; + globals->hb_buf = NULL; + + globals->gsub = NULL; + globals->gsub_lookups_single_alternate = NULL; + } #endif error = af_face_globals_compute_style_coverage( globals ); @@ -405,8 +423,14 @@ } #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - hb_font_destroy( globals->hb_font ); - hb_buffer_destroy( globals->hb_buf ); + if ( ft_hb_enabled ( globals ) ) + { + hb( font_destroy )( globals->hb_font ); + hb( buffer_destroy )( globals->hb_buf ); + + FT_FREE( globals->gsub ); + FT_FREE( globals->gsub_lookups_single_alternate ); + } #endif /* no need to free `globals->glyph_styles'; */ diff --git a/vendor/freetype/src/autofit/afglobal.h b/vendor/freetype/src/autofit/afglobal.h index ddb54c89b27..9ef27cbdfd7 100644 --- a/vendor/freetype/src/autofit/afglobal.h +++ b/vendor/freetype/src/autofit/afglobal.h @@ -73,15 +73,17 @@ FT_BEGIN_HEADER /* default script for OpenType; ignored if HarfBuzz isn't used */ #define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN - /* a bit mask for AF_DIGIT and AF_NONBASE */ -#define AF_STYLE_MASK 0x3FFF + /* a bit mask for AF_DIGIT, AF_NONBASE, and AF_HAS_CMAP_ENTRY */ +#define AF_STYLE_MASK 0x1FFF /* an uncovered glyph */ #define AF_STYLE_UNASSIGNED AF_STYLE_MASK - /* if this flag is set, we have an ASCII digit */ + /* if this flag is set, we have an ASCII digit */ #define AF_DIGIT 0x8000U /* if this flag is set, we have a non-base character */ #define AF_NONBASE 0x4000U + /* if this flag is set, the glyph has a (direct) cmap entry */ +#define AF_HAS_CMAP_ENTRY 0x2000U /* `increase-x-height' property */ #define AF_PROP_INCREASE_X_HEIGHT_MIN 6 @@ -111,6 +113,11 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ hb_font_t* hb_font; hb_buffer_t* hb_buf; /* for feature comparison */ + + /* The GSUB table. */ + FT_Byte* gsub; + /* Lookup offsets, with only SingleSubst and AlternateSubst non-NULL. */ + FT_UInt32* gsub_lookups_single_alternate; #endif /* per-face auto-hinter properties */ diff --git a/vendor/freetype/src/autofit/afgsub.c b/vendor/freetype/src/autofit/afgsub.c new file mode 100644 index 00000000000..f11f987f3bb --- /dev/null +++ b/vendor/freetype/src/autofit/afgsub.c @@ -0,0 +1,691 @@ +/**************************************************************************** + * + * afgsub.c + * + * Auto-fitter routines to parse the GSUB table (body). + * + * Copyright (C) 2025 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 +#include +#include + +#include + +#include "afglobal.h" +#include "afgsub.h" +#include "aftypes.h" + + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + + + /*********************************/ + /******** ********/ + /******** GSUB validation ********/ + /******** ********/ + /*********************************/ + + + static FT_Bool + af_validate_coverage( FT_Byte* table, + FT_Byte* table_limit, + FT_UInt *num_glyphs ) + { + FT_UInt format; + + FT_Byte* p = table; + FT_UInt count = 0; + + + if ( table_limit < p + 4 ) + return FALSE; + + format = FT_NEXT_USHORT( p ); + if ( format == 1 ) + { + FT_UInt glyphCount = FT_NEXT_USHORT( p ); + + + /* We don't validate glyph IDs. */ + if ( table_limit < p + glyphCount * 2 ) + return FALSE; + + count += glyphCount; + } + else if ( format == 2 ) + { + FT_UInt rangeCount = FT_NEXT_USHORT( p ); + FT_Byte* limit = p + rangeCount * 6; + + + if ( table_limit < limit ) + return FALSE; + + while ( p < limit ) + { + FT_UInt startGlyphID = FT_NEXT_USHORT( p ); + FT_UInt endGlyphID = FT_NEXT_USHORT( p ); + + + if ( startGlyphID > endGlyphID ) + return FALSE; + + count += endGlyphID - startGlyphID + 1; + + /* We don't validate coverage indices. */ + p += 2; + } + } + else + return FALSE; + + if ( num_glyphs ) + *num_glyphs = count; + + return TRUE; + } + + + static FT_Bool + af_validate_single_subst1( FT_Byte* table, + FT_Byte* table_limit ) + { + FT_Byte* coverage; + + + /* Subtable format is already checked. */ + + /* The four bytes for the coverage table offset */ + /* and the glyph ID delta are already checked. */ + coverage = table + FT_PEEK_USHORT( table + 2 ); + if ( !af_validate_coverage( coverage, table_limit, NULL ) ) + return FALSE; + + /* We don't validate glyph IDs. */ + + return TRUE; + } + + + static FT_Bool + af_validate_single_subst2( FT_Byte* table, + FT_Byte* table_limit ) + { + FT_Byte* coverage; + FT_UInt glyphCount; + FT_UInt num_glyphs; + + /* Subtable format is already checked. */ + FT_Byte* p = table + 2; + + + /* The four bytes for the coverage table offset */ + /* and `glyphCount` are already checked. */ + coverage = table + FT_NEXT_USHORT( p ); + if ( !af_validate_coverage( coverage, table_limit, &num_glyphs ) ) + return FALSE; + + glyphCount = FT_NEXT_USHORT( p ); + /* We don't validate glyph IDs. */ + if ( table_limit < p + glyphCount * 2 ) + return FALSE; + + if ( glyphCount != num_glyphs ) + return FALSE; + + return TRUE; + } + + + static FT_Bool + af_validate_alternate( FT_Byte* table, + FT_Byte* table_limit ) + { + FT_Byte* coverage; + FT_UInt alternateSetCount; + FT_UInt num_glyphs; + + /* Subtable format is already checked. */ + FT_Byte* p = table + 2; + FT_Byte* limit; + + + /* The four bytes for the coverage table offset */ + /* and `alternateSetCount` are already checked. */ + coverage = table + FT_NEXT_USHORT( p ); + if ( !af_validate_coverage( coverage, table_limit, &num_glyphs ) ) + return FALSE; + + alternateSetCount = FT_NEXT_USHORT( p ); + limit = p + alternateSetCount * 2; + if ( table_limit < limit ) + return FALSE; + + if ( alternateSetCount != num_glyphs ) + return FALSE; + + while ( p < limit ) + { + FT_Byte* alternate_set; + FT_UInt glyphCount; + + + alternate_set = table + FT_NEXT_USHORT( p ); + if ( table_limit < alternate_set + 2 ) + return FALSE; + + glyphCount = FT_PEEK_USHORT( alternate_set ); + /* We don't validate glyph IDs. */ + if ( table_limit < alternate_set + 2 + glyphCount * 2 ) + return FALSE; + } + + return TRUE; + } + + + /* Validate 'SingleSubst' and 'AlternateSubst' lookup tables. */ + static FT_Bool + af_validate_lookup_table( FT_Byte* table, + FT_Byte* table_limit ) + { + FT_UInt lookupType; + FT_UInt real_lookupType = 0; + FT_UInt subtableCount; + + FT_Byte* p = table; + FT_Byte* limit; + + + if ( table_limit < p + 6 ) + return FALSE; + + lookupType = FT_NEXT_USHORT( p ); + + p += 2; /* Skip `lookupFlag`. */ + + subtableCount = FT_NEXT_USHORT( p ); + limit = p + subtableCount * 2; + if ( table_limit < limit ) + return FALSE; + + while ( p < limit ) + { + FT_Byte* subtable = table + FT_NEXT_USHORT( p ); + FT_UInt format; + + + if ( lookupType == 7 ) + { + /* Substitution extension. */ + FT_Byte* q = subtable; + + + if ( table_limit < q + 8 ) + return FALSE; + + if ( FT_NEXT_USHORT( q ) != 1 ) /* format */ + return FALSE; + + if ( real_lookupType == 0 ) + real_lookupType = FT_NEXT_USHORT( q ); + else if ( real_lookupType != FT_NEXT_USHORT( q ) ) + return FALSE; + + subtable += FT_PEEK_ULONG( q ); + } + else + real_lookupType = lookupType; + + /* Ensure the first six bytes of all subtable formats. */ + if ( table_limit < subtable + 6 ) + return FALSE; + + format = FT_PEEK_USHORT( subtable ); + + if ( real_lookupType == 1 ) + { + if ( format == 1 ) + { + if ( !af_validate_single_subst1( subtable, table_limit ) ) + return FALSE; + } + else if ( format == 2 ) + { + if ( !af_validate_single_subst2( subtable, table_limit ) ) + return FALSE; + } + else + return FALSE; + } + else if ( real_lookupType == 3 ) + { + if ( format == 1 ) + { + if ( !af_validate_alternate( subtable, table_limit ) ) + return FALSE; + } + else + return FALSE; + } + else + return FALSE; + } + + return TRUE; + } + + + FT_LOCAL_DEF( void ) + af_parse_gsub( AF_FaceGlobals globals ) + { + FT_Error error = FT_Err_Ok; + + FT_Face face = globals->face; + FT_Memory memory = face->memory; + + FT_ULong gsub_length; + FT_Byte* gsub; + FT_Byte* gsub_limit; + + FT_UInt32* gsub_lookups_single_alternate; + + FT_UInt lookupListOffset; + FT_Byte* lookup_list; + FT_UInt lookupCount; + + FT_UInt idx; + + FT_Byte* p; + FT_Byte* limit; + + + globals->gsub = NULL; + globals->gsub_lookups_single_alternate = NULL; + + /* No error if we can't load or parse GSUB data. */ + + gsub = NULL; + gsub_lookups_single_alternate = NULL; + + gsub_length = 0; + if ( FT_Load_Sfnt_Table( face, TTAG_GSUB, 0, NULL, &gsub_length ) ) + goto Fail; + + if ( FT_QALLOC( gsub, gsub_length ) ) + goto Fail; + + if ( FT_Load_Sfnt_Table( face, TTAG_GSUB, 0, gsub, &gsub_length ) ) + goto Fail; + + if ( gsub_length < 10 ) + goto Fail; + + lookupListOffset = FT_PEEK_USHORT( gsub + 8 ); + if ( gsub_length < lookupListOffset + 2 ) + goto Fail; + + lookupCount = FT_PEEK_USHORT( gsub + lookupListOffset ); + if ( gsub_length < lookupListOffset + 2 + lookupCount * 2 ) + goto Fail; + + if ( FT_NEW_ARRAY( gsub_lookups_single_alternate, lookupCount ) ) + goto Fail; + + gsub_limit = gsub + gsub_length; + lookup_list = gsub + lookupListOffset; + p = lookup_list + 2; + limit = p + lookupCount * 2; + idx = 0; + while ( p < limit ) + { + FT_UInt lookupOffset = FT_NEXT_USHORT( p ); + + + if ( af_validate_lookup_table( lookup_list + lookupOffset, + gsub_limit ) ) + { + /* We store offsets relative to the start of the GSUB table. */ + gsub_lookups_single_alternate[idx] = lookupListOffset + lookupOffset; + } + + idx++; + } + + globals->gsub = gsub; + globals->gsub_lookups_single_alternate = gsub_lookups_single_alternate; + + return; + + Fail: + FT_FREE( gsub ); + FT_FREE( gsub_lookups_single_alternate ); + } + + + /*********************************/ + /******** ********/ + /******** GSUB access ********/ + /******** ********/ + /*********************************/ + + + static FT_UInt + af_coverage_format( FT_Byte* coverage ) + { + return FT_PEEK_USHORT( coverage ); + } + + + static FT_Byte* + af_coverage_start( FT_Byte* coverage ) + { + return coverage + 4; + } + + + static FT_Byte* + af_coverage_limit( FT_Byte* coverage ) + { + if ( af_coverage_format( coverage ) == 1 ) + { + FT_UInt glyphCount = FT_PEEK_USHORT( coverage + 2 ); + + + return af_coverage_start( coverage ) + glyphCount * 2; + } + else + { + FT_UInt rangeCount = FT_PEEK_USHORT( coverage + 2 ); + + + return af_coverage_start( coverage ) + rangeCount * 6; + } + } + + + typedef struct AF_CoverageIteratorRec_* AF_CoverageIterator; + + typedef struct AF_CoverageIteratorRec_ + { + FT_UInt format; + + FT_Byte* p; + FT_Byte* limit; + + FT_UInt16 glyph; + FT_UInt16 glyph_limit; + + } AF_CoverageIteratorRec; + + + static FT_Bool + af_coverage_iterator( AF_CoverageIterator iter, + FT_UInt16* glyph ) + { + if ( iter->p >= iter->limit ) + return FALSE; + + if ( iter->format == 1 ) + *glyph = FT_NEXT_USHORT( iter->p ); + else + { + if ( iter->glyph > iter->glyph_limit ) + { + iter->glyph = FT_NEXT_USHORT( iter->p ); + iter->glyph_limit = FT_NEXT_USHORT( iter->p ); + + iter->p += 2; + } + + *glyph = iter->glyph++; + } + + return TRUE; + } + + + static AF_CoverageIteratorRec + af_coverage_iterator_init( FT_Byte* coverage ) + { + AF_CoverageIteratorRec iterator; + + + iterator.format = af_coverage_format( coverage ); + iterator.p = af_coverage_start( coverage ); + iterator.limit = af_coverage_limit( coverage ); + iterator.glyph = 1; + iterator.glyph_limit = 0; + + return iterator; + } + + + /* + Because we merge all single and alternate substitution mappings into + one, large hash, we need the possibility to have multiple glyphs as + values. We utilize that we have 32bit integers but only 16bit glyph + indices, using the following scheme. + + If glyph G maps to a single substitute S, the entry in the map is + + G -> S + + If glyph G maps to multiple substitutes S1, S2, ..., Sn, we do + + G -> S1 + ((n - 1) << 16) + G + (1 << 16) -> S2 + G + (2 << 16) -> S3 + ... + G + ((n - 1) << 16) -> Sn + */ + static FT_Error + af_hash_insert( FT_UInt16 glyph, + FT_UInt16 substitute, + FT_Hash map, + FT_Memory memory ) + { + FT_Error error; + + size_t* value = ft_hash_num_lookup( glyph, map ); + + + if ( !value ) + { + error = ft_hash_num_insert( glyph, substitute, map, memory ); + if ( error ) + return error; + } + else + { + /* Get number of substitutes, increased by one... */ + FT_UInt mask = ( (FT_UInt)*value & 0xFFFF0000U ) + 0x10000U; + + + /* ... which becomes the new key mask. */ + error = ft_hash_num_insert( (FT_Int)( glyph | mask ), + substitute, + map, + memory ); + if ( error ) + return error; + + /* Update number of substitutes. */ + *value += 0x10000U; + } + + return FT_Err_Ok; + } + + + static FT_Error + af_map_single_subst1( FT_Hash map, + FT_Byte* table, + FT_Memory memory ) + { + FT_Error error; + + FT_Byte* coverage = table + FT_PEEK_USHORT( table + 2 ); + FT_UInt deltaGlyphID = FT_PEEK_USHORT( table + 4 ); + + AF_CoverageIteratorRec iterator = af_coverage_iterator_init( coverage ); + + FT_UInt16 glyph; + + + while ( af_coverage_iterator( &iterator, &glyph ) ) + { + /* `deltaGlyphID` requires modulo 65536 arithmetic. */ + FT_UInt16 subst = (FT_UInt16)( ( glyph + deltaGlyphID ) % 0x10000U ); + + + error = af_hash_insert( glyph, subst, map, memory ); + if ( error ) + return error; + } + + return FT_Err_Ok; + } + + + static FT_Error + af_map_single_subst2( FT_Hash map, + FT_Byte* table, + FT_Memory memory ) + { + FT_Error error; + + FT_Byte* coverage = table + FT_PEEK_USHORT( table + 2 ); + + AF_CoverageIteratorRec iterator = af_coverage_iterator_init( coverage ); + + FT_UInt16 glyph; + FT_Byte* p = table + 6; + + + while ( af_coverage_iterator( &iterator, &glyph ) ) + { + FT_UInt16 subst = FT_NEXT_USHORT( p ); + + + error = af_hash_insert( glyph, subst, map, memory ); + if ( error ) + return error; + } + + return FT_Err_Ok; + } + + + static FT_Error + af_map_alternate( FT_Hash map, + FT_Byte* table, + FT_Memory memory ) + { + FT_Error error; + + FT_Byte* coverage = table + FT_PEEK_USHORT( table + 2 ); + + AF_CoverageIteratorRec iterator = af_coverage_iterator_init( coverage ); + + FT_UInt16 glyph; + FT_Byte* p = table + 6; + + + while ( af_coverage_iterator( &iterator, &glyph ) ) + { + FT_Byte* alternate_set = table + FT_NEXT_USHORT( p ); + + FT_Byte* q = alternate_set; + FT_UInt glyphCount = FT_NEXT_USHORT( q ); + + FT_UInt i; + + + for ( i = 0; i < glyphCount; i++ ) + { + FT_UInt16 subst = FT_NEXT_USHORT( q ); + + + error = af_hash_insert( glyph, subst, map, memory ); + if ( error ) + return error; + } + } + + return FT_Err_Ok; + } + + + /* Map 'SingleSubst' and 'AlternateSubst' lookup tables. */ + FT_LOCAL_DEF( FT_Error ) + af_map_lookup( AF_FaceGlobals globals, + FT_Hash map, + FT_UInt32 lookup_offset ) + { + FT_Face face = globals->face; + FT_Memory memory = face->memory; + + FT_Byte* table = globals->gsub + lookup_offset; + + FT_UInt lookupType = FT_PEEK_USHORT( table ); + FT_UInt subtableCount = FT_PEEK_USHORT( table + 4 ); + + FT_Byte* p = table + 6; + FT_Byte* limit = p + subtableCount * 2; + + + while ( p < limit ) + { + FT_Error error; + + FT_Byte* subtable = table + FT_NEXT_USHORT( p ); + + + if ( lookupType == 7 ) + { + FT_Byte* q = subtable + 2; + + + lookupType = FT_NEXT_USHORT( q ); + subtable += FT_PEEK_ULONG( q ); + } + + if ( lookupType == 1 ) + { + FT_UInt format = FT_PEEK_USHORT( subtable ); + + + error = ( format == 1 ) + ? af_map_single_subst1( map, subtable, memory ) + : af_map_single_subst2( map, subtable, memory ); + } + else + error = af_map_alternate( map, subtable, memory ); + + if ( error ) + return error; + } + + return FT_Err_Ok; + } + + +#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* ANSI C doesn't like empty source files */ +typedef int afgsub_dummy_; + +#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* END */ diff --git a/vendor/freetype/src/autofit/afgsub.h b/vendor/freetype/src/autofit/afgsub.h new file mode 100644 index 00000000000..d57d61475bd --- /dev/null +++ b/vendor/freetype/src/autofit/afgsub.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * + * afgsub.h + * + * Auto-fitter routines to parse the GSUB table (header). + * + * Copyright (C) 2025 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. + * + */ + +#ifndef AFGSUB_H_ +#define AFGSUB_H_ + +#include "afglobal.h" + + +FT_BEGIN_HEADER + + FT_LOCAL( void ) + af_parse_gsub( AF_FaceGlobals globals ); + + FT_LOCAL( FT_Error ) + af_map_lookup( AF_FaceGlobals globals, + FT_Hash map, + FT_UInt32 lookup_offset ); + +FT_END_HEADER + +#endif /* AFGSUB_H_ */ + +/* END */ diff --git a/vendor/freetype/src/autofit/afhints.c b/vendor/freetype/src/autofit/afhints.c index 96ffe343aa4..f44f9b79e85 100644 --- a/vendor/freetype/src/autofit/afhints.c +++ b/vendor/freetype/src/autofit/afhints.c @@ -840,6 +840,10 @@ if ( hints->contours != hints->embedded.contours ) FT_FREE( hints->contours ); + if ( hints->contour_y_minima != hints->embedded.contour_y_minima ) + FT_FREE( hints->contour_y_minima ); + if ( hints->contour_y_maxima != hints->embedded.contour_y_maxima ) + FT_FREE( hints->contour_y_maxima ); hints->max_contours = 0; hints->num_contours = 0; @@ -896,19 +900,30 @@ { if ( !hints->contours ) { - hints->contours = hints->embedded.contours; + hints->contours = hints->embedded.contours; + hints->contour_y_minima = hints->embedded.contour_y_minima; + hints->contour_y_maxima = hints->embedded.contour_y_maxima; + hints->max_contours = AF_CONTOURS_EMBEDDED; } } else if ( new_max > old_max ) { if ( hints->contours == hints->embedded.contours ) - hints->contours = NULL; + { + hints->contours = NULL; + hints->contour_y_minima = NULL; + hints->contour_y_maxima = NULL; + } new_max = ( new_max + 3 ) & ~3; /* round up to a multiple of 4 */ if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) ) goto Exit; + if ( FT_RENEW_ARRAY( hints->contour_y_minima, old_max, new_max ) ) + goto Exit; + if ( FT_RENEW_ARRAY( hints->contour_y_maxima, old_max, new_max ) ) + goto Exit; hints->max_contours = new_max; } @@ -1324,7 +1339,7 @@ af_glyph_hints_align_edge_points( AF_GlyphHints hints, AF_Dimension dim ) { - AF_AxisHints axis = & hints->axis[dim]; + AF_AxisHints axis = &hints->axis[dim]; AF_Segment segments = axis->segments; AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments ); AF_Segment seg; diff --git a/vendor/freetype/src/autofit/afhints.h b/vendor/freetype/src/autofit/afhints.h index 76fe83006a5..c4971498cf8 100644 --- a/vendor/freetype/src/autofit/afhints.h +++ b/vendor/freetype/src/autofit/afhints.h @@ -222,6 +222,9 @@ FT_BEGIN_HEADER /* the distance to the next point is very small */ #define AF_FLAG_NEAR ( 1U << 5 ) + /* prevent the auto-hinter from adding such a point to a segment */ +#define AF_FLAG_IGNORE ( 1U << 6 ) + /* edge hint flags */ #define AF_EDGE_NORMAL 0 @@ -229,6 +232,7 @@ FT_BEGIN_HEADER #define AF_EDGE_SERIF ( 1U << 1 ) #define AF_EDGE_DONE ( 1U << 2 ) #define AF_EDGE_NEUTRAL ( 1U << 3 ) /* edge aligns to a neutral blue zone */ +#define AF_EDGE_NO_BLUE ( 1U << 4 ) /* do not align edge to blue zone */ typedef struct AF_PointRec_* AF_Point; @@ -303,6 +307,7 @@ FT_BEGIN_HEADER } AF_EdgeRec; + #define AF_SEGMENTS_EMBEDDED 18 /* number of embedded segments */ #define AF_EDGES_EMBEDDED 12 /* number of embedded edges */ @@ -346,9 +351,11 @@ FT_BEGIN_HEADER FT_Int num_points; /* number of used points */ AF_Point points; /* points array */ - FT_Int max_contours; /* number of allocated contours */ - FT_Int num_contours; /* number of used contours */ - AF_Point* contours; /* contours array */ + FT_Int max_contours; /* number of allocated contours */ + FT_Int num_contours; /* number of used contours */ + AF_Point* contours; /* contours array */ + FT_Pos* contour_y_minima; /* array with y maxima of contours */ + FT_Pos* contour_y_maxima; /* array with y minima of contours */ AF_AxisHintsRec axis[AF_DIMENSION_MAX]; @@ -357,11 +364,13 @@ FT_BEGIN_HEADER /* implementations */ AF_StyleMetrics metrics; - /* Two arrays to avoid allocation penalty. */ + /* Some arrays to avoid allocation penalty. */ /* The `embedded' structure must be the last element! */ struct { AF_Point contours[AF_CONTOURS_EMBEDDED]; + FT_Pos contour_y_minima[AF_CONTOURS_EMBEDDED]; + FT_Pos contour_y_maxima[AF_CONTOURS_EMBEDDED]; AF_PointRec points[AF_POINTS_EMBEDDED]; } embedded; diff --git a/vendor/freetype/src/autofit/aflatin.c b/vendor/freetype/src/autofit/aflatin.c index 87b56db61f5..7feebe8a8db 100644 --- a/vendor/freetype/src/autofit/aflatin.c +++ b/vendor/freetype/src/autofit/aflatin.c @@ -22,6 +22,7 @@ #include "afglobal.h" #include "aflatin.h" #include "aferrors.h" +#include "afadjust.h" /************************************************************************** @@ -81,12 +82,8 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif const char* p; @@ -97,9 +94,9 @@ p = script_class->standard_charstring; -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled ( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); + /* * We check a list of standard characters to catch features like * `c2sc' (small caps from caps) that don't contain lowercase letters @@ -140,7 +137,7 @@ break; } - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); if ( !glyph_index ) { @@ -149,7 +146,7 @@ goto Exit; } - FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n", + FT_TRACE5(( "standard character: U+%04lX (glyph index %lu)\n", ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); @@ -334,12 +331,8 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif /* we walk over the blue character strings as specified in the */ @@ -349,9 +342,8 @@ FT_TRACE5(( "============================\n" )); FT_TRACE5(( "\n" )); -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled ( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { @@ -367,7 +359,7 @@ FT_Bool have_flag = 0; - FT_TRACE5(( "blue zone %d", axis->blue_count )); + FT_TRACE5(( "blue zone %u", axis->blue_count )); if ( bs->properties ) { @@ -407,6 +399,20 @@ FT_TRACE5(( "long" )); } + if ( AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( bs ) ) + { + if ( have_flag ) + FT_TRACE5(( ", " )); + FT_TRACE5(( "capital bottom" )); + } + + if ( AF_LATIN_IS_SMALL_BOTTOM_BLUE( bs ) ) + { + if ( have_flag ) + FT_TRACE5(( ", " )); + FT_TRACE5(( "small bottom" )); + } + FT_TRACE5(( ")" )); } @@ -454,9 +460,9 @@ } if ( AF_LATIN_IS_TOP_BLUE( bs ) ) - best_y_extremum = FT_INT_MIN; + best_y_extremum = FT_LONG_MIN; else - best_y_extremum = FT_INT_MAX; + best_y_extremum = FT_LONG_MAX; /* iterate over all glyph elements of the character cluster */ /* and get the data of the `biggest' one */ @@ -487,7 +493,7 @@ if ( num_idx == 1 ) FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch )); else - FT_TRACE5(( " component %d of cluster starting with U+%04lX" + FT_TRACE5(( " component %u of cluster starting with U+%04lX" " contains no (usable) outlines\n", i, ch )); #endif continue; @@ -825,7 +831,7 @@ if ( num_idx == 1 ) FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y )); else - FT_TRACE5(( " component %d of cluster starting with U+%04lX:" + FT_TRACE5(( " component %u of cluster starting with U+%04lX:" " best_y = %5ld", i, ch, best_y )); #endif @@ -879,8 +885,8 @@ } /* end for loop */ - if ( !( best_y_extremum == FT_INT_MIN || - best_y_extremum == FT_INT_MAX ) ) + if ( !( best_y_extremum == FT_LONG_MIN || + best_y_extremum == FT_LONG_MAX ) ) { if ( best_round ) rounds[num_rounds++] = best_y_extremum; @@ -959,6 +965,10 @@ blue->flags |= AF_LATIN_BLUE_SUB_TOP; if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_NEUTRAL; + if ( AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( bs ) ) + blue->flags |= AF_LATIN_BLUE_BOTTOM; + if ( AF_LATIN_IS_SMALL_BOTTOM_BLUE( bs ) ) + blue->flags |= AF_LATIN_BLUE_BOTTOM_SMALL; /* * The following flag is used later to adjust the y and x scales @@ -973,7 +983,7 @@ } /* end for loop */ - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); if ( axis->blue_count ) { @@ -1070,23 +1080,20 @@ /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - void* shaper_buf; -#else FT_ULong shaper_buf_; void* shaper_buf = &shaper_buf_; -#endif /* in all supported charmaps, digits have character codes 0x30-0x39 */ const char digits[] = "0 1 2 3 4 5 6 7 8 9"; const char* p; + FT_UNUSED( face ); + p = digits; -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - shaper_buf = af_shaper_buf_create( face ); -#endif + if ( ft_hb_enabled ( metrics->root.globals ) ) + shaper_buf = af_shaper_buf_create( metrics->root.globals ); while ( *p ) { @@ -1122,7 +1129,7 @@ } } - af_shaper_buf_destroy( face, shaper_buf ); + af_shaper_buf_destroy( metrics->root.globals, shaper_buf ); metrics->root.digits_have_same_width = same_width; } @@ -1155,6 +1162,9 @@ af_latin_metrics_check_digits( metrics, face ); } + af_reverse_character_map_new( &metrics->root.reverse_charmap, + &metrics->root ); + Exit: face->charmap = oldmap; return error; @@ -1263,7 +1273,7 @@ max_height = FT_MAX( max_height, -Axis->blues[nn].descender ); } - dist = FT_MulFix( max_height, new_scale - scale ); + dist = FT_MulFix( max_height, new_scale - scale ); if ( -128 < dist && dist < 128 ) { @@ -1466,13 +1476,13 @@ AF_LatinBlue blue = &axis->blues[nn]; - FT_TRACE5(( " reference %d: %ld scaled to %.2f%s\n", + FT_TRACE5(( " reference %u: %ld scaled to %.2f%s\n", nn, blue->ref.org, (double)blue->ref.fit / 64, ( blue->flags & AF_LATIN_BLUE_ACTIVE ) ? "" : " (inactive)" )); - FT_TRACE5(( " overshoot %d: %ld scaled to %.2f%s\n", + FT_TRACE5(( " overshoot %u: %ld scaled to %.2f%s\n", nn, blue->shoot.org, (double)blue->shoot.fit / 64, @@ -1484,6 +1494,17 @@ } + FT_CALLBACK_DEF( void ) + af_latin_metrics_done( AF_StyleMetrics metrics_ ) + { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + + + af_reverse_character_map_done( metrics->root.reverse_charmap, + metrics->root.globals->face->memory ); + } + + /* Scale global values in both directions. */ FT_LOCAL_DEF( void ) @@ -1617,7 +1638,8 @@ FT_Pos prev_max_on_coord = max_on_coord; - if ( FT_ABS( last->out_dir ) == major_dir && + if ( !( point->flags & AF_FLAG_IGNORE ) && + FT_ABS( last->out_dir ) == major_dir && FT_ABS( point->out_dir ) == major_dir ) { /* we are already on an edge, try to locate its start */ @@ -1676,13 +1698,17 @@ max_on_coord = v; } - if ( point->out_dir != segment_dir || point == last ) + if ( point->flags & AF_FLAG_IGNORE || + point->out_dir != segment_dir || + point == last ) { /* check whether the new segment's start point is identical to */ /* the previous segment's end point; for example, this might */ /* happen for spikes */ - if ( !prev_segment || segment->first != prev_segment->last ) + if ( point->flags & AF_FLAG_IGNORE || + !prev_segment || + segment->first != prev_segment->last ) { /* points are different: we are just leaving an edge, thus */ /* record a new segment */ @@ -1842,7 +1868,8 @@ /* if we are not on an edge, check whether the major direction */ /* coincides with the current point's `out' direction, or */ /* whether we have a single-point contour */ - if ( !on_edge && + if ( !( point->flags & AF_FLAG_IGNORE ) && + !on_edge && ( FT_ABS( point->out_dir ) == major_dir || point == point->prev ) ) { @@ -2521,6 +2548,9 @@ FT_Pos best_dist; /* initial threshold */ + if ( edge->flags & AF_EDGE_NO_BLUE ) + continue; + /* compute the initial threshold as a fraction of the EM size */ /* (the value 40 is heuristic) */ best_dist = FT_MulFix( metrics->units_per_em / 40, scale ); @@ -2737,247 +2767,1433 @@ } - /* Compute the snapped width of a given stem, ignoring very thin ones. */ - /* There is a lot of voodoo in this function; changing the hard-coded */ - /* parameters influence the whole hinting process. */ +#undef FT_COMPONENT +#define FT_COMPONENT afadjust - static FT_Pos - af_latin_compute_stem_width( AF_GlyphHints hints, - AF_Dimension dim, - FT_Pos width, - FT_Pos base_delta, - FT_UInt base_flags, - FT_UInt stem_flags ) + + static void + af_move_contour_vertically( AF_Point contour, + FT_Int movement ) { - AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics; - AF_LatinAxis axis = &metrics->axis[dim]; - FT_Pos dist = width; - FT_Int sign = 0; - FT_Int vertical = ( dim == AF_DIMENSION_VERT ); + AF_Point point = contour; + AF_Point first_point = point; - if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) || - axis->extra_light ) - return width; + if ( point ) + { + do + { + point->y += movement; + point = point->next; - if ( dist < 0 ) + } while ( point != first_point ); + } + } + + + /* Move all contours higher than `limit` by `delta`. */ + static void + af_move_contours_up( AF_GlyphHints hints, + FT_Pos limit, + FT_Pos delta ) + { + FT_Int contour; + + + for ( contour = 0; contour < hints->num_contours; contour++ ) { - dist = -width; - sign = 1; + FT_Pos min_y = hints->contour_y_minima[contour]; + FT_Pos max_y = hints->contour_y_maxima[contour]; + + + if ( min_y < max_y && + min_y > limit ) + af_move_contour_vertically( hints->contours[contour], + delta ); } + } - if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) || - ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ) + + static void + af_move_contours_down( AF_GlyphHints hints, + FT_Pos limit, + FT_Pos delta ) + { + FT_Int contour; + + + for ( contour = 0; contour < hints->num_contours; contour++ ) { - /* smooth hinting process: very lightly quantize the stem width */ + FT_Pos min_y = hints->contour_y_minima[contour]; + FT_Pos max_y = hints->contour_y_maxima[contour]; - /* leave the widths of serifs alone */ - if ( ( stem_flags & AF_EDGE_SERIF ) && - vertical && - ( dist < 3 * 64 ) ) - goto Done_Width; - else if ( base_flags & AF_EDGE_ROUND ) - { - if ( dist < 80 ) - dist = 64; - } - else if ( dist < 56 ) - dist = 56; + if ( min_y < max_y && + max_y < limit ) + af_move_contour_vertically( hints->contours[contour], + -delta ); + } + } - if ( axis->width_count > 0 ) - { - FT_Pos delta; + /* Compute vertical extrema of all contours and store them in the */ + /* `contour_y_minima` and `contour_y_maxima` arrays of `hints`. */ + static void + af_compute_vertical_extrema( AF_GlyphHints hints ) + { + FT_Int contour; - /* compare to standard width */ - delta = dist - axis->widths[0].cur; - if ( delta < 0 ) - delta = -delta; + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos min_y = FT_LONG_MAX; + FT_Pos max_y = FT_LONG_MIN; - if ( delta < 40 ) - { - dist = axis->widths[0].cur; - if ( dist < 48 ) - dist = 48; + AF_Point first_point = hints->contours[contour]; + AF_Point point = first_point; - goto Done_Width; - } - if ( dist < 3 * 64 ) - { - delta = dist & 63; - dist &= -64; + if ( !first_point || first_point->next->next == first_point ) + goto End_loop; - if ( delta < 10 ) - dist += delta; + do + { + if ( point->y < min_y ) + min_y = point->y; + if ( point->y > max_y ) + max_y = point->y; - else if ( delta < 32 ) - dist += 10; + point = point->next; - else if ( delta < 54 ) - dist += 54; + } while ( point != first_point ); - else - dist += delta; - } - else - { - /* A stem's end position depends on two values: the start */ - /* position and the stem length. The former gets usually */ - /* rounded to the grid, while the latter gets rounded also if it */ - /* exceeds a certain length (see below in this function). This */ - /* `double rounding' can lead to a great difference to the */ - /* original, unhinted position; this normally doesn't matter for */ - /* large PPEM values, but for small sizes it can easily make */ - /* outlines collide. For this reason, we adjust the stem length */ - /* by a small amount depending on the PPEM value in case the */ - /* former and latter rounding both point into the same */ - /* direction. */ + End_loop: + hints->contour_y_minima[contour] = min_y; + hints->contour_y_maxima[contour] = max_y; + } + } - FT_Pos bdelta = 0; + static FT_Int + af_find_highest_contour( AF_GlyphHints hints ) + { + FT_Int highest_contour = 0; + FT_Pos highest_min_y = FT_LONG_MAX; + FT_Pos highest_max_y = FT_LONG_MIN; - if ( ( ( width > 0 ) && ( base_delta > 0 ) ) || - ( ( width < 0 ) && ( base_delta < 0 ) ) ) - { - FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem; + FT_Int contour; - if ( ppem < 10 ) - bdelta = base_delta; - else if ( ppem < 30 ) - bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20; + /* At this point we have one 'lower' (usually the base glyph) */ + /* and one 'upper' object (usually the diacritic glyph). If */ + /* there are more contours, they must be enclosed within either */ + /* 'lower' or 'upper'. To find this enclosing 'upper' contour */ + /* it is thus sufficient to search for the contour with the */ + /* highest y maximum value. */ + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos current_min_y = hints->contour_y_minima[contour]; + FT_Pos current_max_y = hints->contour_y_maxima[contour]; - if ( bdelta < 0 ) - bdelta = -bdelta; - } - dist = ( dist - bdelta + 32 ) & ~63; - } + /* If we have two contours with the same maximum value, take */ + /* the one that has a smaller height. */ + if ( current_max_y > highest_max_y || + ( current_max_y == highest_max_y && + current_min_y > highest_min_y ) ) + { + highest_min_y = current_min_y; + highest_max_y = current_max_y; + highest_contour = contour; } } - else - { - /* strong hinting process: snap the stem width to integer pixels */ - FT_Pos org_dist = dist; + return highest_contour; + } - dist = af_latin_snap_width( axis->widths, axis->width_count, dist ); + static FT_Int + af_find_second_highest_contour( AF_GlyphHints hints ) + { + FT_Int highest_contour; + FT_Pos highest_min_y; - if ( vertical ) - { - /* in the case of vertical hinting, always round */ - /* the stem heights to integer pixels */ + FT_Int second_highest_contour = 0; + FT_Pos second_highest_max_y = FT_LONG_MIN; - if ( dist >= 64 ) - dist = ( dist + 16 ) & ~63; - else - dist = 64; - } - else - { - if ( AF_LATIN_HINTS_DO_MONO( hints ) ) - { - /* monochrome horizontal hinting: snap widths to integer pixels */ - /* with a different threshold */ + FT_Int contour; - if ( dist < 64 ) - dist = 64; - else - dist = ( dist + 32 ) & ~63; - } - else - { - /* for horizontal anti-aliased hinting, we adopt a more subtle */ - /* approach: we strengthen small stems, round stems whose size */ - /* is between 1 and 2 pixels to an integer, otherwise nothing */ - if ( dist < 48 ) - dist = ( dist + 64 ) >> 1; + if ( hints->num_contours < 3 ) + return 0; - else if ( dist < 128 ) - { - /* We only round to an integer width if the corresponding */ - /* distortion is less than 1/4 pixel. Otherwise this */ - /* makes everything worse since the diagonals, which are */ - /* not hinted, appear a lot bolder or thinner than the */ - /* vertical stems. */ + highest_contour = af_find_highest_contour( hints ); + highest_min_y = hints->contour_y_minima[highest_contour]; - FT_Pos delta; + /* Search the contour with the largest vertical maximum that has a */ + /* vertical minimum lower than the vertical minimum of the topmost */ + /* contour. */ + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos current_min_y; + FT_Pos current_max_y; - dist = ( dist + 22 ) & ~63; - delta = dist - org_dist; - if ( delta < 0 ) - delta = -delta; + if ( contour == highest_contour ) + continue; - if ( delta >= 16 ) - { - dist = org_dist; - if ( dist < 48 ) - dist = ( dist + 64 ) >> 1; - } - } - else - /* round otherwise to prevent color fringes in LCD mode */ - dist = ( dist + 32 ) & ~63; - } + current_min_y = hints->contour_y_minima[contour]; + current_max_y = hints->contour_y_maxima[contour]; + + if ( current_max_y > second_highest_max_y && + current_min_y < highest_min_y ) + { + second_highest_max_y = current_max_y; + second_highest_contour = contour; } } - Done_Width: - if ( sign ) - dist = -dist; - - return dist; + return second_highest_contour; } - /* Align one stem edge relative to the previous stem edge. */ - - static void - af_latin_align_linked_edge( AF_GlyphHints hints, - AF_Dimension dim, - AF_Edge base_edge, - AF_Edge stem_edge ) + static FT_Int + af_find_lowest_contour( AF_GlyphHints hints ) { - FT_Pos dist, base_delta; - FT_Pos fitted_width; + FT_Int lowest_contour = 0; + FT_Pos lowest_min_y = FT_LONG_MAX; + FT_Pos lowest_max_y = FT_LONG_MIN; + FT_Int contour; - dist = stem_edge->opos - base_edge->opos; - base_delta = base_edge->pos - base_edge->opos; - fitted_width = af_latin_compute_stem_width( hints, dim, - dist, base_delta, - base_edge->flags, - stem_edge->flags ); + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos current_min_y = hints->contour_y_minima[contour]; + FT_Pos current_max_y = hints->contour_y_maxima[contour]; - stem_edge->pos = base_edge->pos + fitted_width; + if ( current_min_y < lowest_min_y || + ( current_min_y == lowest_min_y && + current_max_y < lowest_max_y ) ) + { + lowest_min_y = current_min_y; + lowest_max_y = current_max_y; + lowest_contour = contour; + } + } - FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f," - " dist was %.2f, now %.2f\n", - stem_edge - hints->axis[dim].edges, - (double)stem_edge->opos / 64, (double)stem_edge->pos / 64, - (double)dist / 64, (double)fitted_width / 64 )); + return lowest_contour; } - /* Shift the coordinates of the `serif' edge by the same amount */ - /* as the corresponding `base' edge has been moved already. */ - - static void - af_latin_align_serif_edge( AF_GlyphHints hints, - AF_Edge base, - AF_Edge serif ) + static FT_Int + af_find_second_lowest_contour( AF_GlyphHints hints ) { - FT_UNUSED( hints ); + FT_Int lowest_contour; + FT_Pos lowest_max_y; - serif->pos = base->pos + ( serif->opos - base->opos ); + FT_Int second_lowest_contour = 0; + FT_Pos second_lowest_min_y = FT_LONG_MAX; + + FT_Int contour; + + + if ( hints->num_contours < 3 ) + return 0; + + lowest_contour = af_find_lowest_contour( hints ); + lowest_max_y = hints->contour_y_maxima[lowest_contour]; + + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos current_min_y; + FT_Pos current_max_y; + + + if ( contour == lowest_contour ) + continue; + + current_min_y = hints->contour_y_minima[contour]; + current_max_y = hints->contour_y_maxima[contour]; + + if ( current_min_y < second_lowest_min_y && + current_max_y > lowest_max_y ) + { + second_lowest_min_y = current_min_y; + second_lowest_contour = contour; + } + } + + return second_lowest_contour; + } + + + /* While aligning edges to blue zones, make the auto-hinter */ + /* ignore the ones that are higher than `pos`. */ + static void + af_prevent_top_blue_alignment( AF_GlyphHints hints, + FT_Pos pos ) + { + AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT]; + + AF_Edge edges = axis->edges; + AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); + AF_Edge edge; + + + for ( edge = edges; edge < edge_limit; edge++ ) + if ( edge->pos > pos ) + edge->flags |= AF_EDGE_NO_BLUE; + } + + + static void + af_prevent_bottom_blue_alignment( AF_GlyphHints hints, + FT_Pos pos ) + { + AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT]; + + AF_Edge edges = axis->edges; + AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); + AF_Edge edge; + + + for ( edge = edges; edge < edge_limit; edge++ ) + if ( edge->pos < pos ) + edge->flags |= AF_EDGE_NO_BLUE; + } + + + static void + af_latin_get_base_glyph_blues( AF_GlyphHints hints, + FT_Bool is_capital, + AF_LatinBlue* top, + AF_LatinBlue* bottom ) + { + AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics; + AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT]; + + FT_UInt top_flag; + FT_UInt bottom_flag; + + FT_UInt i; + + + top_flag = is_capital ? AF_LATIN_BLUE_TOP + : AF_LATIN_BLUE_ADJUSTMENT; + top_flag |= AF_LATIN_BLUE_ACTIVE; + + for ( i = 0; i < axis->blue_count; i++ ) + if ( ( axis->blues[i].flags & top_flag ) == top_flag ) + break; + if ( i < axis->blue_count ) + *top = &axis->blues[i]; + + bottom_flag = is_capital ? AF_LATIN_BLUE_BOTTOM + : AF_LATIN_BLUE_BOTTOM_SMALL; + bottom_flag |= AF_LATIN_BLUE_ACTIVE; + + for ( i = 0; i < axis->blue_count; i++ ) + if ( ( axis->blues[i].flags & bottom_flag ) == bottom_flag ) + break; + if ( i < axis->blue_count ) + *bottom = &axis->blues[i]; + } + + + /* Make the auto-hinter ignore top blue zones while aligning edges. */ + /* This affects everything that is higher than a vertical position */ + /* based on the lowercase or uppercase top and bottom blue zones */ + /* (depending on `is_capital`). */ + static void + af_latin_ignore_top( AF_GlyphHints hints, + AF_LatinBlue top_blue, + AF_LatinBlue bottom_blue ) + { + FT_Pos base_glyph_height; + FT_Pos limit; + + + /* Ignore blue zones that are higher than a heuristic threshold */ + /* (value 7 corresponds to approx. 14%, which should be sufficient */ + /* to exceed the height of uppercase serifs. We also add a quarter */ + /* of a pixel as a safety measure. */ + base_glyph_height = top_blue->shoot.cur - bottom_blue->shoot.cur; + limit = top_blue->shoot.cur + base_glyph_height / 7 + 16; + + af_prevent_top_blue_alignment( hints, limit ); + } + + + static void + af_latin_ignore_bottom( AF_GlyphHints hints, + AF_LatinBlue top_blue, + AF_LatinBlue bottom_blue ) + { + FT_Pos base_glyph_height; + FT_Pos limit; + + + base_glyph_height = top_blue->shoot.cur - bottom_blue->shoot.cur; + limit = bottom_blue->shoot.cur - base_glyph_height / 7 - 16; + + af_prevent_bottom_blue_alignment( hints, limit ); + } + + + static void + af_touch_contour( AF_GlyphHints hints, + FT_Int contour ) + { + AF_Point first_point = hints->contours[contour]; + AF_Point p = first_point; + + + do + { + p = p->next; + + p->flags |= AF_FLAG_IGNORE; + if ( !( p->flags & AF_FLAG_CONTROL ) ) + p->flags |= AF_FLAG_TOUCH_Y; + + } while ( p != first_point ); + } + + + static void + af_touch_top_contours( AF_GlyphHints hints, + FT_Int limit_contour ) + { + FT_Pos limit = hints->contour_y_minima[limit_contour]; + + FT_Int contour; + + + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos min_y = hints->contour_y_minima[contour]; + FT_Pos max_y = hints->contour_y_maxima[contour]; + + + if ( min_y < max_y && + min_y >= limit ) + af_touch_contour( hints, contour ); + } + } + + + static void + af_touch_bottom_contours( AF_GlyphHints hints, + FT_Int limit_contour ) + { + FT_Pos limit = hints->contour_y_minima[limit_contour]; + + FT_Int contour; + + + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos min_y = hints->contour_y_minima[contour]; + FT_Pos max_y = hints->contour_y_maxima[contour]; + + + if ( min_y < max_y && + max_y <= limit ) + af_touch_contour( hints, contour ); + } + } + + + /* Stretch tilde vertically, if necessary, and return the height */ + /* difference between the original and the stretched outline. */ + static FT_Pos + af_latin_stretch_top_tilde( AF_GlyphHints hints, + FT_Int tilde_contour ) + { + AF_Point p = hints->contours[tilde_contour]; + AF_Point first_point = p; + + FT_Pos min_y = hints->contour_y_minima[tilde_contour]; + FT_Pos max_y = hints->contour_y_maxima[tilde_contour]; + + FT_Pos min_measurement = FT_LONG_MAX; + FT_Bool measurement_taken = FALSE; + + FT_Pos height; + FT_Pos extremum_threshold; + FT_Pos target_height; + + + if ( min_y == max_y ) + return 0; + + FT_TRACE4(( "af_latin_stretch_top_tilde: min y: %ld, max y: %ld\n", + min_y, max_y )); + + height = SUB_LONG( max_y, min_y ); + extremum_threshold = height / 8; /* Value 8 is heuristic. */ + + /* Find points that are local vertical round extrema, and which */ + /* do not coincide with the vertical extreme values (i.e., we */ + /* search for the 'other' wiggles in the tilde), then measure the */ + /* distance to the vertical extreme values. Try to find the one */ + /* with the smallest distance. */ + /* */ + /* The algorithm only works for tilde shapes that don't deviate */ + /* from the standard shape too much. In particular, the wiggles */ + /* must be round extrema. */ + do + { + p = p->next; + + if ( !( p->flags & AF_FLAG_CONTROL ) && + p->prev->y == p->y && p->next->y == p->y && + p->y != min_y && p->y != max_y && + p->prev->flags & AF_FLAG_CONTROL && + p->next->flags & AF_FLAG_CONTROL ) + { + /* This point could be a candidate. Find the next and previous */ + /* on-curve points, and make sure they are both either above or */ + /* below the point, then make the measurement. */ + AF_Point prev_on = p->prev; + AF_Point next_on = p->next; + + FT_Pos measurement; + + + while ( prev_on->flags & AF_FLAG_CONTROL ) + prev_on = prev_on->prev; + while ( next_on->flags & AF_FLAG_CONTROL ) + next_on = next_on->next; + + if ( next_on->y > p->y && prev_on->y > p->y ) + measurement = p->y - min_y; + else if ( next_on->y < p->y && prev_on->y < p->y ) + measurement = max_y - p->y; + else + continue; + + /* Ignore hits that are too near to a vertical extremum. */ + if ( measurement < extremum_threshold ) + continue; + + if ( !measurement_taken || measurement < min_measurement ) + { + measurement_taken = TRUE; + min_measurement = measurement; + } + } + + } while ( p != first_point ); + + if ( !measurement_taken ) + min_measurement = 0; + + FT_TRACE4(( "af_latin_stretch_top_tilde: min measurement %ld\n", + min_measurement )); + + /* To preserve the stretched shape we prevent that the tilde */ + /* gets auto-hinted; we do this for all contours equal or */ + /* above the vertical minimum of `tilde_contour`. */ + af_touch_top_contours( hints, tilde_contour ); + + /* XXX This is an important element of the algorithm; */ + /* we need a description. */ + target_height = min_measurement + 64; + if ( height >= target_height ) + return 0; + + /* Do the scaling. */ + p = first_point; + do + { + p = p->next; + /* We adjust the height of the diacritic only, which means */ + /* we are never dealing with large numbers and can thus avoid */ + /* `FT_MulFix`. */ + p->y = ( ( p->y - min_y ) * target_height / height ) + min_y; + + } while ( p != first_point ); + + return target_height - height; + } + + + static FT_Pos + af_latin_stretch_bottom_tilde( AF_GlyphHints hints, + FT_Int tilde_contour ) + { + AF_Point p = hints->contours[tilde_contour]; + AF_Point first_point = p; + + FT_Pos min_y = hints->contour_y_minima[tilde_contour]; + FT_Pos max_y = hints->contour_y_maxima[tilde_contour]; + + FT_Pos min_measurement = FT_LONG_MAX; + FT_Bool measurement_taken = FALSE; + + FT_Pos height; + FT_Pos extremum_threshold; + FT_Pos target_height; + + + if ( min_y == max_y ) + return 0; + + FT_TRACE4(( "af_latin_stretch_bottom_tilde: min y: %ld, max y: %ld\n", + min_y, max_y )); + + height = SUB_LONG( max_y, min_y ); + extremum_threshold = height / 8; + + do + { + p = p->next; + + if ( !( p->flags & AF_FLAG_CONTROL ) && + p->prev->y == p->y && p->next->y == p->y && + p->y != min_y && p->y != max_y && + p->prev->flags & AF_FLAG_CONTROL && + p->next->flags & AF_FLAG_CONTROL ) + { + AF_Point prev_on = p->prev; + AF_Point next_on = p->next; + + FT_Pos measurement; + + + while ( prev_on->flags & AF_FLAG_CONTROL ) + prev_on = prev_on->prev; + while ( next_on->flags & AF_FLAG_CONTROL ) + next_on = next_on->next; + + if ( next_on->y > p->y && prev_on->y > p->y ) + measurement = p->y - min_y; + else if ( next_on->y < p->y && prev_on->y < p->y ) + measurement = max_y - p->y; + else + continue; + + if ( measurement < extremum_threshold ) + continue; + + if ( !measurement_taken || measurement < min_measurement ) + { + measurement_taken = TRUE; + min_measurement = measurement; + } + } + + } while ( p != first_point ); + + if ( !measurement_taken ) + min_measurement = 0; + + FT_TRACE4(( "af_latin_stretch_bottom_tilde: min measurement %ld\n", + min_measurement )); + + af_touch_bottom_contours( hints, tilde_contour ); + + target_height = min_measurement + 64; + if ( height >= target_height ) + return 0; + + p = first_point; + do + { + p = p->next; + p->y = ( ( p->y - max_y ) * target_height / height ) + max_y; + + } while ( p != first_point ); + + return target_height - height; + } + + + /* + As part of `af_latin_stretch_top_tilde`, normally all points in the + tilde are marked as touched, so the existing grid fitting will leave the + tilde misaligned with the grid. + + This function moves the tilde contour down to be grid-fitted. We assume + that if moving the tilde down would cause it to touch or overlap another + countour, the vertical adjustment step will fix it. + + Because the vertical adjustment step comes after all other grid-fitting + steps, the top edge of the contour under the tilde is usually aligned + with a horizontal grid line. The vertical gap enforced by the vertical + adjustment is exactly one pixel, so if the top edge of the contour below + the tilde is on a grid line, the resulting tilde contour will also be + grid-aligned. + + But in cases where the gap is already big enough so that the vertical + adjustment does nothing, this function ensures that even without the + intervention of the vertical adjustment step, the tilde will be + grid-aligned. + + Return the vertical alignment amount. + */ + static FT_Pos + af_latin_align_top_tilde( AF_GlyphHints hints, + FT_Int tilde_contour ) + { + AF_Point p = hints->contours[tilde_contour]; + AF_Point first_point = p; + + FT_Pos min_y = p->y; + FT_Pos max_y = p->y; + + FT_Pos min_y_rounded; + FT_Pos delta; + FT_Pos height; + + + /* Find vertical extrema of the (now stretched) tilde contour. */ + do + { + p = p->next; + if ( p->y < min_y ) + min_y = p->y; + if ( p->y > max_y ) + max_y = p->y; + + } while ( p != first_point ); + + /* Align bottom of the tilde to the grid. */ + min_y_rounded = FT_PIX_ROUND( min_y ); + delta = min_y_rounded - min_y; + height = max_y - min_y; + + /* If the tilde is less than 3 pixels tall, snap the center of it */ + /* to the grid instead of the bottom to improve readability. */ + if ( height < 64 * 3 ) + delta += ( FT_PIX_ROUND( height ) - height ) / 2; + + af_move_contour_vertically( first_point, delta ); + + return delta; + } + + + static FT_Pos + af_latin_align_bottom_tilde( AF_GlyphHints hints, + FT_Int tilde_contour ) + { + AF_Point p = hints->contours[tilde_contour]; + AF_Point first_point = p; + + FT_Pos min_y = p->y; + FT_Pos max_y = p->y; + + FT_Pos max_y_rounded; + FT_Pos delta; + FT_Pos height; + + + do + { + p = p->next; + if ( p->y < min_y ) + min_y = p->y; + if ( p->y > max_y ) + max_y = p->y; + + } while ( p != first_point ); + + max_y_rounded = FT_PIX_ROUND( max_y ); + delta = max_y_rounded - max_y; + height = max_y - min_y; + + if ( height < 64 * 3 ) + delta -= ( FT_PIX_ROUND( height ) - height ) / 2; + + af_move_contour_vertically( first_point, delta ); + + return delta; + } + + + /* Return 1 if the given contour overlaps horizontally with the bounding */ + /* box of all other contours combined. This is a helper for function */ + /* `af_glyph_hints_apply_vertical_separation_adjustments`. */ + static FT_Bool + af_check_contour_horizontal_overlap( AF_GlyphHints hints, + FT_Int contour_index ) + { + FT_Pos contour_max_x = FT_LONG_MIN; + FT_Pos contour_min_x = FT_LONG_MAX; + FT_Pos others_max_x = FT_LONG_MIN; + FT_Pos others_min_x = FT_LONG_MAX; + + FT_Int contour; + + FT_Bool horizontal_overlap; + + + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + AF_Point first_point = hints->contours[contour]; + AF_Point p = first_point; + + + /* Ignore dimensionless contours (i.e., contours with only one or */ + /* two points). */ + if ( first_point->next->next == first_point ) + continue; + + do + { + p = p->next; + + if ( contour == contour_index ) + { + if ( p->x < contour_min_x ) + contour_min_x = p->x; + if ( p->x > contour_max_x ) + contour_max_x = p->x; + } + else + { + if ( p->x < others_min_x ) + others_min_x = p->x; + if ( p->x > others_max_x ) + others_max_x = p->x; + } + } while ( p != first_point ); + } + + horizontal_overlap = + ( others_min_x <= contour_max_x && contour_max_x <= others_max_x ) || + ( others_min_x <= contour_min_x && contour_min_x <= others_max_x ) || + ( contour_max_x >= others_max_x && contour_min_x <= others_min_x ); + + return horizontal_overlap; + } + + + static void + af_glyph_hints_apply_vertical_separation_adjustments( + AF_GlyphHints hints, + AF_Dimension dim, + FT_UInt glyph_index, + FT_Pos accent_height_limit, + FT_Hash reverse_charmap ) + { + FT_Bool adjust_top = FALSE; + FT_Bool adjust_below_top = FALSE; + + FT_Bool adjust_bottom = FALSE; + FT_Bool adjust_above_bottom = FALSE; + + size_t* val; + FT_UInt32 adj_type = AF_ADJUST_NONE; + + + FT_TRACE4(( "Entering" + " af_glyph_hints_apply_vertical_separation_adjustments\n" )); + + if ( dim != AF_DIMENSION_VERT ) + return; + + val = ft_hash_num_lookup( (FT_Int)glyph_index, reverse_charmap ); + if ( val ) + { + FT_UInt codepoint = *val; + + + adj_type = af_adjustment_database_lookup( codepoint ); + + if ( adj_type ) + { + adjust_top = !!( adj_type & AF_ADJUST_UP ); + adjust_below_top = !!( adj_type & AF_ADJUST_UP2 ); + + adjust_bottom = !!( adj_type & AF_ADJUST_DOWN ); + adjust_above_bottom = !!( adj_type & AF_ADJUST_DOWN2 ); + } + } + + if ( ( ( adjust_top || adjust_bottom ) && + hints->num_contours >= 2 ) || + ( ( adjust_below_top || adjust_above_bottom ) && + hints->num_contours >= 3 ) ) + { + /* Recompute vertical extrema, this time acting on already */ + /* auto-hinted outlines. */ + af_compute_vertical_extrema( hints ); + } + + if ( ( adjust_top && hints->num_contours >= 2 ) || + ( adjust_below_top && hints->num_contours >= 3 ) ) + { + FT_Int high_contour; + FT_Pos high_min_y; + FT_Pos high_max_y; + FT_Pos high_height; + + FT_Int tilde_contour; + FT_Pos tilde_min_y; + FT_Pos tilde_max_y; + FT_Pos tilde_height; + + FT_Int contour; + FT_Bool horizontal_overlap; + + FT_Pos min_distance = 64; + FT_Pos adjustment_amount; + FT_Pos calculated_amount; + FT_Pos centering_adjustment = 0; + FT_Pos pos; + + FT_Bool is_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP ); + FT_Bool is_below_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP2 ); + + + FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n" + " Applying vertical adjustment: %s\n", + adjust_top ? "AF_ADJUST_TOP" : "AF_ADJUST_TOP2" )); + + high_contour = adjust_below_top + ? af_find_second_highest_contour( hints ) + : af_find_highest_contour( hints ); + + /* Check for a horizontal overlap between the high contour and the */ + /* rest. If there is no overlap, do not adjust. */ + horizontal_overlap = + af_check_contour_horizontal_overlap( hints, high_contour ); + if ( !horizontal_overlap ) + { + FT_TRACE4(( " High contour does not horizontally overlap" + " with other contours.\n" + " Skipping adjustment.\n" )); + return; + } + + high_min_y = hints->contour_y_minima[high_contour]; + high_max_y = hints->contour_y_maxima[high_contour]; + high_height = high_max_y - high_min_y; + + if ( high_height > accent_height_limit ) + { + FT_TRACE4(( " High contour height (%.2f) exceeds accent height" + " limit (%.2f).\n" + " Skipping adjustment.\n", + (double)high_height / 64, + (double)accent_height_limit / 64 )); + return; + } + + /* If the difference between the vertical minimum of the high */ + /* contour and the vertical maximum of another contour is less */ + /* than a pixel, shift up the high contour to make the distance */ + /* one pixel. */ + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos min_y; + FT_Pos max_y; + FT_Pos distance; + + + if ( contour == high_contour ) + continue; + + min_y = hints->contour_y_minima[contour]; + max_y = hints->contour_y_maxima[contour]; + + /* We also check that the y minimum of the 'other' contour */ + /* is below the high contour to avoid potential false hits */ + /* with contours enclosed in the high one. */ + distance = high_min_y - max_y; + if ( distance < 64 && + distance < min_distance && + min_y < high_min_y ) + min_distance = distance; + } + + adjustment_amount = 64 - min_distance; + + if ( is_top_tilde || is_below_top_tilde ) + { + tilde_contour = adjust_top + ? high_contour + : ( is_below_top_tilde + ? high_contour + : af_find_highest_contour( hints ) ); + + tilde_min_y = hints->contour_y_minima[tilde_contour]; + tilde_max_y = hints->contour_y_maxima[tilde_contour]; + tilde_height = tilde_max_y - tilde_min_y; + + /* The vertical separation adjustment potentially undoes a */ + /* tilde center alignment. If it would grid-align a tilde */ + /* less than 3 pixels in height, shift additionally to */ + /* re-center the tilde. */ + + pos = high_min_y + adjustment_amount; + if ( adjust_below_top && is_top_tilde ) + pos += high_height; + + if ( pos % 64 == 0 && tilde_height < 3 * 64 ) + { + centering_adjustment = ( FT_PIX_ROUND( tilde_height ) - + tilde_height ) / 2; + + FT_TRACE4(( " Additional tilde centering adjustment: %ld\n", + centering_adjustment )); + } + } + + if ( ( adjust_top && is_top_tilde ) || + ( adjust_below_top && is_below_top_tilde ) ) + calculated_amount = adjustment_amount + centering_adjustment; + else + calculated_amount = adjustment_amount; + + /* allow a delta of 2/64px to handle rounding differences */ + FT_TRACE4(( " Calculated adjustment amount: %ld%s\n", + calculated_amount, + ( calculated_amount < -2 || + ( adjustment_amount > 66 && calculated_amount > 66 ) ) + ? " (out of range [-2;66], not adjusting)" : "" )); + + if ( calculated_amount != 0 && + calculated_amount >= -2 && + ( calculated_amount <= 66 || adjustment_amount <= 66 ) ) + { + /* Value 8 is heuristic. */ + FT_Pos height_delta = high_height / 8; + FT_Pos min_y_limit = high_min_y - height_delta; + + + FT_TRACE4(( " Pushing high contour %ld units up\n", + calculated_amount )); + + /* While we use only a single contour (the 'high' one) for */ + /* computing `adjustment_amount`, we apply it to all contours */ + /* that are (approximately) in the same vertical range or */ + /* higher. This covers, for example, the inner contour of */ + /* the Czech ring accent or the second acute accent in the */ + /* Hungarian double acute accent. */ + af_move_contours_up( hints, min_y_limit, adjustment_amount ); + + if ( adjust_below_top && is_top_tilde ) + { + FT_TRACE4(( " Pushing top tilde %ld units up\n", + centering_adjustment )); + + af_move_contours_up( hints, + min_y_limit + high_height, + centering_adjustment ); + } + } + } + + if ( ( adjust_bottom && hints->num_contours >= 2 ) || + ( adjust_above_bottom && hints->num_contours >= 3 ) ) + { + FT_Int low_contour; + FT_Pos low_min_y; + FT_Pos low_max_y; + FT_Pos low_height; + + FT_Int tilde_contour; + FT_Pos tilde_min_y; + FT_Pos tilde_max_y; + FT_Pos tilde_height; + + FT_Int contour; + FT_Bool horizontal_overlap; + + FT_Pos min_distance = 64; + FT_Pos adjustment_amount; + FT_Pos calculated_amount; + FT_Pos centering_adjustment = 0; + FT_Pos pos; + + FT_Bool is_bottom_tilde = + !!( adj_type & AF_ADJUST_TILDE_BOTTOM ); + FT_Bool is_above_bottom_tilde = + !!( adj_type & AF_ADJUST_TILDE_BOTTOM2 ); + + + FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n" + " Applying vertical adjustment: %s\n", + adjust_bottom ? "AF_ADJUST_DOWN": "AF_ADJUST_DOWN2" )); + + low_contour = adjust_above_bottom + ? af_find_second_lowest_contour( hints ) + : af_find_lowest_contour( hints ); + + horizontal_overlap = + af_check_contour_horizontal_overlap( hints, low_contour ); + if ( !horizontal_overlap ) + { + FT_TRACE4(( " Low contour does not horizontally overlap" + " with other contours.\n" + " Skipping adjustment.\n" )); + return; + } + + low_min_y = hints->contour_y_minima[low_contour]; + low_max_y = hints->contour_y_maxima[low_contour]; + low_height = low_max_y - low_min_y; + + if ( low_height > accent_height_limit ) + { + FT_TRACE4(( " Low contour height (%.2f) exceeds accent height" + " limit (%.2f).\n" + " Skipping adjustment.\n", + (double)low_height / 64, + (double)accent_height_limit / 64 )); + return; + } + + for ( contour = 0; contour < hints->num_contours; contour++ ) + { + FT_Pos min_y; + FT_Pos max_y; + FT_Pos distance; + + + if ( contour == low_contour ) + continue; + + min_y = hints->contour_y_minima[contour]; + max_y = hints->contour_y_maxima[contour]; + + distance = min_y - low_max_y; + if ( distance < 64 && + distance < min_distance && + max_y > low_max_y ) + min_distance = distance; + } + + adjustment_amount = 64 - min_distance; + + if ( is_bottom_tilde || is_above_bottom_tilde ) + { + tilde_contour = adjust_bottom + ? low_contour + : ( is_above_bottom_tilde + ? low_contour + : af_find_lowest_contour( hints ) ); + + tilde_min_y = hints->contour_y_minima[tilde_contour]; + tilde_max_y = hints->contour_y_maxima[tilde_contour]; + tilde_height = tilde_max_y - tilde_min_y; + + pos = low_max_y - adjustment_amount; + if ( adjust_above_bottom && is_bottom_tilde ) + pos -= low_height; + + if ( pos % 64 == 0 && tilde_height < 3 * 64 ) + { + centering_adjustment = ( FT_PIX_ROUND( tilde_height ) - + tilde_height ) / 2; + + FT_TRACE4(( " Additional tilde centering adjustment: %ld\n", + centering_adjustment )); + } + } + + if ( ( adjust_bottom && is_bottom_tilde ) || + ( adjust_above_bottom && is_above_bottom_tilde ) ) + calculated_amount = adjustment_amount + centering_adjustment; + else + calculated_amount = adjustment_amount; + + FT_TRACE4(( " Calculated adjustment amount: %ld%s\n", + calculated_amount, + ( calculated_amount < -2 || + ( adjustment_amount > 66 && calculated_amount > 66 ) ) + ? " (out of range [-2;66], not adjusting)" : "" )); + + if ( calculated_amount != 0 && + calculated_amount >= -2 && + ( calculated_amount <= 66 || adjustment_amount <= 66 ) ) + { + FT_Pos height_delta = low_height / 8; + FT_Pos max_y_limit = low_max_y + height_delta; + + + FT_TRACE4(( " Pushing low contour %ld units down\n", + calculated_amount )); + + af_move_contours_down( hints, max_y_limit, adjustment_amount ); + + if ( adjust_above_bottom && is_bottom_tilde ) + { + FT_TRACE4(( " Pushing bottom tilde %ld units down\n", + centering_adjustment )); + + af_move_contours_down( hints, + max_y_limit - low_height, + centering_adjustment ); + } + } + } + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !( ( ( adjust_top || adjust_bottom ) && + hints->num_contours >= 2 ) || + ( ( adjust_below_top || adjust_above_bottom ) && + hints->num_contours >= 3 ) ) ) + FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n" + " No vertical adjustment applied\n" )); +#endif + + FT_TRACE4(( "Exiting" + " af_glyph_hints_apply_vertical_separation_adjustments\n" )); + } + + +#undef FT_COMPONENT +#define FT_COMPONENT aflatin + + + /* Compute the snapped width of a given stem, ignoring very thin ones. */ + /* There is a lot of voodoo in this function; changing the hard-coded */ + /* parameters influence the whole hinting process. */ + + static FT_Pos + af_latin_compute_stem_width( AF_GlyphHints hints, + AF_Dimension dim, + FT_Pos width, + FT_Pos base_delta, + FT_UInt base_flags, + FT_UInt stem_flags ) + { + AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics; + AF_LatinAxis axis = &metrics->axis[dim]; + FT_Pos dist = width; + FT_Int sign = 0; + FT_Int vertical = ( dim == AF_DIMENSION_VERT ); + + + if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) || + axis->extra_light ) + return width; + + if ( dist < 0 ) + { + dist = -width; + sign = 1; + } + + if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) || + ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ) + { + /* smooth hinting process: very lightly quantize the stem width */ + + /* leave the widths of serifs alone */ + if ( ( stem_flags & AF_EDGE_SERIF ) && + vertical && + ( dist < 3 * 64 ) ) + goto Done_Width; + + else if ( base_flags & AF_EDGE_ROUND ) + { + if ( dist < 80 ) + dist = 64; + } + else if ( dist < 56 ) + dist = 56; + + if ( axis->width_count > 0 ) + { + FT_Pos delta; + + + /* compare to standard width */ + delta = dist - axis->widths[0].cur; + + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) + { + dist = axis->widths[0].cur; + if ( dist < 48 ) + dist = 48; + + goto Done_Width; + } + + if ( dist < 3 * 64 ) + { + delta = dist & 63; + dist &= -64; + + if ( delta < 10 ) + dist += delta; + + else if ( delta < 32 ) + dist += 10; + + else if ( delta < 54 ) + dist += 54; + + else + dist += delta; + } + else + { + /* A stem's end position depends on two values: the start */ + /* position and the stem length. The former gets usually */ + /* rounded to the grid, while the latter gets rounded also if it */ + /* exceeds a certain length (see below in this function). This */ + /* `double rounding' can lead to a great difference to the */ + /* original, unhinted position; this normally doesn't matter for */ + /* large PPEM values, but for small sizes it can easily make */ + /* outlines collide. For this reason, we adjust the stem length */ + /* by a small amount depending on the PPEM value in case the */ + /* former and latter rounding both point into the same */ + /* direction. */ + + FT_Pos bdelta = 0; + + + if ( ( ( width > 0 ) && ( base_delta > 0 ) ) || + ( ( width < 0 ) && ( base_delta < 0 ) ) ) + { + FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem; + + + if ( ppem < 10 ) + bdelta = base_delta; + else if ( ppem < 30 ) + bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20; + + if ( bdelta < 0 ) + bdelta = -bdelta; + } + + dist = ( dist - bdelta + 32 ) & ~63; + } + } + } + else + { + /* strong hinting process: snap the stem width to integer pixels */ + + FT_Pos org_dist = dist; + + + dist = af_latin_snap_width( axis->widths, axis->width_count, dist ); + + if ( vertical ) + { + /* in the case of vertical hinting, always round */ + /* the stem heights to integer pixels */ + + if ( dist >= 64 ) + dist = ( dist + 16 ) & ~63; + else + dist = 64; + } + else + { + if ( AF_LATIN_HINTS_DO_MONO( hints ) ) + { + /* monochrome horizontal hinting: snap widths to integer pixels */ + /* with a different threshold */ + + if ( dist < 64 ) + dist = 64; + else + dist = ( dist + 32 ) & ~63; + } + else + { + /* for horizontal anti-aliased hinting, we adopt a more subtle */ + /* approach: we strengthen small stems, round stems whose size */ + /* is between 1 and 2 pixels to an integer, otherwise nothing */ + + if ( dist < 48 ) + dist = ( dist + 64 ) >> 1; + + else if ( dist < 128 ) + { + /* We only round to an integer width if the corresponding */ + /* distortion is less than 1/4 pixel. Otherwise this */ + /* makes everything worse since the diagonals, which are */ + /* not hinted, appear a lot bolder or thinner than the */ + /* vertical stems. */ + + FT_Pos delta; + + + dist = ( dist + 22 ) & ~63; + delta = dist - org_dist; + if ( delta < 0 ) + delta = -delta; + + if ( delta >= 16 ) + { + dist = org_dist; + if ( dist < 48 ) + dist = ( dist + 64 ) >> 1; + } + } + else + /* round otherwise to prevent color fringes in LCD mode */ + dist = ( dist + 32 ) & ~63; + } + } + } + + Done_Width: + if ( sign ) + dist = -dist; + + return dist; + } + + + /* Align one stem edge relative to the previous stem edge. */ + + static void + af_latin_align_linked_edge( AF_GlyphHints hints, + AF_Dimension dim, + AF_Edge base_edge, + AF_Edge stem_edge ) + { + FT_Pos dist, base_delta; + FT_Pos fitted_width; + + + dist = stem_edge->opos - base_edge->opos; + base_delta = base_edge->pos - base_edge->opos; + + fitted_width = af_latin_compute_stem_width( hints, dim, + dist, base_delta, + base_edge->flags, + stem_edge->flags ); + + + stem_edge->pos = base_edge->pos + fitted_width; + + FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f," + " dist was %.2f, now %.2f\n", + stem_edge - hints->axis[dim].edges, + (double)stem_edge->opos / 64, (double)stem_edge->pos / 64, + (double)dist / 64, (double)fitted_width / 64 )); + } + + + /* Shift the coordinates of the `serif' edge by the same amount */ + /* as the corresponding `base' edge has been moved already. */ + + static void + af_latin_align_serif_edge( AF_GlyphHints hints, + AF_Edge base, + AF_Edge serif ) + { + FT_UNUSED( hints ); + + serif->pos = base->pos + ( serif->opos - base->opos ); } @@ -2998,13 +4214,15 @@ af_latin_hint_edges( AF_GlyphHints hints, AF_Dimension dim ) { - AF_AxisHints axis = &hints->axis[dim]; - AF_Edge edges = axis->edges; - AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); - FT_PtrDist n_edges; - AF_Edge edge; - AF_Edge anchor = NULL; - FT_Int has_serifs = 0; + AF_AxisHints axis = &hints->axis[dim]; + + AF_Edge edges = axis->edges; + AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); + AF_Edge edge; + FT_PtrDist n_edges; + + AF_Edge anchor = NULL; + FT_Bool has_non_stem_edges = 0; AF_StyleClass style_class = hints->metrics->style_class; AF_ScriptClass script_class = af_script_classes[style_class->script]; @@ -3131,7 +4349,7 @@ edge2 = edge->link; if ( !edge2 ) { - has_serifs++; + has_non_stem_edges = TRUE; continue; } @@ -3408,7 +4626,7 @@ } } - if ( has_serifs || !anchor ) + if ( has_non_stem_edges || !anchor ) { /* * now hint the remaining edges (serifs and single) in order @@ -3426,9 +4644,75 @@ if ( edge->serif ) { + AF_Edge e, top, bottom; + FT_Pos min_pos, max_pos; + + + /* Check whether we have a real serif -- if there are */ + /* other edges with overlapping (or enclosed) segments */ + /* between the primary and serif edge, we have not. */ + /* */ + /* Such a situation might happen if an accent is very */ + /* near to its base glyph (for example, Vietnamese */ + /* uppercase letters with two accents in `arial.ttf`), */ + /* and the segment detection algorithm classifies the */ + /* top of the accent incorrectly as a serif. */ delta = edge->serif->opos - edge->opos; if ( delta < 0 ) + { delta = -delta; + + top = edge; + bottom = edge->serif; + } + else + { + top = edge->serif; + bottom = edge; + } + + if ( delta < 64 + 32 ) + { + /* take care of outline orientation while computing extrema */ + min_pos = FT_MIN( FT_MIN( FT_MIN( top->first->first->v, + top->first->last->v ), + FT_MIN( top->last->first->v, + top->last->last->v ) ), + FT_MIN( FT_MIN( bottom->first->first->v, + bottom->first->last->v ), + FT_MIN( bottom->last->first->v, + bottom->last->last->v ) ) ); + max_pos = FT_MAX( FT_MAX( FT_MAX( top->first->first->v, + top->first->last->v ), + FT_MAX( top->last->first->v, + top->last->last->v ) ), + FT_MAX( FT_MAX( bottom->first->first->v, + bottom->first->last->v ), + FT_MAX( bottom->last->first->v, + bottom->last->last->v ) ) ); + + for ( e = bottom + 1; e < top; e++ ) + { + FT_Pos e_min = FT_MIN( FT_MIN( e->first->first->v, + e->first->last->v ), + FT_MIN( e->last->first->v, + e->last->last->v ) ); + FT_Pos e_max = FT_MAX( FT_MAX( e->first->first->v, + e->first->last->v ), + FT_MAX( e->last->first->v, + e->last->last->v ) ); + + if ( !( ( e_min < min_pos && e_max < min_pos ) || + ( e_min > max_pos && e_max > max_pos ) ) ) + { + delta = 1000; /* not a real serif */ + break; + } + } + + if ( delta == 1000 ) + continue; + } } if ( delta < 64 + 16 ) @@ -3562,6 +4846,8 @@ AF_LatinAxis axis; + FT_Pos accent_height_limit = 0; + error = af_glyph_hints_reload( hints, outline ); if ( error ) @@ -3581,11 +4867,172 @@ if ( AF_HINTS_DO_VERTICAL( hints ) ) { + size_t* val; + + FT_Int top_tilde_contour = 0; + FT_Int bottom_tilde_contour = 0; + + FT_Int below_top_tilde_contour = 0; + FT_Int above_bottom_tilde_contour = 0; + + AF_LatinBlue capital_top_blue = NULL; + AF_LatinBlue capital_bottom_blue = NULL; + + AF_LatinBlue small_top_blue = NULL; + AF_LatinBlue small_bottom_blue = NULL; + + FT_Bool have_flags = FALSE; + + FT_Bool is_top_tilde = FALSE; + FT_Bool is_bottom_tilde = FALSE; + + FT_Bool is_below_top_tilde = FALSE; + FT_Bool is_above_bottom_tilde = FALSE; + + FT_Bool ignore_capital_top = FALSE; + FT_Bool ignore_capital_bottom = FALSE; + + FT_Bool ignore_small_top = FALSE; + FT_Bool ignore_small_bottom = FALSE; + + FT_Bool do_height_check = TRUE; + + FT_Pos limit; + FT_Pos y_offset; + + + val = ft_hash_num_lookup( (FT_Int)glyph_index, + metrics->root.reverse_charmap ); + if ( val ) + { + FT_UInt codepoint = *val; + FT_UInt32 adj_type = af_adjustment_database_lookup( codepoint ); + + + if ( adj_type ) + { + have_flags = !!adj_type; + + is_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP ); + is_bottom_tilde = !!( adj_type & AF_ADJUST_TILDE_BOTTOM ); + + is_below_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP2 ); + is_above_bottom_tilde = !!( adj_type & AF_ADJUST_TILDE_BOTTOM2 ); + + ignore_capital_top = !!( adj_type & AF_IGNORE_CAPITAL_TOP ); + ignore_capital_bottom = !!( adj_type & AF_IGNORE_CAPITAL_BOTTOM ); + + ignore_small_top = !!( adj_type & AF_IGNORE_SMALL_TOP ); + ignore_small_bottom = !!( adj_type & AF_IGNORE_SMALL_BOTTOM ); + + do_height_check = !( adj_type & AF_ADJUST_NO_HEIGHT_CHECK ); + } + } + + if ( is_top_tilde || is_bottom_tilde || + is_below_top_tilde || is_above_bottom_tilde ) + af_compute_vertical_extrema( hints ); + + /* Process inner tilde glyphs first. */ + if ( is_below_top_tilde ) + { + below_top_tilde_contour = af_find_second_highest_contour( hints ); + + y_offset = af_latin_stretch_top_tilde( + hints, below_top_tilde_contour ); + y_offset += af_latin_align_top_tilde( + hints, below_top_tilde_contour ); + + limit = hints->contour_y_minima[below_top_tilde_contour]; + af_move_contours_up( hints, limit, y_offset ); + } + if ( is_above_bottom_tilde ) + { + above_bottom_tilde_contour = af_find_second_lowest_contour( hints ); + + y_offset = af_latin_stretch_bottom_tilde( + hints, above_bottom_tilde_contour ); + y_offset -= af_latin_align_bottom_tilde( + hints, above_bottom_tilde_contour ); + + limit = hints->contour_y_maxima[above_bottom_tilde_contour]; + af_move_contours_down( hints, limit, y_offset ); + } + + if ( is_top_tilde ) + { + top_tilde_contour = af_find_highest_contour( hints ); + + (void)af_latin_stretch_top_tilde( hints, top_tilde_contour ); + (void)af_latin_align_top_tilde( hints, top_tilde_contour ); + } + if ( is_bottom_tilde ) + { + bottom_tilde_contour = af_find_lowest_contour( hints ); + + (void)af_latin_stretch_bottom_tilde( hints, bottom_tilde_contour ); + (void)af_latin_align_bottom_tilde( hints, bottom_tilde_contour ); + } + axis = &metrics->axis[AF_DIMENSION_VERT]; error = af_latin_hints_detect_features( hints, axis->width_count, axis->widths, AF_DIMENSION_VERT ); + + if ( have_flags ) + { + af_latin_get_base_glyph_blues( hints, + TRUE, + &capital_top_blue, + &capital_bottom_blue ); + af_latin_get_base_glyph_blues( hints, + FALSE, + &small_top_blue, + &small_bottom_blue ); + + if ( do_height_check ) + { + /* Set a heuristic limit for the accent height so that */ + /* `af_glyph_hints_apply_vertical_separation_adjustments` */ + /* can correctly ignore the case where an accent is */ + /* unexpectedly not the highest (or lowest) contour. */ + + /* Either 2/3 of the lowercase blue zone height... */ + if ( small_top_blue && small_bottom_blue ) + accent_height_limit = 2 * ( small_top_blue->shoot.cur - + small_bottom_blue->shoot.cur ) / 3; + /* or 1/2 of the uppercase blue zone height... */ + else if ( capital_top_blue && capital_bottom_blue ) + accent_height_limit = ( capital_top_blue->shoot.cur - + capital_bottom_blue->shoot.cur ) / 2; + /* or half of the standard PostScript ascender value (8/10) */ + /* of the EM value, scaled. */ + else + accent_height_limit = FT_MulFix( metrics->units_per_em * 4 / 10, + metrics->root.scaler.y_scale ); + } + } + + if ( capital_top_blue && capital_bottom_blue ) + { + if ( ignore_capital_top ) + af_latin_ignore_top( hints, + capital_top_blue, capital_bottom_blue ); + if ( ignore_capital_bottom ) + af_latin_ignore_bottom( hints, + capital_top_blue, capital_bottom_blue ); + } + if ( small_top_blue && small_bottom_blue ) + { + if ( ignore_small_top ) + af_latin_ignore_top( hints, + small_top_blue, small_bottom_blue ); + if ( ignore_small_bottom ) + af_latin_ignore_bottom( hints, + small_top_blue, small_bottom_blue ); + } + if ( error ) goto Exit; @@ -3604,6 +5051,12 @@ af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim ); af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim ); af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim ); + af_glyph_hints_apply_vertical_separation_adjustments( + hints, + (AF_Dimension)dim, + glyph_index, + accent_height_limit, + metrics->root.reverse_charmap ); } } @@ -3632,7 +5085,7 @@ (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init, /* style_metrics_init */ (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale, /* style_metrics_scale */ - (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */ + (AF_WritingSystem_DoneMetricsFunc) af_latin_metrics_done, /* style_metrics_done */ (AF_WritingSystem_GetStdWidthsFunc)af_latin_get_standard_widths, /* style_metrics_getstdw */ (AF_WritingSystem_InitHintsFunc) af_latin_hints_init, /* style_hints_init */ diff --git a/vendor/freetype/src/autofit/aflatin.h b/vendor/freetype/src/autofit/aflatin.h index 54e50615021..cd411a09a5c 100644 --- a/vendor/freetype/src/autofit/aflatin.h +++ b/vendor/freetype/src/autofit/aflatin.h @@ -61,17 +61,26 @@ FT_BEGIN_HEADER ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT ) #define AF_LATIN_IS_LONG_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG ) +#define AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM ) +#define AF_LATIN_IS_SMALL_BOTTOM_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM ) #define AF_LATIN_MAX_WIDTHS 16 -#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */ -#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */ -#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript top */ - /* blue zone */ -#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have neutral blue zone */ -#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustment */ - /* optimization */ +#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */ +#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */ +#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript */ + /* top blue zone */ +#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have a neutral blue */ + /* zone */ +#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustm. */ + /* optimization */ +#define AF_LATIN_BLUE_BOTTOM ( 1U << 5 ) /* we have a capital */ + /* letter bottom blue zone */ +#define AF_LATIN_BLUE_BOTTOM_SMALL ( 1U << 6 ) /* we have a small letter */ + /* bottom blue zone */ typedef struct AF_LatinBlueRec_ diff --git a/vendor/freetype/src/autofit/afmodule.c b/vendor/freetype/src/autofit/afmodule.c index 726f6ca2b78..c0ed4ad9d4f 100644 --- a/vendor/freetype/src/autofit/afmodule.c +++ b/vendor/freetype/src/autofit/afmodule.c @@ -146,7 +146,7 @@ if ( !af_style_classes[ss] ) { - FT_TRACE2(( "af_property_set: Invalid value %d for property `%s'\n", + FT_TRACE2(( "af_property_set: Invalid value %u for property `%s'\n", *fallback_script, property_name )); return FT_THROW( Invalid_Argument ); } @@ -412,6 +412,11 @@ module->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4; module->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4; +#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \ + defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) + ft_hb_funcs_init( module ); +#endif + return FT_Err_Ok; } @@ -421,6 +426,11 @@ { FT_UNUSED( ft_module ); +#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \ + defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) + ft_hb_funcs_done( (AF_Module)ft_module ); +#endif + #ifdef FT_DEBUG_AUTOFIT if ( af_debug_hints_rec_->memory ) af_glyph_hints_done( af_debug_hints_rec_ ); diff --git a/vendor/freetype/src/autofit/afmodule.h b/vendor/freetype/src/autofit/afmodule.h index 91a1abfef1f..f5a406c76dd 100644 --- a/vendor/freetype/src/autofit/afmodule.h +++ b/vendor/freetype/src/autofit/afmodule.h @@ -22,6 +22,7 @@ #include #include +#include "ft-hb.h" FT_BEGIN_HEADER @@ -40,6 +41,11 @@ FT_BEGIN_HEADER FT_Bool no_stem_darkening; FT_Int darken_params[8]; +#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \ + defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) + ft_hb_funcs_t* hb_funcs; +#endif + } AF_ModuleRec, *AF_Module; diff --git a/vendor/freetype/src/autofit/afranges.c b/vendor/freetype/src/autofit/afranges.c index 007b4328189..3bd8f1af366 100644 --- a/vendor/freetype/src/autofit/afranges.c +++ b/vendor/freetype/src/autofit/afranges.c @@ -73,9 +73,11 @@ { AF_UNIRANGE_REC( 0x0600, 0x06FF ), /* Arabic */ AF_UNIRANGE_REC( 0x0750, 0x07FF ), /* Arabic Supplement */ + AF_UNIRANGE_REC( 0x0870, 0x089F ), /* Arabic Extended-B */ AF_UNIRANGE_REC( 0x08A0, 0x08FF ), /* Arabic Extended-A */ AF_UNIRANGE_REC( 0xFB50, 0xFDFF ), /* Arabic Presentation Forms-A */ AF_UNIRANGE_REC( 0xFE70, 0xFEFF ), /* Arabic Presentation Forms-B */ + AF_UNIRANGE_REC( 0x10EC0, 0x10EFF ), /* Arabic Extended-C */ AF_UNIRANGE_REC( 0x1EE00, 0x1EEFF ), /* Arabic Mathematical Alphabetic Symbols */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -90,8 +92,9 @@ AF_UNIRANGE_REC( 0x06DF, 0x06E4 ), AF_UNIRANGE_REC( 0x06E7, 0x06E8 ), AF_UNIRANGE_REC( 0x06EA, 0x06ED ), - AF_UNIRANGE_REC( 0x08D4, 0x08E1 ), - AF_UNIRANGE_REC( 0x08D3, 0x08FF ), + AF_UNIRANGE_REC( 0x0897, 0x089F ), + AF_UNIRANGE_REC( 0x08CA, 0x08E1 ), + AF_UNIRANGE_REC( 0x08E3, 0x08FF ), AF_UNIRANGE_REC( 0xFBB2, 0xFBC1 ), AF_UNIRANGE_REC( 0xFE70, 0xFE70 ), AF_UNIRANGE_REC( 0xFE72, 0xFE72 ), @@ -101,6 +104,7 @@ AF_UNIRANGE_REC( 0xFE7A, 0xFE7A ), AF_UNIRANGE_REC( 0xFE7C, 0xFE7C ), AF_UNIRANGE_REC( 0xFE7E, 0xFE7E ), + AF_UNIRANGE_REC( 0x10EFD, 0x10EFF ), AF_UNIRANGE_REC( 0, 0 ) }; @@ -198,8 +202,9 @@ const AF_Script_UniRangeRec af_cans_uniranges[] = { - AF_UNIRANGE_REC( 0x1400, 0x167F ), /* Unified Canadian Aboriginal Syllabics */ - AF_UNIRANGE_REC( 0x18B0, 0x18FF ), /* Unified Canadian Aboriginal Syllabics Extended */ + AF_UNIRANGE_REC( 0x1400, 0x167F ), /* Unified Canadian Aboriginal Syllabics */ + AF_UNIRANGE_REC( 0x18B0, 0x18FF ), /* Unified Canadian Aboriginal Syllabics Extended */ + AF_UNIRANGE_REC( 0x11AB0, 0x11ABF ), /* Unified Canadian Aboriginal Syllabics Extended-A */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -259,6 +264,9 @@ }; + /* TODO: Split off data for new 'cyrb' (subscript) and 'cyrp' */ + /* (superscript) groups (mainly from the Extended-D block), */ + /* in analogy to 'latb' and 'latp'? */ const AF_Script_UniRangeRec af_cyrl_uniranges[] = { AF_UNIRANGE_REC( 0x0400, 0x04FF ), /* Cyrillic */ @@ -266,6 +274,7 @@ AF_UNIRANGE_REC( 0x2DE0, 0x2DFF ), /* Cyrillic Extended-A */ AF_UNIRANGE_REC( 0xA640, 0xA69F ), /* Cyrillic Extended-B */ AF_UNIRANGE_REC( 0x1C80, 0x1C8F ), /* Cyrillic Extended-C */ + AF_UNIRANGE_REC( 0x1E030, 0x1E08F ), /* Cyrillic Extended-D */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -285,15 +294,16 @@ const AF_Script_UniRangeRec af_deva_uniranges[] = { - AF_UNIRANGE_REC( 0x0900, 0x093B ), /* Devanagari */ + AF_UNIRANGE_REC( 0x0900, 0x093B ), /* Devanagari */ /* omitting U+093C nukta */ - AF_UNIRANGE_REC( 0x093D, 0x0950 ), /* ... continued */ + AF_UNIRANGE_REC( 0x093D, 0x0950 ), /* ... continued */ /* omitting U+0951 udatta, U+0952 anudatta */ - AF_UNIRANGE_REC( 0x0953, 0x0963 ), /* ... continued */ + AF_UNIRANGE_REC( 0x0953, 0x0963 ), /* ... continued */ /* omitting U+0964 danda, U+0965 double danda */ - AF_UNIRANGE_REC( 0x0966, 0x097F ), /* ... continued */ - AF_UNIRANGE_REC( 0x20B9, 0x20B9 ), /* (new) Rupee sign */ - AF_UNIRANGE_REC( 0xA8E0, 0xA8FF ), /* Devanagari Extended */ + AF_UNIRANGE_REC( 0x0966, 0x097F ), /* ... continued */ + AF_UNIRANGE_REC( 0x20B9, 0x20B9 ), /* (new) Rupee sign */ + AF_UNIRANGE_REC( 0xA8E0, 0xA8FF ), /* Devanagari Extended */ + AF_UNIRANGE_REC( 0x11B00, 0x11B5F ), /* Devanagari Extended-A */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -329,6 +339,7 @@ AF_UNIRANGE_REC( 0x1380, 0x139F ), /* Ethiopic Supplement */ AF_UNIRANGE_REC( 0x2D80, 0x2DDF ), /* Ethiopic Extended */ AF_UNIRANGE_REC( 0xAB00, 0xAB2F ), /* Ethiopic Extended-A */ + AF_UNIRANGE_REC( 0x1E7E0, 0x1E7FF ), /* Ethiopic Extended-B */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -534,7 +545,7 @@ { AF_UNIRANGE_REC( 0x0EB1, 0x0EB1 ), AF_UNIRANGE_REC( 0x0EB4, 0x0EBC ), - AF_UNIRANGE_REC( 0x0EC8, 0x0ECD ), + AF_UNIRANGE_REC( 0x0EC8, 0x0ECE ), AF_UNIRANGE_REC( 0, 0 ) }; @@ -567,12 +578,15 @@ AF_UNIRANGE_REC( 0x2C7E, 0x2C7F ), /* ... continued */ AF_UNIRANGE_REC( 0x2E00, 0x2E7F ), /* Supplemental Punctuation */ AF_UNIRANGE_REC( 0xA720, 0xA76F ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xA771, 0xA7F7 ), /* ... continued */ + AF_UNIRANGE_REC( 0xA771, 0xA7F0 ), /* ... continued */ + AF_UNIRANGE_REC( 0xA7F2, 0xA7F7 ), /* ... continued */ AF_UNIRANGE_REC( 0xA7FA, 0xA7FF ), /* ... continued */ AF_UNIRANGE_REC( 0xAB30, 0xAB5B ), /* Latin Extended-E */ - AF_UNIRANGE_REC( 0xAB60, 0xAB6F ), /* ... continued */ + AF_UNIRANGE_REC( 0xAB60, 0xAB68 ), /* ... continued */ + AF_UNIRANGE_REC( 0xAB6A, 0xAB6F ), /* ... continued */ AF_UNIRANGE_REC( 0xFB00, 0xFB06 ), /* Alphab. Present. Forms (Latin Ligs) */ AF_UNIRANGE_REC( 0x1D400, 0x1D7FF ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0x1DF00, 0x1DFFF ), /* Latin Extended-G */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -588,7 +602,7 @@ AF_UNIRANGE_REC( 0x02B9, 0x02DF ), AF_UNIRANGE_REC( 0x02E5, 0x02FF ), AF_UNIRANGE_REC( 0x0300, 0x036F ), - AF_UNIRANGE_REC( 0x1AB0, 0x1ABE ), + AF_UNIRANGE_REC( 0x1AB0, 0x1AEB ), AF_UNIRANGE_REC( 0x1DC0, 0x1DFF ), AF_UNIRANGE_REC( 0x2017, 0x2017 ), AF_UNIRANGE_REC( 0x203E, 0x203E ), @@ -625,8 +639,11 @@ AF_UNIRANGE_REC( 0x2070, 0x207F ), /* superscript digits and letters */ AF_UNIRANGE_REC( 0x2C7D, 0x2C7D ), /* modifier letter capital v */ AF_UNIRANGE_REC( 0xA770, 0xA770 ), /* modifier letter us */ + AF_UNIRANGE_REC( 0xA7F1, 0xA7F1 ), /* modifier letter capital s */ AF_UNIRANGE_REC( 0xA7F8, 0xA7F9 ), /* more modifier letters */ AF_UNIRANGE_REC( 0xAB5C, 0xAB5F ), /* more modifier letters */ + AF_UNIRANGE_REC( 0xAB69, 0xAB69 ), /* modifier letter small turned w */ + AF_UNIRANGE_REC( 0x10780, 0x107FB ), /* Latin Extended-F */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -638,7 +655,8 @@ const AF_Script_UniRangeRec af_lisu_uniranges[] = { - AF_UNIRANGE_REC( 0xA4D0, 0xA4FF ), /* Lisu */ + AF_UNIRANGE_REC( 0xA4D0, 0xA4FF ), /* Lisu */ + AF_UNIRANGE_REC( 0x11FB0, 0x11FBF ), /* Lisu Supplement */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -696,6 +714,7 @@ AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */ AF_UNIRANGE_REC( 0xA9E0, 0xA9FF ), /* Myanmar Extended-B */ AF_UNIRANGE_REC( 0xAA60, 0xAA7F ), /* Myanmar Extended-A */ + AF_UNIRANGE_REC( 0x116D0, 0x116FF ), /* Myanmar Extended-C */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -836,6 +855,7 @@ const AF_Script_UniRangeRec af_sinh_nonbase_uniranges[] = { + AF_UNIRANGE_REC( 0x0D81, 0x0D81 ), AF_UNIRANGE_REC( 0x0DCA, 0x0DCA ), AF_UNIRANGE_REC( 0x0DD2, 0x0DD6 ), AF_UNIRANGE_REC( 0, 0 ) @@ -859,7 +879,8 @@ const AF_Script_UniRangeRec af_taml_uniranges[] = { - AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */ + AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */ + AF_UNIRANGE_REC( 0x11FC0, 0x11FFF ), /* Tamil Supplement */ AF_UNIRANGE_REC( 0, 0 ) }; @@ -899,6 +920,7 @@ { AF_UNIRANGE_REC( 0x0C00, 0x0C00 ), AF_UNIRANGE_REC( 0x0C04, 0x0C04 ), + AF_UNIRANGE_REC( 0x0C3C, 0x0C3C ), AF_UNIRANGE_REC( 0x0C3E, 0x0C40 ), AF_UNIRANGE_REC( 0x0C46, 0x0C56 ), AF_UNIRANGE_REC( 0x0C62, 0x0C63 ), @@ -992,6 +1014,7 @@ AF_UNIRANGE_REC( 0xA806, 0xA806 ), AF_UNIRANGE_REC( 0xA80B, 0xA80B ), AF_UNIRANGE_REC( 0xA825, 0xA826 ), + AF_UNIRANGE_REC( 0xA82C, 0xA82C ), AF_UNIRANGE_REC( 0, 0 ) }; @@ -1048,15 +1071,21 @@ AF_UNIRANGE_REC( 0xFE10, 0xFE1F ), /* Vertical forms */ AF_UNIRANGE_REC( 0xFE30, 0xFE4F ), /* CJK Compatibility Forms */ AF_UNIRANGE_REC( 0xFF00, 0xFFEF ), /* Halfwidth and Fullwidth Forms */ + AF_UNIRANGE_REC( 0x1AFF0, 0x1AFFF ), /* Kana Extended-B */ AF_UNIRANGE_REC( 0x1B000, 0x1B0FF ), /* Kana Supplement */ AF_UNIRANGE_REC( 0x1B100, 0x1B12F ), /* Kana Extended-A */ + AF_UNIRANGE_REC( 0x1B130, 0x1B16F ), /* Small Kana Extension */ AF_UNIRANGE_REC( 0x1D300, 0x1D35F ), /* Tai Xuan Hing Symbols */ AF_UNIRANGE_REC( 0x20000, 0x2A6DF ), /* CJK Unified Ideographs Extension B */ AF_UNIRANGE_REC( 0x2A700, 0x2B73F ), /* CJK Unified Ideographs Extension C */ AF_UNIRANGE_REC( 0x2B740, 0x2B81F ), /* CJK Unified Ideographs Extension D */ AF_UNIRANGE_REC( 0x2B820, 0x2CEAF ), /* CJK Unified Ideographs Extension E */ AF_UNIRANGE_REC( 0x2CEB0, 0x2EBEF ), /* CJK Unified Ideographs Extension F */ + AF_UNIRANGE_REC( 0x2EBF0, 0x2EE5D ), /* CJK Unified Ideographs Extension I */ AF_UNIRANGE_REC( 0x2F800, 0x2FA1F ), /* CJK Compatibility Ideographs Supplement */ + AF_UNIRANGE_REC( 0x30000, 0x3134A ), /* CJK Unified Ideographs Extension G */ + AF_UNIRANGE_REC( 0x31350, 0x323AF ), /* CJK Unified Ideographs Extension H */ + AF_UNIRANGE_REC( 0x323B0, 0x33479 ), /* CJK Unified Ideographs Extension J */ AF_UNIRANGE_REC( 0, 0 ) }; diff --git a/vendor/freetype/src/autofit/afshaper.c b/vendor/freetype/src/autofit/afshaper.c index df0f46ada89..f7ebf4f8699 100644 --- a/vendor/freetype/src/autofit/afshaper.c +++ b/vendor/freetype/src/autofit/afshaper.c @@ -22,8 +22,8 @@ #include "aftypes.h" #include "afshaper.h" -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ /************************************************************************** * @@ -89,17 +89,18 @@ #define SCRIPT( s, S, d, h, H, ss ) h, - static const hb_script_t scripts[] = + FT_LOCAL_ARRAY_DEF( hb_script_t ) + af_hb_scripts[] = { #include "afscript.h" }; - FT_Error - af_shaper_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_UShort* gstyles, - FT_Bool default_script ) + static FT_Error + af_shaper_get_coverage_hb( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_UShort* gstyles, + FT_Bool default_script ) { hb_face_t* face; @@ -124,10 +125,10 @@ if ( !globals || !style_class || !gstyles ) return FT_THROW( Invalid_Argument ); - face = hb_font_get_face( globals->hb_font ); + face = hb( font_get_face )( globals->hb_font ); coverage_tags = coverages[style_class->coverage]; - script = scripts[style_class->script]; + script = af_hb_scripts[style_class->script]; /* Convert a HarfBuzz script tag into the corresponding OpenType */ /* tag or tags -- some Indic scripts like Devanagari have an old */ @@ -137,19 +138,19 @@ hb_tag_t tags[3]; - hb_ot_tags_from_script_and_language( script, - HB_LANGUAGE_INVALID, - &tags_count, - tags, - NULL, - NULL ); + hb( ot_tags_from_script_and_language )( script, + HB_LANGUAGE_INVALID, + &tags_count, + tags, + NULL, + NULL ); script_tags[0] = tags_count > 0 ? tags[0] : HB_TAG_NONE; script_tags[1] = tags_count > 1 ? tags[1] : HB_TAG_NONE; script_tags[2] = tags_count > 2 ? tags[2] : HB_TAG_NONE; } - /* If the second tag is HB_OT_TAG_DEFAULT_SCRIPT, change that to */ - /* HB_TAG_NONE except for the default script. */ + /* If the second tag is HB_OT_TAG_DEFAULT_SCRIPT, change that to */ + /* HB_TAG_NONE except for the default script. */ if ( default_script ) { if ( script_tags[0] == HB_TAG_NONE ) @@ -170,15 +171,15 @@ goto Exit; } - gsub_lookups = hb_set_create(); - hb_ot_layout_collect_lookups( face, - HB_OT_TAG_GSUB, - script_tags, - NULL, - coverage_tags, - gsub_lookups ); + gsub_lookups = hb( set_create )(); + hb( ot_layout_collect_lookups )( face, + HB_OT_TAG_GSUB, + script_tags, + NULL, + coverage_tags, + gsub_lookups ); - if ( hb_set_is_empty( gsub_lookups ) ) + if ( hb( set_is_empty )( gsub_lookups ) ) goto Exit; /* nothing to do */ FT_TRACE4(( "GSUB lookups (style `%s'):\n", @@ -189,22 +190,22 @@ count = 0; #endif - gsub_glyphs = hb_set_create(); - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &idx ); ) + gsub_glyphs = hb( set_create )(); + for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_lookups, &idx ); ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE4(( " %d", idx )); + FT_TRACE4(( " %u", idx )); count++; #endif /* get output coverage of GSUB feature */ - hb_ot_layout_lookup_collect_glyphs( face, - HB_OT_TAG_GSUB, - idx, - NULL, - NULL, - NULL, - gsub_glyphs ); + hb( ot_layout_lookup_collect_glyphs )( face, + HB_OT_TAG_GSUB, + idx, + NULL, + NULL, + NULL, + gsub_glyphs ); } #ifdef FT_DEBUG_LEVEL_TRACE @@ -218,34 +219,34 @@ af_style_names[style_class->style] )); FT_TRACE4(( " " )); - gpos_lookups = hb_set_create(); - hb_ot_layout_collect_lookups( face, - HB_OT_TAG_GPOS, - script_tags, - NULL, - coverage_tags, - gpos_lookups ); + gpos_lookups = hb( set_create )(); + hb( ot_layout_collect_lookups )( face, + HB_OT_TAG_GPOS, + script_tags, + NULL, + coverage_tags, + gpos_lookups ); #ifdef FT_DEBUG_LEVEL_TRACE count = 0; #endif - gpos_glyphs = hb_set_create(); - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &idx ); ) + gpos_glyphs = hb( set_create )(); + for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gpos_lookups, &idx ); ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE4(( " %d", idx )); + FT_TRACE4(( " %u", idx )); count++; #endif /* get input coverage of GPOS feature */ - hb_ot_layout_lookup_collect_glyphs( face, - HB_OT_TAG_GPOS, - idx, - NULL, - gpos_glyphs, - NULL, - NULL ); + hb( ot_layout_lookup_collect_glyphs )( face, + HB_OT_TAG_GPOS, + idx, + NULL, + gpos_glyphs, + NULL, + NULL ); } #ifdef FT_DEBUG_LEVEL_TRACE @@ -281,14 +282,14 @@ GET_UTF8_CHAR( ch, p ); - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, - &idx ); ) + for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_lookups, + &idx ); ) { hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch ); - if ( hb_ot_layout_lookup_would_substitute( face, idx, - &gidx, 1, 1 ) ) + if ( hb( ot_layout_lookup_would_substitute )( face, idx, + &gidx, 1, 1 ) ) { found = 1; break; @@ -352,14 +353,14 @@ * */ if ( style_class->coverage != AF_COVERAGE_DEFAULT ) - hb_set_subtract( gsub_glyphs, gpos_glyphs ); + hb( set_subtract )( gsub_glyphs, gpos_glyphs ); #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" )); count = 0; #endif - for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_glyphs, &idx ); ) + for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_glyphs, &idx ); ) { #ifdef FT_DEBUG_LEVEL_TRACE if ( !( count % 10 ) ) @@ -368,7 +369,7 @@ FT_TRACE4(( " " )); } - FT_TRACE4(( " %d", idx )); + FT_TRACE4(( " %u", idx )); count++; #endif @@ -397,10 +398,10 @@ #endif Exit: - hb_set_destroy( gsub_lookups ); - hb_set_destroy( gsub_glyphs ); - hb_set_destroy( gpos_lookups ); - hb_set_destroy( gpos_glyphs ); + hb( set_destroy )( gsub_lookups ); + hb( set_destroy )( gsub_glyphs ); + hb( set_destroy )( gpos_lookups ); + hb( set_destroy )( gpos_glyphs ); return FT_Err_Ok; } @@ -437,31 +438,33 @@ }; - void* - af_shaper_buf_create( FT_Face face ) + static void* + af_shaper_buf_create_hb( AF_FaceGlobals globals ) { - FT_UNUSED( face ); + FT_UNUSED( globals ); - return (void*)hb_buffer_create(); + return (void*)hb( buffer_create )(); } - void - af_shaper_buf_destroy( FT_Face face, - void* buf ) + static void + af_shaper_buf_destroy_hb( AF_FaceGlobals globals, + void* buf ) { - FT_UNUSED( face ); + FT_UNUSED( globals ); - hb_buffer_destroy( (hb_buffer_t*)buf ); + hb( buffer_destroy )( (hb_buffer_t*)buf ); } - const char* - af_shaper_get_cluster( const char* p, - AF_StyleMetrics metrics, - void* buf_, - unsigned int* count ) + static const char* + af_shaper_get_cluster_hb( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ) { + AF_FaceGlobals globals = metrics->globals; + AF_StyleClass style_class; const hb_feature_t* feature; FT_Int upem; @@ -472,6 +475,8 @@ hb_font_t* font; hb_codepoint_t dummy; + FT_UNUSED( globals ); + upem = (FT_Int)metrics->globals->face->units_per_EM; style_class = metrics->style_class; @@ -480,7 +485,7 @@ font = metrics->globals->hb_font; /* we shape at a size of units per EM; this means font units */ - hb_font_set_scale( font, upem, upem ); + hb( font_set_scale )( font, upem, upem ); while ( *p == ' ' ) p++; @@ -492,15 +497,15 @@ len = (int)( q - p ); /* feed character(s) to the HarfBuzz buffer */ - hb_buffer_clear_contents( buf ); - hb_buffer_add_utf8( buf, p, len, 0, len ); + hb( buffer_clear_contents )( buf ); + hb( buffer_add_utf8 )( buf, p, len, 0, len ); /* we let HarfBuzz guess the script and writing direction */ - hb_buffer_guess_segment_properties( buf ); + hb( buffer_guess_segment_properties )( buf ); /* shape buffer, which means conversion from character codes to */ /* glyph indices, possibly applying a feature */ - hb_shape( font, buf, feature, feature ? 1 : 0 ); + hb( shape )( font, buf, feature, feature ? 1 : 0 ); if ( feature ) { @@ -517,13 +522,13 @@ /* glyph indices; otherwise the affected glyph or glyphs aren't */ /* available at all in the feature */ - hb_buffer_clear_contents( hb_buf ); - hb_buffer_add_utf8( hb_buf, p, len, 0, len ); - hb_buffer_guess_segment_properties( hb_buf ); - hb_shape( font, hb_buf, NULL, 0 ); + hb( buffer_clear_contents )( hb_buf ); + hb( buffer_add_utf8 )( hb_buf, p, len, 0, len ); + hb( buffer_guess_segment_properties )( hb_buf ); + hb( shape )( font, hb_buf, NULL, 0 ); - ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); - hb_ginfo = hb_buffer_get_glyph_infos( hb_buf, &hb_gcount ); + ginfo = hb( buffer_get_glyph_infos )( buf, &gcount ); + hb_ginfo = hb( buffer_get_glyph_infos )( hb_buf, &hb_gcount ); if ( gcount == hb_gcount ) { @@ -537,12 +542,12 @@ if ( i == gcount ) { /* both buffers have identical glyph indices */ - hb_buffer_clear_contents( buf ); + hb( buffer_clear_contents )( buf ); } } } - *count = hb_buffer_get_length( buf ); + *count = hb( buffer_get_length )( buf ); #ifdef FT_DEBUG_LEVEL_TRACE if ( feature && *count > 1 ) @@ -554,23 +559,25 @@ } - FT_ULong - af_shaper_get_elem( AF_StyleMetrics metrics, - void* buf_, - unsigned int idx, - FT_Long* advance, - FT_Long* y_offset ) + static FT_ULong + af_shaper_get_elem_hb( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* advance, + FT_Long* y_offset ) { + AF_FaceGlobals globals = metrics->globals; + hb_buffer_t* buf = (hb_buffer_t*)buf_; hb_glyph_info_t* ginfo; hb_glyph_position_t* gpos; unsigned int gcount; - FT_UNUSED( metrics ); + FT_UNUSED( globals ); - ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); - gpos = hb_buffer_get_glyph_positions( buf, &gcount ); + ginfo = hb( buffer_get_glyph_infos )( buf, &gcount ); + gpos = hb( buffer_get_glyph_positions )( buf, &gcount ); if ( idx >= gcount ) return 0; @@ -584,14 +591,14 @@ } -#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ +#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */ - FT_Error - af_shaper_get_coverage( AF_FaceGlobals globals, - AF_StyleClass style_class, - FT_UShort* gstyles, - FT_Bool default_script ) + static FT_Error + af_shaper_get_coverage_nohb( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_UShort* gstyles, + FT_Bool default_script ) { FT_UNUSED( globals ); FT_UNUSED( style_class ); @@ -602,29 +609,29 @@ } - void* - af_shaper_buf_create( FT_Face face ) + static void* + af_shaper_buf_create_nohb( AF_FaceGlobals globals ) { - FT_UNUSED( face ); + FT_UNUSED( globals ); return NULL; } - void - af_shaper_buf_destroy( FT_Face face, - void* buf ) + static void + af_shaper_buf_destroy_nohb( AF_FaceGlobals globals, + void* buf ) { - FT_UNUSED( face ); + FT_UNUSED( globals ); FT_UNUSED( buf ); } - const char* - af_shaper_get_cluster( const char* p, - AF_StyleMetrics metrics, - void* buf_, - unsigned int* count ) + static const char* + af_shaper_get_cluster_nohb( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ) { FT_Face face = metrics->globals->face; FT_ULong ch, dummy = 0; @@ -656,12 +663,12 @@ } - FT_ULong - af_shaper_get_elem( AF_StyleMetrics metrics, - void* buf_, - unsigned int idx, - FT_Long* advance, - FT_Long* y_offset ) + static FT_ULong + af_shaper_get_elem_nohb( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* advance, + FT_Long* y_offset ) { FT_Face face = metrics->globals->face; FT_ULong glyph_index = *(FT_ULong*)buf_; @@ -684,7 +691,90 @@ } -#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + /********************************************************************/ + + FT_Error + af_shaper_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_UShort* gstyles, + FT_Bool default_script ) + { +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + if ( ft_hb_enabled( globals ) ) + return af_shaper_get_coverage_hb( globals, + style_class, + gstyles, + default_script ); + else +#endif + return af_shaper_get_coverage_nohb( globals, + style_class, + gstyles, + default_script ); + } + + + void* + af_shaper_buf_create( AF_FaceGlobals globals ) + { +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + if ( ft_hb_enabled( globals ) ) + return af_shaper_buf_create_hb( globals ); + else +#endif + return af_shaper_buf_create_nohb( globals ); + } + + + void + af_shaper_buf_destroy( AF_FaceGlobals globals, + void* buf ) + { +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + if ( ft_hb_enabled( globals ) ) + af_shaper_buf_destroy_hb( globals, buf ); + else +#endif + af_shaper_buf_destroy_nohb( globals, buf ); + } + + + const char* + af_shaper_get_cluster( const char* p, + AF_StyleMetrics metrics, + void* buf_, + unsigned int* count ) + { +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + if ( ft_hb_enabled( metrics->globals ) ) + return af_shaper_get_cluster_hb( p, metrics, buf_, count ); + else +#endif + return af_shaper_get_cluster_nohb( p, metrics, buf_, count ); + } + + + FT_ULong + af_shaper_get_elem( AF_StyleMetrics metrics, + void* buf_, + unsigned int idx, + FT_Long* advance, + FT_Long* y_offset ) + { +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + if ( ft_hb_enabled( metrics->globals ) ) + return af_shaper_get_elem_hb( metrics, + buf_, + idx, + advance, + y_offset ); +#endif + return af_shaper_get_elem_nohb( metrics, + buf_, + idx, + advance, + y_offset ); + } /* END */ diff --git a/vendor/freetype/src/autofit/afshaper.h b/vendor/freetype/src/autofit/afshaper.h index 2eb03bb5d98..71ecdeb03d4 100644 --- a/vendor/freetype/src/autofit/afshaper.h +++ b/vendor/freetype/src/autofit/afshaper.h @@ -23,17 +23,14 @@ #include -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ - -#include -#include -#include "ft-hb.h" +FT_BEGIN_HEADER +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + FT_LOCAL_ARRAY( hb_script_t ) + af_hb_scripts[]; #endif -FT_BEGIN_HEADER - FT_Error af_shaper_get_coverage( AF_FaceGlobals globals, AF_StyleClass style_class, @@ -42,11 +39,11 @@ FT_BEGIN_HEADER void* - af_shaper_buf_create( FT_Face face ); + af_shaper_buf_create( AF_FaceGlobals globals ); void - af_shaper_buf_destroy( FT_Face face, - void* buf ); + af_shaper_buf_destroy( AF_FaceGlobals globals, + void* buf ); const char* af_shaper_get_cluster( const char* p, diff --git a/vendor/freetype/src/autofit/afstyles.h b/vendor/freetype/src/autofit/afstyles.h index 7a33f37a856..5f3f93eeeda 100644 --- a/vendor/freetype/src/autofit/afstyles.h +++ b/vendor/freetype/src/autofit/afstyles.h @@ -50,36 +50,36 @@ AF_COVERAGE_ ## C ) #undef META_STYLE_LATIN -#define META_STYLE_LATIN( s, S, ds ) \ - STYLE_LATIN( s, S, c2cp, C2CP, ds, \ +#define META_STYLE_LATIN( s, S, ds ) \ + STYLE_LATIN( s, S, c2cp, C2CP, ds, \ "petite capitals from capitals", \ - PETITE_CAPITALS_FROM_CAPITALS ) \ - STYLE_LATIN( s, S, c2sc, C2SC, ds, \ + PETITE_CAPITALS_FROM_CAPITALS ) \ + STYLE_LATIN( s, S, c2sc, C2SC, ds, \ "small capitals from capitals", \ - SMALL_CAPITALS_FROM_CAPITALS ) \ - STYLE_LATIN( s, S, ordn, ORDN, ds, \ - "ordinals", \ - ORDINALS ) \ - STYLE_LATIN( s, S, pcap, PCAP, ds, \ - "petite capitals", \ - PETITE_CAPITALS ) \ - STYLE_LATIN( s, S, sinf, SINF, ds, \ - "scientific inferiors", \ - SCIENTIFIC_INFERIORS ) \ - STYLE_LATIN( s, S, smcp, SMCP, ds, \ - "small capitals", \ - SMALL_CAPITALS ) \ - STYLE_LATIN( s, S, subs, SUBS, ds, \ - "subscript", \ - SUBSCRIPT ) \ - STYLE_LATIN( s, S, sups, SUPS, ds, \ - "superscript", \ - SUPERSCRIPT ) \ - STYLE_LATIN( s, S, titl, TITL, ds, \ - "titling", \ - TITLING ) \ - STYLE_LATIN( s, S, dflt, DFLT, ds, \ - "default", \ + SMALL_CAPITALS_FROM_CAPITALS ) \ + STYLE_LATIN( s, S, ordn, ORDN, ds, \ + "ordinals", \ + ORDINALS ) \ + STYLE_LATIN( s, S, pcap, PCAP, ds, \ + "petite capitals", \ + PETITE_CAPITALS ) \ + STYLE_LATIN( s, S, sinf, SINF, ds, \ + "scientific inferiors", \ + SCIENTIFIC_INFERIORS ) \ + STYLE_LATIN( s, S, smcp, SMCP, ds, \ + "small capitals", \ + SMALL_CAPITALS ) \ + STYLE_LATIN( s, S, subs, SUBS, ds, \ + "subscript", \ + SUBSCRIPT ) \ + STYLE_LATIN( s, S, sups, SUPS, ds, \ + "superscript", \ + SUPERSCRIPT ) \ + STYLE_LATIN( s, S, titl, TITL, ds, \ + "titling", \ + TITLING ) \ + STYLE_LATIN( s, S, dflt, DFLT, ds, \ + "default", \ DEFAULT ) diff --git a/vendor/freetype/src/autofit/aftypes.h b/vendor/freetype/src/autofit/aftypes.h index 27e4185e9f8..b0440474d9b 100644 --- a/vendor/freetype/src/autofit/aftypes.h +++ b/vendor/freetype/src/autofit/aftypes.h @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -406,6 +407,7 @@ extern void* af_debug_hints_; typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; + /* This is the main structure that combines everything. Autofit modules */ /* specific to writing systems derive their structures from it, for */ /* example `AF_LatinMetrics'. */ @@ -418,6 +420,8 @@ extern void* af_debug_hints_; AF_FaceGlobals globals; /* to access properties */ + FT_Hash reverse_charmap; + } AF_StyleMetricsRec; diff --git a/vendor/freetype/src/autofit/autofit.c b/vendor/freetype/src/autofit/autofit.c index de5ec7c7c5c..8349e83518a 100644 --- a/vendor/freetype/src/autofit/autofit.c +++ b/vendor/freetype/src/autofit/autofit.c @@ -19,10 +19,13 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT #include "ft-hb.c" +#include "ft-hb-ft.c" +#include "afadjust.c" #include "afblue.c" #include "afcjk.c" #include "afdummy.c" #include "afglobal.c" +#include "afgsub.c" #include "afhints.c" #include "afindic.c" #include "aflatin.c" diff --git a/vendor/freetype/src/autofit/ft-hb-decls.h b/vendor/freetype/src/autofit/ft-hb-decls.h new file mode 100644 index 00000000000..032d4d37a5e --- /dev/null +++ b/vendor/freetype/src/autofit/ft-hb-decls.h @@ -0,0 +1,203 @@ +/* + * Copyright © 2009, 2023 Red Hat, Inc. + * Copyright © 2015 Google, Inc. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen + * Google Author(s): Behdad Esfahbod + */ + + + /* All HarfBuzz function declarations used by FreeType, taken */ + /* from various public HarfBuzz header files. The wrapper macro */ + /* `HB_EXTERN` is defined in `ft-hb.h`. */ + + +/* hb-blob.h */ + +HB_EXTERN(hb_blob_t *, +hb_blob_create,(const char *data, + unsigned int length, + hb_memory_mode_t mode, + void *user_data, + hb_destroy_func_t destroy)) + +HB_EXTERN(void, +hb_blob_destroy,(hb_blob_t *blob)) + + +/* hb-buffer.h */ + +HB_EXTERN(void, +hb_buffer_add_utf8,(hb_buffer_t *buffer, + const char *text, + int text_length, + unsigned int item_offset, + int item_length)) + +HB_EXTERN(void, +hb_buffer_clear_contents,(hb_buffer_t *buffer)) + +HB_EXTERN(hb_buffer_t *, +hb_buffer_create,(void)) + +HB_EXTERN(void, +hb_buffer_destroy,(hb_buffer_t *buffer)) + +HB_EXTERN(hb_glyph_info_t *, +hb_buffer_get_glyph_infos,(hb_buffer_t *buffer, + unsigned int *length)) + +HB_EXTERN(hb_glyph_position_t *, +hb_buffer_get_glyph_positions,(hb_buffer_t *buffer, + unsigned int *length)) + +HB_EXTERN(unsigned int, +hb_buffer_get_length,(const hb_buffer_t *buffer)) + +HB_EXTERN(void, +hb_buffer_guess_segment_properties,(hb_buffer_t *buffer)) + + +/* hb-face.h */ + +HB_EXTERN(hb_face_t *, +hb_face_create,(hb_blob_t *blob, + unsigned int index)) + +HB_EXTERN(hb_face_t *, +hb_face_create_for_tables,(hb_reference_table_func_t reference_table_func, + void *user_data, + hb_destroy_func_t destroy)) + +HB_EXTERN(void, +hb_face_destroy,(hb_face_t *face)) + +HB_EXTERN(void, +hb_face_set_index,(hb_face_t *face, + unsigned int index)) + +HB_EXTERN(void, +hb_face_set_upem,(hb_face_t *face, + unsigned int upem)) + + +/* hb-font.h */ + +HB_EXTERN(hb_font_t *, +hb_font_create,(hb_face_t *face)) + +HB_EXTERN(void, +hb_font_destroy,(hb_font_t *font)) + +HB_EXTERN(hb_face_t *, +hb_font_get_face,(hb_font_t *font)) + +HB_EXTERN(void, +hb_font_set_scale,(hb_font_t *font, + int x_scale, + int y_scale)) + + +/* hb-ot-layout.h */ + +HB_EXTERN(void, +hb_ot_layout_collect_lookups,(hb_face_t *face, + hb_tag_t table_tag, + const hb_tag_t *scripts, + const hb_tag_t *languages, + const hb_tag_t *features, + hb_set_t *lookup_indexes /* OUT */)) + +HB_EXTERN(void, +hb_ot_layout_lookup_collect_glyphs,(hb_face_t *face, + hb_tag_t table_tag, + unsigned int lookup_index, + hb_set_t *glyphs_before, /* OUT. May be NULL */ + hb_set_t *glyphs_input, /* OUT. May be NULL */ + hb_set_t *glyphs_after, /* OUT. May be NULL */ + hb_set_t *glyphs_output /* OUT. May be NULL */)) + +HB_EXTERN(hb_bool_t, +hb_ot_layout_lookup_would_substitute,(hb_face_t *face, + unsigned int lookup_index, + const hb_codepoint_t *glyphs, + unsigned int glyphs_length, + hb_bool_t zero_context)) + +HB_EXTERN(void, +hb_ot_tags_from_script_and_language,(hb_script_t script, + hb_language_t language, + unsigned int *script_count /* IN/OUT */, + hb_tag_t *script_tags /* OUT */, + unsigned int *language_count /* IN/OUT */, + hb_tag_t *language_tags /* OUT */)) + + +/* hb-set.h */ + +HB_EXTERN(void, +hb_set_add,(hb_set_t *set, + hb_codepoint_t codepoint)) + +HB_EXTERN(void, +hb_set_clear,(hb_set_t *set)) + +HB_EXTERN(hb_set_t *, +hb_set_create,(void)) + +HB_EXTERN(void, +hb_set_destroy,(hb_set_t *set)) + +HB_EXTERN(void, +hb_set_del,(hb_set_t *set, + hb_codepoint_t codepoint)) + +HB_EXTERN(hb_bool_t, +hb_set_has,(const hb_set_t *set, + hb_codepoint_t codepoint)) + +HB_EXTERN(hb_bool_t, +hb_set_is_empty,(const hb_set_t *set)) + +HB_EXTERN(hb_bool_t, +hb_set_next,(const hb_set_t *set, + hb_codepoint_t *codepoint)) + +HB_EXTERN(void, +hb_set_subtract,(hb_set_t *set, + const hb_set_t *other)) + + +/* hb-shape.h */ + +HB_EXTERN(void, +hb_shape,(hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features)) + +HB_EXTERN(hb_bool_t, +hb_version_atleast,(unsigned int major, + unsigned int minor, + unsigned int micro)) + + +/* END */ diff --git a/vendor/freetype/src/autofit/ft-hb-ft.c b/vendor/freetype/src/autofit/ft-hb-ft.c new file mode 100644 index 00000000000..d82106b5430 --- /dev/null +++ b/vendor/freetype/src/autofit/ft-hb-ft.c @@ -0,0 +1,117 @@ +/* + * Copyright © 2009, 2023 Red Hat, Inc. + * Copyright © 2015 Google, Inc. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen + * Google Author(s): Behdad Esfahbod + */ + +#include +#include + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + +#include "ft-hb-ft.h" + +/* The following three functions are a more or less verbatim + * copy of corresponding HarfBuzz code from hb-ft.cc + */ + +static hb_blob_t * +ft_hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data) +{ + AF_FaceGlobals globals = (AF_FaceGlobals) user_data; + + FT_Face ft_face = globals->face; + FT_Byte *buffer; + FT_ULong length = 0; + FT_Error error; + + FT_UNUSED (face); + + /* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */ + + error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length); + if (error) + return NULL; + + buffer = (FT_Byte *) ft_smalloc (length); + if (!buffer) + return NULL; + + error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length); + if (error) + { + free (buffer); + return NULL; + } + + return hb(blob_create) ((const char *) buffer, length, + HB_MEMORY_MODE_WRITABLE, + buffer, ft_sfree); +} + +static hb_face_t * +ft_hb_ft_face_create (AF_FaceGlobals globals) +{ + FT_Face ft_face = globals->face; + + hb_face_t *face; + + if (!ft_face->stream->read) { + hb_blob_t *blob; + + blob = hb(blob_create) ((const char *) ft_face->stream->base, + (unsigned int) ft_face->stream->size, + HB_MEMORY_MODE_READONLY, + ft_face, NULL); + face = hb(face_create) (blob, ft_face->face_index); + hb(blob_destroy) (blob); + } else { + face = hb(face_create_for_tables) (ft_hb_ft_reference_table, globals, NULL); + } + + hb(face_set_index) (face, ft_face->face_index); + hb(face_set_upem) (face, ft_face->units_per_EM); + + return face; +} + +FT_LOCAL_DEF(hb_font_t *) +ft_hb_ft_font_create (AF_FaceGlobals globals) +{ + hb_font_t *font; + hb_face_t *face; + + face = ft_hb_ft_face_create (globals); + font = hb(font_create) (face); + hb(face_destroy) (face); + return font; +} + +#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* ANSI C doesn't like empty source files */ +typedef int ft_hb_ft_dummy_; + +#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* END */ diff --git a/vendor/freetype/src/autofit/ft-hb-ft.h b/vendor/freetype/src/autofit/ft-hb-ft.h new file mode 100644 index 00000000000..f4f1d6291ff --- /dev/null +++ b/vendor/freetype/src/autofit/ft-hb-ft.h @@ -0,0 +1,46 @@ +/* + * Copyright © 2009, 2023 Red Hat, Inc. + * Copyright © 2015 Google, Inc. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen + * Google Author(s): Behdad Esfahbod + */ + +#ifndef FT_HB_FT_H +#define FT_HB_FT_H + +#include "ft-hb.h" + +#include "afglobal.h" + + +FT_BEGIN_HEADER + +FT_LOCAL(hb_font_t *) +ft_hb_ft_font_create (AF_FaceGlobals globals); + + +FT_END_HEADER + +#endif /* FT_HB_FT_H */ + + +/* END */ diff --git a/vendor/freetype/src/autofit/ft-hb-types.h b/vendor/freetype/src/autofit/ft-hb-types.h new file mode 100644 index 00000000000..6176622f7ca --- /dev/null +++ b/vendor/freetype/src/autofit/ft-hb-types.h @@ -0,0 +1,129 @@ +/* + * Copyright © 2009, 2023 Red Hat, Inc. + * Copyright © 2015 Google, Inc. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen + * Google Author(s): Behdad Esfahbod + */ + + + /* This file is a condensed version of the public HarfBuzz header file */ + /* `hb-common.h`, also including some additional HarfBuzz declarations */ + /* and macros. It allows FreeType to load HarfBuzz dynamically without */ + /* actually using its header files. */ + + +#ifndef FT_HB_TYPES_H +#define FT_HB_TYPES_H + +#if defined (_AIX) +# include +#elif defined (_MSC_VER) && _MSC_VER < 1600 +/* VS 2010 (_MSC_VER 1600) has stdint.h */ +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#elif defined (_MSC_VER) && _MSC_VER < 1800 +/* VS 2013 (_MSC_VER 1800) has inttypes.h */ +# include +#else +# include +#endif +#include + +typedef int hb_bool_t; +typedef uint32_t hb_codepoint_t; +#define HB_CODEPOINT_INVALID ((hb_codepoint_t) -1) +typedef uint32_t hb_tag_t; + +#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint32_t)(c1)&0xFF)<<24)|(((uint32_t)(c2)&0xFF)<<16)|(((uint32_t)(c3)&0xFF)<<8)|((uint32_t)(c4)&0xFF))) +#define HB_TAG_NONE HB_TAG(0,0,0,0) +#define HB_TAG_MAX_SIGNED HB_TAG(0x7f,0xff,0xff,0xff) +#define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T') +#define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') +#define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') + +typedef int32_t hb_position_t; +typedef uint32_t hb_mask_t; + +typedef enum { + HB_DIRECTION_INVALID = 0, + HB_DIRECTION_LTR = 4, + HB_DIRECTION_RTL, + HB_DIRECTION_TTB, + HB_DIRECTION_BTT +} hb_direction_t; +typedef enum { + HB_MEMORY_MODE_DUPLICATE, + HB_MEMORY_MODE_READONLY, + HB_MEMORY_MODE_WRITABLE, + HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE +} hb_memory_mode_t; + +#define HB_NO_SINGLE_HEADER_ERROR +#include "hb-script-list.h" +#undef HB_NO_SINGLE_HEADER_ERROR + +typedef const struct hb_language_impl_t *hb_language_t; +#define HB_LANGUAGE_INVALID ((hb_language_t) 0) +#define HB_SET_VALUE_INVALID HB_CODEPOINT_INVALID + +typedef struct hb_feature_t { + hb_tag_t tag; + uint32_t value; + unsigned int start; + unsigned int end; +} hb_feature_t; + +#define HB_FEATURE_GLOBAL_START 0 +#define HB_FEATURE_GLOBAL_END ((unsigned int) -1) + +typedef struct hb_glyph_info_t { + hb_codepoint_t codepoint; + hb_mask_t mask; + uint32_t cluster; + uint32_t var1; + uint32_t var2; +} hb_glyph_info_t; + +typedef struct hb_glyph_position_t { + hb_position_t x_advance; + hb_position_t y_advance; + hb_position_t x_offset; + hb_position_t y_offset; + uint32_t var; +} hb_glyph_position_t; + +typedef struct hb_blob_t hb_blob_t; +typedef struct hb_buffer_t hb_buffer_t; +typedef struct hb_face_t hb_face_t; +typedef struct hb_font_t hb_font_t; +typedef struct hb_set_t hb_set_t; + +typedef void (*hb_destroy_func_t) (void *data); +typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag, void *user_data); + +#endif /* FT_HB_TYPES_H */ diff --git a/vendor/freetype/src/autofit/ft-hb.c b/vendor/freetype/src/autofit/ft-hb.c index 71aee045503..3c145d04640 100644 --- a/vendor/freetype/src/autofit/ft-hb.c +++ b/vendor/freetype/src/autofit/ft-hb.c @@ -1,115 +1,197 @@ -/* - * Copyright © 2009, 2023 Red Hat, Inc. - * Copyright © 2015 Google, Inc. +/**************************************************************************** * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. + * ft-hb.c * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. + * FreeType-HarfBuzz bridge (body). * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * Copyright (C) 2025 by + * Behdad Esfahbod. + * + * 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. * - * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen - * Google Author(s): Behdad Esfahbod */ + +#if !defined( _WIN32 ) && !defined( _GNU_SOURCE ) +# define _GNU_SOURCE 1 /* for RTLD_DEFAULT */ +#endif + #include -#include +#include -#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ +#include "afglobal.h" #include "ft-hb.h" -/* The following three functions are a more or less verbatim - * copy of corresponding HarfBuzz code from hb-ft.cc - */ -static hb_blob_t * -hb_ft_reference_table_ (hb_face_t *face, hb_tag_t tag, void *user_data) -{ - FT_Face ft_face = (FT_Face) user_data; - FT_Byte *buffer; - FT_ULong length = 0; - FT_Error error; +#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \ + defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) + +#ifndef FT_LIBHARFBUZZ +# ifdef _WIN32 +# define FT_LIBHARFBUZZ "libharfbuzz-0.dll" +# else +# ifdef __APPLE__ +# define FT_LIBHARFBUZZ "libharfbuzz.0.dylib" +# else +# define FT_LIBHARFBUZZ "libharfbuzz.so.0" +# endif +# endif +#endif - FT_UNUSED (face); +#ifdef _WIN32 - /* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */ +# include - error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length); - if (error) - return NULL; +#else /* !_WIN32 */ - buffer = (FT_Byte *) ft_smalloc (length); - if (!buffer) - return NULL; +# include - error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length); - if (error) + /* The GCC pragma suppresses the warning "ISO C forbids */ + /* assignment between function pointer and 'void *'", which */ + /* inevitably gets emitted with `-Wpedantic`; see the man */ + /* page of function `dlsym` for more information. */ +# if defined( __GNUC__ ) +# pragma GCC diagnostic push +# ifndef __cplusplus +# pragma GCC diagnostic ignored "-Wpedantic" +# endif +# endif + +#endif /* !_WIN32 */ + + + FT_LOCAL_DEF( void ) + ft_hb_funcs_init( struct AF_ModuleRec_ *af_module ) { - free (buffer); - return NULL; + FT_Memory memory = af_module->root.memory; + FT_Error error; + + ft_hb_funcs_t *funcs = NULL; + ft_hb_version_atleast_func_t version_atleast = NULL; + +#ifdef _WIN32 + HANDLE lib; +# define DLSYM( lib, name ) \ + (ft_ ## name ## _func_t)GetProcAddress( lib, #name ) +#else + void *lib; +# define DLSYM( lib, name ) \ + (ft_ ## name ## _func_t)dlsym( lib, #name ) +#endif + + + af_module->hb_funcs = NULL; + + if ( FT_NEW( funcs ) ) + return; + FT_ZERO( funcs ); + +#ifdef _WIN32 + + lib = LoadLibraryA( FT_LIBHARFBUZZ ); + if ( !lib ) + goto Fail; + version_atleast = DLSYM( lib, hb_version_atleast ); + +#else /* !_WIN32 */ + +# ifdef RTLD_DEFAULT +# define FT_RTLD_FLAGS RTLD_LAZY | RTLD_GLOBAL + lib = RTLD_DEFAULT; + version_atleast = DLSYM( lib, hb_version_atleast ); +# else +# define FT_RTLD_FLAGS RTLD_LAZY +# endif + + if ( !version_atleast ) + { + /* Load the HarfBuzz library. + * + * We never close the library, since we opened it with RTLD_GLOBAL. + * This is important for the case where we are using HarfBuzz as a + * shared library, and we want to use the symbols from the library in + * other shared libraries or clients. HarfBuzz holds onto global + * variables, and closing the library will cause them to be + * invalidated. + */ + lib = dlopen( FT_LIBHARFBUZZ, FT_RTLD_FLAGS ); + if ( !lib ) + goto Fail; + version_atleast = DLSYM( lib, hb_version_atleast ); + } + +#endif /* !_WIN32 */ + + if ( !version_atleast ) + goto Fail; + + /* Load all symbols we use. */ +#define HB_EXTERN( ret, name, args ) \ + { \ + funcs->name = DLSYM( lib, name ); \ + if ( !funcs->name ) \ + goto Fail; \ } +#include "ft-hb-decls.h" +#undef HB_EXTERN - return hb_blob_create ((const char *) buffer, length, - HB_MEMORY_MODE_WRITABLE, - buffer, ft_sfree); -} - -static hb_face_t * -hb_ft_face_create_ (FT_Face ft_face, - hb_destroy_func_t destroy) -{ - hb_face_t *face; - - if (!ft_face->stream->read) { - hb_blob_t *blob; - - blob = hb_blob_create ((const char *) ft_face->stream->base, - (unsigned int) ft_face->stream->size, - HB_MEMORY_MODE_READONLY, - ft_face, destroy); - face = hb_face_create (blob, ft_face->face_index); - hb_blob_destroy (blob); - } else { - face = hb_face_create_for_tables (hb_ft_reference_table_, ft_face, destroy); +#undef DLSYM + + af_module->hb_funcs = funcs; + return; + + Fail: + if ( funcs ) + FT_FREE( funcs ); } - hb_face_set_index (face, ft_face->face_index); - hb_face_set_upem (face, ft_face->units_per_EM); - return face; -} + FT_LOCAL_DEF( void ) + ft_hb_funcs_done( struct AF_ModuleRec_ *af_module ) + { + FT_Memory memory = af_module->root.memory; -FT_LOCAL_DEF(hb_font_t *) -hb_ft_font_create_ (FT_Face ft_face, - hb_destroy_func_t destroy) -{ - hb_font_t *font; - hb_face_t *face; - face = hb_ft_face_create_ (ft_face, destroy); - font = hb_font_create (face); - hb_face_destroy (face); - return font; -} + if ( af_module->hb_funcs ) + { + FT_FREE( af_module->hb_funcs ); + af_module->hb_funcs = NULL; + } + } + + + FT_LOCAL_DEF( FT_Bool ) + ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals ) + { + return globals->module->hb_funcs != NULL; + } + +#ifndef _WIN32 +# if defined( __GNUC__ ) +# pragma GCC diagnostic pop +# endif +#endif -#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ +#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */ + + FT_LOCAL_DEF( FT_Bool ) + ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals ) + { + FT_UNUSED( globals ); + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + return TRUE; +#else + return FALSE; +#endif + } -/* ANSI C doesn't like empty source files */ -typedef int ft_hb_dummy_; +#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */ -#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ /* END */ diff --git a/vendor/freetype/src/autofit/ft-hb.h b/vendor/freetype/src/autofit/ft-hb.h index 92a5774bc46..95914deb8d3 100644 --- a/vendor/freetype/src/autofit/ft-hb.h +++ b/vendor/freetype/src/autofit/ft-hb.h @@ -1,43 +1,77 @@ -/* - * Copyright © 2009, 2023 Red Hat, Inc. - * Copyright © 2015 Google, Inc. +/**************************************************************************** * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. + * ft-hb.h * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. + * FreeType-HarfBuzz bridge (specification). * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * Copyright (C) 2025 by + * Behdad Esfahbod. + * + * 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. * - * Red Hat Author(s): Behdad Esfahbod, Matthias Clasen - * Google Author(s): Behdad Esfahbod */ + #ifndef FT_HB_H #define FT_HB_H -#include - #include #include FT_BEGIN_HEADER -FT_LOCAL(hb_font_t *) -hb_ft_font_create_ (FT_Face ft_face, - hb_destroy_func_t destroy); +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + +# include "ft-hb-types.h" + +# ifdef FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC + +# define HB_EXTERN( ret, name, args ) \ + typedef ret (*ft_ ## name ## _func_t) args; +# include "ft-hb-decls.h" +# undef HB_EXTERN + + typedef struct ft_hb_funcs_t + { +# define HB_EXTERN( ret, name, args ) \ + ft_ ## name ## _func_t name; +# include "ft-hb-decls.h" +# undef HB_EXTERN + } ft_hb_funcs_t; + + struct AF_ModuleRec_; + + FT_LOCAL( void ) + ft_hb_funcs_init( struct AF_ModuleRec_ *af_module ); + + FT_LOCAL( void ) + ft_hb_funcs_done( struct AF_ModuleRec_ *af_module ); + +# define hb( x ) globals->module->hb_funcs->hb_ ## x + +# else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */ + +# define HB_EXTERN( ret, name, args ) \ + ret name args; +# include "ft-hb-decls.h" +# undef HB_EXTERN + +# define hb( x ) hb_ ## x + +# endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */ + +#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */ + + + struct AF_FaceGlobalsRec_; + + FT_LOCAL( FT_Bool ) + ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals ); FT_END_HEADER diff --git a/vendor/freetype/src/autofit/hb-script-list.h b/vendor/freetype/src/autofit/hb-script-list.h new file mode 100644 index 00000000000..88e270d3479 --- /dev/null +++ b/vendor/freetype/src/autofit/hb-script-list.h @@ -0,0 +1,484 @@ +/* + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) +#error "Include instead." +#endif + +#ifndef HB_SCRIPT_LIST_H +#define HB_SCRIPT_LIST_H + +/* This file belongs to the middle of hb-common.h. + * The reason it has been surgically extracted is because + * FreeType imports types and enums from hb-common.h, + * and since this enum is large and growing, we want to + * make it easy to just copy the file over to FreeType. + * https://github.com/harfbuzz/harfbuzz/issues/5271 + */ + +/* Dummy lines to make our checks happy. */ +#if 0 +#include "hb-common.h" +HB_BEGIN_DECLS +HB_END_DECLS +#endif + + +/** + * hb_script_t: + * @HB_SCRIPT_COMMON: `Zyyy` + * @HB_SCRIPT_INHERITED: `Zinh` + * @HB_SCRIPT_UNKNOWN: `Zzzz` + * @HB_SCRIPT_ARABIC: `Arab` + * @HB_SCRIPT_ARMENIAN: `Armn` + * @HB_SCRIPT_BENGALI: `Beng` + * @HB_SCRIPT_CYRILLIC: `Cyrl` + * @HB_SCRIPT_DEVANAGARI: `Deva` + * @HB_SCRIPT_GEORGIAN: `Geor` + * @HB_SCRIPT_GREEK: `Grek` + * @HB_SCRIPT_GUJARATI: `Gujr` + * @HB_SCRIPT_GURMUKHI: `Guru` + * @HB_SCRIPT_HANGUL: `Hang` + * @HB_SCRIPT_HAN: `Hani` + * @HB_SCRIPT_HEBREW: `Hebr` + * @HB_SCRIPT_HIRAGANA: `Hira` + * @HB_SCRIPT_KANNADA: `Knda` + * @HB_SCRIPT_KATAKANA: `Kana` + * @HB_SCRIPT_LAO: `Laoo` + * @HB_SCRIPT_LATIN: `Latn` + * @HB_SCRIPT_MALAYALAM: `Mlym` + * @HB_SCRIPT_ORIYA: `Orya` + * @HB_SCRIPT_TAMIL: `Taml` + * @HB_SCRIPT_TELUGU: `Telu` + * @HB_SCRIPT_THAI: `Thai` + * @HB_SCRIPT_TIBETAN: `Tibt` + * @HB_SCRIPT_BOPOMOFO: `Bopo` + * @HB_SCRIPT_BRAILLE: `Brai` + * @HB_SCRIPT_CANADIAN_SYLLABICS: `Cans` + * @HB_SCRIPT_CHEROKEE: `Cher` + * @HB_SCRIPT_ETHIOPIC: `Ethi` + * @HB_SCRIPT_KHMER: `Khmr` + * @HB_SCRIPT_MONGOLIAN: `Mong` + * @HB_SCRIPT_MYANMAR: `Mymr` + * @HB_SCRIPT_OGHAM: `Ogam` + * @HB_SCRIPT_RUNIC: `Runr` + * @HB_SCRIPT_SINHALA: `Sinh` + * @HB_SCRIPT_SYRIAC: `Syrc` + * @HB_SCRIPT_THAANA: `Thaa` + * @HB_SCRIPT_YI: `Yiii` + * @HB_SCRIPT_DESERET: `Dsrt` + * @HB_SCRIPT_GOTHIC: `Goth` + * @HB_SCRIPT_OLD_ITALIC: `Ital` + * @HB_SCRIPT_BUHID: `Buhd` + * @HB_SCRIPT_HANUNOO: `Hano` + * @HB_SCRIPT_TAGALOG: `Tglg` + * @HB_SCRIPT_TAGBANWA: `Tagb` + * @HB_SCRIPT_CYPRIOT: `Cprt` + * @HB_SCRIPT_LIMBU: `Limb` + * @HB_SCRIPT_LINEAR_B: `Linb` + * @HB_SCRIPT_OSMANYA: `Osma` + * @HB_SCRIPT_SHAVIAN: `Shaw` + * @HB_SCRIPT_TAI_LE: `Tale` + * @HB_SCRIPT_UGARITIC: `Ugar` + * @HB_SCRIPT_BUGINESE: `Bugi` + * @HB_SCRIPT_COPTIC: `Copt` + * @HB_SCRIPT_GLAGOLITIC: `Glag` + * @HB_SCRIPT_KHAROSHTHI: `Khar` + * @HB_SCRIPT_NEW_TAI_LUE: `Talu` + * @HB_SCRIPT_OLD_PERSIAN: `Xpeo` + * @HB_SCRIPT_SYLOTI_NAGRI: `Sylo` + * @HB_SCRIPT_TIFINAGH: `Tfng` + * @HB_SCRIPT_BALINESE: `Bali` + * @HB_SCRIPT_CUNEIFORM: `Xsux` + * @HB_SCRIPT_NKO: `Nkoo` + * @HB_SCRIPT_PHAGS_PA: `Phag` + * @HB_SCRIPT_PHOENICIAN: `Phnx` + * @HB_SCRIPT_CARIAN: `Cari` + * @HB_SCRIPT_CHAM: `Cham` + * @HB_SCRIPT_KAYAH_LI: `Kali` + * @HB_SCRIPT_LEPCHA: `Lepc` + * @HB_SCRIPT_LYCIAN: `Lyci` + * @HB_SCRIPT_LYDIAN: `Lydi` + * @HB_SCRIPT_OL_CHIKI: `Olck` + * @HB_SCRIPT_REJANG: `Rjng` + * @HB_SCRIPT_SAURASHTRA: `Saur` + * @HB_SCRIPT_SUNDANESE: `Sund` + * @HB_SCRIPT_VAI: `Vaii` + * @HB_SCRIPT_AVESTAN: `Avst` + * @HB_SCRIPT_BAMUM: `Bamu` + * @HB_SCRIPT_EGYPTIAN_HIEROGLYPHS: `Egyp` + * @HB_SCRIPT_IMPERIAL_ARAMAIC: `Armi` + * @HB_SCRIPT_INSCRIPTIONAL_PAHLAVI: `Phli` + * @HB_SCRIPT_INSCRIPTIONAL_PARTHIAN: `Prti` + * @HB_SCRIPT_JAVANESE: `Java` + * @HB_SCRIPT_KAITHI: `Kthi` + * @HB_SCRIPT_LISU: `Lisu` + * @HB_SCRIPT_MEETEI_MAYEK: `Mtei` + * @HB_SCRIPT_OLD_SOUTH_ARABIAN: `Sarb` + * @HB_SCRIPT_OLD_TURKIC: `Orkh` + * @HB_SCRIPT_SAMARITAN: `Samr` + * @HB_SCRIPT_TAI_THAM: `Lana` + * @HB_SCRIPT_TAI_VIET: `Tavt` + * @HB_SCRIPT_BATAK: `Batk` + * @HB_SCRIPT_BRAHMI: `Brah` + * @HB_SCRIPT_MANDAIC: `Mand` + * @HB_SCRIPT_CHAKMA: `Cakm` + * @HB_SCRIPT_MEROITIC_CURSIVE: `Merc` + * @HB_SCRIPT_MEROITIC_HIEROGLYPHS: `Mero` + * @HB_SCRIPT_MIAO: `Plrd` + * @HB_SCRIPT_SHARADA: `Shrd` + * @HB_SCRIPT_SORA_SOMPENG: `Sora` + * @HB_SCRIPT_TAKRI: `Takr` + * @HB_SCRIPT_BASSA_VAH: `Bass`, Since: 0.9.30 + * @HB_SCRIPT_CAUCASIAN_ALBANIAN: `Aghb`, Since: 0.9.30 + * @HB_SCRIPT_DUPLOYAN: `Dupl`, Since: 0.9.30 + * @HB_SCRIPT_ELBASAN: `Elba`, Since: 0.9.30 + * @HB_SCRIPT_GRANTHA: `Gran`, Since: 0.9.30 + * @HB_SCRIPT_KHOJKI: `Khoj`, Since: 0.9.30 + * @HB_SCRIPT_KHUDAWADI: `Sind`, Since: 0.9.30 + * @HB_SCRIPT_LINEAR_A: `Lina`, Since: 0.9.30 + * @HB_SCRIPT_MAHAJANI: `Mahj`, Since: 0.9.30 + * @HB_SCRIPT_MANICHAEAN: `Mani`, Since: 0.9.30 + * @HB_SCRIPT_MENDE_KIKAKUI: `Mend`, Since: 0.9.30 + * @HB_SCRIPT_MODI: `Modi`, Since: 0.9.30 + * @HB_SCRIPT_MRO: `Mroo`, Since: 0.9.30 + * @HB_SCRIPT_NABATAEAN: `Nbat`, Since: 0.9.30 + * @HB_SCRIPT_OLD_NORTH_ARABIAN: `Narb`, Since: 0.9.30 + * @HB_SCRIPT_OLD_PERMIC: `Perm`, Since: 0.9.30 + * @HB_SCRIPT_PAHAWH_HMONG: `Hmng`, Since: 0.9.30 + * @HB_SCRIPT_PALMYRENE: `Palm`, Since: 0.9.30 + * @HB_SCRIPT_PAU_CIN_HAU: `Pauc`, Since: 0.9.30 + * @HB_SCRIPT_PSALTER_PAHLAVI: `Phlp`, Since: 0.9.30 + * @HB_SCRIPT_SIDDHAM: `Sidd`, Since: 0.9.30 + * @HB_SCRIPT_TIRHUTA: `Tirh`, Since: 0.9.30 + * @HB_SCRIPT_WARANG_CITI: `Wara`, Since: 0.9.30 + * @HB_SCRIPT_AHOM: `Ahom`, Since: 0.9.30 + * @HB_SCRIPT_ANATOLIAN_HIEROGLYPHS: `Hluw`, Since: 0.9.30 + * @HB_SCRIPT_HATRAN: `Hatr`, Since: 0.9.30 + * @HB_SCRIPT_MULTANI: `Mult`, Since: 0.9.30 + * @HB_SCRIPT_OLD_HUNGARIAN: `Hung`, Since: 0.9.30 + * @HB_SCRIPT_SIGNWRITING: `Sgnw`, Since: 0.9.30 + * @HB_SCRIPT_ADLAM: `Adlm`, Since: 1.3.0 + * @HB_SCRIPT_BHAIKSUKI: `Bhks`, Since: 1.3.0 + * @HB_SCRIPT_MARCHEN: `Marc`, Since: 1.3.0 + * @HB_SCRIPT_OSAGE: `Osge`, Since: 1.3.0 + * @HB_SCRIPT_TANGUT: `Tang`, Since: 1.3.0 + * @HB_SCRIPT_NEWA: `Newa`, Since: 1.3.0 + * @HB_SCRIPT_MASARAM_GONDI: `Gonm`, Since: 1.6.0 + * @HB_SCRIPT_NUSHU: `Nshu`, Since: 1.6.0 + * @HB_SCRIPT_SOYOMBO: `Soyo`, Since: 1.6.0 + * @HB_SCRIPT_ZANABAZAR_SQUARE: `Zanb`, Since: 1.6.0 + * @HB_SCRIPT_DOGRA: `Dogr`, Since: 1.8.0 + * @HB_SCRIPT_GUNJALA_GONDI: `Gong`, Since: 1.8.0 + * @HB_SCRIPT_HANIFI_ROHINGYA: `Rohg`, Since: 1.8.0 + * @HB_SCRIPT_MAKASAR: `Maka`, Since: 1.8.0 + * @HB_SCRIPT_MEDEFAIDRIN: `Medf`, Since: 1.8.0 + * @HB_SCRIPT_OLD_SOGDIAN: `Sogo`, Since: 1.8.0 + * @HB_SCRIPT_SOGDIAN: `Sogd`, Since: 1.8.0 + * @HB_SCRIPT_ELYMAIC: `Elym`, Since: 2.4.0 + * @HB_SCRIPT_NANDINAGARI: `Nand`, Since: 2.4.0 + * @HB_SCRIPT_NYIAKENG_PUACHUE_HMONG: `Hmnp`, Since: 2.4.0 + * @HB_SCRIPT_WANCHO: `Wcho`, Since: 2.4.0 + * @HB_SCRIPT_CHORASMIAN: `Chrs`, Since: 2.6.7 + * @HB_SCRIPT_DIVES_AKURU: `Diak`, Since: 2.6.7 + * @HB_SCRIPT_KHITAN_SMALL_SCRIPT: `Kits`, Since: 2.6.7 + * @HB_SCRIPT_YEZIDI: `Yezi`, Since: 2.6.7 + * @HB_SCRIPT_CYPRO_MINOAN: `Cpmn`, Since: 3.0.0 + * @HB_SCRIPT_OLD_UYGHUR: `Ougr`, Since: 3.0.0 + * @HB_SCRIPT_TANGSA: `Tnsa`, Since: 3.0.0 + * @HB_SCRIPT_TOTO: `Toto`, Since: 3.0.0 + * @HB_SCRIPT_VITHKUQI: `Vith`, Since: 3.0.0 + * @HB_SCRIPT_MATH: `Zmth`, Since: 3.4.0 + * @HB_SCRIPT_KAWI: `Kawi`, Since: 5.2.0 + * @HB_SCRIPT_NAG_MUNDARI: `Nagm`, Since: 5.2.0 + * @HB_SCRIPT_GARAY: `Gara`, Since: 10.0.0 + * @HB_SCRIPT_GURUNG_KHEMA: `Gukh`, Since: 10.0.0 + * @HB_SCRIPT_KIRAT_RAI: `Krai`, Since: 10.0.0 + * @HB_SCRIPT_OL_ONAL: `Onao`, Since: 10.0.0 + * @HB_SCRIPT_SUNUWAR: `Sunu`, Since: 10.0.0 + * @HB_SCRIPT_TODHRI: `Todr`, Since: 10.0.0 + * @HB_SCRIPT_TULU_TIGALARI: `Tutg`, Since: 10.0.0 + * @HB_SCRIPT_INVALID: No script set + * + * Data type for scripts. Each #hb_script_t's value is an #hb_tag_t corresponding + * to the four-letter values defined by [ISO 15924](https://unicode.org/iso15924/). + * + * See also the Script (sc) property of the Unicode Character Database. + * + **/ + +/* https://docs.google.com/spreadsheets/d/1Y90M0Ie3MUJ6UVCRDOypOtijlMDLNNyyLk36T6iMu0o */ +typedef enum +{ + HB_SCRIPT_COMMON = HB_TAG ('Z','y','y','y'), /*1.1*/ + HB_SCRIPT_INHERITED = HB_TAG ('Z','i','n','h'), /*1.1*/ + HB_SCRIPT_UNKNOWN = HB_TAG ('Z','z','z','z'), /*5.0*/ + + HB_SCRIPT_ARABIC = HB_TAG ('A','r','a','b'), /*1.1*/ + HB_SCRIPT_ARMENIAN = HB_TAG ('A','r','m','n'), /*1.1*/ + HB_SCRIPT_BENGALI = HB_TAG ('B','e','n','g'), /*1.1*/ + HB_SCRIPT_CYRILLIC = HB_TAG ('C','y','r','l'), /*1.1*/ + HB_SCRIPT_DEVANAGARI = HB_TAG ('D','e','v','a'), /*1.1*/ + HB_SCRIPT_GEORGIAN = HB_TAG ('G','e','o','r'), /*1.1*/ + HB_SCRIPT_GREEK = HB_TAG ('G','r','e','k'), /*1.1*/ + HB_SCRIPT_GUJARATI = HB_TAG ('G','u','j','r'), /*1.1*/ + HB_SCRIPT_GURMUKHI = HB_TAG ('G','u','r','u'), /*1.1*/ + HB_SCRIPT_HANGUL = HB_TAG ('H','a','n','g'), /*1.1*/ + HB_SCRIPT_HAN = HB_TAG ('H','a','n','i'), /*1.1*/ + HB_SCRIPT_HEBREW = HB_TAG ('H','e','b','r'), /*1.1*/ + HB_SCRIPT_HIRAGANA = HB_TAG ('H','i','r','a'), /*1.1*/ + HB_SCRIPT_KANNADA = HB_TAG ('K','n','d','a'), /*1.1*/ + HB_SCRIPT_KATAKANA = HB_TAG ('K','a','n','a'), /*1.1*/ + HB_SCRIPT_LAO = HB_TAG ('L','a','o','o'), /*1.1*/ + HB_SCRIPT_LATIN = HB_TAG ('L','a','t','n'), /*1.1*/ + HB_SCRIPT_MALAYALAM = HB_TAG ('M','l','y','m'), /*1.1*/ + HB_SCRIPT_ORIYA = HB_TAG ('O','r','y','a'), /*1.1*/ + HB_SCRIPT_TAMIL = HB_TAG ('T','a','m','l'), /*1.1*/ + HB_SCRIPT_TELUGU = HB_TAG ('T','e','l','u'), /*1.1*/ + HB_SCRIPT_THAI = HB_TAG ('T','h','a','i'), /*1.1*/ + + HB_SCRIPT_TIBETAN = HB_TAG ('T','i','b','t'), /*2.0*/ + + HB_SCRIPT_BOPOMOFO = HB_TAG ('B','o','p','o'), /*3.0*/ + HB_SCRIPT_BRAILLE = HB_TAG ('B','r','a','i'), /*3.0*/ + HB_SCRIPT_CANADIAN_SYLLABICS = HB_TAG ('C','a','n','s'), /*3.0*/ + HB_SCRIPT_CHEROKEE = HB_TAG ('C','h','e','r'), /*3.0*/ + HB_SCRIPT_ETHIOPIC = HB_TAG ('E','t','h','i'), /*3.0*/ + HB_SCRIPT_KHMER = HB_TAG ('K','h','m','r'), /*3.0*/ + HB_SCRIPT_MONGOLIAN = HB_TAG ('M','o','n','g'), /*3.0*/ + HB_SCRIPT_MYANMAR = HB_TAG ('M','y','m','r'), /*3.0*/ + HB_SCRIPT_OGHAM = HB_TAG ('O','g','a','m'), /*3.0*/ + HB_SCRIPT_RUNIC = HB_TAG ('R','u','n','r'), /*3.0*/ + HB_SCRIPT_SINHALA = HB_TAG ('S','i','n','h'), /*3.0*/ + HB_SCRIPT_SYRIAC = HB_TAG ('S','y','r','c'), /*3.0*/ + HB_SCRIPT_THAANA = HB_TAG ('T','h','a','a'), /*3.0*/ + HB_SCRIPT_YI = HB_TAG ('Y','i','i','i'), /*3.0*/ + + HB_SCRIPT_DESERET = HB_TAG ('D','s','r','t'), /*3.1*/ + HB_SCRIPT_GOTHIC = HB_TAG ('G','o','t','h'), /*3.1*/ + HB_SCRIPT_OLD_ITALIC = HB_TAG ('I','t','a','l'), /*3.1*/ + + HB_SCRIPT_BUHID = HB_TAG ('B','u','h','d'), /*3.2*/ + HB_SCRIPT_HANUNOO = HB_TAG ('H','a','n','o'), /*3.2*/ + HB_SCRIPT_TAGALOG = HB_TAG ('T','g','l','g'), /*3.2*/ + HB_SCRIPT_TAGBANWA = HB_TAG ('T','a','g','b'), /*3.2*/ + + HB_SCRIPT_CYPRIOT = HB_TAG ('C','p','r','t'), /*4.0*/ + HB_SCRIPT_LIMBU = HB_TAG ('L','i','m','b'), /*4.0*/ + HB_SCRIPT_LINEAR_B = HB_TAG ('L','i','n','b'), /*4.0*/ + HB_SCRIPT_OSMANYA = HB_TAG ('O','s','m','a'), /*4.0*/ + HB_SCRIPT_SHAVIAN = HB_TAG ('S','h','a','w'), /*4.0*/ + HB_SCRIPT_TAI_LE = HB_TAG ('T','a','l','e'), /*4.0*/ + HB_SCRIPT_UGARITIC = HB_TAG ('U','g','a','r'), /*4.0*/ + + HB_SCRIPT_BUGINESE = HB_TAG ('B','u','g','i'), /*4.1*/ + HB_SCRIPT_COPTIC = HB_TAG ('C','o','p','t'), /*4.1*/ + HB_SCRIPT_GLAGOLITIC = HB_TAG ('G','l','a','g'), /*4.1*/ + HB_SCRIPT_KHAROSHTHI = HB_TAG ('K','h','a','r'), /*4.1*/ + HB_SCRIPT_NEW_TAI_LUE = HB_TAG ('T','a','l','u'), /*4.1*/ + HB_SCRIPT_OLD_PERSIAN = HB_TAG ('X','p','e','o'), /*4.1*/ + HB_SCRIPT_SYLOTI_NAGRI = HB_TAG ('S','y','l','o'), /*4.1*/ + HB_SCRIPT_TIFINAGH = HB_TAG ('T','f','n','g'), /*4.1*/ + + HB_SCRIPT_BALINESE = HB_TAG ('B','a','l','i'), /*5.0*/ + HB_SCRIPT_CUNEIFORM = HB_TAG ('X','s','u','x'), /*5.0*/ + HB_SCRIPT_NKO = HB_TAG ('N','k','o','o'), /*5.0*/ + HB_SCRIPT_PHAGS_PA = HB_TAG ('P','h','a','g'), /*5.0*/ + HB_SCRIPT_PHOENICIAN = HB_TAG ('P','h','n','x'), /*5.0*/ + + HB_SCRIPT_CARIAN = HB_TAG ('C','a','r','i'), /*5.1*/ + HB_SCRIPT_CHAM = HB_TAG ('C','h','a','m'), /*5.1*/ + HB_SCRIPT_KAYAH_LI = HB_TAG ('K','a','l','i'), /*5.1*/ + HB_SCRIPT_LEPCHA = HB_TAG ('L','e','p','c'), /*5.1*/ + HB_SCRIPT_LYCIAN = HB_TAG ('L','y','c','i'), /*5.1*/ + HB_SCRIPT_LYDIAN = HB_TAG ('L','y','d','i'), /*5.1*/ + HB_SCRIPT_OL_CHIKI = HB_TAG ('O','l','c','k'), /*5.1*/ + HB_SCRIPT_REJANG = HB_TAG ('R','j','n','g'), /*5.1*/ + HB_SCRIPT_SAURASHTRA = HB_TAG ('S','a','u','r'), /*5.1*/ + HB_SCRIPT_SUNDANESE = HB_TAG ('S','u','n','d'), /*5.1*/ + HB_SCRIPT_VAI = HB_TAG ('V','a','i','i'), /*5.1*/ + + HB_SCRIPT_AVESTAN = HB_TAG ('A','v','s','t'), /*5.2*/ + HB_SCRIPT_BAMUM = HB_TAG ('B','a','m','u'), /*5.2*/ + HB_SCRIPT_EGYPTIAN_HIEROGLYPHS = HB_TAG ('E','g','y','p'), /*5.2*/ + HB_SCRIPT_IMPERIAL_ARAMAIC = HB_TAG ('A','r','m','i'), /*5.2*/ + HB_SCRIPT_INSCRIPTIONAL_PAHLAVI = HB_TAG ('P','h','l','i'), /*5.2*/ + HB_SCRIPT_INSCRIPTIONAL_PARTHIAN = HB_TAG ('P','r','t','i'), /*5.2*/ + HB_SCRIPT_JAVANESE = HB_TAG ('J','a','v','a'), /*5.2*/ + HB_SCRIPT_KAITHI = HB_TAG ('K','t','h','i'), /*5.2*/ + HB_SCRIPT_LISU = HB_TAG ('L','i','s','u'), /*5.2*/ + HB_SCRIPT_MEETEI_MAYEK = HB_TAG ('M','t','e','i'), /*5.2*/ + HB_SCRIPT_OLD_SOUTH_ARABIAN = HB_TAG ('S','a','r','b'), /*5.2*/ + HB_SCRIPT_OLD_TURKIC = HB_TAG ('O','r','k','h'), /*5.2*/ + HB_SCRIPT_SAMARITAN = HB_TAG ('S','a','m','r'), /*5.2*/ + HB_SCRIPT_TAI_THAM = HB_TAG ('L','a','n','a'), /*5.2*/ + HB_SCRIPT_TAI_VIET = HB_TAG ('T','a','v','t'), /*5.2*/ + + HB_SCRIPT_BATAK = HB_TAG ('B','a','t','k'), /*6.0*/ + HB_SCRIPT_BRAHMI = HB_TAG ('B','r','a','h'), /*6.0*/ + HB_SCRIPT_MANDAIC = HB_TAG ('M','a','n','d'), /*6.0*/ + + HB_SCRIPT_CHAKMA = HB_TAG ('C','a','k','m'), /*6.1*/ + HB_SCRIPT_MEROITIC_CURSIVE = HB_TAG ('M','e','r','c'), /*6.1*/ + HB_SCRIPT_MEROITIC_HIEROGLYPHS = HB_TAG ('M','e','r','o'), /*6.1*/ + HB_SCRIPT_MIAO = HB_TAG ('P','l','r','d'), /*6.1*/ + HB_SCRIPT_SHARADA = HB_TAG ('S','h','r','d'), /*6.1*/ + HB_SCRIPT_SORA_SOMPENG = HB_TAG ('S','o','r','a'), /*6.1*/ + HB_SCRIPT_TAKRI = HB_TAG ('T','a','k','r'), /*6.1*/ + + /* + * Since: 0.9.30 + */ + HB_SCRIPT_BASSA_VAH = HB_TAG ('B','a','s','s'), /*7.0*/ + HB_SCRIPT_CAUCASIAN_ALBANIAN = HB_TAG ('A','g','h','b'), /*7.0*/ + HB_SCRIPT_DUPLOYAN = HB_TAG ('D','u','p','l'), /*7.0*/ + HB_SCRIPT_ELBASAN = HB_TAG ('E','l','b','a'), /*7.0*/ + HB_SCRIPT_GRANTHA = HB_TAG ('G','r','a','n'), /*7.0*/ + HB_SCRIPT_KHOJKI = HB_TAG ('K','h','o','j'), /*7.0*/ + HB_SCRIPT_KHUDAWADI = HB_TAG ('S','i','n','d'), /*7.0*/ + HB_SCRIPT_LINEAR_A = HB_TAG ('L','i','n','a'), /*7.0*/ + HB_SCRIPT_MAHAJANI = HB_TAG ('M','a','h','j'), /*7.0*/ + HB_SCRIPT_MANICHAEAN = HB_TAG ('M','a','n','i'), /*7.0*/ + HB_SCRIPT_MENDE_KIKAKUI = HB_TAG ('M','e','n','d'), /*7.0*/ + HB_SCRIPT_MODI = HB_TAG ('M','o','d','i'), /*7.0*/ + HB_SCRIPT_MRO = HB_TAG ('M','r','o','o'), /*7.0*/ + HB_SCRIPT_NABATAEAN = HB_TAG ('N','b','a','t'), /*7.0*/ + HB_SCRIPT_OLD_NORTH_ARABIAN = HB_TAG ('N','a','r','b'), /*7.0*/ + HB_SCRIPT_OLD_PERMIC = HB_TAG ('P','e','r','m'), /*7.0*/ + HB_SCRIPT_PAHAWH_HMONG = HB_TAG ('H','m','n','g'), /*7.0*/ + HB_SCRIPT_PALMYRENE = HB_TAG ('P','a','l','m'), /*7.0*/ + HB_SCRIPT_PAU_CIN_HAU = HB_TAG ('P','a','u','c'), /*7.0*/ + HB_SCRIPT_PSALTER_PAHLAVI = HB_TAG ('P','h','l','p'), /*7.0*/ + HB_SCRIPT_SIDDHAM = HB_TAG ('S','i','d','d'), /*7.0*/ + HB_SCRIPT_TIRHUTA = HB_TAG ('T','i','r','h'), /*7.0*/ + HB_SCRIPT_WARANG_CITI = HB_TAG ('W','a','r','a'), /*7.0*/ + + HB_SCRIPT_AHOM = HB_TAG ('A','h','o','m'), /*8.0*/ + HB_SCRIPT_ANATOLIAN_HIEROGLYPHS = HB_TAG ('H','l','u','w'), /*8.0*/ + HB_SCRIPT_HATRAN = HB_TAG ('H','a','t','r'), /*8.0*/ + HB_SCRIPT_MULTANI = HB_TAG ('M','u','l','t'), /*8.0*/ + HB_SCRIPT_OLD_HUNGARIAN = HB_TAG ('H','u','n','g'), /*8.0*/ + HB_SCRIPT_SIGNWRITING = HB_TAG ('S','g','n','w'), /*8.0*/ + + /* + * Since 1.3.0 + */ + HB_SCRIPT_ADLAM = HB_TAG ('A','d','l','m'), /*9.0*/ + HB_SCRIPT_BHAIKSUKI = HB_TAG ('B','h','k','s'), /*9.0*/ + HB_SCRIPT_MARCHEN = HB_TAG ('M','a','r','c'), /*9.0*/ + HB_SCRIPT_OSAGE = HB_TAG ('O','s','g','e'), /*9.0*/ + HB_SCRIPT_TANGUT = HB_TAG ('T','a','n','g'), /*9.0*/ + HB_SCRIPT_NEWA = HB_TAG ('N','e','w','a'), /*9.0*/ + + /* + * Since 1.6.0 + */ + HB_SCRIPT_MASARAM_GONDI = HB_TAG ('G','o','n','m'), /*10.0*/ + HB_SCRIPT_NUSHU = HB_TAG ('N','s','h','u'), /*10.0*/ + HB_SCRIPT_SOYOMBO = HB_TAG ('S','o','y','o'), /*10.0*/ + HB_SCRIPT_ZANABAZAR_SQUARE = HB_TAG ('Z','a','n','b'), /*10.0*/ + + /* + * Since 1.8.0 + */ + HB_SCRIPT_DOGRA = HB_TAG ('D','o','g','r'), /*11.0*/ + HB_SCRIPT_GUNJALA_GONDI = HB_TAG ('G','o','n','g'), /*11.0*/ + HB_SCRIPT_HANIFI_ROHINGYA = HB_TAG ('R','o','h','g'), /*11.0*/ + HB_SCRIPT_MAKASAR = HB_TAG ('M','a','k','a'), /*11.0*/ + HB_SCRIPT_MEDEFAIDRIN = HB_TAG ('M','e','d','f'), /*11.0*/ + HB_SCRIPT_OLD_SOGDIAN = HB_TAG ('S','o','g','o'), /*11.0*/ + HB_SCRIPT_SOGDIAN = HB_TAG ('S','o','g','d'), /*11.0*/ + + /* + * Since 2.4.0 + */ + HB_SCRIPT_ELYMAIC = HB_TAG ('E','l','y','m'), /*12.0*/ + HB_SCRIPT_NANDINAGARI = HB_TAG ('N','a','n','d'), /*12.0*/ + HB_SCRIPT_NYIAKENG_PUACHUE_HMONG = HB_TAG ('H','m','n','p'), /*12.0*/ + HB_SCRIPT_WANCHO = HB_TAG ('W','c','h','o'), /*12.0*/ + + /* + * Since 2.6.7 + */ + HB_SCRIPT_CHORASMIAN = HB_TAG ('C','h','r','s'), /*13.0*/ + HB_SCRIPT_DIVES_AKURU = HB_TAG ('D','i','a','k'), /*13.0*/ + HB_SCRIPT_KHITAN_SMALL_SCRIPT = HB_TAG ('K','i','t','s'), /*13.0*/ + HB_SCRIPT_YEZIDI = HB_TAG ('Y','e','z','i'), /*13.0*/ + + /* + * Since 3.0.0 + */ + HB_SCRIPT_CYPRO_MINOAN = HB_TAG ('C','p','m','n'), /*14.0*/ + HB_SCRIPT_OLD_UYGHUR = HB_TAG ('O','u','g','r'), /*14.0*/ + HB_SCRIPT_TANGSA = HB_TAG ('T','n','s','a'), /*14.0*/ + HB_SCRIPT_TOTO = HB_TAG ('T','o','t','o'), /*14.0*/ + HB_SCRIPT_VITHKUQI = HB_TAG ('V','i','t','h'), /*14.0*/ + + /* + * Since 3.4.0 + */ + HB_SCRIPT_MATH = HB_TAG ('Z','m','t','h'), + + /* + * Since 5.2.0 + */ + HB_SCRIPT_KAWI = HB_TAG ('K','a','w','i'), /*15.0*/ + HB_SCRIPT_NAG_MUNDARI = HB_TAG ('N','a','g','m'), /*15.0*/ + + /* + * Since 10.0.0 + */ + HB_SCRIPT_GARAY = HB_TAG ('G','a','r','a'), /*16.0*/ + HB_SCRIPT_GURUNG_KHEMA = HB_TAG ('G','u','k','h'), /*16.0*/ + HB_SCRIPT_KIRAT_RAI = HB_TAG ('K','r','a','i'), /*16.0*/ + HB_SCRIPT_OL_ONAL = HB_TAG ('O','n','a','o'), /*16.0*/ + HB_SCRIPT_SUNUWAR = HB_TAG ('S','u','n','u'), /*16.0*/ + HB_SCRIPT_TODHRI = HB_TAG ('T','o','d','r'), /*16.0*/ + HB_SCRIPT_TULU_TIGALARI = HB_TAG ('T','u','t','g'), /*16.0*/ + + /* No script set. */ + HB_SCRIPT_INVALID = HB_TAG_NONE, + + /*< private >*/ + + /* Dummy values to ensure any hb_tag_t value can be passed/stored as hb_script_t + * without risking undefined behavior. We have two, for historical reasons. + * HB_TAG_MAX used to be unsigned, but that was invalid Ansi C, so was changed + * to _HB_SCRIPT_MAX_VALUE to be equal to HB_TAG_MAX_SIGNED as well. + * + * See this thread for technicalities: + * + * https://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html + */ + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX_SIGNED, /*< skip >*/ + _HB_SCRIPT_MAX_VALUE_SIGNED = HB_TAG_MAX_SIGNED /*< skip >*/ + +} hb_script_t; + + +#endif /* HB_SCRIPT_LIST_H */ diff --git a/vendor/freetype/src/autofit/module.mk b/vendor/freetype/src/autofit/module.mk new file mode 100644 index 00000000000..dd6b407157d --- /dev/null +++ b/vendor/freetype/src/autofit/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 auto-fitter module definition +# + + +# Copyright (C) 2003-2024 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. + + +FTMODULE_H_COMMANDS += AUTOFIT_MODULE + +define AUTOFIT_MODULE +$(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/autofit/rules.mk b/vendor/freetype/src/autofit/rules.mk new file mode 100644 index 00000000000..111549d3b52 --- /dev/null +++ b/vendor/freetype/src/autofit/rules.mk @@ -0,0 +1,92 @@ +# +# FreeType 2 auto-fitter module configuration rules +# + + +# Copyright (C) 2003-2024 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. + + +# AUTOF driver directory +# +AUTOF_DIR := $(SRC_DIR)/autofit + + +# compilation flags for the driver +# +AUTOF_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# AUTOF driver sources (i.e., C files) +# +AUTOF_DRV_SRC := $(AUTOF_DIR)/afadjust.c \ + $(AUTOF_DIR)/afblue.c \ + $(AUTOF_DIR)/afcjk.c \ + $(AUTOF_DIR)/afdummy.c \ + $(AUTOF_DIR)/afglobal.c \ + $(AUTOF_DIR)/afgsub.c \ + $(AUTOF_DIR)/afhints.c \ + $(AUTOF_DIR)/afindic.c \ + $(AUTOF_DIR)/aflatin.c \ + $(AUTOF_DIR)/afloader.c \ + $(AUTOF_DIR)/afmodule.c \ + $(AUTOF_DIR)/afranges.c \ + $(AUTOF_DIR)/afshaper.c \ + $(AUTOF_DIR)/ft-hb.c \ + $(AUTOF_DIR)/ft-hb-ft.c + +# AUTOF driver headers +# +AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \ + $(AUTOF_DIR)/afcover.h \ + $(AUTOF_DIR)/aferrors.h \ + $(AUTOF_DIR)/afscript.h \ + $(AUTOF_DIR)/afstyles.h \ + $(AUTOF_DIR)/aftypes.h \ + $(AUTOF_DIR)/afws-decl.h \ + $(AUTOF_DIR)/afws-iter.h \ + $(AUTOF_DIR)/ft-hb-decls.h + + +# AUTOF driver object(s) +# +# AUTOF_DRV_OBJ_M is used during `multi' builds. +# AUTOF_DRV_OBJ_S is used during `single' builds. +# +AUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O) +AUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O + +# AUTOF driver source file for single build +# +AUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c + + +# AUTOF driver - single object +# +$(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \ + $(FREETYPE_H) $(AUTOF_DRV_H) + $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S)) + + +# AUTOF driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H) + $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(AUTOF_DRV_OBJ_S) +DRV_OBJS_M += $(AUTOF_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/base/ftbase.c b/vendor/freetype/src/base/ftbase.c index 50805ccec4b..8cd7395e864 100644 --- a/vendor/freetype/src/base/ftbase.c +++ b/vendor/freetype/src/base/ftbase.c @@ -19,7 +19,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT #include "ftadvanc.c" -#include "ftcalc.c" #include "ftcolor.c" #include "ftdbgmem.c" #include "fterrors.c" @@ -35,6 +34,7 @@ #include "ftsnames.c" #include "ftstream.c" #include "fttrigon.c" +#include "ftcalc.c" /* included after FT_MulFix callers to inline it */ #include "ftutil.c" diff --git a/vendor/freetype/src/base/ftbase.h b/vendor/freetype/src/base/ftbase.h index 1d98b26dd51..f216c1df11b 100644 --- a/vendor/freetype/src/base/ftbase.h +++ b/vendor/freetype/src/base/ftbase.h @@ -34,7 +34,7 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_MAC_FONTS /* MacOS resource fork cannot exceed 16MB at least for Carbon code; */ - /* see https://support.microsoft.com/en-us/kb/130437 */ + /* see https://jeffpar.github.io/kbarchive/kb/130/Q130437/ */ #define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL diff --git a/vendor/freetype/src/base/ftbitmap.c b/vendor/freetype/src/base/ftbitmap.c index 4be145679fd..f45beefb3bc 100644 --- a/vendor/freetype/src/base/ftbitmap.c +++ b/vendor/freetype/src/base/ftbitmap.c @@ -876,13 +876,13 @@ #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE5(( "FT_Bitmap_Blend:\n" )); - FT_TRACE5(( " source bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n", + FT_TRACE5(( " source bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n", source_llx / 64, source_lly / 64, source_urx / 64, source_ury / 64, source_->width, source_->rows )); if ( target->width && target->rows ) - FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n", + FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n", target_llx / 64, target_lly / 64, target_urx / 64, target_ury / 64, target->width, target->rows )); @@ -890,7 +890,7 @@ FT_TRACE5(( " target bitmap: empty\n" )); if ( final_width && final_rows ) - FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n", + FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n", final_llx / 64, final_lly / 64, final_urx / 64, final_ury / 64, final_width, final_rows )); @@ -924,7 +924,7 @@ if ( FT_LONG_MAX / target->pitch < (int)target->rows ) { - FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n", + FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%u x %u)\n", final_width, final_rows )); return FT_THROW( Invalid_Argument ); } @@ -952,7 +952,7 @@ if ( FT_LONG_MAX / new_pitch < (int)final_rows ) { - FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n", + FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%u x %u)\n", final_width, final_rows )); return FT_THROW( Invalid_Argument ); } diff --git a/vendor/freetype/src/base/ftcalc.c b/vendor/freetype/src/base/ftcalc.c index 92de09ed877..b5e2cba5885 100644 --- a/vendor/freetype/src/base/ftcalc.c +++ b/vendor/freetype/src/base/ftcalc.c @@ -38,24 +38,14 @@ #include #include - -#ifdef FT_MULFIX_ASSEMBLER -#undef FT_MulFix + /* cancel inlining macro from internal/ftcalc.h */ +#ifdef FT_MulFix +# undef FT_MulFix +# ifdef vms_auto64_source +# define FT_MulFix FT_MulFix64__ +# endif #endif -/* we need to emulate a 64-bit data type if a real one isn't available */ - -#ifndef FT_INT64 - - typedef struct FT_Int64_ - { - FT_UInt32 lo; - FT_UInt32 hi; - - } FT_Int64; - -#endif /* !FT_INT64 */ - /************************************************************************** * @@ -88,7 +78,7 @@ FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a ) { - return ( ADD_LONG( a, 0x8000L - ( a < 0 ) ) ) & ~0xFFFFL; + return ADD_LONG( a, 0x8000L - ( a < 0 ) ) & ~0xFFFFL; } @@ -97,7 +87,7 @@ FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a ) { - return ( ADD_LONG( a, 0xFFFFL ) ) & ~0xFFFFL; + return ADD_LONG( a, 0xFFFFL ) & ~0xFFFFL; } @@ -225,18 +215,18 @@ FT_MulFix( FT_Long a_, FT_Long b_ ) { -#ifdef FT_MULFIX_ASSEMBLER +#ifdef FT_CONFIG_OPTION_INLINE_MULFIX - return FT_MULFIX_ASSEMBLER( (FT_Int32)a_, (FT_Int32)b_ ); + return FT_MulFix_64( a_, b_ ); #else - FT_Int64 ab = (FT_Int64)a_ * (FT_Int64)b_; + FT_Int64 ab = MUL_INT64( a_, b_ ); /* this requires arithmetic right shift of signed numbers */ - return (FT_Long)( ( ab + 0x8000L - ( ab < 0 ) ) >> 16 ); + return (FT_Long)( ( ab + 0x8000L + ( ab >> 63 ) ) >> 16 ); -#endif /* FT_MULFIX_ASSEMBLER */ +#endif /* FT_CONFIG_OPTION_INLINE_MULFIX */ } @@ -975,43 +965,36 @@ #else - FT_Int result; + FT_Int64 z1, z2; + FT_Int result; - if ( ADD_LONG( FT_ABS( in_x ), FT_ABS( out_y ) ) <= 131071L && - ADD_LONG( FT_ABS( in_y ), FT_ABS( out_x ) ) <= 131071L ) + if ( (FT_ULong)FT_ABS( in_x ) + (FT_ULong)FT_ABS( out_y ) <= 92681UL ) { - FT_Long z1 = MUL_LONG( in_x, out_y ); - FT_Long z2 = MUL_LONG( in_y, out_x ); - - - if ( z1 > z2 ) - result = +1; - else if ( z1 < z2 ) - result = -1; - else - result = 0; + z1.lo = (FT_UInt32)in_x * (FT_UInt32)out_y; + z1.hi = (FT_UInt32)( (FT_Int32)z1.lo >> 31 ); /* sign-expansion */ } - else /* products might overflow 32 bits */ - { - FT_Int64 z1, z2; - - - /* XXX: this function does not allow 64-bit arguments */ + else ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 ); - ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 ); - if ( z1.hi > z2.hi ) - result = +1; - else if ( z1.hi < z2.hi ) - result = -1; - else if ( z1.lo > z2.lo ) - result = +1; - else if ( z1.lo < z2.lo ) - result = -1; - else - result = 0; + if ( (FT_ULong)FT_ABS( in_y ) + (FT_ULong)FT_ABS( out_x ) <= 92681UL ) + { + z2.lo = (FT_UInt32)in_y * (FT_UInt32)out_x; + z2.hi = (FT_UInt32)( (FT_Int32)z2.lo >> 31 ); /* sign-expansion */ } + else + ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 ); + + if ( (FT_Int32)z1.hi > (FT_Int32)z2.hi ) + result = +1; + else if ( (FT_Int32)z1.hi < (FT_Int32)z2.hi ) + result = -1; + else if ( z1.lo > z2.lo ) + result = +1; + else if ( z1.lo < z2.lo ) + result = -1; + else + result = 0; /* XXX: only the sign of return value, +1/0/-1 must be used */ return result; @@ -1065,62 +1048,4 @@ } - FT_BASE_DEF( FT_Int32 ) - FT_MulAddFix( FT_Fixed* s, - FT_Int32* f, - FT_UInt count ) - { - FT_UInt i; - FT_Int64 temp; - - -#ifdef FT_INT64 - temp = 0; - - for ( i = 0; i < count; ++i ) - temp += (FT_Int64)s[i] * f[i]; - - return (FT_Int32)( ( temp + 0x8000 ) >> 16 ); -#else - temp.hi = 0; - temp.lo = 0; - - for ( i = 0; i < count; ++i ) - { - FT_Int64 multResult; - - FT_Int sign = 1; - FT_UInt32 carry = 0; - - FT_UInt32 scalar; - FT_UInt32 factor; - - - FT_MOVE_SIGN( FT_UInt32, s[i], scalar, sign ); - FT_MOVE_SIGN( FT_UInt32, f[i], factor, sign ); - - ft_multo64( scalar, factor, &multResult ); - - if ( sign < 0 ) - { - /* Emulated `FT_Int64` negation. */ - carry = ( multResult.lo == 0 ); - - multResult.lo = ~multResult.lo + 1; - multResult.hi = ~multResult.hi + carry; - } - - FT_Add64( &temp, &multResult, &temp ); - } - - /* Shift and round value. */ - return (FT_Int32)( ( ( temp.hi << 16 ) | ( temp.lo >> 16 ) ) - + ( 1 & ( temp.lo >> 15 ) ) ); - - -#endif /* !FT_INT64 */ - - } - - /* END */ diff --git a/vendor/freetype/src/base/ftdbgmem.c b/vendor/freetype/src/base/ftdbgmem.c index 902a5dc8bbc..3300a1e1d93 100644 --- a/vendor/freetype/src/base/ftdbgmem.c +++ b/vendor/freetype/src/base/ftdbgmem.c @@ -139,7 +139,6 @@ } FT_MemTableRec; -#define FT_MEM_SIZE_MIN 7 #define FT_MEM_SIZE_MAX 13845163 #define FT_FILENAME( x ) ( (x) ? (x) : "unknown file" ) diff --git a/vendor/freetype/src/base/fthash.c b/vendor/freetype/src/base/fthash.c index 313bbbb4b27..ab248ace8bd 100644 --- a/vendor/freetype/src/base/fthash.c +++ b/vendor/freetype/src/base/fthash.c @@ -41,6 +41,7 @@ #include #include +#include #define INITIAL_HT_SIZE 241 @@ -233,7 +234,8 @@ hash_insert( FT_Hashkey key, size_t data, FT_Hash hash, - FT_Memory memory ) + FT_Memory memory, + FT_Bool overwrite ) { FT_Hashnode nn; FT_Hashnode* bp = hash_bucket( key, hash ); @@ -259,7 +261,7 @@ hash->used++; } - else + else if ( overwrite ) nn->data = data; Exit: @@ -278,7 +280,7 @@ hk.str = key; - return hash_insert( hk, data, hash, memory ); + return hash_insert( hk, data, hash, memory, TRUE ); } @@ -293,7 +295,37 @@ hk.num = num; - return hash_insert( hk, data, hash, memory ); + return hash_insert( hk, data, hash, memory, TRUE ); + } + + + FT_Error + ft_hash_str_insert_no_overwrite( const char* key, + size_t data, + FT_Hash hash, + FT_Memory memory ) + { + FT_Hashkey hk; + + + hk.str = key; + + return hash_insert( hk, data, hash, memory, FALSE ); + } + + + FT_Error + ft_hash_num_insert_no_overwrite( FT_Int num, + size_t data, + FT_Hash hash, + FT_Memory memory ) + { + FT_Hashkey hk; + + + hk.num = num; + + return hash_insert( hk, data, hash, memory, FALSE ); } @@ -335,4 +367,68 @@ } + FT_Bool + ft_hash_num_iterator( FT_UInt *idx, + FT_Int *key, + size_t *value, + FT_Hash hash ) + { + FT_Hashnode nn = NULL; + + + while ( 1 ) + { + if ( *idx >= hash->size ) + return 0; + + nn = hash->table[*idx]; + if ( nn ) + break; + + (*idx)++; + } + + if ( key ) + *key = nn->key.num; + if ( value ) + *value = nn->data; + + (*idx)++; + + return 1; + } + + + FT_Bool + ft_hash_str_iterator( FT_UInt *idx, + const char* *key, + size_t *value, + FT_Hash hash ) + { + FT_Hashnode nn = NULL; + + + while ( 1 ) + { + if ( *idx >= hash->size ) + return 0; + + nn = hash->table[*idx]; + if ( nn ) + break; + + (*idx)++; + } + + if ( key ) + *key = nn->key.str; + if ( value ) + *value = nn->data; + + (*idx)++; + + return 1; + } + + /* END */ diff --git a/vendor/freetype/src/base/ftmm.c b/vendor/freetype/src/base/ftmm.c index cc4ca22fba3..6bf6a46bb30 100644 --- a/vendor/freetype/src/base/ftmm.c +++ b/vendor/freetype/src/base/ftmm.c @@ -292,6 +292,9 @@ if ( num_coords && !coords ) return FT_THROW( Invalid_Argument ); + if ( !num_coords && !FT_IS_VARIATION( face ) ) + return FT_Err_Ok; /* nothing to be done */ + error = ft_face_get_mm_service( face, &service_mm ); if ( !error ) { @@ -299,15 +302,18 @@ if ( service_mm->set_var_design ) error = service_mm->set_var_design( face, num_coords, coords ); - if ( !error || error == -1 ) + if ( !error || error == -1 || error == -2 ) { FT_Bool is_variation_old = FT_IS_VARIATION( face ); - if ( num_coords ) - face->face_flags |= FT_FACE_FLAG_VARIATION; - else - face->face_flags &= ~FT_FACE_FLAG_VARIATION; + if ( error != -1 ) + { + if ( error == -2 ) /* -2 means is_variable. */ + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + } if ( service_mm->construct_ps_name ) { @@ -474,15 +480,18 @@ if ( service_mm->set_mm_blend ) error = service_mm->set_mm_blend( face, num_coords, coords ); - if ( !error || error == -1 ) + if ( !error || error == -1 || error == -2 ) { FT_Bool is_variation_old = FT_IS_VARIATION( face ); - if ( num_coords ) - face->face_flags |= FT_FACE_FLAG_VARIATION; - else - face->face_flags &= ~FT_FACE_FLAG_VARIATION; + if ( error != -1 ) + { + if ( error == -2 ) /* -2 means is_variable. */ + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + } if ( service_mm->construct_ps_name ) { diff --git a/vendor/freetype/src/base/ftobjs.c b/vendor/freetype/src/base/ftobjs.c index 720a3f4b696..13e1d922642 100644 --- a/vendor/freetype/src/base/ftobjs.c +++ b/vendor/freetype/src/base/ftobjs.c @@ -994,8 +994,7 @@ /* the check for `num_locations' assures that we actually */ /* test for instructions in a TTF and not in a CFF-based OTF */ /* */ - /* since `maxSizeOfInstructions' might be unreliable, we */ - /* check the size of the `fpgm' and `prep' tables, too -- */ + /* we check the size of the `fpgm' and `prep' tables, too -- */ /* the assumption is that there don't exist real TTFs where */ /* both `fpgm' and `prep' tables are missing */ if ( ( mode == FT_RENDER_MODE_LIGHT && @@ -1003,9 +1002,8 @@ !is_light_type1 ) ) || ( FT_IS_SFNT( face ) && ttface->num_locations && - ttface->max_profile.maxSizeOfInstructions == 0 && ttface->font_program_size == 0 && - ttface->cvt_program_size == 0 ) ) + ttface->cvt_program_size <= 7 ) ) autohint = TRUE; } } @@ -1172,9 +1170,9 @@ } #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( "FT_Load_Glyph: index %d, flags 0x%x\n", + FT_TRACE5(( "FT_Load_Glyph: index %u, flags 0x%x\n", glyph_index, load_flags )); - FT_TRACE5(( " bitmap %dx%d %s, %s (mode %d)\n", + FT_TRACE5(( " bitmap %ux%u %s, %s (mode %d)\n", slot->bitmap.width, slot->bitmap.rows, slot->outline.points ? @@ -1359,21 +1357,9 @@ } - /************************************************************************** - * - * @Function: - * find_unicode_charmap - * - * @Description: - * This function finds a Unicode charmap, if there is one. - * And if there is more than one, it tries to favour the more - * extensive one, i.e., one that supports UCS-4 against those which - * are limited to the BMP (said UCS-2 encoding.) - * - * This function is called from open_face() (just below), and also - * from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ). - */ - static FT_Error + /* documentation is in ftobjs.h */ + + FT_BASE_DEF( FT_Error ) find_unicode_charmap( FT_Face face ) { FT_CharMap* first; @@ -2125,7 +2111,7 @@ if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len ) goto Exit2; - FT_TRACE3(( " Load POST fragment #%d (%ld byte) to buffer" + FT_TRACE3(( " Load POST fragment #%d (%lu byte) to buffer" " %p + 0x%08lx\n", i, rlen, (void*)pfb_data, pfb_pos )); @@ -2398,7 +2384,7 @@ is_darwin_vfs = ft_raccess_rule_by_darwin_vfs( library, i ); if ( is_darwin_vfs && vfs_rfork_has_no_font ) { - FT_TRACE3(( "Skip rule %d: darwin vfs resource fork" + FT_TRACE3(( "Skip rule %u: darwin vfs resource fork" " is already checked and" " no font is found\n", i )); @@ -2407,7 +2393,7 @@ if ( errors[i] ) { - FT_TRACE3(( "Error 0x%x has occurred in rule %d\n", + FT_TRACE3(( "Error 0x%x has occurred in rule %u\n", errors[i], i )); continue; } @@ -2415,7 +2401,7 @@ args2.flags = FT_OPEN_PATHNAME; args2.pathname = file_names[i] ? file_names[i] : args->pathname; - FT_TRACE3(( "Try rule %d: %s (offset=%ld) ...", + FT_TRACE3(( "Try rule %u: %s (offset=%ld) ...", i, args2.pathname, offsets[i] )); error = FT_Stream_New( library, &args2, &stream2 ); diff --git a/vendor/freetype/src/base/ftrfork.c b/vendor/freetype/src/base/ftrfork.c index dc9b043d8bb..25c6f98d8e6 100644 --- a/vendor/freetype/src/base/ftrfork.c +++ b/vendor/freetype/src/base/ftrfork.c @@ -269,14 +269,8 @@ * According to Inside Macintosh: More Macintosh Toolbox, * "Resource IDs" (1-46), there are some reserved IDs. * However, FreeType2 is not a font synthesizer, no need - * to check the acceptable resource ID. + * to check the acceptable resource ID or its attributes. */ - if ( temp < 0 ) - { - error = FT_THROW( Invalid_Table ); - goto Exit; - } - ref[j].offset = temp & 0xFFFFFFL; FT_TRACE3(( " [%d]:" diff --git a/vendor/freetype/src/base/ftstream.c b/vendor/freetype/src/base/ftstream.c index 66722246128..004f12a16b1 100644 --- a/vendor/freetype/src/base/ftstream.c +++ b/vendor/freetype/src/base/ftstream.c @@ -242,7 +242,7 @@ FT_ULong read_bytes; - FT_TRACE7(( "FT_Stream_EnterFrame: %ld bytes\n", count )); + FT_TRACE7(( "FT_Stream_EnterFrame: %lu bytes\n", count )); /* check for nested frame access */ FT_ASSERT( stream && stream->cursor == 0 ); diff --git a/vendor/freetype/src/base/ftstroke.c b/vendor/freetype/src/base/ftstroke.c index 40d74d6e4f6..8fa5f672385 100644 --- a/vendor/freetype/src/base/ftstroke.c +++ b/vendor/freetype/src/base/ftstroke.c @@ -1070,7 +1070,7 @@ if ( theta == FT_ANGLE_PI2 ) theta = -rotate; - phi = stroker->angle_in + theta + rotate; + phi = stroker->angle_in + theta + rotate; FT_Vector_From_Polar( &sigma, stroker->miter_limit, theta ); diff --git a/vendor/freetype/src/base/ftsynth.c b/vendor/freetype/src/base/ftsynth.c index b5e36117480..b4668bc935e 100644 --- a/vendor/freetype/src/base/ftsynth.c +++ b/vendor/freetype/src/base/ftsynth.c @@ -141,7 +141,7 @@ /* * XXX: overflow check for 16-bit system, for compatibility * with FT_GlyphSlot_Embolden() since FreeType 2.1.10. - * unfortunately, this function return no information + * unfortunately, this function returns no information * about the cause of error. */ if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN ) diff --git a/vendor/freetype/src/base/ftsystem.c b/vendor/freetype/src/base/ftsystem.c index eee3642334f..721bdd0a923 100644 --- a/vendor/freetype/src/base/ftsystem.c +++ b/vendor/freetype/src/base/ftsystem.c @@ -280,7 +280,7 @@ stream->close = ft_ansi_stream_close; FT_TRACE1(( "FT_Stream_Open:" )); - FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n", + FT_TRACE1(( " opened `%s' (%lu bytes) successfully\n", filepathname, stream->size )); return FT_Err_Ok; diff --git a/vendor/freetype/src/base/ftver.rc b/vendor/freetype/src/base/ftver.rc index 3175ab7defd..1b354e75e13 100644 --- a/vendor/freetype/src/base/ftver.rc +++ b/vendor/freetype/src/base/ftver.rc @@ -45,7 +45,7 @@ BEGIN VALUE "FileVersion", FT_VERSION_STR VALUE "ProductName", "FreeType" VALUE "ProductVersion", FT_VERSION_STR - VALUE "LegalCopyright", L"\x00A9 2000-2024 The FreeType Project www.freetype.org. All rights reserved." + VALUE "LegalCopyright", L"\x00A9 2000-2024 The FreeType Project freetype.org. All rights reserved." VALUE "InternalName", "freetype" VALUE "OriginalFilename", FT_FILENAME END diff --git a/vendor/freetype/src/base/rules.mk b/vendor/freetype/src/base/rules.mk new file mode 100644 index 00000000000..042c0755efb --- /dev/null +++ b/vendor/freetype/src/base/rules.mk @@ -0,0 +1,108 @@ +# +# FreeType 2 base layer configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# It sets the following variables which are used by the master Makefile +# after the call: +# +# BASE_OBJ_S: The single-object base layer. +# BASE_OBJ_M: A list of all objects for a multiple-objects build. +# BASE_EXT_OBJ: A list of base layer extensions, i.e., components found +# in `src/base' which are not compiled within the base +# layer proper. + + +BASE_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(BASE_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# Base layer sources +# +# ftsystem, ftinit, and ftdebug are handled by freetype.mk +# +# All files listed here should be included in `ftbase.c' (for a `single' +# build). +# +BASE_SRC := $(BASE_DIR)/ftadvanc.c \ + $(BASE_DIR)/ftcalc.c \ + $(BASE_DIR)/ftcolor.c \ + $(BASE_DIR)/ftdbgmem.c \ + $(BASE_DIR)/fterrors.c \ + $(BASE_DIR)/ftfntfmt.c \ + $(BASE_DIR)/ftgloadr.c \ + $(BASE_DIR)/fthash.c \ + $(BASE_DIR)/ftlcdfil.c \ + $(BASE_DIR)/ftobjs.c \ + $(BASE_DIR)/ftoutln.c \ + $(BASE_DIR)/ftpsprop.c \ + $(BASE_DIR)/ftrfork.c \ + $(BASE_DIR)/ftsnames.c \ + $(BASE_DIR)/ftstream.c \ + $(BASE_DIR)/fttrigon.c \ + $(BASE_DIR)/ftutil.c + + +ifneq ($(ftmac_c),) + BASE_SRC += $(BASE_DIR)/$(ftmac_c) +endif + +# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h') +BASE_H := $(BASE_DIR)/ftbase.h \ + $(BASE_DIR)/md5.c \ + $(BASE_DIR)/md5.h + +# Base layer `extensions' sources +# +# An extension is added to the library file as a separate object. It is +# then linked to the final executable only if one of its symbols is used by +# the application. +# +BASE_EXT_SRC := $(patsubst %,$(BASE_DIR)/%,$(BASE_EXTENSIONS)) + +# Default extensions objects +# +BASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O) + + +# Base layer object(s) +# +# BASE_OBJ_M is used during `multi' builds (each base source file compiles +# to a single object file). +# +# BASE_OBJ_S is used during `single' builds (the whole base layer is +# compiled as a single object file using ftbase.c). +# +BASE_OBJ_M := $(BASE_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O) +BASE_OBJ_S := $(OBJ_DIR)/ftbase.$O + +# Base layer root source file for single build +# +BASE_SRC_S := $(BASE_DIR)/ftbase.c + + +# Base layer - single object build +# +$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(BASE_H) + $(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BASE_SRC_S)) + + +# Multiple objects build + extensions +# +$(OBJ_DIR)/%.$O: $(BASE_DIR)/%.c $(FREETYPE_H) $(BASE_H) + $(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# EOF diff --git a/vendor/freetype/src/bdf/bdfdrivr.c b/vendor/freetype/src/bdf/bdfdrivr.c index 1995c36ac9e..f57bb0007ef 100644 --- a/vendor/freetype/src/bdf/bdfdrivr.c +++ b/vendor/freetype/src/bdf/bdfdrivr.c @@ -389,10 +389,10 @@ THE SOFTWARE. bdf_property_t* prop = NULL; - FT_TRACE4(( " number of glyphs: allocated %ld (used %ld)\n", + FT_TRACE4(( " number of glyphs: allocated %lu (used %lu)\n", font->glyphs_size, font->glyphs_used )); - FT_TRACE4(( " number of unencoded glyphs: allocated %ld (used %ld)\n", + FT_TRACE4(( " number of unencoded glyphs: allocated %lu (used %lu)\n", font->unencoded_size, font->unencoded_used )); @@ -621,7 +621,7 @@ THE SOFTWARE. for ( n = 0; n < font->glyphs_size; n++ ) { (bdfface->en_table[n]).enc = cur[n].encoding; - FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding )); + FT_TRACE4(( " idx %lu, val 0x%lX\n", n, cur[n].encoding )); (bdfface->en_table[n]).glyph = (FT_UShort)n; if ( cur[n].encoding == font->default_char ) @@ -630,7 +630,7 @@ THE SOFTWARE. bdfface->default_glyph = (FT_UInt)n; else FT_TRACE1(( "BDF_Face_Init:" - " idx %ld is too large for this system\n", n )); + " idx %lu is too large for this system\n", n )); } } } @@ -817,7 +817,7 @@ THE SOFTWARE. goto Exit; } - FT_TRACE1(( "BDF_Glyph_Load: glyph index %d\n", glyph_index )); + FT_TRACE1(( "BDF_Glyph_Load: glyph index %u\n", glyph_index )); /* index 0 is the undefined glyph */ if ( glyph_index == 0 ) @@ -831,7 +831,7 @@ THE SOFTWARE. bitmap->rows = glyph.bbx.height; bitmap->width = glyph.bbx.width; if ( glyph.bpr > FT_INT_MAX ) - FT_TRACE1(( "BDF_Glyph_Load: too large pitch %ld is truncated\n", + FT_TRACE1(( "BDF_Glyph_Load: too large pitch %lu is truncated\n", glyph.bpr )); bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */ diff --git a/vendor/freetype/src/bdf/bdflib.c b/vendor/freetype/src/bdf/bdflib.c index b4df8e6b551..ab6f6a9bf23 100644 --- a/vendor/freetype/src/bdf/bdflib.c +++ b/vendor/freetype/src/bdf/bdflib.c @@ -150,19 +150,6 @@ num_bdf_properties_ = sizeof ( bdf_properties_ ) / sizeof ( bdf_properties_[0] ); - - /* An auxiliary macro to parse properties, to be used in conditionals. */ - /* It behaves like `strncmp' but also tests the following character */ - /* whether it is a whitespace or null. */ - /* `property' is a constant string of length `n' to compare with. */ -#define _bdf_strncmp( name, property, n ) \ - ( ft_strncmp( name, property, n ) || \ - !( name[n] == ' ' || \ - name[n] == '\0' || \ - name[n] == '\n' || \ - name[n] == '\r' || \ - name[n] == '\t' ) ) - /* Auto correction messages. */ #define ACMSG1 "FONT_ASCENT property missing. " \ "Added `FONT_ASCENT %hd'.\n" @@ -175,28 +162,28 @@ #define ACMSG6 "Font descent != actual descent. Old: %d New: %d.\n" #define ACMSG7 "Font height != actual height. Old: %d New: %d.\n" #define ACMSG8 "Glyph scalable width (SWIDTH) adjustments made.\n" -#define ACMSG9 "SWIDTH field missing at line %ld. Set automatically.\n" -#define ACMSG10 "DWIDTH field missing at line %ld. Set to glyph width.\n" +#define ACMSG9 "SWIDTH field missing at line %lu. Set automatically.\n" +#define ACMSG10 "DWIDTH field missing at line %lu. Set to glyph width.\n" #define ACMSG11 "SIZE bits per pixel field adjusted to %hd.\n" #define ACMSG13 "Glyph %lu extra rows removed.\n" #define ACMSG14 "Glyph %lu extra columns removed.\n" -#define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n" +#define ACMSG15 "Incorrect glyph count: %lu indicated but %lu found.\n" #define ACMSG16 "Glyph %lu missing columns padded with zero bits.\n" -#define ACMSG17 "Adjusting number of glyphs to %ld.\n" +#define ACMSG17 "Adjusting number of glyphs to %lu.\n" /* Error messages. */ -#define ERRMSG1 "[line %ld] Missing `%s' line.\n" -#define ERRMSG2 "[line %ld] Font header corrupted or missing fields.\n" -#define ERRMSG3 "[line %ld] Font glyphs corrupted or missing fields.\n" -#define ERRMSG4 "[line %ld] BBX too big.\n" -#define ERRMSG5 "[line %ld] `%s' value too big.\n" -#define ERRMSG6 "[line %ld] Input line too long.\n" -#define ERRMSG7 "[line %ld] Font name too long.\n" -#define ERRMSG8 "[line %ld] Invalid `%s' value.\n" -#define ERRMSG9 "[line %ld] Invalid keyword.\n" +#define ERRMSG1 "[line %lu] Missing `%s' line.\n" +#define ERRMSG2 "[line %lu] Font header corrupted or missing fields.\n" +#define ERRMSG3 "[line %lu] Font glyphs corrupted or missing fields.\n" +#define ERRMSG4 "[line %lu] BBX too big.\n" +#define ERRMSG5 "[line %lu] `%s' value too big.\n" +#define ERRMSG6 "[line %lu] Input line too long.\n" +#define ERRMSG7 "[line %lu] Font name too long.\n" +#define ERRMSG8 "[line %lu] Invalid `%s' value.\n" +#define ERRMSG9 "[line %lu] Invalid keyword.\n" /* Debug messages. */ -#define DBGMSG1 " [%6ld] %s" /* no \n */ +#define DBGMSG1 " [%6lu] %s" /* no \n */ #define DBGMSG2 " (0x%lX)\n" @@ -207,16 +194,6 @@ */ - /* Function type for parsing lines of a BDF font. */ - - typedef FT_Error - (*bdf_line_func_t_)( char* line, - unsigned long linelen, - unsigned long lineno, - void* call_data, - void* client_data ); - - /* Structure used while loading BDF fonts. */ typedef struct bdf_parse_t__ @@ -245,6 +222,16 @@ } bdf_parse_t_; + /* Function type for parsing lines of a BDF font. */ + + typedef FT_Error + (*bdf_line_func_t_)( char* line, + unsigned long linelen, + unsigned long lineno, + bdf_parse_t_* p, + void* next ); + + #define setsbit( m, cc ) \ ( m[(FT_Byte)(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) ) #define sbitset( m, cc ) \ @@ -268,113 +255,6 @@ } - static FT_Error - bdf_readstream_( FT_Stream stream, - bdf_line_func_t_ callback, - void* client_data, - unsigned long *lno ) - { - bdf_line_func_t_ cb; - unsigned long lineno, buf_size; - unsigned long bytes, start, end, cursor, avail; - char* buf = NULL; - FT_Memory memory = stream->memory; - FT_Error error = FT_Err_Ok; - - - if ( callback == NULL ) - { - error = FT_THROW( Invalid_Argument ); - goto Exit; - } - - /* initial size and allocation of the input buffer */ - buf_size = 1024; - - if ( FT_QALLOC( buf, buf_size ) ) - goto Exit; - - cb = callback; - lineno = 1; - start = 0; - cursor = 0; - - Refill: - bytes = FT_Stream_TryRead( stream, - (FT_Byte*)buf + cursor, buf_size - cursor ); - avail = cursor + bytes; - - while ( bytes ) - { - /* try to find the start of the line */ - while ( start < avail && buf[start] < ' ' ) - start++; - - /* try to find the end of the line */ - end = start + 1; - while ( end < avail && buf[end] >= ' ' ) - end++; - - /* if we hit the end of the buffer, try shifting its content */ - /* or even resizing it */ - if ( end >= avail ) - { - if ( start == 0 ) - { - /* this line is definitely too long; try resizing the input */ - /* buffer a bit to handle it. */ - FT_ULong new_size; - - - if ( buf_size >= 65536UL ) /* limit ourselves to 64KByte */ - { - FT_ERROR(( "bdf_readstream_: " ERRMSG6, lineno )); - error = FT_THROW( Invalid_File_Format ); - - goto Exit; - } - - new_size = buf_size * 4; - if ( FT_QREALLOC( buf, buf_size, new_size ) ) - goto Exit; - - cursor = avail; - buf_size = new_size; - } - else - { - cursor = avail - start; - - FT_MEM_MOVE( buf, buf + start, cursor ); - - start = 0; - } - goto Refill; - } - - /* NUL-terminate the line. */ - buf[end] = 0; - - if ( buf[start] != '#' ) - { - error = (*cb)( buf + start, end - start, lineno, - (void*)&cb, client_data ); - if ( error ) - break; - } - - lineno += 1; - start = end + 1; - } - - *lno = lineno; - - Exit: - FT_FREE( buf ); - return error; - } - - /* XXX: make this work with EBCDIC also */ static const unsigned char a2i[128] = @@ -405,14 +285,6 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - static const unsigned char hdigits[32] = - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, - 0x7E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - /* Routine to convert a decimal ASCII string to an unsigned long integer. */ static unsigned long @@ -685,7 +557,7 @@ sp = ep = line; - while ( *ep && *ep != ' ' && *ep != '\t' ) + while ( *ep && *ep != ' ' ) ep++; hold = *ep; @@ -711,7 +583,7 @@ if ( sp < ep ) do sp++; - while ( *sp == ' ' || *sp == '\t' ); + while ( *sp == ' ' ); /* Trim the leading double quote if it exists. */ if ( *sp == '"' ) @@ -723,7 +595,7 @@ if ( sp < ep ) do *ep-- = '\0'; - while ( *ep == ' ' || *ep == '\t' ); + while ( *ep == ' ' ); /* Trim the trailing double quote if it exists. */ if ( *ep == '"' ) @@ -854,16 +726,16 @@ bdf_parse_end_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ) + bdf_parse_t_* p, + void* next ) { /* a no-op; we ignore everything after `ENDFONT' */ FT_UNUSED( line ); FT_UNUSED( linelen ); FT_UNUSED( lineno ); - FT_UNUSED( call_data ); - FT_UNUSED( client_data ); + FT_UNUSED( p ); + FT_UNUSED( next ); return FT_Err_Ok; } @@ -872,18 +744,18 @@ /* Line function prototypes. */ static FT_Error bdf_parse_start_( char* line, - unsigned long linelen, - unsigned long lineno, - void* call_data, - void* client_data ); + unsigned long linelen, + unsigned long lineno, + bdf_parse_t_* p, + void* next ); static FT_Error bdf_parse_glyphs_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ); + bdf_parse_t_* p, + void* next ); /* Aggressively parse the glyph bitmaps. */ @@ -891,16 +763,13 @@ bdf_parse_bitmap_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ) + bdf_parse_t_* p, + void* next ) { - bdf_line_func_t_* next = (bdf_line_func_t_ *)call_data; - bdf_parse_t_* p = (bdf_parse_t_ *) client_data; - bdf_glyph_t* glyph = p->glyph; - - unsigned char* bp; - unsigned long i, nibbles; - int x; + bdf_glyph_t* glyph = p->glyph; + unsigned char* bp; + unsigned long i, nibbles; + int x; FT_UNUSED( lineno ); /* only used in debug mode */ @@ -924,14 +793,14 @@ if ( i & 1 ) *bp++ |= x; else - *bp = x << 4; + *bp = (unsigned char)( x << 4 ); } p->row++; /* When done, go back to parsing glyphs */ if ( p->row >= (unsigned long)glyph->bbx.height ) - *next = bdf_parse_glyphs_; + *(bdf_line_func_t_*)next = bdf_parse_glyphs_; return FT_Err_Ok; } @@ -942,22 +811,19 @@ bdf_parse_glyphs_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ) + bdf_parse_t_* p, + void* next ) { - bdf_line_func_t_* next = (bdf_line_func_t_ *)call_data; - bdf_parse_t_* p = (bdf_parse_t_ *) client_data; - bdf_font_t* font = p->font; - bdf_glyph_t* glyph; - - FT_Memory memory = font->memory; - FT_Error error = FT_Err_Ok; + bdf_font_t* font = p->font; + bdf_glyph_t* glyph; + FT_Memory memory = font->memory; + FT_Error error = FT_Err_Ok; FT_UNUSED( lineno ); /* only used in debug mode */ /* Check for a comment. */ - if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { if ( p->flags & BDF_KEEP_COMMENTS ) error = bdf_add_comment_( font, line, linelen ); @@ -966,7 +832,7 @@ } /* Check for the ENDFONT field. */ - if ( _bdf_strncmp( line, "ENDFONT", 7 ) == 0 ) + if ( ft_strncmp( line, "ENDFONT", 7 ) == 0 ) { if ( p->flags & BDF_GLYPH_BITS_ ) { @@ -983,13 +849,14 @@ by_encoding ); p->flags &= ~BDF_START_; - *next = bdf_parse_end_; + + *(bdf_line_func_t_*)next = bdf_parse_end_; goto Exit; } /* Check for the ENDCHAR field. */ - if ( _bdf_strncmp( line, "ENDCHAR", 7 ) == 0 ) + if ( ft_strncmp( line, "ENDCHAR", 7 ) == 0 ) { /* Free unused glyph_name */ FT_FREE( p->glyph_name ); @@ -1008,7 +875,7 @@ goto Exit; /* Check for the STARTCHAR field. */ - if ( _bdf_strncmp( line, "STARTCHAR", 9 ) == 0 ) + if ( ft_strncmp( line, "STARTCHAR ", 10 ) == 0 ) { if ( p->flags & BDF_GLYPH_BITS_ ) { @@ -1031,7 +898,7 @@ } /* Check for the ENCODING field. */ - if ( _bdf_strncmp( line, "ENCODING", 8 ) == 0 ) + if ( ft_strncmp( line, "ENCODING ", 9 ) == 0 ) { if ( !( p->flags & BDF_GLYPH_ ) ) { @@ -1118,7 +985,7 @@ glyph = p->glyph; /* Expect the SWIDTH (scalable width) field next. */ - if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 ) + if ( ft_strncmp( line, "SWIDTH ", 7 ) == 0 ) { line = bdf_strtok_( line, ' ' ); glyph->swidth = bdf_atous_( line ); @@ -1128,7 +995,7 @@ } /* Expect the DWIDTH (device width) field next. */ - if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 ) + if ( ft_strncmp( line, "DWIDTH ", 7 ) == 0 ) { line = bdf_strtok_( line, ' ' ); glyph->dwidth = bdf_atous_( line ); @@ -1154,7 +1021,7 @@ goto Exit; /* Expect the BBX field next. */ - if ( _bdf_strncmp( line, "BBX", 3 ) == 0 ) + if ( ft_strncmp( line, "BBX ", 4 ) == 0 ) { line = bdf_strtok_( line, ' ' ); glyph->bbx.width = bdf_atous_( line ); @@ -1212,7 +1079,7 @@ } /* And finally, gather up the bitmap. */ - if ( _bdf_strncmp( line, "BITMAP", 6 ) == 0 ) + if ( ft_strncmp( line, "BITMAP", 6 ) == 0 ) { unsigned long bitmap_size; @@ -1243,7 +1110,7 @@ p->row = 0; p->flags |= BDF_BITMAP_; - *next = bdf_parse_bitmap_; + *(bdf_line_func_t_*)next = bdf_parse_bitmap_; goto Exit; } @@ -1270,23 +1137,19 @@ bdf_parse_properties_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ) + bdf_parse_t_* p, + void* next ) { - bdf_line_func_t_* next = (bdf_line_func_t_ *)call_data; - bdf_parse_t_* p = (bdf_parse_t_ *) client_data; - bdf_font_t* font = p->font; - - FT_Error error = FT_Err_Ok; - - char* name; - char* value; + bdf_font_t* font = p->font; + FT_Error error = FT_Err_Ok; + char* name; + char* value; FT_UNUSED( lineno ); /* Check for a comment. */ - if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { if ( p->flags & BDF_KEEP_COMMENTS ) error = bdf_add_comment_( font, line, linelen ); @@ -1295,15 +1158,15 @@ } /* Check for the end of the properties. */ - if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) + if ( ft_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) { - *next = bdf_parse_start_; + *(bdf_line_func_t_*)next = bdf_parse_start_; goto Exit; } /* Ignore the _XFREE86_GLYPH_RANGES properties. */ - if ( _bdf_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) + if ( ft_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) goto Exit; if ( bdf_is_atom_( line, linelen, &name, &value, p->font ) ) @@ -1331,15 +1194,12 @@ bdf_parse_start_( char* line, unsigned long linelen, unsigned long lineno, - void* call_data, - void* client_data ) + bdf_parse_t_* p, + void* next ) { - bdf_line_func_t_* next = (bdf_line_func_t_ *)call_data; - bdf_parse_t_* p = (bdf_parse_t_ *) client_data; - bdf_font_t* font; - - FT_Memory memory = p->memory; - FT_Error error = FT_Err_Ok; + bdf_font_t* font; + FT_Memory memory = p->memory; + FT_Error error = FT_Err_Ok; FT_UNUSED( lineno ); /* only used in debug mode */ @@ -1348,7 +1208,7 @@ /* Otherwise, reject the font immediately. */ if ( !( p->flags & BDF_START_ ) ) { - if ( _bdf_strncmp( line, "STARTFONT", 9 ) != 0 ) + if ( ft_strncmp( line, "STARTFONT", 9 ) != 0 ) { error = FT_THROW( Missing_Startfont_Field ); goto Exit; @@ -1368,7 +1228,7 @@ font = p->font; /* Check for a comment. */ - if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { if ( p->flags & BDF_KEEP_COMMENTS ) error = bdf_add_comment_( font, line, linelen ); @@ -1378,7 +1238,7 @@ /* Check for the start of the properties. */ if ( !( p->flags & BDF_PROPS_ ) && - _bdf_strncmp( line, "STARTPROPERTIES", 15 ) == 0 ) + ft_strncmp( line, "STARTPROPERTIES ", 16 ) == 0 ) { line = bdf_strtok_( line, ' ' ); font->props_size = bdf_atoul_( line ); @@ -1427,13 +1287,14 @@ } p->flags |= BDF_PROPS_; - *next = bdf_parse_properties_; + + *(bdf_line_func_t_*)next = bdf_parse_properties_; goto Exit; } /* Check for the FONTBOUNDINGBOX field. */ - if ( _bdf_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) + if ( ft_strncmp( line, "FONTBOUNDINGBOX ", 16 ) == 0 ) { line = bdf_strtok_( line, ' ' ); font->bbx.width = bdf_atous_( line ); @@ -1455,7 +1316,7 @@ } /* The next thing to check for is the FONT field. */ - if ( _bdf_strncmp( line, "FONT", 4 ) == 0 ) + if ( ft_strncmp( line, "FONT ", 5 ) == 0 ) { int i; @@ -1501,7 +1362,7 @@ } /* Check for the SIZE field. */ - if ( _bdf_strncmp( line, "SIZE", 4 ) == 0 ) + if ( ft_strncmp( line, "SIZE ", 5 ) == 0 ) { line = bdf_strtok_( line, ' ' ); font->point_size = bdf_atoul_( line ); @@ -1541,7 +1402,7 @@ } /* Check for the CHARS field */ - if ( _bdf_strncmp( line, "CHARS", 5 ) == 0 ) + if ( ft_strncmp( line, "CHARS ", 6 ) == 0 ) { /* Check the header for completeness before parsing glyphs. */ if ( !( p->flags & BDF_FONT_NAME_ ) ) @@ -1593,7 +1454,8 @@ goto Exit; p->flags |= BDF_GLYPHS_; - *next = bdf_parse_glyphs_; + + *(bdf_line_func_t_*)next = bdf_parse_glyphs_; goto Exit; } @@ -1606,6 +1468,104 @@ } + static FT_Error + bdf_readstream_( FT_Stream stream, + bdf_parse_t_* p, + unsigned long* lno ) + { + bdf_line_func_t_ cb = bdf_parse_start_; + unsigned long lineno, buf_size; + unsigned long bytes, start, end, cursor, avail; + char* buf = NULL; + FT_Memory memory = stream->memory; + FT_Error error = FT_Err_Ok; + + + /* initial size and allocation of the input buffer */ + buf_size = 1024; + + if ( FT_QALLOC( buf, buf_size ) ) + goto Exit; + + lineno = 1; + start = 0; + cursor = 0; + + Refill: + bytes = FT_Stream_TryRead( stream, + (FT_Byte*)buf + cursor, buf_size - cursor ); + avail = cursor + bytes; + + while ( bytes ) + { + /* try to find the start of the line */ + while ( start < avail && buf[start] < ' ' ) + start++; + + /* try to find the end of the line */ + end = start + 1; + while ( end < avail && buf[end] >= ' ' ) + end++; + + /* if we hit the end of the buffer, try shifting its content */ + /* or even resizing it */ + if ( end >= avail ) + { + if ( start == 0 ) + { + /* this line is definitely too long; try resizing the input */ + /* buffer a bit to handle it. */ + FT_ULong new_size; + + + if ( buf_size >= 65536UL ) /* limit ourselves to 64KByte */ + { + FT_ERROR(( "bdf_readstream_: " ERRMSG6, lineno )); + error = FT_THROW( Invalid_File_Format ); + + goto Exit; + } + + new_size = buf_size * 4; + if ( FT_QREALLOC( buf, buf_size, new_size ) ) + goto Exit; + + cursor = avail; + buf_size = new_size; + } + else + { + cursor = avail - start; + + FT_MEM_MOVE( buf, buf + start, cursor ); + + start = 0; + } + goto Refill; + } + + /* NUL-terminate the line. */ + buf[end] = 0; + + if ( buf[start] != '#' ) + { + error = (*cb)( buf + start, end - start, lineno, p, (void*)&cb ); + if ( error ) + break; + } + + lineno += 1; + start = end + 1; + } + + *lno = lineno; + + Exit: + FT_FREE( buf ); + return error; + } + + /************************************************************************** * * API. @@ -1633,8 +1593,7 @@ p->size = stream->size; p->memory = memory; /* only during font creation */ - error = bdf_readstream_( stream, bdf_parse_start_, - (void *)p, &lineno ); + error = bdf_readstream_( stream, p, &lineno ); if ( error ) goto Fail; diff --git a/vendor/freetype/src/bdf/module.mk b/vendor/freetype/src/bdf/module.mk new file mode 100644 index 00000000000..fe06ae8e064 --- /dev/null +++ b/vendor/freetype/src/bdf/module.mk @@ -0,0 +1,34 @@ +# +# FreeType 2 BDF module definition +# + +# Copyright 2001, 2002, 2006 by +# Francesco Zappa Nardelli +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +FTMODULE_H_COMMANDS += BDF_DRIVER + +define BDF_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, bdf_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)bdf $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/bdf/rules.mk b/vendor/freetype/src/bdf/rules.mk new file mode 100644 index 00000000000..d1dd76b1c3d --- /dev/null +++ b/vendor/freetype/src/bdf/rules.mk @@ -0,0 +1,84 @@ +# +# FreeType 2 bdf driver configuration rules +# + + +# Copyright (C) 2001, 2002, 2003, 2008 by +# Francesco Zappa Nardelli +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + + + +# bdf driver directory +# +BDF_DIR := $(SRC_DIR)/bdf + + +BDF_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(BDF_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# bdf driver sources (i.e., C files) +# +BDF_DRV_SRC := $(BDF_DIR)/bdflib.c \ + $(BDF_DIR)/bdfdrivr.c + + +# bdf driver headers +# +BDF_DRV_H := $(BDF_DIR)/bdf.h \ + $(BDF_DIR)/bdfdrivr.h \ + $(BDF_DIR)/bdferror.h + +# bdf driver object(s) +# +# BDF_DRV_OBJ_M is used during `multi' builds +# BDF_DRV_OBJ_S is used during `single' builds +# +BDF_DRV_OBJ_M := $(BDF_DRV_SRC:$(BDF_DIR)/%.c=$(OBJ_DIR)/%.$O) +BDF_DRV_OBJ_S := $(OBJ_DIR)/bdf.$O + +# bdf driver source file for single build +# +BDF_DRV_SRC_S := $(BDF_DIR)/bdf.c + + +# bdf driver - single object +# +$(BDF_DRV_OBJ_S): $(BDF_DRV_SRC_S) $(BDF_DRV_SRC) $(FREETYPE_H) $(BDF_DRV_H) + $(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BDF_DRV_SRC_S)) + + +# bdf driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(BDF_DIR)/%.c $(FREETYPE_H) $(BDF_DRV_H) + $(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(BDF_DRV_OBJ_S) +DRV_OBJS_M += $(BDF_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/bzip2/rules.mk b/vendor/freetype/src/bzip2/rules.mk new file mode 100644 index 00000000000..9019eee1412 --- /dev/null +++ b/vendor/freetype/src/bzip2/rules.mk @@ -0,0 +1,64 @@ +# +# FreeType 2 BZIP2 support configuration rules +# + +# Copyright (C) 2010-2024 by +# Joel Klinghed. +# +# based on `src/lzw/rules.mk' +# +# 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. + + +# BZIP2 driver directory +# +BZIP2_DIR := $(SRC_DIR)/bzip2 + + +# compilation flags for the driver +# +BZIP2_COMPILE := $(CC) $(ANSIFLAGS) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# BZIP2 support sources (i.e., C files) +# +BZIP2_DRV_SRC := $(BZIP2_DIR)/ftbzip2.c + +# BZIP2 driver object(s) +# +# BZIP2_DRV_OBJ_M is used during `multi' builds +# BZIP2_DRV_OBJ_S is used during `single' builds +# +BZIP2_DRV_OBJ_M := $(OBJ_DIR)/ftbzip2.$O +BZIP2_DRV_OBJ_S := $(OBJ_DIR)/ftbzip2.$O + +# BZIP2 support source file for single build +# +BZIP2_DRV_SRC_S := $(BZIP2_DIR)/ftbzip2.c + + +# BZIP2 support - single object +# +$(BZIP2_DRV_OBJ_S): $(BZIP2_DRV_SRC_S) $(BZIP2_DRV_SRC) $(FREETYPE_H) $(BZIP2_DRV_H) + $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BZIP2_DRV_SRC_S)) + + +# BZIP2 support - multiple objects +# +$(OBJ_DIR)/%.$O: $(BZIP2_DIR)/%.c $(FREETYPE_H) $(BZIP2_DRV_H) + $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(BZIP2_DRV_OBJ_S) +DRV_OBJS_M += $(BZIP2_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/cache/rules.mk b/vendor/freetype/src/cache/rules.mk new file mode 100644 index 00000000000..ace92c59fa3 --- /dev/null +++ b/vendor/freetype/src/cache/rules.mk @@ -0,0 +1,85 @@ +# +# FreeType 2 Cache configuration rules +# + + +# Copyright (C) 2000-2024 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. + + +# Cache driver directory +# +CACHE_DIR := $(SRC_DIR)/cache + + +# compilation flags for the driver +# +CACHE_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# Cache driver sources (i.e., C files) +# +CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \ + $(CACHE_DIR)/ftccache.c \ + $(CACHE_DIR)/ftccmap.c \ + $(CACHE_DIR)/ftcglyph.c \ + $(CACHE_DIR)/ftcimage.c \ + $(CACHE_DIR)/ftcmanag.c \ + $(CACHE_DIR)/ftcmru.c \ + $(CACHE_DIR)/ftcsbits.c + + +# Cache driver headers +# +CACHE_DRV_H := $(CACHE_DIR)/ftccache.h \ + $(CACHE_DIR)/ftccback.h \ + $(CACHE_DIR)/ftcerror.h \ + $(CACHE_DIR)/ftcglyph.h \ + $(CACHE_DIR)/ftcimage.h \ + $(CACHE_DIR)/ftcmanag.h \ + $(CACHE_DIR)/ftcmru.h \ + $(CACHE_DIR)/ftcsbits.h + + +# Cache driver object(s) +# +# CACHE_DRV_OBJ_M is used during `multi' builds. +# CACHE_DRV_OBJ_S is used during `single' builds. +# +CACHE_DRV_OBJ_M := $(CACHE_DRV_SRC:$(CACHE_DIR)/%.c=$(OBJ_DIR)/%.$O) +CACHE_DRV_OBJ_S := $(OBJ_DIR)/ftcache.$O + +# Cache driver source file for single build +# +CACHE_DRV_SRC_S := $(CACHE_DIR)/ftcache.c + + +# Cache driver - single object +# +$(CACHE_DRV_OBJ_S): $(CACHE_DRV_SRC_S) $(CACHE_DRV_SRC) \ + $(FREETYPE_H) $(CACHE_DRV_H) + $(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CACHE_DRV_SRC_S)) + + +# Cache driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(CACHE_DIR)/%.c $(FREETYPE_H) $(CACHE_DRV_H) + $(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(CACHE_DRV_OBJ_S) +DRV_OBJS_M += $(CACHE_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/cff/cffdrivr.c b/vendor/freetype/src/cff/cffdrivr.c index bab7d349aa5..f432c9e4a33 100644 --- a/vendor/freetype/src/cff/cffdrivr.c +++ b/vendor/freetype/src/cff/cffdrivr.c @@ -121,7 +121,20 @@ kerning->y = 0; if ( sfnt ) - kerning->x = sfnt->get_kerning( cffface, left_glyph, right_glyph ); + { + /* Use 'kern' table if available since that can be faster; otherwise */ + /* use GPOS kerning pairs if available. */ + if ( cffface->kern_avail_bits ) + kerning->x = sfnt->get_kerning( cffface, + left_glyph, + right_glyph ); +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + else if ( cffface->num_gpos_lookups_kerning ) + kerning->x = sfnt->get_gpos_kerning( cffface, + left_glyph, + right_glyph ); +#endif + } return FT_Err_Ok; } @@ -168,7 +181,7 @@ CFF_Size cffsize = (CFF_Size)size; - FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index )); + FT_TRACE1(( "cff_glyph_load: glyph index %u\n", glyph_index )); /* now load the glyph outline if necessary */ error = cff_slot_load( cffslot, cffsize, glyph_index, load_flags ); @@ -242,7 +255,7 @@ &dummy, &aw ); - FT_TRACE5(( " idx %d: advance %s %d font unit%s\n", + FT_TRACE5(( " idx %u: advance %s %d font unit%s\n", start + nn, horz ? "width" : "height", aw, diff --git a/vendor/freetype/src/cff/cffgload.c b/vendor/freetype/src/cff/cffgload.c index 1abee3aec7f..208ac98ba3f 100644 --- a/vendor/freetype/src/cff/cffgload.c +++ b/vendor/freetype/src/cff/cffgload.c @@ -408,12 +408,28 @@ #endif /* FT_CONFIG_OPTION_SVG */ + /* top-level code ensures that FT_LOAD_NO_HINTING is set */ + /* if FT_LOAD_NO_SCALE is active */ + hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); + scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ); + + glyph->hint = hinting; + glyph->scaled = scaled; + + if ( scaled ) + { + glyph->x_scale = size->root.metrics.x_scale; + glyph->y_scale = size->root.metrics.y_scale; + } + else + { + glyph->x_scale = 0x10000L; + glyph->y_scale = 0x10000L; + } + /* if we have a CID subfont, use its matrix (which has already */ /* been multiplied with the root matrix) */ - glyph->x_scale = size->root.metrics.x_scale; - glyph->y_scale = size->root.metrics.y_scale; - /* this scaling is only relevant if the PS hinter isn't active */ if ( cff->num_subfonts ) { @@ -445,14 +461,6 @@ font_offset = cff->top_font.font_dict.font_offset; } - /* top-level code ensures that FT_LOAD_NO_HINTING is set */ - /* if FT_LOAD_NO_SCALE is active */ - hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); - scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ); - - glyph->hint = hinting; - glyph->scaled = scaled; - { #ifdef CFF_CONFIG_OPTION_OLD_ENGINE PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face ); @@ -687,7 +695,7 @@ metrics->vertAdvance += font_offset.y; } - if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling ) + if ( scaled || force_scaling ) { /* scale the outline and the metrics */ FT_Int n; diff --git a/vendor/freetype/src/cff/cffload.c b/vendor/freetype/src/cff/cffload.c index 979fd45f6ca..7ca60af85ac 100644 --- a/vendor/freetype/src/cff/cffload.c +++ b/vendor/freetype/src/cff/cffload.c @@ -442,7 +442,7 @@ if ( cur_offset != 0 ) { FT_TRACE0(( "cff_index_get_pointers:" - " invalid first offset value %ld set to zero\n", + " invalid first offset value %lu set to zero\n", cur_offset )); cur_offset = 0; } @@ -559,8 +559,8 @@ idx->data_offset > stream->size - off2 + 1 ) { FT_ERROR(( "cff_index_access_element:" - " offset to next entry (%ld)" - " exceeds the end of stream (%ld)\n", + " offset to next entry (%lu)" + " exceeds the end of stream (%lu)\n", off2, stream->size - idx->data_offset + 1 )); off2 = stream->size - idx->data_offset + 1; } @@ -982,7 +982,7 @@ if ( glyph_sid > 0xFFFFL - nleft ) { FT_ERROR(( "cff_charset_load: invalid SID range trimmed" - " nleft=%d -> %ld\n", nleft, 0xFFFFL - glyph_sid )); + " nleft=%u -> %ld\n", nleft, 0xFFFFL - glyph_sid )); nleft = ( FT_UInt )( 0xFFFFL - glyph_sid ); } @@ -1315,7 +1315,7 @@ if ( numOperands > count ) { - FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d argument%s\n", + FT_TRACE4(( " cff_blend_doBlend: Stack underflow %u argument%s\n", count, count == 1 ? "" : "s" )); @@ -1466,7 +1466,7 @@ if ( master == 0 ) { blend->BV[master] = FT_FIXED_ONE; - FT_TRACE4(( " build blend vector len %d\n", len )); + FT_TRACE4(( " build blend vector len %u\n", len )); FT_TRACE4(( " [ %f ", blend->BV[master] / 65536.0 )); continue; } @@ -2341,7 +2341,7 @@ if ( face_index > 0 && subfont_index >= font->name_index.count ) { FT_ERROR(( "cff_font_load:" - " invalid subfont index for pure CFF font (%d)\n", + " invalid subfont index for pure CFF font (%u)\n", subfont_index )); error = FT_THROW( Invalid_Argument ); goto Exit; diff --git a/vendor/freetype/src/cff/cffobjs.c b/vendor/freetype/src/cff/cffobjs.c index 77dce2818e2..78f1e1dcb4f 100644 --- a/vendor/freetype/src/cff/cffobjs.c +++ b/vendor/freetype/src/cff/cffobjs.c @@ -653,7 +653,7 @@ { s = cff_index_get_sid_string( cff, idx ); if ( s ) - FT_TRACE4(( " %5d %s\n", idx, s )); + FT_TRACE4(( " %5u %s\n", idx, s )); } /* In Multiple Master CFFs, two SIDs hold the Normalize Design */ @@ -668,7 +668,7 @@ FT_PtrDist l; - FT_TRACE4(( " %5d ", idx + 390 )); + FT_TRACE4(( " %5u ", idx + 390 )); for ( l = 0; l < s1len; l++ ) FT_TRACE4(( "%c", s1[l] )); FT_TRACE4(( "\n" )); @@ -683,7 +683,7 @@ FT_PtrDist l; - FT_TRACE4(( " %5d ", cff->num_strings + 390 )); + FT_TRACE4(( " %5u ", cff->num_strings + 390 )); for ( l = 0; l < s1len; l++ ) FT_TRACE4(( "%c", s1[l] )); FT_TRACE4(( "\n" )); diff --git a/vendor/freetype/src/cff/cffparse.c b/vendor/freetype/src/cff/cffparse.c index 92a69c3b516..b247e42615c 100644 --- a/vendor/freetype/src/cff/cffparse.c +++ b/vendor/freetype/src/cff/cffparse.c @@ -892,7 +892,7 @@ dict->cid_supplement )); error = FT_Err_Ok; - FT_TRACE4(( " %d %d %ld\n", + FT_TRACE4(( " %u %u %ld\n", dict->cid_registry, dict->cid_ordering, dict->cid_supplement )); @@ -929,7 +929,7 @@ priv->vsindex = (FT_UInt)cff_parse_num( parser, data++ ); - FT_TRACE4(( " %d\n", priv->vsindex )); + FT_TRACE4(( " %u\n", priv->vsindex )); error = FT_Err_Ok; @@ -979,7 +979,7 @@ goto Exit; } - FT_TRACE4(( " %d value%s blended\n", + FT_TRACE4(( " %u value%s blended\n", numBlends, numBlends == 1 ? "" : "s" )); @@ -1014,7 +1014,7 @@ if ( dict->maxstack < CFF2_DEFAULT_STACK ) dict->maxstack = CFF2_DEFAULT_STACK; - FT_TRACE4(( " %d\n", dict->maxstack )); + FT_TRACE4(( " %u\n", dict->maxstack )); Exit: return error; diff --git a/vendor/freetype/src/cff/module.mk b/vendor/freetype/src/cff/module.mk new file mode 100644 index 00000000000..2c89cc62bba --- /dev/null +++ b/vendor/freetype/src/cff/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 CFF module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += CFF_DRIVER + +define CFF_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/cff/rules.mk b/vendor/freetype/src/cff/rules.mk new file mode 100644 index 00000000000..8d4d6457bcd --- /dev/null +++ b/vendor/freetype/src/cff/rules.mk @@ -0,0 +1,75 @@ +# +# FreeType 2 OpenType/CFF driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# OpenType driver directory +# +CFF_DIR := $(SRC_DIR)/cff + + +CFF_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(CFF_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# CFF driver sources (i.e., C files) +# +CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c \ + $(CFF_DIR)/cffdrivr.c \ + $(CFF_DIR)/cffgload.c \ + $(CFF_DIR)/cffload.c \ + $(CFF_DIR)/cffobjs.c \ + $(CFF_DIR)/cffparse.c + + +# CFF driver headers +# +CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \ + $(CFF_DIR)/cfferrs.h \ + $(CFF_DIR)/cfftoken.h + + +# CFF driver object(s) +# +# CFF_DRV_OBJ_M is used during `multi' builds +# CFF_DRV_OBJ_S is used during `single' builds +# +CFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR)/%.c=$(OBJ_DIR)/%.$O) +CFF_DRV_OBJ_S := $(OBJ_DIR)/cff.$O + +# CFF driver source file for single build +# +CFF_DRV_SRC_S := $(CFF_DIR)/cff.c + + +# CFF driver - single object +# +$(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H) + $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CFF_DRV_SRC_S)) + + +# CFF driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(CFF_DIR)/%.c $(FREETYPE_H) $(CFF_DRV_H) + $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(CFF_DRV_OBJ_S) +DRV_OBJS_M += $(CFF_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/cid/cidgload.c b/vendor/freetype/src/cid/cidgload.c index cb2861519d9..2299070ff3a 100644 --- a/vendor/freetype/src/cid/cidgload.c +++ b/vendor/freetype/src/cid/cidgload.c @@ -103,20 +103,20 @@ if ( ( cid->fd_bytes == 1 && fd_select == 0xFFU ) || ( cid->fd_bytes == 2 && fd_select == 0xFFFFU ) ) { - FT_TRACE1(( "cid_load_glyph: fail for glyph index %d:\n", + FT_TRACE1(( "cid_load_glyph: fail for glyph index %u:\n", glyph_index )); - FT_TRACE1(( " FD number %ld is the maximum\n", + FT_TRACE1(( " FD number %lu is the maximum\n", fd_select )); - FT_TRACE1(( " integer fitting into %d byte%s\n", + FT_TRACE1(( " integer fitting into %u byte%s\n", cid->fd_bytes, cid->fd_bytes == 1 ? "" : "s" )); } else { - FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n", glyph_index )); - FT_TRACE0(( " FD number %ld is larger\n", + FT_TRACE0(( " FD number %lu is larger\n", fd_select )); - FT_TRACE0(( " than number of dictionaries (%d)\n", + FT_TRACE0(( " than number of dictionaries (%u)\n", cid->num_dicts )); } @@ -125,7 +125,7 @@ } else if ( off2 > stream->size ) { - FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n", glyph_index )); FT_TRACE0(( " end of the glyph data\n" )); FT_TRACE0(( " is beyond the data stream\n" )); @@ -135,7 +135,7 @@ } else if ( off1 > off2 ) { - FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n", glyph_index )); FT_TRACE0(( " the end position of glyph data\n" )); FT_TRACE0(( " is set before the start position\n" )); @@ -252,8 +252,8 @@ cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0; if ( cs_offset > glyph_length ) { - FT_TRACE0(( "cid_load_glyph: fail for glyph_index=%d, " - "offset to the charstring is beyond glyph length\n", + FT_TRACE0(( "cid_load_glyph: fail for glyph_index=%u," + " offset to the charstring is beyond glyph length\n", glyph_index )); error = FT_THROW( Invalid_Offset ); goto Exit; diff --git a/vendor/freetype/src/cid/module.mk b/vendor/freetype/src/cid/module.mk new file mode 100644 index 00000000000..c65a69fbae9 --- /dev/null +++ b/vendor/freetype/src/cid/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 CID module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += TYPE1CID_DRIVER + +define TYPE1CID_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, t1cid_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/cid/rules.mk b/vendor/freetype/src/cid/rules.mk new file mode 100644 index 00000000000..85ac737a43b --- /dev/null +++ b/vendor/freetype/src/cid/rules.mk @@ -0,0 +1,73 @@ +# +# FreeType 2 CID driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# CID driver directory +# +CID_DIR := $(SRC_DIR)/cid + + +CID_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(CID_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# CID driver sources (i.e., C files) +# +CID_DRV_SRC := $(CID_DIR)/cidparse.c \ + $(CID_DIR)/cidload.c \ + $(CID_DIR)/cidriver.c \ + $(CID_DIR)/cidgload.c \ + $(CID_DIR)/cidobjs.c + +# CID driver headers +# +CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \ + $(CID_DIR)/cidtoken.h \ + $(CID_DIR)/ciderrs.h + + +# CID driver object(s) +# +# CID_DRV_OBJ_M is used during `multi' builds +# CID_DRV_OBJ_S is used during `single' builds +# +CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR)/%.c=$(OBJ_DIR)/%.$O) +CID_DRV_OBJ_S := $(OBJ_DIR)/type1cid.$O + +# CID driver source file for single build +# +CID_DRV_SRC_S := $(CID_DIR)/type1cid.c + + +# CID driver - single object +# +$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H) + $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CID_DRV_SRC_S)) + + +# CID driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(CID_DIR)/%.c $(FREETYPE_H) $(CID_DRV_H) + $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(CID_DRV_OBJ_S) +DRV_OBJS_M += $(CID_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/dlg/rules.mk b/vendor/freetype/src/dlg/rules.mk new file mode 100644 index 00000000000..14953636a3d --- /dev/null +++ b/vendor/freetype/src/dlg/rules.mk @@ -0,0 +1,70 @@ +# +# FreeType 2 dlg logging library configuration rules +# + + +# Copyright (C) 2020-2024 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. + + +# dlg logging library directory +# +DLG_DIR := $(SRC_DIR)/dlg + + +# compilation flags for the library +# +DLG_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(DLG_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# dlg logging library sources (i.e., C files) +# +DLG_SRC := $(DLG_DIR)/dlgwrap.c + +# dlg logging library headers +# +DLG_H := $(TOP_DIR)/include/dlg/dlg.h \ + $(TOP_DIR)/include/dlg/output.h + + +# dlg logging library object(s) +# +# DLG_OBJ_M is used during `multi' builds +# DLG_OBJ_S is used during `single' builds +# +DLG_OBJ_M := $(DLG_SRC:$(DLG_DIR)/%.c=$(OBJ_DIR)/%.$O) +DLG_OBJ_S := $(OBJ_DIR)/dlg.$O + +# dlg logging library source file for single build +# +DLG_SRC_S := $(DLG_DIR)/dlgwrap.c + + +# dlg logging library - single object +# +$(DLG_OBJ_S): $(DLG_SRC_S) $(DLG_SRC) $(FREETYPE_H) $(DLG_H) + $(DLG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(DLG_SRC_S)) + + +# dlg logging library - multiple objects +# +$(OBJ_DIR)/%.$O: $(DLG_DIR)/%.c $(FREETYPE_H) $(DLG_H) + $(DLG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main object lists +# +DLG_OBJS_S += $(DLG_OBJ_S) +DLG_OBJS_M += $(DLG_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/gxvalid/gxvcommn.c b/vendor/freetype/src/gxvalid/gxvcommn.c index 5f8fa115f52..e27da9236a7 100644 --- a/vendor/freetype/src/gxvalid/gxvcommn.c +++ b/vendor/freetype/src/gxvalid/gxvcommn.c @@ -1730,7 +1730,7 @@ { #ifdef FT_DEBUG_LEVEL_TRACE if ( odtect->range[i].name || odtect->range[j].name ) - GXV_TRACE(( "found overlap between range %d and range %d\n", + GXV_TRACE(( "found overlap between range %u and range %u\n", i, j )); else GXV_TRACE(( "found overlap between `%s' and `%s\'\n", diff --git a/vendor/freetype/src/gxvalid/gxvfeat.c b/vendor/freetype/src/gxvalid/gxvfeat.c index 57b389239ba..c192935d6dd 100644 --- a/vendor/freetype/src/gxvalid/gxvfeat.c +++ b/vendor/freetype/src/gxvalid/gxvfeat.c @@ -306,7 +306,7 @@ FT_INVALID_FORMAT; featureNameCount = FT_NEXT_USHORT( p ); - GXV_TRACE(( " (featureNameCount = %d)\n", featureNameCount )); + GXV_TRACE(( " (featureNameCount = %u)\n", featureNameCount )); if ( !( IS_PARANOID_VALIDATION ) ) p += 6; /* skip (none) and (none) */ diff --git a/vendor/freetype/src/gxvalid/gxvjust.c b/vendor/freetype/src/gxvalid/gxvjust.c index 1cf9e84ad45..0e491138d36 100644 --- a/vendor/freetype/src/gxvalid/gxvjust.c +++ b/vendor/freetype/src/gxvalid/gxvjust.c @@ -672,7 +672,7 @@ FT_TRACE3(( "validating `just' table\n" )); GXV_INIT; - limit = gxvalid->root->limit; + limit = gxvalid->root->limit; GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 ); version = FT_NEXT_ULONG( p ); diff --git a/vendor/freetype/src/gxvalid/gxvkern.c b/vendor/freetype/src/gxvalid/gxvkern.c index cf8c51fb8ee..8ff19540da6 100644 --- a/vendor/freetype/src/gxvalid/gxvkern.c +++ b/vendor/freetype/src/gxvalid/gxvkern.c @@ -884,7 +884,7 @@ for ( i = 0; i < nTables; i++ ) { - GXV_TRACE(( "validating subtable %d/%lu\n", i, nTables )); + GXV_TRACE(( "validating subtable %u/%lu\n", i, nTables )); /* p should be 32bit-aligned? */ gxv_kern_subtable_validate( p, 0, gxvalid ); p += gxvalid->subtable_length; diff --git a/vendor/freetype/src/gxvalid/gxvmort.c b/vendor/freetype/src/gxvalid/gxvmort.c index 5ad9d81c59a..23e9932b0dc 100644 --- a/vendor/freetype/src/gxvalid/gxvmort.c +++ b/vendor/freetype/src/gxvalid/gxvmort.c @@ -207,7 +207,7 @@ func = fmt_funcs_table[type]; if ( !func ) - GXV_TRACE(( "morx type %d is reserved\n", type )); + GXV_TRACE(( "morx type %u is reserved\n", type )); func( p, p + rest, gxvalid ); diff --git a/vendor/freetype/src/gxvalid/gxvtrak.c b/vendor/freetype/src/gxvalid/gxvtrak.c index a402823af74..c0e32453f5f 100644 --- a/vendor/freetype/src/gxvalid/gxvtrak.c +++ b/vendor/freetype/src/gxvalid/gxvtrak.c @@ -231,7 +231,7 @@ gxvalid->table_data = trak; gxvalid->face = face; - limit = gxvalid->root->limit; + limit = gxvalid->root->limit; FT_TRACE3(( "validating `trak' table\n" )); GXV_INIT; diff --git a/vendor/freetype/src/gxvalid/module.mk b/vendor/freetype/src/gxvalid/module.mk new file mode 100644 index 00000000000..1d1df0044b2 --- /dev/null +++ b/vendor/freetype/src/gxvalid/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 gxvalid module definition +# + +# Copyright (C) 2004-2024 by +# suzuki toshiya, Masatake YAMATO, Red Hat K.K., +# 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. + + +FTMODULE_H_COMMANDS += GXVALID_MODULE + +define GXVALID_MODULE +$(OPEN_DRIVER) FT_Module_Class, gxv_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)gxvalid $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/gxvalid/rules.mk b/vendor/freetype/src/gxvalid/rules.mk new file mode 100644 index 00000000000..0d88010832f --- /dev/null +++ b/vendor/freetype/src/gxvalid/rules.mk @@ -0,0 +1,98 @@ +# +# FreeType 2 TrueTypeGX/AAT validation driver configuration rules +# + + +# Copyright (C) 2004-2024 by +# suzuki toshiya, Masatake YAMATO, Red Hat K.K., +# 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. + + +# GXV driver directory +# +GXV_DIR := $(SRC_DIR)/gxvalid + + +# compilation flags for the driver +# +GXV_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(GXV_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# GXV driver sources (i.e., C files) +# +GXV_DRV_SRC := $(GXV_DIR)/gxvcommn.c \ + $(GXV_DIR)/gxvfeat.c \ + $(GXV_DIR)/gxvbsln.c \ + $(GXV_DIR)/gxvtrak.c \ + $(GXV_DIR)/gxvopbd.c \ + $(GXV_DIR)/gxvprop.c \ + $(GXV_DIR)/gxvjust.c \ + $(GXV_DIR)/gxvmort.c \ + $(GXV_DIR)/gxvmort0.c \ + $(GXV_DIR)/gxvmort1.c \ + $(GXV_DIR)/gxvmort2.c \ + $(GXV_DIR)/gxvmort4.c \ + $(GXV_DIR)/gxvmort5.c \ + $(GXV_DIR)/gxvmorx.c \ + $(GXV_DIR)/gxvmorx0.c \ + $(GXV_DIR)/gxvmorx1.c \ + $(GXV_DIR)/gxvmorx2.c \ + $(GXV_DIR)/gxvmorx4.c \ + $(GXV_DIR)/gxvmorx5.c \ + $(GXV_DIR)/gxvlcar.c \ + $(GXV_DIR)/gxvkern.c \ + $(GXV_DIR)/gxvmod.c + +# GXV driver headers +# +GXV_DRV_H := $(GXV_DIR)/gxvalid.h \ + $(GXV_DIR)/gxverror.h \ + $(GXV_DIR)/gxvcommn.h \ + $(GXV_DIR)/gxvfeat.h \ + $(GXV_DIR)/gxvmod.h \ + $(GXV_DIR)/gxvmort.h \ + $(GXV_DIR)/gxvmorx.h + + +# GXV driver object(s) +# +# GXV_DRV_OBJ_M is used during `multi' builds. +# GXV_DRV_OBJ_S is used during `single' builds. +# +GXV_DRV_OBJ_M := $(GXV_DRV_SRC:$(GXV_DIR)/%.c=$(OBJ_DIR)/%.$O) +GXV_DRV_OBJ_S := $(OBJ_DIR)/gxvalid.$O + +# GXV driver source file for single build +# +GXV_DRV_SRC_S := $(GXV_DIR)/gxvalid.c + + +# GXV driver - single object +# +$(GXV_DRV_OBJ_S): $(GXV_DRV_SRC_S) $(GXV_DRV_SRC) \ + $(FREETYPE_H) $(GXV_DRV_H) + $(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GXV_DRV_SRC_S)) + + +# GXV driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(GXV_DIR)/%.c $(FREETYPE_H) $(GXV_DRV_H) + $(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(GXV_DRV_OBJ_S) +DRV_OBJS_M += $(GXV_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/gzip/ftzconf.h b/vendor/freetype/src/gzip/ftzconf.h index fb76ffe312a..62adc8d8431 100644 --- a/vendor/freetype/src/gzip/ftzconf.h +++ b/vendor/freetype/src/gzip/ftzconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -300,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/vendor/freetype/src/gzip/gzguts.h b/vendor/freetype/src/gzip/gzguts.h index f9a250b8561..d7d733bda71 100644 --- a/vendor/freetype/src/gzip/gzguts.h +++ b/vendor/freetype/src/gzip/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error); /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else unsigned ZLIB_INTERNAL gz_intmax(void); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/vendor/freetype/src/gzip/inflate.c b/vendor/freetype/src/gzip/inflate.c index f7ed5d1813d..c8125680b0c 100644 --- a/vendor/freetype/src/gzip/inflate.c +++ b/vendor/freetype/src/gzip/inflate.c @@ -1393,7 +1393,7 @@ int ZEXPORT inflateSync(z_streamp strm) { /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { diff --git a/vendor/freetype/src/gzip/inftrees.c b/vendor/freetype/src/gzip/inftrees.c index 1fd655593ac..468eea8790a 100644 --- a/vendor/freetype/src/gzip/inftrees.c +++ b/vendor/freetype/src/gzip/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2023 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 static const char inflate_copyright[] = - " inflate 1.3 Copyright 1995-2023 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/vendor/freetype/src/gzip/inftrees.h b/vendor/freetype/src/gzip/inftrees.h index 47f726c36a2..d735b0a5145 100644 --- a/vendor/freetype/src/gzip/inftrees.h +++ b/vendor/freetype/src/gzip/inftrees.h @@ -44,8 +44,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ diff --git a/vendor/freetype/src/gzip/patches/freetype-zlib.diff b/vendor/freetype/src/gzip/patches/freetype-zlib.diff index 9486bd02aac..9c7e549c6e8 100644 --- a/vendor/freetype/src/gzip/patches/freetype-zlib.diff +++ b/vendor/freetype/src/gzip/patches/freetype-zlib.diff @@ -104,7 +104,7 @@ index 6c38f5c04..27487dcc2 100644 + +#endif /* !Z_FREETYPE */ diff --git b/src/gzip/gzguts.h a/src/gzip/gzguts.h -index f9375047e..f9a250b85 100644 +index eba72085b..d7d733bda 100644 --- b/src/gzip/gzguts.h +++ a/src/gzip/gzguts.h @@ -162,7 +162,7 @@ @@ -127,7 +127,7 @@ index 49c6d156c..a38c5be45 100644 -void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); +static void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); diff --git b/src/gzip/inflate.c a/src/gzip/inflate.c -index b0757a9b2..f7ed5d181 100644 +index 94ecff015..c8125680b 100644 --- b/src/gzip/inflate.c +++ a/src/gzip/inflate.c @@ -215,6 +215,8 @@ int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, @@ -184,7 +184,7 @@ index f127b6b1f..8a0e437ae 100644 + +#endif /* !INFLATE_H */ diff --git b/src/gzip/inftrees.c a/src/gzip/inftrees.c -index 8a208c2da..1fd655593 100644 +index 468eea879..98cfe1644 100644 --- b/src/gzip/inftrees.c +++ a/src/gzip/inftrees.c @@ -8,7 +8,7 @@ @@ -193,11 +193,11 @@ index 8a208c2da..1fd655593 100644 -const char inflate_copyright[] = +static const char inflate_copyright[] = - " inflate 1.3 Copyright 1995-2023 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome diff --git b/src/gzip/inftrees.h a/src/gzip/inftrees.h -index a10712d8c..47f726c36 100644 +index 396f74b5d..d735b0a51 100644 --- b/src/gzip/inftrees.h +++ a/src/gzip/inftrees.h @@ -3,6 +3,9 @@ @@ -221,7 +221,7 @@ index a10712d8c..47f726c36 100644 + +#endif /* !INFTREES_H */ diff --git b/src/gzip/zlib.h a/src/gzip/zlib.h -index 6b7244f99..5c7a884c9 100644 +index 8d4b932ea..8c3c42a32 100644 --- b/src/gzip/zlib.h +++ a/src/gzip/zlib.h @@ -31,7 +31,7 @@ @@ -305,7 +305,7 @@ index 6b7244f99..5c7a884c9 100644 /* utility functions */ @@ -1768,6 +1783,8 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ +#ifndef Z_FREETYPE @@ -404,7 +404,7 @@ index b1c5d2d3c..f76def425 100644 #ifndef Z_SOLO diff --git b/src/gzip/zutil.h a/src/gzip/zutil.h -index 902a304cc..a2c046a1f 100644 +index 48dd7feba..2c96797e3 100644 --- b/src/gzip/zutil.h +++ a/src/gzip/zutil.h @@ -53,8 +53,10 @@ typedef unsigned long ulg; @@ -416,9 +416,9 @@ index 902a304cc..a2c046a1f 100644 /* (size given to avoid silly warnings with Visual C++) */ +#endif - #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + #define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] -@@ -188,6 +190,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +@@ -167,6 +169,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #pragma warn -8066 #endif @@ -427,7 +427,7 @@ index 902a304cc..a2c046a1f 100644 /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) -@@ -196,6 +200,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +@@ -175,6 +179,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); #endif @@ -436,7 +436,7 @@ index 902a304cc..a2c046a1f 100644 /* common defaults */ #ifndef OS_CODE -@@ -227,9 +233,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +@@ -206,9 +212,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define zmemcmp _fmemcmp # define zmemzero(dest, len) _fmemset(dest, 0, len) # else diff --git a/vendor/freetype/src/gzip/rules.mk b/vendor/freetype/src/gzip/rules.mk new file mode 100644 index 00000000000..6b6c9900848 --- /dev/null +++ b/vendor/freetype/src/gzip/rules.mk @@ -0,0 +1,81 @@ +# +# FreeType 2 GZip support configuration rules +# + + +# Copyright (C) 2002-2024 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. + + +# gzip driver directory +# +GZIP_DIR := $(SRC_DIR)/gzip + + +# compilation flags for the driver +# +ifeq ($(SYSTEM_ZLIB),) + GZIP_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) +else + GZIP_COMPILE := $(CC) $(ANSIFLAGS) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) +endif + + +# gzip support sources +# +# All source and header files get loaded by `ftgzip.c' only if SYSTEM_ZLIB +# is not defined (regardless whether we have a `single' or a `multi' build). +# +ifeq ($(SYSTEM_ZLIB),) + GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c \ + $(GZIP_DIR)/crc32.c \ + $(GZIP_DIR)/crc32.h \ + $(GZIP_DIR)/ftzconf.h \ + $(GZIP_DIR)/inffast.c \ + $(GZIP_DIR)/inffast.h \ + $(GZIP_DIR)/inffixed.h \ + $(GZIP_DIR)/inflate.c \ + $(GZIP_DIR)/inflate.h \ + $(GZIP_DIR)/inftrees.c \ + $(GZIP_DIR)/inftrees.h \ + $(GZIP_DIR)/zlib.h \ + $(GZIP_DIR)/zutil.c \ + $(GZIP_DIR)/zutil.h +endif + +# gzip driver object(s) +# +# GZIP_DRV_OBJ is used during both `single' and `multi' builds +# +GZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O + + +# gzip main source file +# +GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c + + +# gzip support - object +# +$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H) + $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC)) + + +# update main driver object lists +# +DRV_OBJS_S += $(GZIP_DRV_OBJ) +DRV_OBJS_M += $(GZIP_DRV_OBJ) + + +# EOF diff --git a/vendor/freetype/src/gzip/zlib.h b/vendor/freetype/src/gzip/zlib.h index 5c7a884c937..8c3c42a3232 100644 --- a/vendor/freetype/src/gzip/zlib.h +++ b/vendor/freetype/src/gzip/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.3, August 18th, 2023 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.3" -#define ZLIB_VERNUM 0x1300 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 3 -#define ZLIB_VER_REVISION 0 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -941,10 +941,10 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, @@ -1773,14 +1773,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ #ifndef Z_FREETYPE diff --git a/vendor/freetype/src/gzip/zutil.h b/vendor/freetype/src/gzip/zutil.h index a2c046a1f0f..2c96797e3ae 100644 --- a/vendor/freetype/src/gzip/zutil.h +++ b/vendor/freetype/src/gzip/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -58,7 +58,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ #endif -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -139,17 +139,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -172,18 +163,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 diff --git a/vendor/freetype/src/lzw/rules.mk b/vendor/freetype/src/lzw/rules.mk new file mode 100644 index 00000000000..d051fda5abc --- /dev/null +++ b/vendor/freetype/src/lzw/rules.mk @@ -0,0 +1,72 @@ +# +# FreeType 2 LZW support configuration rules +# + + +# Copyright (C) 2004-2024 by +# Albert Chin-A-Young. +# +# based on `src/lzw/rules.mk' +# +# 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. + + +# LZW driver directory +# +LZW_DIR := $(SRC_DIR)/lzw + + +# compilation flags for the driver +# +LZW_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(LZW_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# LZW support sources (i.e., C files) +# +LZW_DRV_SRC := $(LZW_DIR)/ftlzw.c + +# LZW support headers +# +LZW_DRV_H := $(LZW_DIR)/ftzopen.h \ + $(LZW_DIR)/ftzopen.c + + +# LZW driver object(s) +# +# LZW_DRV_OBJ_M is used during `multi' builds +# LZW_DRV_OBJ_S is used during `single' builds +# +LZW_DRV_OBJ_M := $(OBJ_DIR)/ftlzw.$O +LZW_DRV_OBJ_S := $(OBJ_DIR)/ftlzw.$O + +# LZW support source file for single build +# +LZW_DRV_SRC_S := $(LZW_DIR)/ftlzw.c + + +# LZW support - single object +# +$(LZW_DRV_OBJ_S): $(LZW_DRV_SRC_S) $(LZW_DRV_SRC) $(FREETYPE_H) $(LZW_DRV_H) + $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(LZW_DRV_SRC_S)) + + +# LZW support - multiple objects +# +$(OBJ_DIR)/%.$O: $(LZW_DIR)/%.c $(FREETYPE_H) $(LZW_DRV_H) + $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(LZW_DRV_OBJ_S) +DRV_OBJS_M += $(LZW_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/otvalid/module.mk b/vendor/freetype/src/otvalid/module.mk new file mode 100644 index 00000000000..b3ca83cf83e --- /dev/null +++ b/vendor/freetype/src/otvalid/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 otvalid module definition +# + + +# Copyright (C) 2004-2024 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. + + +FTMODULE_H_COMMANDS += OTVALID_MODULE + +define OTVALID_MODULE +$(OPEN_DRIVER) FT_Module_Class, otv_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)otvalid $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/otvalid/otvbase.c b/vendor/freetype/src/otvalid/otvbase.c index 610126242ac..445bd90c2b9 100644 --- a/vendor/freetype/src/otvalid/otvbase.c +++ b/vendor/freetype/src/otvalid/otvbase.c @@ -44,7 +44,7 @@ BaseCoordFormat = FT_NEXT_USHORT( p ); p += 2; /* skip Coordinate */ - OTV_TRACE(( " (format %d)\n", BaseCoordFormat )); + OTV_TRACE(( " (format %u)\n", BaseCoordFormat )); switch ( BaseCoordFormat ) { @@ -83,7 +83,7 @@ BaseTagCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BaseTagCount = %d)\n", BaseTagCount )); + OTV_TRACE(( " (BaseTagCount = %u)\n", BaseTagCount )); OTV_LIMIT_CHECK( BaseTagCount * 4 ); /* BaselineTag */ @@ -106,7 +106,7 @@ p += 2; /* skip DefaultIndex */ BaseCoordCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BaseCoordCount = %d)\n", BaseCoordCount )); + OTV_TRACE(( " (BaseCoordCount = %u)\n", BaseCoordCount )); OTV_LIMIT_CHECK( BaseCoordCount * 2 ); @@ -138,7 +138,7 @@ OTV_OPTIONAL_OFFSET( MaxCoord ); FeatMinMaxCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (FeatMinMaxCount = %d)\n", FeatMinMaxCount )); + OTV_TRACE(( " (FeatMinMaxCount = %u)\n", FeatMinMaxCount )); table_size = FeatMinMaxCount * 8 + 6; @@ -192,7 +192,7 @@ OTV_OPTIONAL_OFFSET( DefaultMinMax ); BaseLangSysCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BaseLangSysCount = %d)\n", BaseLangSysCount )); + OTV_TRACE(( " (BaseLangSysCount = %u)\n", BaseLangSysCount )); table_size = BaseLangSysCount * 6 + 6; @@ -231,7 +231,7 @@ OTV_LIMIT_CHECK( 2 ); BaseScriptCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BaseScriptCount = %d)\n", BaseScriptCount )); + OTV_TRACE(( " (BaseScriptCount = %u)\n", BaseScriptCount )); OTV_LIMIT_CHECK( BaseScriptCount * 6 ); diff --git a/vendor/freetype/src/otvalid/otvcommn.c b/vendor/freetype/src/otvalid/otvcommn.c index f06354b7816..d58b93ca7d0 100644 --- a/vendor/freetype/src/otvalid/otvcommn.c +++ b/vendor/freetype/src/otvalid/otvcommn.c @@ -52,7 +52,7 @@ OTV_LIMIT_CHECK( 4 ); CoverageFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", CoverageFormat )); + OTV_TRACE(( " (format %u)\n", CoverageFormat )); switch ( CoverageFormat ) { @@ -64,7 +64,7 @@ GlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */ @@ -90,7 +90,7 @@ RangeCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (RangeCount = %d)\n", RangeCount )); + OTV_TRACE(( " (RangeCount = %u)\n", RangeCount )); OTV_LIMIT_CHECK( RangeCount * 6 ); @@ -233,7 +233,7 @@ OTV_LIMIT_CHECK( 4 ); ClassFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", ClassFormat )); + OTV_TRACE(( " (format %u)\n", ClassFormat )); switch ( ClassFormat ) { @@ -248,7 +248,7 @@ StartGlyph = FT_NEXT_USHORT( p ); GlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */ @@ -265,7 +265,7 @@ ClassRangeCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount )); + OTV_TRACE(( " (ClassRangeCount = %u)\n", ClassRangeCount )); OTV_LIMIT_CHECK( ClassRangeCount * 6 ); @@ -368,14 +368,14 @@ LookupFlag = FT_NEXT_USHORT( p ); SubTableCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (type %d)\n", LookupType )); + OTV_TRACE(( " (type %u)\n", LookupType )); if ( LookupType == 0 || LookupType > otvalid->type_count ) FT_INVALID_DATA; validate = otvalid->type_funcs[LookupType - 1]; - OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount )); + OTV_TRACE(( " (SubTableCount = %u)\n", SubTableCount )); OTV_LIMIT_CHECK( SubTableCount * 2 ); @@ -405,7 +405,7 @@ OTV_LIMIT_CHECK( 2 ); LookupCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); + OTV_TRACE(( " (LookupCount = %u)\n", LookupCount )); OTV_LIMIT_CHECK( LookupCount * 2 ); @@ -450,7 +450,7 @@ p += 2; /* skip FeatureParams (unused) */ LookupCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); + OTV_TRACE(( " (LookupCount = %u)\n", LookupCount )); OTV_LIMIT_CHECK( LookupCount * 2 ); @@ -486,7 +486,7 @@ OTV_LIMIT_CHECK( 2 ); FeatureCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); + OTV_TRACE(( " (FeatureCount = %u)\n", FeatureCount )); OTV_LIMIT_CHECK( FeatureCount * 2 ); @@ -532,8 +532,8 @@ ReqFeatureIndex = FT_NEXT_USHORT( p ); FeatureCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex )); - OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); + OTV_TRACE(( " (ReqFeatureIndex = %u)\n", ReqFeatureIndex )); + OTV_TRACE(( " (FeatureCount = %u)\n", FeatureCount )); if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 ) FT_INVALID_DATA; @@ -571,7 +571,7 @@ DefaultLangSys = FT_NEXT_USHORT( p ); LangSysCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount )); + OTV_TRACE(( " (LangSysCount = %u)\n", LangSysCount )); if ( DefaultLangSys != 0 ) otv_LangSys_validate( table + DefaultLangSys, otvalid ); @@ -607,7 +607,7 @@ OTV_LIMIT_CHECK( 2 ); ScriptCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount )); + OTV_TRACE(( " (ScriptCount = %u)\n", ScriptCount )); OTV_LIMIT_CHECK( ScriptCount * 6 ); @@ -665,7 +665,7 @@ OTV_LIMIT_CHECK( 2 ); Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (Count = %u)\n", Count )); OTV_LIMIT_CHECK( Count * 2 ); @@ -698,7 +698,7 @@ Coverage = FT_NEXT_USHORT( p ); Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (Count = %u)\n", Count )); otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)Count ); @@ -731,7 +731,7 @@ OTV_LIMIT_CHECK( 2 ); Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (Count = %u)\n", Count )); OTV_LIMIT_CHECK( Count * 2 ); @@ -765,8 +765,8 @@ Count1 = FT_NEXT_USHORT( p ); Count2 = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count1 = %d)\n", Count1 )); - OTV_TRACE(( " (Count2 = %d)\n", Count2 )); + OTV_TRACE(( " (Count1 = %u)\n", Count1 )); + OTV_TRACE(( " (Count2 = %u)\n", Count2 )); if ( Count1 == 0 ) FT_INVALID_DATA; @@ -806,7 +806,7 @@ OTV_LIMIT_CHECK( 2 ); BacktrackCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount )); + OTV_TRACE(( " (BacktrackCount = %u)\n", BacktrackCount )); OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 ); p += BacktrackCount * 2; @@ -815,21 +815,21 @@ if ( InputCount == 0 ) FT_INVALID_DATA; - OTV_TRACE(( " (InputCount = %d)\n", InputCount )); + OTV_TRACE(( " (InputCount = %u)\n", InputCount )); OTV_LIMIT_CHECK( InputCount * 2 ); p += ( InputCount - 1 ) * 2; LookaheadCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount )); + OTV_TRACE(( " (LookaheadCount = %u)\n", LookaheadCount )); OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 ); p += LookaheadCount * 2; Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (Count = %u)\n", Count )); OTV_LIMIT_CHECK( Count * 4 ); @@ -866,7 +866,7 @@ ClassDef = FT_NEXT_USHORT( p ); ClassSetCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount )); + OTV_TRACE(( " (ClassSetCount = %u)\n", ClassSetCount )); otv_Coverage_validate( table + Coverage, otvalid, -1 ); otv_ClassDef_validate( table + ClassDef, otvalid ); @@ -910,8 +910,8 @@ GlyphCount = FT_NEXT_USHORT( p ); Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); + OTV_TRACE(( " (Count = %u)\n", Count )); OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 ); @@ -955,7 +955,7 @@ LookaheadClassDef = FT_NEXT_USHORT( p ); ChainClassSetCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount )); + OTV_TRACE(( " (ChainClassSetCount = %u)\n", ChainClassSetCount )); otv_Coverage_validate( table + Coverage, otvalid, -1 ); @@ -1002,7 +1002,7 @@ OTV_LIMIT_CHECK( 2 ); BacktrackGlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); + OTV_TRACE(( " (BacktrackGlyphCount = %u)\n", BacktrackGlyphCount )); OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); @@ -1011,7 +1011,7 @@ InputGlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount )); + OTV_TRACE(( " (InputGlyphCount = %u)\n", InputGlyphCount )); OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 ); @@ -1020,7 +1020,7 @@ LookaheadGlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); + OTV_TRACE(( " (LookaheadGlyphCount = %u)\n", LookaheadGlyphCount )); OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); @@ -1029,7 +1029,7 @@ count2 = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", count2 )); + OTV_TRACE(( " (Count = %u)\n", count2 )); OTV_LIMIT_CHECK( count2 * 4 ); diff --git a/vendor/freetype/src/otvalid/otvgdef.c b/vendor/freetype/src/otvalid/otvgdef.c index e36cda754ef..8a09b8e8c3d 100644 --- a/vendor/freetype/src/otvalid/otvgdef.c +++ b/vendor/freetype/src/otvalid/otvgdef.c @@ -59,7 +59,7 @@ Coverage = table + FT_NEXT_USHORT( p ); GlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); otv_Coverage_validate( Coverage, otvalid, (FT_Int)GlyphCount ); if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) @@ -104,7 +104,7 @@ CaretValueFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format = %d)\n", CaretValueFormat )); + OTV_TRACE(( " (format = %u)\n", CaretValueFormat )); switch ( CaretValueFormat ) { @@ -156,7 +156,7 @@ OTV_LIMIT_CHECK( 2 ); MarkGlyphSetCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (MarkGlyphSetCount = %d)\n", MarkGlyphSetCount )); + OTV_TRACE(( " (MarkGlyphSetCount = %u)\n", MarkGlyphSetCount )); OTV_LIMIT_CHECK( MarkGlyphSetCount * 4 ); /* CoverageOffsets */ diff --git a/vendor/freetype/src/otvalid/otvgpos.c b/vendor/freetype/src/otvalid/otvgpos.c index d7547a33ef6..3ce22082696 100644 --- a/vendor/freetype/src/otvalid/otvgpos.c +++ b/vendor/freetype/src/otvalid/otvgpos.c @@ -69,7 +69,7 @@ Count = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (Count = %d)\n", Count )); + OTV_TRACE(( " (Count = %u)\n", Count )); OTV_LIMIT_CHECK( Count * otvalid->extra1 * 2 ); @@ -252,7 +252,7 @@ OTV_LIMIT_CHECK( 6 ); AnchorFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", AnchorFormat )); + OTV_TRACE(( " (format %u)\n", AnchorFormat )); p += 4; /* skip XCoordinate and YCoordinate */ @@ -318,7 +318,7 @@ OTV_LIMIT_CHECK( 2 ); MarkCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (MarkCount = %d)\n", MarkCount )); + OTV_TRACE(( " (MarkCount = %u)\n", MarkCount )); OTV_LIMIT_CHECK( MarkCount * 4 ); @@ -357,7 +357,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); otvalid->extra3 = table; @@ -387,7 +387,7 @@ ValueFormat = FT_NEXT_USHORT( p ); ValueCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ValueCount = %d)\n", ValueCount )); + OTV_TRACE(( " (ValueCount = %u)\n", ValueCount )); len_value = otv_value_length( ValueFormat ); @@ -441,7 +441,7 @@ OTV_LIMIT_CHECK( 2 ); PairValueCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (PairValueCount = %d)\n", PairValueCount )); + OTV_TRACE(( " (PairValueCount = %u)\n", PairValueCount )); value_len1 = otv_value_length( format1 ); value_len2 = otv_value_length( format2 ); @@ -481,7 +481,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -496,7 +496,7 @@ ValueFormat2 = FT_NEXT_USHORT( p ); PairSetCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount )); + OTV_TRACE(( " (PairSetCount = %u)\n", PairSetCount )); otv_Coverage_validate( table + Coverage, otvalid, -1 ); @@ -524,8 +524,8 @@ ClassCount1 = FT_NEXT_USHORT( p ); ClassCount2 = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (ClassCount1 = %d)\n", ClassCount1 )); - OTV_TRACE(( " (ClassCount2 = %d)\n", ClassCount2 )); + OTV_TRACE(( " (ClassCount1 = %u)\n", ClassCount1 )); + OTV_TRACE(( " (ClassCount2 = %u)\n", ClassCount2 )); len_value1 = otv_value_length( ValueFormat1 ); len_value2 = otv_value_length( ValueFormat2 ); @@ -588,7 +588,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -605,7 +605,7 @@ Coverage = FT_NEXT_USHORT( p ); EntryExitCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount )); + OTV_TRACE(( " (EntryExitCount = %u)\n", EntryExitCount )); otv_Coverage_validate( table + Coverage, otvalid, @@ -666,7 +666,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -707,7 +707,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -748,7 +748,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -789,7 +789,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -848,7 +848,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { @@ -909,7 +909,7 @@ OTV_LIMIT_CHECK( 2 ); PosFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", PosFormat )); + OTV_TRACE(( " (format %u)\n", PosFormat )); switch ( PosFormat ) { diff --git a/vendor/freetype/src/otvalid/otvgsub.c b/vendor/freetype/src/otvalid/otvgsub.c index a479101b15f..915fa0a4ac6 100644 --- a/vendor/freetype/src/otvalid/otvgsub.c +++ b/vendor/freetype/src/otvalid/otvgsub.c @@ -53,7 +53,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -99,7 +99,7 @@ Coverage = FT_NEXT_USHORT( p ); GlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); otv_Coverage_validate( table + Coverage, otvalid, @@ -145,7 +145,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -186,7 +186,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -233,7 +233,7 @@ CompCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (CompCount = %d)\n", CompCount )); + OTV_TRACE(( " (CompCount = %u)\n", CompCount )); if ( CompCount == 0 ) FT_INVALID_DATA; @@ -261,7 +261,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -301,7 +301,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -360,7 +360,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -421,7 +421,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -478,7 +478,7 @@ OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (format %d)\n", SubstFormat )); + OTV_TRACE(( " (format %u)\n", SubstFormat )); switch ( SubstFormat ) { @@ -487,7 +487,7 @@ Coverage = table + FT_NEXT_USHORT( p ); BacktrackGlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); + OTV_TRACE(( " (BacktrackGlyphCount = %u)\n", BacktrackGlyphCount )); otv_Coverage_validate( Coverage, otvalid, -1 ); @@ -498,7 +498,7 @@ LookaheadGlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); + OTV_TRACE(( " (LookaheadGlyphCount = %u)\n", LookaheadGlyphCount )); OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); @@ -507,7 +507,7 @@ GlyphCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (GlyphCount = %u)\n", GlyphCount )); if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) FT_INVALID_DATA; diff --git a/vendor/freetype/src/otvalid/otvjstf.c b/vendor/freetype/src/otvalid/otvjstf.c index 1309f6d906e..8394287bebb 100644 --- a/vendor/freetype/src/otvalid/otvjstf.c +++ b/vendor/freetype/src/otvalid/otvjstf.c @@ -163,7 +163,7 @@ OTV_OPTIONAL_OFFSET( DefJstfLangSys ); JstfLangSysCount = FT_NEXT_USHORT( p ); - OTV_TRACE(( " (JstfLangSysCount = %d)\n", JstfLangSysCount )); + OTV_TRACE(( " (JstfLangSysCount = %u)\n", JstfLangSysCount )); table_size = JstfLangSysCount * 6 + 6; @@ -227,7 +227,7 @@ JstfScriptCount = FT_NEXT_USHORT( p ); - FT_TRACE3(( " (JstfScriptCount = %d)\n", JstfScriptCount )); + FT_TRACE3(( " (JstfScriptCount = %u)\n", JstfScriptCount )); OTV_LIMIT_CHECK( JstfScriptCount * 6 ); diff --git a/vendor/freetype/src/otvalid/rules.mk b/vendor/freetype/src/otvalid/rules.mk new file mode 100644 index 00000000000..123b696f201 --- /dev/null +++ b/vendor/freetype/src/otvalid/rules.mk @@ -0,0 +1,81 @@ +# +# FreeType 2 OpenType validation driver configuration rules +# + + +# Copyright (C) 2004-2024 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. + + +# OTV driver directory +# +OTV_DIR := $(SRC_DIR)/otvalid + + +# compilation flags for the driver +# +OTV_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(OTV_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# OTV driver sources (i.e., C files) +# +OTV_DRV_SRC := $(OTV_DIR)/otvbase.c \ + $(OTV_DIR)/otvcommn.c \ + $(OTV_DIR)/otvgdef.c \ + $(OTV_DIR)/otvgpos.c \ + $(OTV_DIR)/otvgsub.c \ + $(OTV_DIR)/otvjstf.c \ + $(OTV_DIR)/otvmath.c \ + $(OTV_DIR)/otvmod.c + +# OTV driver headers +# +OTV_DRV_H := $(OTV_DIR)/otvalid.h \ + $(OTV_DIR)/otvcommn.h \ + $(OTV_DIR)/otverror.h \ + $(OTV_DIR)/otvgpos.h \ + $(OTV_DIR)/otvmod.h + + +# OTV driver object(s) +# +# OTV_DRV_OBJ_M is used during `multi' builds. +# OTV_DRV_OBJ_S is used during `single' builds. +# +OTV_DRV_OBJ_M := $(OTV_DRV_SRC:$(OTV_DIR)/%.c=$(OBJ_DIR)/%.$O) +OTV_DRV_OBJ_S := $(OBJ_DIR)/otvalid.$O + +# OTV driver source file for single build +# +OTV_DRV_SRC_S := $(OTV_DIR)/otvalid.c + + +# OTV driver - single object +# +$(OTV_DRV_OBJ_S): $(OTV_DRV_SRC_S) $(OTV_DRV_SRC) \ + $(FREETYPE_H) $(OTV_DRV_H) + $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(OTV_DRV_SRC_S)) + + +# OTV driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(OTV_DIR)/%.c $(FREETYPE_H) $(OTV_DRV_H) + $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(OTV_DRV_OBJ_S) +DRV_OBJS_M += $(OTV_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/pcf/module.mk b/vendor/freetype/src/pcf/module.mk new file mode 100644 index 00000000000..df383ff0fbe --- /dev/null +++ b/vendor/freetype/src/pcf/module.mk @@ -0,0 +1,34 @@ +# +# FreeType 2 PCF module definition +# + +# Copyright 2000, 2006 by +# Francesco Zappa Nardelli +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +FTMODULE_H_COMMANDS += PCF_DRIVER + +define PCF_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, pcf_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/pcf/pcfdrivr.c b/vendor/freetype/src/pcf/pcfdrivr.c index 93632f17c43..ecd68495163 100644 --- a/vendor/freetype/src/pcf/pcfdrivr.c +++ b/vendor/freetype/src/pcf/pcfdrivr.c @@ -461,7 +461,7 @@ THE SOFTWARE. FT_ULong bytes; - FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index )); + FT_TRACE1(( "PCF_Glyph_Load: glyph index %u\n", glyph_index )); if ( !face ) { diff --git a/vendor/freetype/src/pcf/pcfread.c b/vendor/freetype/src/pcf/pcfread.c index f167bcb8aee..9c250c84649 100644 --- a/vendor/freetype/src/pcf/pcfread.c +++ b/vendor/freetype/src/pcf/pcfread.c @@ -121,7 +121,7 @@ THE SOFTWARE. toc->count > 9 ) { FT_TRACE0(( "pcf_read_TOC: adjusting number of tables" - " (from %ld to %ld)\n", + " (from %lu to %lu)\n", toc->count, FT_MIN( stream->size >> 4, 9 ) )); toc->count = FT_MIN( stream->size >> 4, 9 ); @@ -231,7 +231,7 @@ THE SOFTWARE. FT_TRACE4(( "pcf_read_TOC:\n" )); - FT_TRACE4(( " number of tables: %ld\n", face->toc.count )); + FT_TRACE4(( " number of tables: %lu\n", face->toc.count )); tables = face->toc.tables; for ( i = 0; i < toc->count; i++ ) @@ -241,8 +241,8 @@ THE SOFTWARE. if ( tables[i].type == 1UL << j ) name = tableNames[j]; - FT_TRACE4(( " %d: type=%s, format=0x%lX," - " size=%ld (0x%lX), offset=%ld (0x%lX)\n", + FT_TRACE4(( " %u: type=%s, format=0x%lX," + " size=%lu (0x%lX), offset=%lu (0x%lX)\n", i, name, tables[i].format, tables[i].size, tables[i].size, @@ -516,7 +516,7 @@ THE SOFTWARE. if ( error ) goto Bail; - FT_TRACE4(( " number of properties: %ld\n", orig_nprops )); + FT_TRACE4(( " number of properties: %lu\n", orig_nprops )); /* rough estimate */ if ( orig_nprops > size / PCF_PROPERTY_SIZE ) @@ -588,7 +588,7 @@ THE SOFTWARE. if ( error ) goto Bail; - FT_TRACE4(( " string size: %ld\n", string_size )); + FT_TRACE4(( " string size: %lu\n", string_size )); /* rough estimate */ if ( string_size > size - orig_nprops * PCF_PROPERTY_SIZE ) @@ -725,7 +725,7 @@ THE SOFTWARE. if ( error ) return FT_THROW( Invalid_File_Format ); - FT_TRACE4(( " number of metrics: %ld\n", orig_nmetrics )); + FT_TRACE4(( " number of metrics: %lu\n", orig_nmetrics )); /* rough estimate */ if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) @@ -776,7 +776,7 @@ THE SOFTWARE. FT_TRACE4(( "\n" )); for ( i = 1; i < face->nmetrics; i++, metrics++ ) { - FT_TRACE5(( " idx %ld:", i )); + FT_TRACE5(( " idx %lu:", i )); error = pcf_get_metric( stream, format, metrics ); metrics->bits = 0; @@ -797,7 +797,7 @@ THE SOFTWARE. metrics->descent = 0; FT_TRACE0(( "pcf_get_metrics:" - " invalid metrics for glyph %ld\n", i )); + " invalid metrics for glyph %lu\n", i )); } } @@ -858,7 +858,7 @@ THE SOFTWARE. if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) return FT_THROW( Invalid_File_Format ); - FT_TRACE4(( " number of bitmaps: %ld\n", orig_nbitmaps )); + FT_TRACE4(( " number of bitmaps: %lu\n", orig_nbitmaps )); /* see comment in `pcf_get_metrics' */ if ( orig_nbitmaps > 65534 ) diff --git a/vendor/freetype/src/pcf/rules.mk b/vendor/freetype/src/pcf/rules.mk new file mode 100644 index 00000000000..1b55daf4f43 --- /dev/null +++ b/vendor/freetype/src/pcf/rules.mk @@ -0,0 +1,82 @@ +# +# FreeType 2 pcf driver configuration rules +# + + +# Copyright (C) 2000, 2001, 2003, 2008 by +# Francesco Zappa Nardelli +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +# pcf driver directory +# +PCF_DIR := $(SRC_DIR)/pcf + + +PCF_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(PCF_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# pcf driver sources (i.e., C files) +# +PCF_DRV_SRC := $(PCF_DIR)/pcfdrivr.c \ + $(PCF_DIR)/pcfread.c \ + $(PCF_DIR)/pcfutil.c + +# pcf driver headers +# +PCF_DRV_H := $(PCF_DRV_SRC:%.c=%.h) \ + $(PCF_DIR)/pcf.h \ + $(PCF_DIR)/pcferror.h + +# pcf driver object(s) +# +# PCF_DRV_OBJ_M is used during `multi' builds +# PCF_DRV_OBJ_S is used during `single' builds +# +PCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR)/%.c=$(OBJ_DIR)/%.$O) +PCF_DRV_OBJ_S := $(OBJ_DIR)/pcf.$O + +# pcf driver source file for single build +# +PCF_DRV_SRC_S := $(PCF_DIR)/pcf.c + + +# pcf driver - single object +# +$(PCF_DRV_OBJ_S): $(PCF_DRV_SRC_S) $(PCF_DRV_SRC) $(FREETYPE_H) $(PCF_DRV_H) + $(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PCF_DRV_SRC_S)) + + +# pcf driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(PCF_DIR)/%.c $(FREETYPE_H) $(PCF_DRV_H) + $(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(PCF_DRV_OBJ_S) +DRV_OBJS_M += $(PCF_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/pfr/module.mk b/vendor/freetype/src/pfr/module.mk new file mode 100644 index 00000000000..7df42310114 --- /dev/null +++ b/vendor/freetype/src/pfr/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 PFR module definition +# + + +# Copyright (C) 2002-2024 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. + + +FTMODULE_H_COMMANDS += PFR_DRIVER + +define PFR_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, pfr_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/pfr/pfrgload.c b/vendor/freetype/src/pfr/pfrgload.c index e8500755272..da8248c3431 100644 --- a/vendor/freetype/src/pfr/pfrgload.c +++ b/vendor/freetype/src/pfr/pfrgload.c @@ -388,7 +388,7 @@ break; case 2: /* horizontal line to */ - FT_TRACE6(( "- horizontal line to cx.%d", format_low )); + FT_TRACE6(( "- horizontal line to cx.%u", format_low )); if ( format_low >= x_count ) goto Failure; pos[0].x = glyph->x_control[format_low]; @@ -398,7 +398,7 @@ break; case 3: /* vertical line to */ - FT_TRACE6(( "- vertical line to cy.%d", format_low )); + FT_TRACE6(( "- vertical line to cy.%u", format_low )); if ( format_low >= y_count ) goto Failure; pos[0].x = pos[3].x; @@ -444,7 +444,7 @@ if ( idx >= x_count ) goto Failure; cur->x = glyph->x_control[idx]; - FT_TRACE7(( " cx#%d", idx )); + FT_TRACE7(( " cx#%u", idx )); break; case 1: /* 16-bit absolute value */ @@ -474,7 +474,7 @@ if ( idx >= y_count ) goto Failure; cur->y = glyph->y_control[idx]; - FT_TRACE7(( " cy#%d", idx )); + FT_TRACE7(( " cy#%u", idx )); break; case 1: /* 16-bit absolute value */ @@ -754,7 +754,7 @@ count = glyph->num_subs - old_count; - FT_TRACE4(( "compound glyph with %d element%s (offset %lu):\n", + FT_TRACE4(( "compound glyph with %u element%s (offset %lu):\n", count, count == 1 ? "" : "s", offset )); @@ -766,7 +766,7 @@ PFR_SubGlyph subglyph; - FT_TRACE4(( " subglyph %d:\n", n )); + FT_TRACE4(( " subglyph %u:\n", n )); subglyph = glyph->subs + old_count + n; old_points = base->n_points; @@ -810,7 +810,7 @@ /* proceed to next sub-glyph */ } - FT_TRACE4(( "end compound glyph with %d element%s\n", + FT_TRACE4(( "end compound glyph with %u element%s\n", count, count == 1 ? "" : "s" )); } diff --git a/vendor/freetype/src/pfr/pfrobjs.c b/vendor/freetype/src/pfr/pfrobjs.c index 79b8f629f9f..ce52423cb12 100644 --- a/vendor/freetype/src/pfr/pfrobjs.c +++ b/vendor/freetype/src/pfr/pfrobjs.c @@ -326,7 +326,7 @@ FT_ULong gps_offset; - FT_TRACE1(( "pfr_slot_load: glyph index %d\n", gindex )); + FT_TRACE1(( "pfr_slot_load: glyph index %u\n", gindex )); if ( gindex > 0 ) gindex--; diff --git a/vendor/freetype/src/pfr/rules.mk b/vendor/freetype/src/pfr/rules.mk new file mode 100644 index 00000000000..3e0c57ba31f --- /dev/null +++ b/vendor/freetype/src/pfr/rules.mk @@ -0,0 +1,76 @@ +# +# FreeType 2 PFR driver configuration rules +# + + +# Copyright (C) 2002-2024 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. + + +# pfr driver directory +# +PFR_DIR := $(SRC_DIR)/pfr + + +# compilation flags for the driver +# +PFR_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(PFR_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# pfr driver sources (i.e., C files) +# +PFR_DRV_SRC := $(PFR_DIR)/pfrload.c \ + $(PFR_DIR)/pfrgload.c \ + $(PFR_DIR)/pfrcmap.c \ + $(PFR_DIR)/pfrdrivr.c \ + $(PFR_DIR)/pfrsbit.c \ + $(PFR_DIR)/pfrobjs.c + +# pfr driver headers +# +PFR_DRV_H := $(PFR_DRV_SRC:%.c=%.h) \ + $(PFR_DIR)/pfrerror.h \ + $(PFR_DIR)/pfrtypes.h + + +# Pfr driver object(s) +# +# PFR_DRV_OBJ_M is used during `multi' builds +# PFR_DRV_OBJ_S is used during `single' builds +# +PFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR)/%.c=$(OBJ_DIR)/%.$O) +PFR_DRV_OBJ_S := $(OBJ_DIR)/pfr.$O + +# pfr driver source file for single build +# +PFR_DRV_SRC_S := $(PFR_DIR)/pfr.c + + +# pfr driver - single object +# +$(PFR_DRV_OBJ_S): $(PFR_DRV_SRC_S) $(PFR_DRV_SRC) $(FREETYPE_H) $(PFR_DRV_H) + $(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PFR_DRV_SRC_S)) + + +# pfr driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(PFR_DIR)/%.c $(FREETYPE_H) $(PFR_DRV_H) + $(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(PFR_DRV_OBJ_S) +DRV_OBJS_M += $(PFR_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/psaux/cffdecode.c b/vendor/freetype/src/psaux/cffdecode.c index 9556e11a586..ed19f0e2cdf 100644 --- a/vendor/freetype/src/psaux/cffdecode.c +++ b/vendor/freetype/src/psaux/cffdecode.c @@ -2141,7 +2141,7 @@ decoder->locals_bias ); - FT_TRACE4(( " callsubr (idx %d, entering level %td)\n", + FT_TRACE4(( " callsubr (idx %u, entering level %td)\n", idx, zone - decoder->zones + 1 )); @@ -2185,7 +2185,7 @@ decoder->globals_bias ); - FT_TRACE4(( " callgsubr (idx %d, entering level %td)\n", + FT_TRACE4(( " callgsubr (idx %u, entering level %td)\n", idx, zone - decoder->zones + 1 )); diff --git a/vendor/freetype/src/psaux/module.mk b/vendor/freetype/src/psaux/module.mk new file mode 100644 index 00000000000..fd6b3e153a3 --- /dev/null +++ b/vendor/freetype/src/psaux/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 PSaux module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += PSAUX_MODULE + +define PSAUX_MODULE +$(OPEN_DRIVER) FT_Module_Class, psaux_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)psaux $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/psaux/psintrp.c b/vendor/freetype/src/psaux/psintrp.c index 7572e225e37..7e3475e6f58 100644 --- a/vendor/freetype/src/psaux/psintrp.c +++ b/vendor/freetype/src/psaux/psintrp.c @@ -618,7 +618,7 @@ /* Our copy of it does not change that requirement. */ cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 ); - charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack ); + charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack ); /* catch errors so far */ if ( *error ) diff --git a/vendor/freetype/src/psaux/psobjs.c b/vendor/freetype/src/psaux/psobjs.c index eca465f009e..ed53594a5f6 100644 --- a/vendor/freetype/src/psaux/psobjs.c +++ b/vendor/freetype/src/psaux/psobjs.c @@ -460,6 +460,9 @@ case '%': skip_comment( &cur, limit ); break; + + default: + break; } } @@ -1145,7 +1148,7 @@ FT_ERROR(( "ps_parser_load_field:" " expected a name or string\n" )); FT_ERROR(( " " - " but found token of type %d instead\n", + " but found token of type %u instead\n", token.type )); error = FT_THROW( Invalid_File_Format ); goto Exit; @@ -1225,7 +1228,7 @@ if ( result < 0 || (FT_UInt)result < max_objects ) { FT_ERROR(( "ps_parser_load_field:" - " expected %d integer%s in the %s subarray\n", + " expected %u integer%s in the %s subarray\n", max_objects, max_objects > 1 ? "s" : "", i == 0 ? "first" : ( i == 1 ? "second" diff --git a/vendor/freetype/src/psaux/rules.mk b/vendor/freetype/src/psaux/rules.mk new file mode 100644 index 00000000000..9053525922d --- /dev/null +++ b/vendor/freetype/src/psaux/rules.mk @@ -0,0 +1,89 @@ +# +# FreeType 2 PSaux driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# PSAUX driver directory +# +PSAUX_DIR := $(SRC_DIR)/psaux + + +# compilation flags for the driver +# +PSAUX_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# PSAUX driver sources (i.e., C files) +# +PSAUX_DRV_SRC := $(PSAUX_DIR)/psobjs.c \ + $(PSAUX_DIR)/t1decode.c \ + $(PSAUX_DIR)/t1cmap.c \ + $(PSAUX_DIR)/afmparse.c \ + $(PSAUX_DIR)/psconv.c \ + $(PSAUX_DIR)/psauxmod.c \ + $(PSAUX_DIR)/psarrst.c \ + $(PSAUX_DIR)/psblues.c \ + $(PSAUX_DIR)/pserror.c \ + $(PSAUX_DIR)/psfont.c \ + $(PSAUX_DIR)/psft.c \ + $(PSAUX_DIR)/pshints.c \ + $(PSAUX_DIR)/psintrp.c \ + $(PSAUX_DIR)/psread.c \ + $(PSAUX_DIR)/psstack.c \ + $(PSAUX_DIR)/cffdecode.c + +# PSAUX driver headers +# +PSAUX_DRV_H := $(PSAUX_DRV_SRC:%c=%h) \ + $(PSAUX_DIR)/psauxerr.h \ + $(PSAUX_DIR)/psfixed.h \ + $(PSAUX_DIR)/psglue.h \ + $(PSAUX_DIR)/pstypes.h + + +# PSAUX driver object(s) +# +# PSAUX_DRV_OBJ_M is used during `multi' builds. +# PSAUX_DRV_OBJ_S is used during `single' builds. +# +PSAUX_DRV_OBJ_M := $(PSAUX_DRV_SRC:$(PSAUX_DIR)/%.c=$(OBJ_DIR)/%.$O) +PSAUX_DRV_OBJ_S := $(OBJ_DIR)/psaux.$O + +# PSAUX driver source file for single build +# +PSAUX_DRV_SRC_S := $(PSAUX_DIR)/psaux.c + + +# PSAUX driver - single object +# +$(PSAUX_DRV_OBJ_S): $(PSAUX_DRV_SRC_S) $(PSAUX_DRV_SRC) \ + $(FREETYPE_H) $(PSAUX_DRV_H) + $(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSAUX_DRV_SRC_S)) + + +# PSAUX driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(PSAUX_DIR)/%.c $(FREETYPE_H) $(PSAUX_DRV_H) + $(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(PSAUX_DRV_OBJ_S) +DRV_OBJS_M += $(PSAUX_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/psaux/t1decode.c b/vendor/freetype/src/psaux/t1decode.c index c74baa8038f..c5eb71f48e1 100644 --- a/vendor/freetype/src/psaux/t1decode.c +++ b/vendor/freetype/src/psaux/t1decode.c @@ -1633,7 +1633,7 @@ default: FT_ERROR(( "t1_decoder_parse_charstrings:" - " unhandled opcode %d\n", op )); + " unhandled opcode %u\n", op )); goto Syntax_Error; } diff --git a/vendor/freetype/src/pshinter/module.mk b/vendor/freetype/src/pshinter/module.mk new file mode 100644 index 00000000000..30325141fb2 --- /dev/null +++ b/vendor/freetype/src/pshinter/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 PSHinter module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += PSHINTER_MODULE + +define PSHINTER_MODULE +$(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/pshinter/pshalgo.c b/vendor/freetype/src/pshinter/pshalgo.c index 967767b3485..792a7c60c9c 100644 --- a/vendor/freetype/src/pshinter/pshalgo.c +++ b/vendor/freetype/src/pshinter/pshalgo.c @@ -100,7 +100,7 @@ if ( idx >= table->max_hints ) { - FT_TRACE0(( "psh_hint_table_record: invalid hint index %d\n", idx )); + FT_TRACE0(( "psh_hint_table_record: invalid hint index %u\n", idx )); return; } diff --git a/vendor/freetype/src/pshinter/pshrec.c b/vendor/freetype/src/pshinter/pshrec.c index 0b2b549fc29..557c35e5507 100644 --- a/vendor/freetype/src/pshinter/pshrec.c +++ b/vendor/freetype/src/pshinter/pshrec.c @@ -467,7 +467,7 @@ table->num_masks--; } else - FT_TRACE0(( "ps_mask_table_merge: ignoring invalid indices (%d,%d)\n", + FT_TRACE0(( "ps_mask_table_merge: ignoring invalid indices (%u,%u)\n", index1, index2 )); Exit: @@ -817,7 +817,7 @@ /* limit "dimension" to 0..1 */ if ( dimension > 1 ) { - FT_TRACE0(( "ps_hints_stem: invalid dimension (%d) used\n", + FT_TRACE0(( "ps_hints_stem: invalid dimension (%u) used\n", dimension )); dimension = ( dimension != 0 ); } @@ -870,7 +870,7 @@ /* limit "dimension" to 0..1 */ if ( dimension > 1 ) { - FT_TRACE0(( "ps_hints_t1stem3: invalid dimension (%d) used\n", + FT_TRACE0(( "ps_hints_t1stem3: invalid dimension (%u) used\n", dimension )); dimension = ( dimension != 0 ); } @@ -976,7 +976,7 @@ if ( bit_count != count1 + count2 ) { FT_TRACE0(( "ps_hints_t2mask:" - " called with invalid bitcount %d (instead of %d)\n", + " called with invalid bitcount %u (instead of %u)\n", bit_count, count1 + count2 )); /* simply ignore the operator */ @@ -1022,7 +1022,7 @@ if ( bit_count != count1 + count2 ) { FT_TRACE0(( "ps_hints_t2counter:" - " called with invalid bitcount %d (instead of %d)\n", + " called with invalid bitcount %u (instead of %u)\n", bit_count, count1 + count2 )); /* simply ignore the operator */ diff --git a/vendor/freetype/src/pshinter/rules.mk b/vendor/freetype/src/pshinter/rules.mk new file mode 100644 index 00000000000..417bc59c2ef --- /dev/null +++ b/vendor/freetype/src/pshinter/rules.mk @@ -0,0 +1,75 @@ +# +# FreeType 2 PSHinter driver configuration rules +# + + +# Copyright (C) 2001-2024 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. + + +# PSHINTER driver directory +# +PSHINTER_DIR := $(SRC_DIR)/pshinter + + +# compilation flags for the driver +# +PSHINTER_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# PSHINTER driver sources (i.e., C files) +# +PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \ + $(PSHINTER_DIR)/pshglob.c \ + $(PSHINTER_DIR)/pshmod.c \ + $(PSHINTER_DIR)/pshrec.c + + +# PSHINTER driver headers +# +PSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h) \ + $(PSHINTER_DIR)/pshnterr.h + + +# PSHINTER driver object(s) +# +# PSHINTER_DRV_OBJ_M is used during `multi' builds. +# PSHINTER_DRV_OBJ_S is used during `single' builds. +# +PSHINTER_DRV_OBJ_M := $(PSHINTER_DRV_SRC:$(PSHINTER_DIR)/%.c=$(OBJ_DIR)/%.$O) +PSHINTER_DRV_OBJ_S := $(OBJ_DIR)/pshinter.$O + +# PSHINTER driver source file for single build +# +PSHINTER_DRV_SRC_S := $(PSHINTER_DIR)/pshinter.c + + +# PSHINTER driver - single object +# +$(PSHINTER_DRV_OBJ_S): $(PSHINTER_DRV_SRC_S) $(PSHINTER_DRV_SRC) \ + $(FREETYPE_H) $(PSHINTER_DRV_H) + $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSHINTER_DRV_SRC_S)) + + +# PSHINTER driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(PSHINTER_DIR)/%.c $(FREETYPE_H) $(PSHINTER_DRV_H) + $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(PSHINTER_DRV_OBJ_S) +DRV_OBJS_M += $(PSHINTER_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/psnames/module.mk b/vendor/freetype/src/psnames/module.mk new file mode 100644 index 00000000000..f0494748fa1 --- /dev/null +++ b/vendor/freetype/src/psnames/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 PSnames module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += PSNAMES_MODULE + +define PSNAMES_MODULE +$(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/psnames/rules.mk b/vendor/freetype/src/psnames/rules.mk new file mode 100644 index 00000000000..19c5d32afbc --- /dev/null +++ b/vendor/freetype/src/psnames/rules.mk @@ -0,0 +1,73 @@ +# +# FreeType 2 psnames driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# psnames driver directory +# +PSNAMES_DIR := $(SRC_DIR)/psnames + + +# compilation flags for the driver +# +PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# psnames driver sources (i.e., C files) +# +PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c + + +# psnames driver headers +# +PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \ + $(PSNAMES_DIR)/psnamerr.h \ + $(PSNAMES_DIR)/pstables.h + + +# psnames driver object(s) +# +# PSNAMES_DRV_OBJ_M is used during `multi' builds +# PSNAMES_DRV_OBJ_S is used during `single' builds +# +PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O) +PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O + +# psnames driver source file for single build +# +PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c + + +# psnames driver - single object +# +$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \ + $(FREETYPE_H) $(PSNAMES_DRV_H) + $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S)) + + +# psnames driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H) + $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) +DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/raster/ftraster.c b/vendor/freetype/src/raster/ftraster.c index e4b7b937d5a..c47d478e93f 100644 --- a/vendor/freetype/src/raster/ftraster.c +++ b/vendor/freetype/src/raster/ftraster.c @@ -251,7 +251,11 @@ /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */ /* for clipping computations. It simply uses the FT_MulDiv() function */ /* defined in `ftcalc.h'. */ -#define SMulDiv_No_Round FT_MulDiv_No_Round +#ifdef FT_INT64 +#define SMulDiv( a, b, c ) (Long)( (FT_Int64)(a) * (b) / (c) ) +#else +#define SMulDiv FT_MulDiv_No_Round +#endif /* The rasterizer is a very general purpose component; please leave */ /* the following redefinitions there (you never know your target */ @@ -653,7 +657,7 @@ ras.cProfile->height = 0; } - ras.cProfile->flags = ras.dropOutControl; + ras.cProfile->flags = ras.dropOutControl; switch ( aState ) { @@ -967,14 +971,14 @@ goto Fin; } - Ix = SMulDiv_No_Round( e - y1, Dx, Dy ); + Ix = SMulDiv( e - y1, Dx, Dy ); x1 += Ix; *top++ = x1; if ( --size ) { Ax = Dx * ( e - y1 ) - Dy * Ix; /* remainder */ - Ix = FMulDiv( ras.precision, Dx, Dy ); + Ix = SMulDiv( ras.precision, Dx, Dy ); Rx = Dx * ras.precision - Dy * Ix; /* remainder */ Dx = 1; @@ -1090,8 +1094,8 @@ PLong top; - y1 = arc[degree].y; - y2 = arc[0].y; + y1 = arc[degree].y; + y2 = arc[0].y; if ( y2 < miny || y1 > maxy ) return SUCCESS; diff --git a/vendor/freetype/src/raster/module.mk b/vendor/freetype/src/raster/module.mk new file mode 100644 index 00000000000..2e322adb1fc --- /dev/null +++ b/vendor/freetype/src/raster/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 renderer module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += RASTER_MODULE + +define RASTER_MODULE +$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/raster/rules.mk b/vendor/freetype/src/raster/rules.mk new file mode 100644 index 00000000000..8fea0972895 --- /dev/null +++ b/vendor/freetype/src/raster/rules.mk @@ -0,0 +1,72 @@ +# +# FreeType 2 renderer module build rules +# + + +# Copyright (C) 1996-2024 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. + + +# raster driver directory +# +RASTER_DIR := $(SRC_DIR)/raster + +# compilation flags for the driver +# +RASTER_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# raster driver sources (i.e., C files) +# +RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \ + $(RASTER_DIR)/ftrend1.c + + +# raster driver headers +# +RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \ + $(RASTER_DIR)/rasterrs.h + + +# raster driver object(s) +# +# RASTER_DRV_OBJ_M is used during `multi' builds. +# RASTER_DRV_OBJ_S is used during `single' builds. +# +RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O) +RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O + +# raster driver source file for single build +# +RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c + + +# raster driver - single object +# +$(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \ + $(FREETYPE_H) $(RASTER_DRV_H) + $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S)) + + +# raster driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H) + $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(RASTER_DRV_OBJ_S) +DRV_OBJS_M += $(RASTER_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/sdf/ftbsdf.c b/vendor/freetype/src/sdf/ftbsdf.c index 10d1de8a3b4..de98b3d582c 100644 --- a/vendor/freetype/src/sdf/ftbsdf.c +++ b/vendor/freetype/src/sdf/ftbsdf.c @@ -848,11 +848,23 @@ FT_Int y_offset, FT_Int width ) { +#if USE_SQUARED_DISTANCES + FT_16D16 edge_threshold = ONE / 4; +#else + FT_16D16 edge_threshold = ONE / 2; +#endif ED* to_check; FT_16D16 dist; FT_16D16_Vec dist_vec; + /* + * Skip neighbor comparison if the distance is less than or equal to 0.5. + * When using squared distances, compare to 0.25 (= 0.5^2) instead. + */ + if ( current->dist <= edge_threshold ) + return; + to_check = current + ( y_offset * width ) + x_offset; /* diff --git a/vendor/freetype/src/sdf/ftsdf.c b/vendor/freetype/src/sdf/ftsdf.c index 8b3ff6776c2..06aa4225708 100644 --- a/vendor/freetype/src/sdf/ftsdf.c +++ b/vendor/freetype/src/sdf/ftsdf.c @@ -1391,7 +1391,7 @@ SDF_Contour* contour = contour_list; - FT_TRACE5(( " Contour %d\n", num_contours )); + FT_TRACE5(( " Contour %u\n", num_contours )); edge_list = contour->edges; @@ -1400,7 +1400,7 @@ SDF_Edge* edge = edge_list; - FT_TRACE5(( " %3d: ", num_edges )); + FT_TRACE5(( " %3u: ", num_edges )); switch ( edge->edge_type ) { @@ -1443,11 +1443,11 @@ } FT_TRACE5(( "\n" )); - FT_TRACE5(( " total number of contours = %d\n", num_contours )); - FT_TRACE5(( " total number of edges = %d\n", total_edges )); - FT_TRACE5(( " |__lines = %d\n", total_lines )); - FT_TRACE5(( " |__conic = %d\n", total_conic )); - FT_TRACE5(( " |__cubic = %d\n", total_cubic )); + FT_TRACE5(( " total number of contours = %u\n", num_contours )); + FT_TRACE5(( " total number of edges = %u\n", total_edges )); + FT_TRACE5(( " |__lines = %u\n", total_lines )); + FT_TRACE5(( " |__conic = %u\n", total_conic )); + FT_TRACE5(( " |__cubic = %u\n", total_cubic )); } #endif /* FT_DEBUG_LEVEL_TRACE */ diff --git a/vendor/freetype/src/sdf/module.mk b/vendor/freetype/src/sdf/module.mk new file mode 100644 index 00000000000..b3b842a0b01 --- /dev/null +++ b/vendor/freetype/src/sdf/module.mk @@ -0,0 +1,29 @@ +# +# FreeType 2 Signed Distance Field module definition +# + + +# Copyright (C) 2020-2024 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. + + +FTMODULE_H_COMMANDS += SDF_RENDERER +FTMODULE_H_COMMANDS += BSDF_RENDERER + +define SDF_RENDERER +$(OPEN_DRIVER) FT_Renderer_Class, ft_sdf_renderer_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)sdf $(ECHO_DRIVER_DESC)signed distance field renderer$(ECHO_DRIVER_DONE) +endef + +define BSDF_RENDERER +$(OPEN_DRIVER) FT_Renderer_Class, ft_bitmap_sdf_renderer_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)bsdf $(ECHO_DRIVER_DESC)bitmap to signed distance field converter$(ECHO_DRIVER_DONE) +endef + +#EOF diff --git a/vendor/freetype/src/sdf/rules.mk b/vendor/freetype/src/sdf/rules.mk new file mode 100644 index 00000000000..250b985d980 --- /dev/null +++ b/vendor/freetype/src/sdf/rules.mk @@ -0,0 +1,78 @@ +# +# FreeType 2 Signed Distance Field driver configuration rules +# + + +# Copyright (C) 2020-2024 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. + + +# sdf driver directory +# +SDF_DIR := $(SRC_DIR)/sdf + + +# compilation flags for the driver +# +SDF_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(SDF_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# sdf driver sources (i.e., C files) +# +SDF_DRV_SRC := $(SDF_DIR)/ftsdfrend.c \ + $(SDF_DIR)/ftsdf.c \ + $(SDF_DIR)/ftbsdf.c \ + $(SDF_DIR)/ftsdfcommon.c + + +# sdf driver headers +# +SDF_DRV_H := $(SDF_DIR)/ftsdfrend.h \ + $(SDF_DIR)/ftsdf.h \ + $(SDF_DIR)/ftsdferrs.h \ + $(SDF_DIR)/ftsdfcommon.h + + +# sdf driver object(s) +# +# SDF_DRV_OBJ_M is used during `multi' builds. +# SDF_DRV_OBJ_S is used during `single' builds. +# +SDF_DRV_OBJ_M := $(SDF_DRV_SRC:$(SDF_DIR)/%.c=$(OBJ_DIR)/%.$O) +SDF_DRV_OBJ_S := $(OBJ_DIR)/sdf.$O + + +# sdf driver source file for single build +# +SDF_DRV_SRC_S := $(SDF_DIR)/sdf.c + + +# sdf driver - single object +# +$(SDF_DRV_OBJ_S): $(SDF_DRV_SRC_S) $(SDF_DRV_SRC) \ + $(FREETYPE_H) $(SDF_DRV_H) + $(SDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SDF_DRV_SRC_S)) + + +# sdf driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(SDF_DIR)/%.c $(FREETYPE_H) $(SDF_DRV_H) + $(SDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver list +# +DRV_OBJS_S += $(SDF_DRV_OBJ_S) +DRV_OBJS_M += $(SDF_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/sfnt/module.mk b/vendor/freetype/src/sfnt/module.mk new file mode 100644 index 00000000000..0818bfb0cc3 --- /dev/null +++ b/vendor/freetype/src/sfnt/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 SFNT module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += SFNT_MODULE + +define SFNT_MODULE +$(OPEN_DRIVER) FT_Module_Class, sfnt_module_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)sfnt $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/sfnt/rules.mk b/vendor/freetype/src/sfnt/rules.mk new file mode 100644 index 00000000000..2e03dddc753 --- /dev/null +++ b/vendor/freetype/src/sfnt/rules.mk @@ -0,0 +1,87 @@ +# +# FreeType 2 SFNT driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# SFNT driver directory +# +SFNT_DIR := $(SRC_DIR)/sfnt + + +# compilation flags for the driver +# +SFNT_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# SFNT driver sources (i.e., C files) +# +SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \ + $(SFNT_DIR)/sfdriver.c \ + $(SFNT_DIR)/sfobjs.c \ + $(SFNT_DIR)/sfwoff.c \ + $(SFNT_DIR)/sfwoff2.c \ + $(SFNT_DIR)/ttbdf.c \ + $(SFNT_DIR)/ttcmap.c \ + $(SFNT_DIR)/ttcolr.c \ + $(SFNT_DIR)/ttsvg.c \ + $(SFNT_DIR)/ttcpal.c \ + $(SFNT_DIR)/ttgpos.c \ + $(SFNT_DIR)/ttkern.c \ + $(SFNT_DIR)/ttload.c \ + $(SFNT_DIR)/ttmtx.c \ + $(SFNT_DIR)/ttpost.c \ + $(SFNT_DIR)/ttsbit.c \ + $(SFNT_DIR)/woff2tags.c + +# SFNT driver headers +# +SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) \ + $(SFNT_DIR)/sferrors.h + + +# SFNT driver object(s) +# +# SFNT_DRV_OBJ_M is used during `multi' builds. +# SFNT_DRV_OBJ_S is used during `single' builds. +# +SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR)/%.c=$(OBJ_DIR)/%.$O) +SFNT_DRV_OBJ_S := $(OBJ_DIR)/sfnt.$O + +# SFNT driver source file for single build +# +SFNT_DRV_SRC_S := $(SFNT_DIR)/sfnt.c + + +# SFNT driver - single object +# +$(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \ + $(FREETYPE_H) $(SFNT_DRV_H) + $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SFNT_DRV_SRC_S)) + + +# SFNT driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(SFNT_DIR)/%.c $(FREETYPE_H) $(SFNT_DRV_H) + $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(SFNT_DRV_OBJ_S) +DRV_OBJS_M += $(SFNT_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/sfnt/sfdriver.c b/vendor/freetype/src/sfnt/sfdriver.c index 81072207b49..7133ff7099e 100644 --- a/vendor/freetype/src/sfnt/sfdriver.c +++ b/vendor/freetype/src/sfnt/sfdriver.c @@ -895,7 +895,7 @@ FT_TRACE0(( "sfnt_get_var_ps_name:" " Shortening variation PS name prefix\n" )); FT_TRACE0(( " " - " to %d characters\n", len )); + " to %u characters\n", len )); } face->var_postscript_prefix = result; diff --git a/vendor/freetype/src/sfnt/sfobjs.c b/vendor/freetype/src/sfnt/sfobjs.c index 6ee4e5e939b..75411f75907 100644 --- a/vendor/freetype/src/sfnt/sfobjs.c +++ b/vendor/freetype/src/sfnt/sfobjs.c @@ -1127,9 +1127,9 @@ flags |= FT_FACE_FLAG_VERTICAL; /* kerning available ? */ - if ( TT_FACE_HAS_KERNING( face ) + if ( face->kern_avail_bits #ifdef TT_CONFIG_OPTION_GPOS_KERNING - || face->gpos_kerning_available + || face->num_gpos_lookups_kerning #endif ) flags |= FT_FACE_FLAG_KERNING; diff --git a/vendor/freetype/src/sfnt/sfwoff2.c b/vendor/freetype/src/sfnt/sfwoff2.c index 589b3e0c6b7..6229eadedf6 100644 --- a/vendor/freetype/src/sfnt/sfwoff2.c +++ b/vendor/freetype/src/sfnt/sfwoff2.c @@ -902,7 +902,7 @@ substreams[i].offset = pos + offset; substreams[i].size = substream_size; - FT_TRACE5(( " Substream %d: offset = %lu; size = %lu;\n", + FT_TRACE5(( " Substream %u: offset = %lu; size = %lu;\n", i, substreams[i].offset, substreams[i].size )); offset += substream_size; } @@ -1592,7 +1592,7 @@ WOFF2_TableRec table = *( indices[nn] ); - FT_TRACE3(( "Seeking to %ld with table size %ld.\n", + FT_TRACE3(( "Seeking to %lu with table size %lu.\n", table.src_offset, table.src_length )); FT_TRACE3(( "Table tag: %c%c%c%c.\n", (FT_Char)( table.Tag >> 24 ), @@ -1943,7 +1943,7 @@ src_offset += table->TransformLength; table->dst_offset = 0; - FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n", + FT_TRACE2(( " %c%c%c%c %08d %08d %08lu %08lu %08lu\n", (FT_Char)( table->Tag >> 24 ), (FT_Char)( table->Tag >> 16 ), (FT_Char)( table->Tag >> 8 ), diff --git a/vendor/freetype/src/sfnt/ttcmap.c b/vendor/freetype/src/sfnt/ttcmap.c index 3e40da6b028..d802ddca6b7 100644 --- a/vendor/freetype/src/sfnt/ttcmap.c +++ b/vendor/freetype/src/sfnt/ttcmap.c @@ -3792,7 +3792,7 @@ return FT_THROW( Invalid_Table ); /* Version 1.8.3 of the OpenType specification contains the following */ - /* (https://docs.microsoft.com/en-us/typography/opentype/spec/cmap): */ + /* (https://learn.microsoft.com/typography/opentype/spec/cmap): */ /* */ /* The 'cmap' table version number remains at 0x0000 for fonts that */ /* make use of the newer subtable formats. */ @@ -3803,7 +3803,7 @@ p += 2; num_cmaps = TT_NEXT_USHORT( p ); - FT_TRACE4(( "tt_face_build_cmaps: %d cmaps\n", num_cmaps )); + FT_TRACE4(( "tt_face_build_cmaps: %u cmaps\n", num_cmaps )); limit = table + face->cmap_size; for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) diff --git a/vendor/freetype/src/sfnt/ttcolr.c b/vendor/freetype/src/sfnt/ttcolr.c index b37658dde9e..2bf9a7e95a9 100644 --- a/vendor/freetype/src/sfnt/ttcolr.c +++ b/vendor/freetype/src/sfnt/ttcolr.c @@ -51,7 +51,7 @@ #define COLOR_STOP_SIZE 6U #define VAR_IDX_BASE_SIZE 4U #define LAYER_SIZE 4U -/* https://docs.microsoft.com/en-us/typography/opentype/spec/colr#colr-header */ +/* https://learn.microsoft.com/typography/opentype/spec/colr#colr-header */ /* 3 * uint16 + 2 * Offset32 */ #define COLRV0_HEADER_SIZE 14U /* COLRV0_HEADER_SIZE + 5 * Offset32 */ diff --git a/vendor/freetype/src/sfnt/ttgpos.c b/vendor/freetype/src/sfnt/ttgpos.c index b6cd8bf8205..4ff54933f47 100644 --- a/vendor/freetype/src/sfnt/ttgpos.c +++ b/vendor/freetype/src/sfnt/ttgpos.c @@ -2,36 +2,33 @@ * * ttgpos.c * - * Load the TrueType GPOS table. The only GPOS layout feature this - * currently supports is kerning, from x advances in the pair adjustment - * layout feature. + * Routines to parse and access the 'GPOS' table for simple kerning (body). * - * Parts of the implementation were adapted from: - * https://github.com/nothings/stb/blob/master/stb_truetype.h - * - * GPOS spec reference available at: - * https://learn.microsoft.com/en-us/typography/opentype/spec/gpos - * - * Copyright (C) 2024 by - * David Saltzman + * Copyright (C) 2025 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 +#include +#include + #include #include -#include -#include "freetype/fttypes.h" -#include "freetype/internal/ftobjs.h" + #include "ttgpos.h" #ifdef TT_CONFIG_OPTION_GPOS_KERNING + /************************************************************************** * * The macro FT_COMPONENT is used in trace mode. It is an implicit @@ -42,292 +39,542 @@ #define FT_COMPONENT ttgpos - typedef enum coverage_table_format_type_ + /*********************************/ + /******** ********/ + /******** GPOS validation ********/ + /******** ********/ + /*********************************/ + + static FT_Bool + tt_face_validate_coverage( FT_Byte* table, + FT_Byte* table_limit, + FT_UInt max_num_coverage_indices ) { - COVERAGE_TABLE_FORMAT_LIST = 1, - COVERAGE_TABLE_FORMAT_RANGE = 2 + FT_UInt format; - } coverage_table_format_type; + FT_Byte* p = table; + FT_Byte* limit; - typedef enum class_def_table_format_type_ - { - CLASS_DEF_TABLE_FORMAT_ARRAY = 1, - CLASS_DEF_TABLE_FORMAT_RANGE_GROUPS = 2 + FT_Long last_id = -1; - } class_def_table_format_type; - typedef enum gpos_lookup_type_ - { - GPOS_LOOKUP_TYPE_NONE = 0, - GPOS_LOOKUP_TYPE_SINGLE_ADJUSTMENT = 1, - GPOS_LOOKUP_TYPE_PAIR_ADJUSTMENT = 2, - GPOS_LOOKUP_TYPE_CURSIVE_ATTACHMENT = 3, - GPOS_LOOKUP_TYPE_MARK_TO_BASE_ATTACHMENT = 4, - GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE_ATTACHMENT = 5, - GPOS_LOOKUP_TYPE_MARK_TO_MARK_ATTACHMENT = 6, - GPOS_LOOKUP_TYPE_CONTEXT_POSITIONING = 7, - GPOS_LOOKUP_TYPE_CHAINED_CONTEXT_POSITIONING = 8, - GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING = 9 - - } gpos_lookup_type; - - typedef enum gpos_pair_adjustment_format_ - { - GPOS_PAIR_ADJUSTMENT_FORMAT_GLYPH_PAIR = 1, - GPOS_PAIR_ADJUSTMENT_FORMAT_CLASS_PAIR = 2 + if ( table_limit < p + 4 ) + return FALSE; - } gpos_pair_adjustment_format; + format = FT_NEXT_USHORT( p ); + if ( format == 1 ) + { + FT_UInt glyphCount = FT_NEXT_USHORT( p ); - typedef enum gpos_value_format_bitmask_ - { - GPOS_VALUE_FORMAT_NONE = 0x0000, - GPOS_VALUE_FORMAT_X_PLACEMENT = 0x0001, - GPOS_VALUE_FORMAT_Y_PLACEMENT = 0x0002, - GPOS_VALUE_FORMAT_X_ADVANCE = 0x0004, - GPOS_VALUE_FORMAT_Y_ADVANCE = 0x0008, - GPOS_VALUE_FORMAT_X_PLACEMENT_DEVICE = 0x0010, - GPOS_VALUE_FORMAT_Y_PLACEMENT_DEVICE = 0x0020, - GPOS_VALUE_FORMAT_X_ADVANCE_DEVICE = 0x0040, - GPOS_VALUE_FORMAT_Y_ADVANCE_DEVICE = 0x0080 - } gpos_value_format_bitmask; + if ( glyphCount > max_num_coverage_indices ) + return FALSE; + limit = p + glyphCount * 2; + if ( table_limit < limit ) + return FALSE; - typedef struct TT_GPOS_Subtable_Iterator_Context_ - { - /* Iteration state. */ - FT_Byte* current_lookup_table; - gpos_lookup_type current_lookup_type; - FT_UShort subtable_count; - FT_Byte* subtable_offsets; - FT_UInt subtable_idx; + while ( p < limit ) + { + FT_UInt id = FT_NEXT_USHORT( p ); - /* Element for the current iteration. */ - FT_Byte* subtable; - gpos_lookup_type subtable_type; - } TT_GPOS_Subtable_Iterator_Context; + if ( last_id >= id ) + return FALSE; + last_id = id; + } + } + else if ( format == 2 ) + { + FT_UInt rangeCount = FT_NEXT_USHORT( p ); + + limit = p + rangeCount * 6; + if ( table_limit < limit ) + return FALSE; - /* Initialize a subtable iterator for a given lookup list index. */ - static void - tt_gpos_subtable_iterator_init( - TT_GPOS_Subtable_Iterator_Context* context, - FT_Byte* gpos_table, - FT_ULong lookup_list_idx ) + while ( p < limit ) + { + FT_UInt startGlyphID = FT_NEXT_USHORT( p ); + FT_UInt endGlyphID = FT_NEXT_USHORT( p ); + FT_UInt startCoverageIndex = FT_NEXT_USHORT( p ); + + + if ( startGlyphID > endGlyphID ) + return FALSE; + + if ( last_id >= startGlyphID ) + return FALSE; + last_id = endGlyphID; + + /* XXX: Is this modulo 65536 arithmetic? */ + if ( startCoverageIndex + endGlyphID - startGlyphID >= + max_num_coverage_indices ) + return FALSE; + } + } + else + return FALSE; + + return TRUE; + } + + + static FT_Bool + tt_face_validate_class_def( FT_Byte* table, + FT_Byte* table_limit, + FT_UInt num_classes ) { - FT_Byte* lookup_list = gpos_table + FT_PEEK_USHORT( gpos_table + 8 ); - FT_UInt16 lookup_count = FT_PEEK_USHORT( lookup_list ); + FT_UInt format; + FT_Byte* p = table; + FT_Byte* limit; - if ( lookup_list_idx < lookup_count ) + FT_UInt max_class_value = 0; + + + if ( table_limit < p + 2 ) + return FALSE; + + format = FT_NEXT_USHORT( p ); + if ( format == 1 ) { - context->current_lookup_table = - lookup_list + FT_PEEK_USHORT( lookup_list + 2 + 2 * lookup_list_idx ); - context->current_lookup_type = - (gpos_lookup_type)FT_PEEK_USHORT( context->current_lookup_table ); - context->subtable_count = - FT_PEEK_USHORT( context->current_lookup_table + 4 ); - context->subtable_offsets = context->current_lookup_table + 6; + FT_UInt glyphCount; + + + if ( table_limit < p + 4 ) + return FALSE; + + p += 2; /* Skip `startGlyphID`. */ + + glyphCount = FT_NEXT_USHORT( p ); + limit = p + glyphCount * 2; + if ( table_limit < limit ) + return FALSE; + + while ( p < limit ) + { + FT_UInt class_value = FT_NEXT_USHORT( p ); + + + if ( class_value > max_class_value ) + max_class_value = class_value; + } } - else + else if ( format == 2 ) { - context->current_lookup_table = NULL; - context->current_lookup_type = GPOS_LOOKUP_TYPE_NONE; - context->subtable_count = 0; - context->subtable_offsets = NULL; + FT_UInt classRangeCount; + FT_Long last_id = -1; + + + if ( table_limit < p + 2 ) + return FALSE; + + classRangeCount = FT_NEXT_USHORT( p ); + limit = p + classRangeCount * 6; + if ( table_limit < limit ) + return FALSE; + + while ( p < limit ) + { + FT_UInt startGlyphID = FT_NEXT_USHORT( p ); + FT_UInt endGlyphID = FT_NEXT_USHORT( p ); + FT_UInt class_value = FT_NEXT_USHORT( p ); + + + if ( startGlyphID > endGlyphID ) + return FALSE; + + if ( last_id >= startGlyphID ) + return FALSE; + last_id = endGlyphID; + + if ( class_value > max_class_value ) + max_class_value = class_value; + } } + else + return FALSE; - context->subtable_idx = 0; - context->subtable = NULL; - context->subtable_type = GPOS_LOOKUP_TYPE_NONE; + if ( max_class_value + 1 != num_classes ) + return FALSE; + + return TRUE; } - /* Get the next subtable. Return whether there was a next one. */ static FT_Bool - tt_gpos_subtable_iterator_next( - TT_GPOS_Subtable_Iterator_Context* context ) + tt_face_validate_feature( FT_Byte* table, + FT_Byte* table_limit, + FT_UInt use_lookup_table_size, + FT_Byte* use_lookup_table ) { - if ( context->subtable_idx < context->subtable_count ) + FT_UInt lookupIndexCount; + + FT_Byte* p = table; + FT_Byte* limit; + + + if ( table_limit < p + 4 ) + return FALSE; + + p += 2; /* Skip `featureParamsOffset`. */ + + lookupIndexCount = FT_NEXT_USHORT( p ); + limit = p + lookupIndexCount * 2; + if ( table_limit < limit ) + return FALSE; + + while ( p < limit ) { - FT_UShort subtable_offset = - FT_PEEK_USHORT( context->subtable_offsets + - 2 * context->subtable_idx ); + FT_UInt lookup_index = FT_NEXT_USHORT( p ); + + + if ( lookup_index >= use_lookup_table_size ) + return FALSE; + + use_lookup_table[lookup_index] = TRUE; + } + + return TRUE; + } + + + static FT_Bool + tt_face_validate_feature_table( FT_Byte* table, + FT_Byte* table_limit, + FT_UInt use_lookup_table_size, + FT_Byte* use_lookup_table ) + { + FT_UInt featureCount; + + FT_Byte* p = table; + FT_Byte* limit; + + if ( table_limit < p + 2 ) + return FALSE; - context->subtable = context->current_lookup_table + subtable_offset; + featureCount = FT_NEXT_USHORT( p ); + limit = p + featureCount * 6; + if ( table_limit < limit ) + return FALSE; - if ( context->current_lookup_type == - GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING ) + /* We completely ignore GPOS script information */ + /* and collect lookup tables of all 'kern' features. */ + while ( p < limit ) + { + FT_ULong featureTag = FT_NEXT_ULONG( p ); + FT_UInt featureOffset = FT_NEXT_USHORT( p ); + + + if ( featureTag == TTAG_kern ) { - /* Update type and subtable based on extension positioning header. */ - context->subtable_type = - (gpos_lookup_type)FT_PEEK_USHORT( context->subtable + 2 ); - context->subtable += FT_PEEK_ULONG( context->subtable + 4 ); + if ( !tt_face_validate_feature( table + featureOffset, + table_limit, + use_lookup_table_size, + use_lookup_table ) ) + return FALSE; } - else - context->subtable_type = context->current_lookup_type; - - context->subtable_idx++; - return TRUE; } - return FALSE; + return TRUE; } - static FT_Int - tt_gpos_get_coverage_index( FT_Byte *coverage_table, - FT_UInt glyph ) + static FT_Bool + tt_face_validate_pair_set( FT_Byte* table, + FT_Byte* table_limit ) { - coverage_table_format_type coverage_format = - (coverage_table_format_type)FT_PEEK_USHORT( coverage_table ); + FT_UInt pairValueCount; + + FT_Byte* p = table; + FT_Byte* limit; + FT_Long last_id = -1; - switch ( coverage_format ) + + if ( table_limit < p + 2 ) + return FALSE; + + /* For our purposes, the first value record only contains X advances */ + /* while the second one is empty; a `PairValue` record has thus a */ + /* size of four bytes. */ + pairValueCount = FT_NEXT_USHORT( p ); + limit = p + pairValueCount * 4; + if ( table_limit < limit ) + return FALSE; + + /* We validate the order of `secondGlyph` so that binary search works. */ + while ( p < limit ) { - case COVERAGE_TABLE_FORMAT_LIST: - { - FT_UShort glyph_count = FT_PEEK_USHORT( coverage_table + 2 ); + FT_UInt id = FT_NEXT_USHORT( p ); - FT_Int l = 0; - FT_Int r = glyph_count - 1; - FT_Int m; - FT_Int straw; - FT_Int needle = (FT_Int)glyph; + if ( last_id >= id ) + return FALSE; + last_id = id; - /* Binary search. */ - while ( l <= r ) - { - FT_Byte *glyph_array = coverage_table + 4; - FT_UShort glyph_id; + p += 2; /* Skip `valueRecord1`. */ + } + return TRUE; + } - m = ( l + r ) >> 1; - glyph_id = FT_PEEK_USHORT( glyph_array + 2 * m ); - straw = glyph_id; - if ( needle < straw ) - r = m - 1; - else if ( needle > straw ) - l = m + 1; - else - return m; - } - break; - } + static FT_Bool + tt_face_validate_pair_pos1( FT_Byte* table, + FT_Byte* table_limit, + FT_Bool* is_fitting ) + { + FT_Byte* coverage; + FT_UInt valueFormat1; + FT_UInt valueFormat2; + + /* Subtable format is already checked. */ + FT_Byte* p = table + 2; + FT_Byte* limit; + + + /* The six bytes for the coverage table offset */ + /* and the value formats are already checked. */ + coverage = table + FT_NEXT_USHORT( p ); + + /* For the limited purpose of accessing the simplest type of kerning */ + /* (similar to what FreeType's 'kern' table handling provides) we */ + /* only consider tables that contains X advance values for the first */ + /* glyph and no data for the second glyph. */ + valueFormat1 = FT_NEXT_USHORT( p ); + valueFormat2 = FT_NEXT_USHORT( p ); + if ( valueFormat1 == 0x4 && valueFormat2 == 0 ) + { + FT_UInt pairSetCount; + + + if ( table_limit < p + 2 ) + return FALSE; + + pairSetCount = FT_NEXT_USHORT( p ); + limit = p + pairSetCount * 2; + if ( table_limit < limit ) + return FALSE; + + if ( !tt_face_validate_coverage( coverage, + table_limit, + pairSetCount ) ) + return FALSE; - case COVERAGE_TABLE_FORMAT_RANGE: + while ( p < limit ) { - FT_UShort range_count = FT_PEEK_USHORT( coverage_table + 2 ); - FT_Byte *range_array = coverage_table + 4; + FT_Byte* pair_set = table + FT_NEXT_USHORT( p ); - FT_Int l = 0; - FT_Int r = range_count - 1; - FT_Int m; - FT_Int straw_start; - FT_Int straw_end; - FT_Int needle = (FT_Int)glyph; + if ( !tt_face_validate_pair_set( pair_set, table_limit ) ) + return FALSE; + } + *is_fitting = TRUE; + } - /* Binary search. */ - while ( l <= r ) - { - FT_Byte *range_record; + return TRUE; + } - m = ( l + r ) >> 1; - range_record = range_array + 6 * m; - straw_start = FT_PEEK_USHORT( range_record ); - straw_end = FT_PEEK_USHORT( range_record + 2 ); + static FT_Bool + tt_face_validate_pair_pos2( FT_Byte* table, + FT_Byte* table_limit, + FT_Bool* is_fitting ) + { + FT_Byte* coverage; + FT_UInt valueFormat1; + FT_UInt valueFormat2; - if ( needle < straw_start ) - r = m - 1; - else if ( needle > straw_end ) - l = m + 1; - else - { - FT_UShort start_coverage_index = - FT_PEEK_USHORT( range_record + 4 ); + /* Subtable format is already checked. */ + FT_Byte* p = table + 2; + FT_Byte* limit; - return (FT_Int)start_coverage_index + (FT_Int)glyph - straw_start; - } - } - break; - } + /* The six bytes for the coverage table offset */ + /* and the value formats are already checked. */ + coverage = table + FT_NEXT_USHORT( p ); + + valueFormat1 = FT_NEXT_USHORT( p ); + valueFormat2 = FT_NEXT_USHORT( p ); + if ( valueFormat1 == 0x4 && valueFormat2 == 0 ) + { + FT_Byte* class_def1; + FT_Byte* class_def2; + FT_UInt class1Count; + FT_UInt class2Count; + + + /* The number of coverage indices is not relevant here. */ + if ( !tt_face_validate_coverage( coverage, table_limit, FT_UINT_MAX ) ) + return FALSE; + + if ( table_limit < p + 8 ) + return FALSE; + + class_def1 = table + FT_NEXT_USHORT( p ); + class_def2 = table + FT_NEXT_USHORT( p ); + class1Count = FT_NEXT_USHORT( p ); + class2Count = FT_NEXT_USHORT( p ); + + if ( !tt_face_validate_class_def( class_def1, + table_limit, + class1Count ) ) + return FALSE; + if ( !tt_face_validate_class_def( class_def2, + table_limit, + class2Count ) ) + return FALSE; + + /* For our purposes, the first value record only contains */ + /* X advances while the second one is empty. */ + limit = p + class1Count * class2Count * 2; + if ( table_limit < limit ) + return FALSE; + + *is_fitting = TRUE; } - return -1; + return TRUE; } - static FT_Int - tt_gpos_get_glyph_class( FT_Byte *class_def_table, - FT_UInt glyph ) + /* The return value is the number of fitting subtables. */ + static FT_UInt + tt_face_validate_lookup_table( FT_Byte* table, + FT_Byte* table_limit ) { - class_def_table_format_type class_def_format = - (class_def_table_format_type)FT_PEEK_USHORT( class_def_table ); + FT_UInt lookupType; + FT_UInt real_lookupType = 0; + FT_UInt subtableCount; + + FT_Byte* p = table; + FT_Byte* limit; + + FT_UInt num_fitting_subtables = 0; + + + if ( table_limit < p + 6 ) + return 0; + lookupType = FT_NEXT_USHORT( p ); - switch ( class_def_format ) + p += 2; /* Skip `lookupFlag`. */ + + subtableCount = FT_NEXT_USHORT( p ); + limit = p + subtableCount * 2; + if ( table_limit < limit ) + return 0; + + while ( p < limit ) { - case CLASS_DEF_TABLE_FORMAT_ARRAY: - { - FT_UInt start_glyph_id = FT_PEEK_USHORT( class_def_table + 2 ); - FT_UInt glyph_count = FT_PEEK_USHORT( class_def_table + 4 ); - FT_Byte *class_value_array = class_def_table + 6; + FT_Byte* subtable = table + FT_NEXT_USHORT( p ); + FT_UInt format; + FT_Bool is_fitting = FALSE; - if ( glyph >= start_glyph_id && - glyph < start_glyph_id + glyph_count ) - return (FT_Int)FT_PEEK_USHORT( class_value_array + - 2 * ( glyph - start_glyph_id ) ); - break; - } - case CLASS_DEF_TABLE_FORMAT_RANGE_GROUPS: + if ( lookupType == 9 ) { - FT_UShort class_range_count = FT_PEEK_USHORT( class_def_table + 2 ); - FT_Byte *class_range_records = class_def_table + 4; + /* Positioning extension. */ + FT_Byte* q = subtable; - FT_Int l = 0; - FT_Int r = class_range_count - 1; - FT_Int m; - FT_Int straw_start; - FT_Int straw_end; - FT_Int needle = (FT_Int)glyph; + if ( table_limit < q + 8 ) + return 0; + if ( FT_NEXT_USHORT( q ) != 1 ) /* format */ + return 0; - while ( l <= r ) - { - FT_Byte *class_range_record; + if ( real_lookupType == 0 ) + real_lookupType = FT_NEXT_USHORT( q ); + else if ( real_lookupType != FT_NEXT_USHORT( q ) ) + return 0; + + subtable += FT_PEEK_ULONG( q ); + } + else + real_lookupType = lookupType; + /* Ensure the first eight bytes of the subtable formats. */ + if ( table_limit < subtable + 8 ) + return 0; - m = ( l + r ) >> 1; - class_range_record = class_range_records + 6 * m; - straw_start = FT_PEEK_USHORT( class_range_record ); - straw_end = FT_PEEK_USHORT( class_range_record + 2 ); + format = FT_PEEK_USHORT( subtable ); - if ( needle < straw_start ) - r = m - 1; - else if ( needle > straw_end ) - l = m + 1; - else - return (FT_Int)FT_PEEK_USHORT( class_range_record + 4 ); + if ( real_lookupType == 2 ) + { + if ( format == 1 ) + { + if ( !tt_face_validate_pair_pos1( subtable, + table_limit, + &is_fitting ) ) + return 0; } - break; + else if ( format == 2 ) + { + if ( !tt_face_validate_pair_pos2( subtable, + table_limit, + &is_fitting ) ) + return 0; + } + else + return 0; } + else + return 0; + + if ( is_fitting ) + num_fitting_subtables++; } - /* "All glyphs not assigned to a class fall into class 0." */ - /* (OpenType spec) */ - return 0; + return num_fitting_subtables; + } + + + static void + tt_face_get_subtable_offsets( FT_Byte* table, + FT_Byte* gpos, + FT_UInt32* gpos_lookups_kerning, + FT_UInt* idx ) + { + FT_UInt lookupType; + FT_UInt subtableCount; + + FT_Byte* p = table; + FT_Byte* limit; + + + lookupType = FT_NEXT_USHORT( p ); + + p += 2; + + subtableCount = FT_NEXT_USHORT( p ); + limit = p + subtableCount * 2; + while ( p < limit ) + { + FT_Byte* subtable = table + FT_NEXT_USHORT( p ); + FT_UInt valueFormat1; + FT_UInt valueFormat2; + + + if ( lookupType == 9 ) + subtable += FT_PEEK_ULONG( subtable + 4 ); + + /* Table offsets for `valueFormat[12]` values */ + /* are identical for both subtable formats. */ + valueFormat1 = FT_PEEK_USHORT( subtable + 4 ); + valueFormat2 = FT_PEEK_USHORT( subtable + 6 ); + if ( valueFormat1 == 0x4 && valueFormat2 == 0 ) + { + /* We store offsets relative to the start of the GPOS table. */ + gpos_lookups_kerning[(*idx)++] = (FT_UInt32)( subtable - gpos ); + } + } } @@ -335,57 +582,142 @@ tt_face_load_gpos( TT_Face face, FT_Stream stream ) { - FT_Error error; - FT_ULong table_size; + FT_Error error; + FT_Memory memory = face->root.memory; + + FT_ULong gpos_length; + FT_Byte* gpos; + FT_Byte* gpos_limit; + + FT_UInt32* gpos_lookups_kerning; + + FT_UInt featureListOffset; + + FT_UInt lookupListOffset; + FT_Byte* lookup_list; + FT_UInt lookupCount; + + FT_UInt i; + + FT_Byte* use_lookup_table = NULL; + FT_UInt num_fitting_subtables; + FT_Byte* p; + FT_Byte* limit; - /* The GPOS table is optional; exit silently if it is missing. */ - error = face->goto_table( face, TTAG_GPOS, stream, &table_size ); + + face->gpos_table = NULL; + face->gpos_lookups_kerning = NULL; + face->num_gpos_lookups_kerning = 0; + + gpos = NULL; + gpos_lookups_kerning = NULL; + + error = face->goto_table( face, TTAG_GPOS, stream, &gpos_length ); if ( error ) - goto Exit; + goto Fail; - if ( table_size < 4 ) /* the case of a malformed table */ - { - FT_ERROR(( "tt_face_load_gpos:" - " GPOS table is too small - ignored\n" )); - error = FT_THROW( Table_Missing ); - goto Exit; - } + if ( FT_FRAME_EXTRACT( gpos_length, gpos ) ) + goto Fail; - if ( FT_FRAME_EXTRACT( table_size, face->gpos_table ) ) - { - FT_ERROR(( "tt_face_load_gpos:" - " could not extract GPOS table\n" )); - goto Exit; - } + if ( gpos_length < 10 ) + goto Fail; + + gpos_limit = gpos + gpos_length; - face->gpos_kerning_available = FALSE; + /* We first need the number of GPOS lookups. */ + lookupListOffset = FT_PEEK_USHORT( gpos + 8 ); - if ( face->gpos_table ) + lookup_list = gpos + lookupListOffset; + p = lookup_list; + if ( gpos_limit < p + 2 ) + goto Fail; + + lookupCount = FT_NEXT_USHORT( p ); + limit = p + lookupCount * 2; + if ( gpos_limit < limit ) + goto Fail; + + /* Allocate an auxiliary array for Boolean values that */ + /* gets filled while walking over all 'kern' features. */ + if ( FT_NEW_ARRAY( use_lookup_table, lookupCount ) ) + goto Fail; + + featureListOffset = FT_PEEK_USHORT( gpos + 6 ); + + if ( !tt_face_validate_feature_table( gpos + featureListOffset, + gpos_limit, + lookupCount, + use_lookup_table ) ) + goto Fail; + + /* Now walk over all lookup tables and get the */ + /* number of fitting subtables. */ + num_fitting_subtables = 0; + for ( i = 0; i < lookupCount; i++ ) { - FT_Byte* feature_list = face->gpos_table + - FT_PEEK_USHORT( face->gpos_table + 6 ); - FT_UInt16 feature_count = FT_PEEK_USHORT( feature_list ); - FT_Byte* feature_records = feature_list + 2; + FT_UInt lookupOffset; + + + if ( !use_lookup_table[i] ) + continue; + lookupOffset = FT_PEEK_USHORT( p + i * 2 ); + + num_fitting_subtables += + tt_face_validate_lookup_table( lookup_list + lookupOffset, + gpos_limit ); + + } + + /* Loop again over all lookup tables and */ + /* collect offsets to those subtables. */ + if ( num_fitting_subtables ) + { FT_UInt idx; - for ( idx = 0; idx < feature_count; idx++, feature_records += 6 ) + if ( FT_QNEW_ARRAY( gpos_lookups_kerning, num_fitting_subtables ) ) + goto Fail; + + idx = 0; + for ( i = 0; i < lookupCount; i++ ) { - FT_ULong feature_tag = FT_PEEK_ULONG( feature_records ); + FT_UInt lookupOffset; - if ( feature_tag == TTAG_kern ) - { - face->gpos_kerning_available = TRUE; - break; - } + if ( !use_lookup_table[i] ) + continue; + + lookupOffset = FT_PEEK_USHORT( p + i * 2 ); + + tt_face_get_subtable_offsets( lookup_list + lookupOffset, + gpos, + gpos_lookups_kerning, + &idx ); } } + FT_FREE( use_lookup_table ); + use_lookup_table = NULL; + + face->gpos_table = gpos; + face->gpos_lookups_kerning = gpos_lookups_kerning; + face->num_gpos_lookups_kerning = num_fitting_subtables; + Exit: return error; + + Fail: + FT_FREE( gpos ); + FT_FREE( gpos_lookups_kerning ); + FT_FREE( use_lookup_table ); + + /* If we don't have an explicit error code, set it to a generic value. */ + if ( !error ) + error = FT_THROW( Invalid_Table ); + + goto Exit; } @@ -393,198 +725,250 @@ tt_face_done_gpos( TT_Face face ) { FT_Stream stream = face->root.stream; + FT_Memory memory = face->root.memory; FT_FRAME_RELEASE( face->gpos_table ); + FT_FREE( face->gpos_lookups_kerning ); } - FT_LOCAL_DEF( FT_Int ) - tt_face_get_gpos_kerning( TT_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph ) + /*********************************/ + /******** ********/ + /******** GPOS access ********/ + /******** ********/ + /*********************************/ + + + static FT_Long + tt_face_get_coverage_index( FT_Byte* table, + FT_UInt glyph_index ) { - FT_Byte* feature_list; - FT_UInt16 feature_count; - FT_Byte* feature_records; - FT_UInt feature_idx; + FT_Byte* p = table; + FT_UInt format = FT_NEXT_USHORT( p ); + FT_UInt count = FT_NEXT_USHORT( p ); + FT_UInt min, max; - if ( !face->gpos_kerning_available ) - return 0; - feature_list = face->gpos_table + - FT_PEEK_USHORT( face->gpos_table + 6 ); - feature_count = FT_PEEK_USHORT( feature_list ); - feature_records = feature_list + 2; + min = 0; + max = count; - for ( feature_idx = 0; - feature_idx < feature_count; - feature_idx++, feature_records += 6 ) + if ( format == 1 ) { - FT_ULong feature_tag = FT_PEEK_ULONG( feature_records ); - FT_Byte* feature_table; - FT_UInt16 lookup_idx_count; - FT_UInt16 lookup_idx; + while ( min < max ) + { + FT_UInt mid = min + ( max - min ) / 2; + FT_UInt mid_index = FT_PEEK_USHORT( p + mid * 2 ); - if ( feature_tag != TTAG_kern ) - continue; + if ( glyph_index > mid_index ) + min = mid + 1; + else if ( glyph_index < mid_index ) + max = mid; + else + return mid; + } + } + else + { + while ( min < max ) + { + FT_UInt mid = min + ( max - min ) / 2; + FT_UInt startGlyphID = FT_PEEK_USHORT( p + mid * 6 ); + FT_UInt endGlyphID = FT_PEEK_USHORT( p + mid * 6 + 2 ); - feature_table = feature_list + FT_PEEK_USHORT( feature_records + 4 ); - lookup_idx_count = FT_PEEK_USHORT( feature_table + 2 ); - for ( lookup_idx = 0; lookup_idx < lookup_idx_count; lookup_idx++ ) - { - FT_UInt16 lookup_list_idx = - FT_PEEK_USHORT( feature_table + 4 + 2 * lookup_idx ); - TT_GPOS_Subtable_Iterator_Context subtable_iter; + if ( glyph_index > endGlyphID ) + min = mid + 1; + else if ( glyph_index < startGlyphID ) + max = mid; + else + { + FT_UInt startCoverageIndex = FT_PEEK_USHORT( p + mid * 6 + 4 ); - tt_gpos_subtable_iterator_init( &subtable_iter, - face->gpos_table, - lookup_list_idx ); + return startCoverageIndex + glyph_index - startGlyphID; + } + } + } - while ( tt_gpos_subtable_iterator_next( &subtable_iter ) ) - { - FT_Byte* subtable; + return -1; + } - gpos_value_format_bitmask value_format_1; - gpos_value_format_bitmask value_format_2; - gpos_pair_adjustment_format format; - FT_UShort coverage_offset; - FT_Int coverage_index; + static FT_UInt + tt_face_get_class( FT_Byte* table, + FT_UInt glyph_index ) + { + FT_Byte* p = table; + FT_UInt format = FT_NEXT_USHORT( p ); - if ( subtable_iter.subtable_type != - GPOS_LOOKUP_TYPE_PAIR_ADJUSTMENT ) - continue; + if ( format == 1 ) + { + FT_UInt startGlyphID = FT_NEXT_USHORT( p ); + FT_UInt glyphCount = FT_NEXT_USHORT( p ); - subtable = subtable_iter.subtable; - value_format_1 = - (gpos_value_format_bitmask)FT_PEEK_USHORT( subtable + 4 ); - value_format_2 = - (gpos_value_format_bitmask)FT_PEEK_USHORT( subtable + 6 ); + /* XXX: Is this modulo 65536 arithmetic? */ + if ( startGlyphID <= glyph_index && + startGlyphID + glyphCount >= glyph_index ) + return FT_PEEK_USHORT( p + ( glyph_index - startGlyphID ) * 2 ); + } + else + { + FT_UInt count = FT_NEXT_USHORT( p ); - if ( !( value_format_1 == GPOS_VALUE_FORMAT_X_ADVANCE && - value_format_2 == GPOS_VALUE_FORMAT_NONE ) ) - continue; + FT_UInt min, max; - format = (gpos_pair_adjustment_format)FT_PEEK_USHORT( subtable ); - coverage_offset = FT_PEEK_USHORT( subtable + 2 ); - coverage_index = - tt_gpos_get_coverage_index( subtable + coverage_offset, - left_glyph ); + min = 0; + max = count; - if ( coverage_index == -1 ) - continue; + while ( min < max ) + { + FT_UInt mid = min + ( max - min ) / 2; + FT_UInt startGlyphID = FT_PEEK_USHORT( p + mid * 6 ); + FT_UInt endGlyphID = FT_PEEK_USHORT( p + mid * 6 + 2 ); - switch ( format ) - { - case GPOS_PAIR_ADJUSTMENT_FORMAT_GLYPH_PAIR: - { - FT_Int l, r, m; - FT_Int straw, needle; - FT_Int value_record_pair_size_in_bytes = 2; + if ( glyph_index > endGlyphID ) + min = mid + 1; + else if ( glyph_index < startGlyphID ) + max = mid; + else + return FT_PEEK_USHORT( p + mid * 6 + 4 ); + } + } - FT_UShort pair_set_count = FT_PEEK_USHORT( subtable + 8 ); - FT_UShort pair_pos_offset; + return 0; + } - FT_Byte* pair_value_table; - FT_UShort pair_value_count; - FT_Byte* pair_value_array; + + static FT_Bool + tt_face_get_pair_pos1_kerning( FT_Byte* table, + FT_UInt first_glyph, + FT_UInt second_glyph, + FT_Int* kerning ) + { + FT_Byte* coverage = table + FT_PEEK_USHORT( table + 2 ); + FT_Long coverage_index = tt_face_get_coverage_index( coverage, + first_glyph ); + + FT_UInt pair_set_offset; + FT_Byte* p; + FT_UInt count; + + FT_UInt min, max; - if ( coverage_index >= pair_set_count ) - return 0; + if ( coverage_index < 0 ) + return FALSE; - pair_pos_offset = - FT_PEEK_USHORT( subtable + 10 + 2 * coverage_index ); + pair_set_offset = FT_PEEK_USHORT( table + 10 + coverage_index * 2 ); + p = table + pair_set_offset; + count = FT_NEXT_USHORT( p ); - pair_value_table = subtable + pair_pos_offset; - pair_value_count = FT_PEEK_USHORT( pair_value_table ); - pair_value_array = pair_value_table + 2; + min = 0; + max = count; - needle = (FT_Int)right_glyph; - r = pair_value_count - 1; - l = 0; + while ( min < max ) + { + FT_UInt mid = min + ( max - min ) / 2; + FT_UInt mid_index = FT_PEEK_USHORT( p + mid * 4 ); - /* Binary search. */ - while ( l <= r ) - { - FT_UShort second_glyph; - FT_Byte* pair_value; + if ( second_glyph > mid_index ) + min = max + 1; + else if ( second_glyph < mid_index ) + max = mid; + else + { + *kerning = FT_PEEK_SHORT( p + mid * 4 + 2 ); - m = ( l + r ) >> 1; - pair_value = pair_value_array + - ( 2 + value_record_pair_size_in_bytes ) * m; - second_glyph = FT_PEEK_USHORT( pair_value ); - straw = second_glyph; + return TRUE; + } + } - if ( needle < straw ) - r = m - 1; - else if ( needle > straw ) - l = m + 1; - else - { - FT_Short x_advance = FT_PEEK_SHORT( pair_value + 2 ); + return FALSE; + } - return x_advance; - } - } - break; - } + static FT_Bool + tt_face_get_pair_pos2_kerning( FT_Byte* table, + FT_UInt first_glyph, + FT_UInt second_glyph, + FT_Int* kerning ) + { + FT_Byte* coverage = table + FT_PEEK_USHORT( table + 2 ); + FT_Long coverage_index = tt_face_get_coverage_index( coverage, + first_glyph ); - case GPOS_PAIR_ADJUSTMENT_FORMAT_CLASS_PAIR: - { - FT_UShort class_def1_offset = FT_PEEK_USHORT( subtable + 8 ); - FT_UShort class_def2_offset = FT_PEEK_USHORT( subtable + 10 ); + FT_Byte* class_def1; + FT_Byte* class_def2; + FT_UInt first_class; + FT_UInt second_class; + FT_UInt class2Count; - FT_Int left_glyph_class = - tt_gpos_get_glyph_class( subtable + class_def1_offset, - left_glyph ); - FT_Int right_glyph_class = - tt_gpos_get_glyph_class( subtable + class_def2_offset, - right_glyph ); - FT_UShort class1_count = FT_PEEK_USHORT( subtable + 12 ); - FT_UShort class2_count = FT_PEEK_USHORT( subtable + 14 ); + if ( coverage_index < 0 ) + return FALSE; - FT_Byte *class1_records, *class2_records; - FT_Short x_advance; + class_def1 = table + FT_PEEK_USHORT( table + 8 ); + class_def2 = table + FT_PEEK_USHORT( table + 10 ); + class2Count = FT_PEEK_USHORT( table + 14 ); - if ( left_glyph_class < 0 || - left_glyph_class >= class1_count ) - return 0; /* malformed */ - if ( right_glyph_class < 0 || - right_glyph_class >= class2_count ) - return 0; /* malformed */ + first_class = tt_face_get_class( class_def1, first_glyph ); + second_class = tt_face_get_class( class_def2, second_glyph ); - if ( right_glyph_class == 0 ) - continue; /* right glyph not found in this table */ + *kerning = + FT_PEEK_SHORT( table + 16 + + ( first_class * class2Count + second_class ) * 2 ); - class1_records = subtable + 16; - class2_records = - class1_records + 2 * ( left_glyph_class * class2_count ); + return TRUE; + } - x_advance = - FT_PEEK_SHORT( class2_records + 2 * right_glyph_class ); - return x_advance; - } - } - } + FT_LOCAL_DEF( FT_Int ) + tt_face_get_gpos_kerning( TT_Face face, + FT_UInt first_glyph, + FT_UInt second_glyph ) + { + FT_Int kerning = 0; + + FT_UInt i; + + + /* We only have `PairPos` subtables. */ + for ( i = 0; i < face->num_gpos_lookups_kerning; i++ ) + { + FT_Byte* subtable = face->gpos_table + face->gpos_lookups_kerning[i]; + FT_Byte* p = subtable; + + FT_UInt format = FT_NEXT_USHORT( p ); + + + if ( format == 1 ) + { + if ( tt_face_get_pair_pos1_kerning( subtable, + first_glyph, + second_glyph, + &kerning ) ) + break; + } + else + { + if ( tt_face_get_pair_pos2_kerning( subtable, + first_glyph, + second_glyph, + &kerning ) ) + break; } } - return 0; + return kerning; } #else /* !TT_CONFIG_OPTION_GPOS_KERNING */ diff --git a/vendor/freetype/src/sfnt/ttgpos.h b/vendor/freetype/src/sfnt/ttgpos.h index 570e9e3d750..42e2a5e68bd 100644 --- a/vendor/freetype/src/sfnt/ttgpos.h +++ b/vendor/freetype/src/sfnt/ttgpos.h @@ -1,10 +1,9 @@ /**************************************************************************** * - * ttgpos.c + * ttgpos.h * - * Load the TrueType GPOS table. The only GPOS layout feature this - * currently supports is kerning, from x advances in the pair adjustment - * layout feature. + * Routines to parse and access the 'GPOS' table for simple kerning + * (specification). * * Copyright (C) 2024 by * David Saltzman @@ -39,8 +38,8 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Int ) tt_face_get_gpos_kerning( TT_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph ); + FT_UInt first_glyph, + FT_UInt second_glyph ); #endif /* TT_CONFIG_OPTION_GPOS_KERNING */ diff --git a/vendor/freetype/src/sfnt/ttkern.c b/vendor/freetype/src/sfnt/ttkern.c index f0411366af4..cd6deb29877 100644 --- a/vendor/freetype/src/sfnt/ttkern.c +++ b/vendor/freetype/src/sfnt/ttkern.c @@ -2,8 +2,7 @@ * * ttkern.c * - * Load the basic TrueType kerning table. This doesn't handle - * kerning data within the GPOS table at the moment. + * Routines to parse and access the 'kern' table for kerning (body). * * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. diff --git a/vendor/freetype/src/sfnt/ttkern.h b/vendor/freetype/src/sfnt/ttkern.h index a54e51df12d..8615ab2d952 100644 --- a/vendor/freetype/src/sfnt/ttkern.h +++ b/vendor/freetype/src/sfnt/ttkern.h @@ -2,8 +2,8 @@ * * ttkern.h * - * Load the basic TrueType kerning table. This doesn't handle - * kerning data within the GPOS table at the moment. + * Routines to parse and access the 'kern' table for kerning + * (specification). * * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. @@ -40,8 +40,6 @@ FT_BEGIN_HEADER FT_UInt left_glyph, FT_UInt right_glyph ); -#define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 ) - FT_END_HEADER diff --git a/vendor/freetype/src/sfnt/ttload.c b/vendor/freetype/src/sfnt/ttload.c index c3a5fae2cb9..f64ce889044 100644 --- a/vendor/freetype/src/sfnt/ttload.c +++ b/vendor/freetype/src/sfnt/ttload.c @@ -535,7 +535,8 @@ * The tag of table to load. Use the value 0 if you want * to access the whole font file, else set this parameter * to a valid TrueType table tag that you can forge with - * the MAKE_TT_TAG macro. + * the MAKE_TT_TAG macro. Use value 1 to access the table + * directory. * * offset :: * The starting offset in the table (or the file if @@ -577,7 +578,18 @@ FT_ULong size; - if ( tag != 0 ) + if ( tag == 0 ) + { + /* The whole font file. */ + size = face->root.stream->size; + } + else if ( tag == 1 ) + { + /* The currently selected font's table directory. */ + offset += face->ttc_header.offsets[face->root.face_index & 0xFFFF]; + size = 4 + 8 + 16 * face->num_tables; + } + else { /* look for tag in font directory */ table = tt_face_lookup_table( face, tag ); @@ -590,9 +602,6 @@ offset += table->Offset; size = table->Length; } - else - /* tag == 0 -- the user wants to access the font file directly */ - size = face->root.stream->size; if ( length && *length == 0 ) { diff --git a/vendor/freetype/src/sfnt/ttmtx.c b/vendor/freetype/src/sfnt/ttmtx.c index 27884118563..f3afa16330d 100644 --- a/vendor/freetype/src/sfnt/ttmtx.c +++ b/vendor/freetype/src/sfnt/ttmtx.c @@ -306,7 +306,7 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( var && face->blend ) + if ( var && FT_IS_VARIATION( &face->root ) ) { FT_Face f = FT_FACE( face ); FT_Int a = (FT_Int)*aadvance; diff --git a/vendor/freetype/src/sfnt/ttsbit.c b/vendor/freetype/src/sfnt/ttsbit.c index cad24a5c864..7d957d4d14d 100644 --- a/vendor/freetype/src/sfnt/ttsbit.c +++ b/vendor/freetype/src/sfnt/ttsbit.c @@ -342,7 +342,7 @@ FT_TRACE2(( "tt_face_load_strike_metrics:" " sanitizing invalid ascender and descender\n" )); FT_TRACE2(( " " - " values for strike %ld (%dppem, %dppem)\n", + " values for strike %lu (%dppem, %dppem)\n", strike_index, metrics->x_ppem, metrics->y_ppem )); @@ -993,7 +993,7 @@ goto Fail; } - FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d component%s\n", + FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %u component%s\n", num_components, num_components == 1 ? "" : "s" )); @@ -1419,7 +1419,7 @@ image_start = image_offset + image_start; FT_TRACE3(( "tt_sbit_decoder_load_image:" - " found sbit (format %d) for glyph index %d\n", + " found sbit (format %u) for glyph index %u\n", image_format, glyph_index )); return tt_sbit_decoder_load_bitmap( decoder, @@ -1438,13 +1438,13 @@ if ( recurse_count ) { FT_TRACE4(( "tt_sbit_decoder_load_image:" - " missing subglyph sbit with glyph index %d\n", + " missing subglyph sbit with glyph index %u\n", glyph_index )); return FT_THROW( Invalid_Composite ); } FT_TRACE4(( "tt_sbit_decoder_load_image:" - " no sbit found for glyph index %d\n", glyph_index )); + " no sbit found for glyph index %u\n", glyph_index )); return FT_THROW( Missing_Bitmap ); } diff --git a/vendor/freetype/src/sfnt/ttsvg.c b/vendor/freetype/src/sfnt/ttsvg.c index 298afd8b55a..5876041ed82 100644 --- a/vendor/freetype/src/sfnt/ttsvg.c +++ b/vendor/freetype/src/sfnt/ttsvg.c @@ -20,7 +20,7 @@ * * 'SVG' table specification: * - * https://docs.microsoft.com/en-us/typography/opentype/spec/svg + * https://learn.microsoft.com/typography/opentype/spec/svg * */ @@ -46,6 +46,9 @@ SVG_DOCUMENT_LIST_MINIMUM_SIZE) + /* An arbitrary, heuristic size limit (67MByte) for expanded SVG data. */ +#define MAX_SVG_SIZE ( 1 << 26 ) + typedef struct Svg_ { FT_UShort version; /* table version (starting at 0) */ @@ -346,6 +349,13 @@ (FT_ULong)doc[doc_length - 3] << 8 | (FT_ULong)doc[doc_length - 4]; + if ( uncomp_size >= MAX_SVG_SIZE ) + { + FT_ERROR(( "Uncompressed SVG document too large.\n" )); + error = FT_THROW( Array_Too_Large ); + goto Exit; + } + if ( FT_QALLOC( uncomp_buffer, uncomp_size ) ) goto Exit; diff --git a/vendor/freetype/src/smooth/ftgrays.c b/vendor/freetype/src/smooth/ftgrays.c index 24c119571b0..9964e37e30b 100644 --- a/vendor/freetype/src/smooth/ftgrays.c +++ b/vendor/freetype/src/smooth/ftgrays.c @@ -157,10 +157,6 @@ #define ft_memset memset -#define ft_setjmp setjmp -#define ft_longjmp longjmp -#define ft_jmp_buf jmp_buf - typedef ptrdiff_t FT_PtrDist; @@ -170,8 +166,8 @@ typedef ptrdiff_t FT_PtrDist; #define Smooth_Err_Invalid_Argument -3 #define Smooth_Err_Raster_Overflow -4 -#define FT_BEGIN_HEADER -#define FT_END_HEADER +#define FT_BEGIN_HEADER /* nothing */ +#define FT_END_HEADER /* nothing */ #include "ftimage.h" #include "ftgrays.h" @@ -495,6 +491,7 @@ typedef ptrdiff_t FT_PtrDist; TCoord min_ey, max_ey; TCoord count_ey; /* same as (max_ey - min_ey) */ + int error; /* pool overflow exception */ PCell cell; /* current cell */ PCell cell_free; /* call allocation next free slot */ PCell cell_null; /* last cell, used as dumpster and limit */ @@ -510,8 +507,6 @@ typedef ptrdiff_t FT_PtrDist; FT_Raster_Span_Func render_span; void* render_span_data; - ft_jmp_buf jump_buffer; - } gray_TWorker, *gray_PWorker; #if defined( _MSC_VER ) @@ -613,9 +608,14 @@ typedef ptrdiff_t FT_PtrDist; } /* insert new cell */ - cell = ras.cell_free++; - if ( cell >= ras.cell_null ) - ft_longjmp( ras.jump_buffer, 1 ); + cell = ras.cell_free; + if ( cell == ras.cell_null ) + { + ras.error = FT_THROW( Raster_Overflow ); + goto Found; + } + + ras.cell_free = cell + 1; cell->x = ex; cell->area = 0; @@ -1353,7 +1353,8 @@ typedef ptrdiff_t FT_PtrDist; ras.x = x; ras.y = y; - return 0; + + return ras.error; } @@ -1365,7 +1366,8 @@ typedef ptrdiff_t FT_PtrDist; gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) ); - return 0; + + return ras.error; } @@ -1378,7 +1380,8 @@ typedef ptrdiff_t FT_PtrDist; gray_render_conic( RAS_VAR_ control, to ); - return 0; + + return ras.error; } @@ -1392,7 +1395,8 @@ typedef ptrdiff_t FT_PtrDist; gray_render_cubic( RAS_VAR_ control1, control2, to ); - return 0; + + return ras.error; } @@ -1700,30 +1704,22 @@ typedef ptrdiff_t FT_PtrDist; gray_convert_glyph_inner( RAS_ARG_ int continued ) { - volatile int error; + int error; - if ( ft_setjmp( ras.jump_buffer ) == 0 ) - { - if ( continued ) - FT_Trace_Disable(); - error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); - if ( continued ) - FT_Trace_Enable(); - - FT_TRACE7(( "band [%d..%d]: %td cell%s remaining\n", - ras.min_ey, - ras.max_ey, - ras.cell_null - ras.cell_free, - ras.cell_null - ras.cell_free == 1 ? "" : "s" )); - } - else - { - error = FT_THROW( Raster_Overflow ); + if ( continued ) + FT_Trace_Disable(); + error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); + if ( continued ) + FT_Trace_Enable(); - FT_TRACE7(( "band [%d..%d]: to be bisected\n", - ras.min_ey, ras.max_ey )); - } + FT_TRACE7(( error == Smooth_Err_Raster_Overflow + ? "band [%d..%d]: to be bisected\n" + : "band [%d..%d]: %td cell%s remaining\n", + ras.min_ey, + ras.max_ey, + ras.cell_null - ras.cell_free, + ras.cell_null - ras.cell_free == 1 ? "" : "s" )); return error; } @@ -1922,6 +1918,7 @@ typedef ptrdiff_t FT_PtrDist; ras.cell_free = buffer + n; ras.cell = ras.cell_null; + ras.error = Smooth_Err_Ok; error = gray_convert_glyph_inner( RAS_VAR_ continued ); continued = 1; diff --git a/vendor/freetype/src/smooth/ftgrays.h b/vendor/freetype/src/smooth/ftgrays.h index 940fbe8c79b..a32e7b32daa 100644 --- a/vendor/freetype/src/smooth/ftgrays.h +++ b/vendor/freetype/src/smooth/ftgrays.h @@ -19,11 +19,6 @@ #ifndef FTGRAYS_H_ #define FTGRAYS_H_ -#ifdef __cplusplus - extern "C" { -#endif - - #ifdef STANDALONE_ #include "ftimage.h" #else @@ -31,6 +26,7 @@ #include #endif +FT_BEGIN_HEADER /************************************************************************** * @@ -46,10 +42,7 @@ FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; - -#ifdef __cplusplus - } -#endif +FT_END_HEADER #endif /* FTGRAYS_H_ */ diff --git a/vendor/freetype/src/smooth/module.mk b/vendor/freetype/src/smooth/module.mk new file mode 100644 index 00000000000..9b4526fb549 --- /dev/null +++ b/vendor/freetype/src/smooth/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 smooth renderer module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += SMOOTH_RENDERER + +define SMOOTH_RENDERER +$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/smooth/rules.mk b/vendor/freetype/src/smooth/rules.mk new file mode 100644 index 00000000000..f50fc475c39 --- /dev/null +++ b/vendor/freetype/src/smooth/rules.mk @@ -0,0 +1,73 @@ +# +# FreeType 2 smooth renderer module build rules +# + + +# Copyright (C) 1996-2024 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. + + +# smooth driver directory +# +SMOOTH_DIR := $(SRC_DIR)/smooth + + +# compilation flags for the driver +# +SMOOTH_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# smooth driver sources (i.e., C files) +# +SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \ + $(SMOOTH_DIR)/ftsmooth.c + + +# smooth driver headers +# +SMOOTH_DRV_H := $(SMOOTH_DRV_SRC:%c=%h) \ + $(SMOOTH_DIR)/ftsmerrs.h + + +# smooth driver object(s) +# +# SMOOTH_DRV_OBJ_M is used during `multi' builds. +# SMOOTH_DRV_OBJ_S is used during `single' builds. +# +SMOOTH_DRV_OBJ_M := $(SMOOTH_DRV_SRC:$(SMOOTH_DIR)/%.c=$(OBJ_DIR)/%.$O) +SMOOTH_DRV_OBJ_S := $(OBJ_DIR)/smooth.$O + +# smooth driver source file for single build +# +SMOOTH_DRV_SRC_S := $(SMOOTH_DIR)/smooth.c + + +# smooth driver - single object +# +$(SMOOTH_DRV_OBJ_S): $(SMOOTH_DRV_SRC_S) $(SMOOTH_DRV_SRC) \ + $(FREETYPE_H) $(SMOOTH_DRV_H) + $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SMOOTH_DRV_SRC_S)) + + +# smooth driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(SMOOTH_DIR)/%.c $(FREETYPE_H) $(SMOOTH_DRV_H) + $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(SMOOTH_DRV_OBJ_S) +DRV_OBJS_M += $(SMOOTH_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/svg/module.mk b/vendor/freetype/src/svg/module.mk new file mode 100644 index 00000000000..3f085433bce --- /dev/null +++ b/vendor/freetype/src/svg/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 SVG renderer module definition +# + + +# Copyright (C) 2022-2024 by +# David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. +# +# 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. + + +FTMODULE_H_COMMANDS += SVG_MODULE + +define SVG_MODULE +$(OPEN_DRIVER) FT_Renderer_Class, ft_svg_renderer_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)ot-svg $(ECHO_DRIVER_DESC)OT-SVG glyph renderer module$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/svg/rules.mk b/vendor/freetype/src/svg/rules.mk new file mode 100644 index 00000000000..56276285e9c --- /dev/null +++ b/vendor/freetype/src/svg/rules.mk @@ -0,0 +1,70 @@ +# +# FreeType 2 SVG renderer module build rules +# + + +# Copyright (C) 2022-2024 by +# David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. +# +# 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. + + +# SVG renderer driver directory +# +SVG_DIR := $(SRC_DIR)/svg + +# compilation flags for the driver +# +SVG_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(SVG_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + +# SVG renderer sources (i.e., C files) +# +SVG_DRV_SRC := $(SVG_DIR)/ftsvg.c + + +# SVG renderer headers +# +SVG_DRV_H := $(SVG_DIR)/ftsvg.h \ + $(SVG_DIR)/svgtypes.h + + +# SVG renderer object(s) +# +# SVG_DRV_OBJ_M is used during `multi' builds. +# SVG_DRV_OBJ_S is used during `single' builds. +# +SVG_DRV_OBJ_M := $(SVG_DRV_SRC:$(SVG_DIR)/%.c=$(OBJ_DIR)/%.$O) +SVG_DRV_OBJ_S := $(OBJ_DIR)/svg.$O + +# SVG renderer source file for single build +# +SVG_DRV_SRC_S := $(SVG_DIR)/svg.c + + +# SVG renderer - single object +# +$(SVG_DRV_OBJ_S): $(SVG_DRV_SRC_S) $(SVG_DRV_SRC) \ + $(FREETYPE_H) $(SVG_DRV_H) + $(SVG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SVG_DRV_SRC_S)) + + +# SVG renderer - multiple objects +# +$(OBJ_DIR)/%.$O: $(SVG_DIR)/%.c $(FREETYPE_H) $(SVG_DRV_H) + $(SVG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(SVG_DRV_OBJ_S) +DRV_OBJS_M += $(SVG_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/tools/afblue.pl b/vendor/freetype/src/tools/afblue.pl new file mode 100644 index 00000000000..1341c7734e8 --- /dev/null +++ b/vendor/freetype/src/tools/afblue.pl @@ -0,0 +1,551 @@ +#! /usr/bin/perl -w +# -*- Perl -*- +# +# afblue.pl +# +# Process a blue zone character data file. +# +# Copyright (C) 2013-2024 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. + +use strict; +use warnings; +use English '-no_match_vars'; +use open ':std', ':encoding(UTF-8)'; + + +my $prog = $PROGRAM_NAME; +$prog =~ s| .* / ||x; # Remove path. + +die "usage: $prog datafile < infile > outfile\n" if $#ARGV != 0; + + +my $datafile = $ARGV[0]; + +my %diversions; # The extracted and massaged data from `datafile'. +my @else_stack; # Booleans to track else-clauses. +my @name_stack; # Stack of integers used for names of aux. variables. + +my $curr_enum; # Name of the current enumeration. +my $curr_array; # Name of the current array. +my $curr_max; # Name of the current maximum value. + +my $curr_enum_element; # Name of the current enumeration element. +my $curr_offset; # The offset relative to current aux. variable. +my $curr_elem_size; # The number of non-space characters in the current string or + # the number of elements in the current block. + +my $have_sections = 0; # Boolean; set if start of a section has been seen. +my $have_strings; # Boolean; set if current section contains strings. +my $have_blocks; # Boolean; set if current section contains blocks. + +my $have_enum_element; # Boolean; set if we have an enumeration element. +my $in_string; # Boolean; set if a string has been parsed. + +my $num_sections = 0; # Number of sections seen so far. + +my $last_aux; # Name of last auxiliary variable. + + +# Regular expressions. + +# [] [] ':' [] '\n' +my $section_re = qr/ ^ \s* (\S+) \s+ (\S+) \s+ (\S+) \s* : \s* $ /x; + +# [] [] '\n' +my $enum_element_re = qr/ ^ \s* ( [A-Za-z0-9_]+ ) \s* $ /x; + +# '#' '\n' +my $preprocessor_re = qr/ ^ \# /x; + +# [] '/' '/' '\n' +my $comment_re = qr| ^ \s* // |x; + +# empty line +my $whitespace_only_re = qr/ ^ \s* $ /x; + +# [] '"' '"' [] '\n' ( doesn't contain newlines) +my $string_re = qr/ ^ \s* + " ( (?> (?: (?> [^"\\]+ ) | \\. )* ) ) " + \s* $ /x; + +# [] '{' '}' [] '\n' ( can contain newlines) +my $block_start_re = qr/ ^ \s* \{ /x; + +# We need the capturing group for `split' to make it return the separator +# tokens (i.e., the opening and closing brace) also. +my $brace_re = qr/ ( [{}] ) /x; + + +sub Warn +{ + my $message = shift; + warn "$datafile:$INPUT_LINE_NUMBER: warning: $message\n"; +} + + +sub Die +{ + my $message = shift; + die "$datafile:$INPUT_LINE_NUMBER: error: $message\n"; +} + + +my $warned_before = 0; + +sub warn_before +{ + Warn("data before first section gets ignored") unless $warned_before; + $warned_before = 1; +} + + +sub strip_newline +{ + chomp; + s/ \x0D $ //x; +} + + +sub end_curr_string +{ + # Append final null byte to string. + if ($have_strings) + { + push @{$diversions{$curr_array}}, " '\\0',\n" if $in_string; + + $curr_offset++; + $in_string = 0; + } +} + + +sub update_max_elem_size +{ + if ($curr_elem_size) + { + my $max = pop @{$diversions{$curr_max}}; + $max = $curr_elem_size if $curr_elem_size > $max; + push @{$diversions{$curr_max}}, $max; + } +} + + +sub convert_non_ascii_char +{ + # A UTF-8 character outside of the printable ASCII range, with possibly a + # leading backslash character. + my $s = shift; + + # Here we count characters, not bytes. + $curr_elem_size += length $s; + + utf8::encode($s); + $s = uc unpack 'H*', $s; + + $curr_offset += $s =~ s/\G(..)/'\\x$1', /sg; + + return $s; +} + + +sub convert_ascii_chars +{ + # A series of ASCII characters in the printable range. + my $s = shift; + + # We reduce multiple space characters to a single one. + $s =~ s/ +/ /g; + + # Count all non-space characters. Note that `()' applies a list context + # to the capture that is used to count the elements. + $curr_elem_size += () = $s =~ /[^ ]/g; + + $curr_offset += $s =~ s/\G(.)/'$1', /g; + + return $s; +} + + +sub convert_literal +{ + my $s = shift; + my $orig = $s; + + # ASCII printables and space + my $safe_re = '\x20-\x7E'; + # ASCII printables and space, no backslash + my $safe_no_backslash_re = '\x20-\x5B\x5D-\x7E'; + + $s =~ s{ + (?: \\? ( [^$safe_re] ) + | ( (?: [$safe_no_backslash_re] + | \\ [$safe_re] )+ ) ) + } + { + defined($1) ? convert_non_ascii_char($1) + : convert_ascii_chars($2) + }egx; + + # We assume that `$orig' doesn't contain `*/' + return $s . " /* $orig */"; +} + + +sub aux_name +{ + return "af_blue_" . $num_sections. "_" . join('_', @name_stack); +} + + +sub aux_name_next +{ + $name_stack[$#name_stack]++; + my $name = aux_name(); + $name_stack[$#name_stack]--; + + return $name; +} + + +sub enum_val_string +{ + # Build string that holds code to save the current offset in an + # enumeration element. + my $aux = shift; + + my $add = ($last_aux eq "af_blue_" . $num_sections . "_0" ) + ? "" + : "$last_aux + "; + + return " $aux = $add$curr_offset,\n"; +} + + + +# Process data file. + +open(DATA, $datafile) || die "$prog: can't open \`$datafile': $OS_ERROR\n"; + +while () +{ + strip_newline(); + + next if /$comment_re/; + next if /$whitespace_only_re/; + + if (/$section_re/) + { + Warn("previous section is empty") if ($have_sections + && !$have_strings + && !$have_blocks); + + end_curr_string(); + update_max_elem_size(); + + # Save captured groups from `section_re'. + $curr_enum = $1; + $curr_array = $2; + $curr_max = $3; + + $curr_enum_element = ""; + $curr_offset = 0; + + Warn("overwriting already defined enumeration \`$curr_enum'") + if exists($diversions{$curr_enum}); + Warn("overwriting already defined array \`$curr_array'") + if exists($diversions{$curr_array}); + Warn("overwriting already defined maximum value \`$curr_max'") + if exists($diversions{$curr_max}); + + $diversions{$curr_enum} = []; + $diversions{$curr_array} = []; + $diversions{$curr_max} = []; + + push @{$diversions{$curr_max}}, 0; + + @name_stack = (); + push @name_stack, 0; + + $have_sections = 1; + $have_strings = 0; + $have_blocks = 0; + + $have_enum_element = 0; + $in_string = 0; + + $num_sections++; + $curr_elem_size = 0; + + $last_aux = aux_name(); + + next; + } + + if (/$preprocessor_re/) + { + if ($have_sections) + { + # Having preprocessor conditionals complicates the computation of + # correct offset values. We have to introduce auxiliary enumeration + # elements with the name `af_blue____...' that store + # offsets to be used in conditional clauses. `' is the number of + # sections seen so far, `' is the number of `#if' and `#endif' + # conditionals seen so far in the topmost level, `' the number of + # `#if' and `#endif' conditionals seen so far one level deeper, etc. + # As a consequence, uneven values are used within a clause, and even + # values after a clause, since the C standard doesn't allow the + # redefinition of an enumeration value. For example, the name + # `af_blue_5_1_6' is used to construct enumeration values in the fifth + # section after the third (second-level) if-clause within the first + # (top-level) if-clause. After the first top-level clause has + # finished, `af_blue_5_2' is used. The current offset is then + # relative to the value stored in the current auxiliary element. + + if (/ ^ \# \s* if /x) + { + push @else_stack, 0; + + $name_stack[$#name_stack]++; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ \# \s* elif /x) + { + Die("unbalanced #elif") unless @else_stack; + + pop @name_stack; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ \# \s* else /x) + { + my $prev_else = pop @else_stack; + Die("unbalanced #else") unless defined($prev_else); + Die("#else already seen") if $prev_else; + push @else_stack, 1; + + pop @name_stack; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ (\# \s*) endif /x) + { + my $prev_else = pop @else_stack; + Die("unbalanced #endif") unless defined($prev_else); + + pop @name_stack; + + # If there is no else-clause for an if-clause, we add one. This is + # necessary to have correct offsets. + if (!$prev_else) + { + # Use amount of whitespace from `endif'. + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()) + . $1 . "else\n"; + $last_aux = aux_name(); + + $curr_offset = 0; + } + + $name_stack[$#name_stack]++; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()); + $last_aux = aux_name(); + + $curr_offset = 0; + } + + # Handle (probably continued) preprocessor lines. + CONTINUED_LOOP: + { + do + { + strip_newline(); + + push @{$diversions{$curr_enum}}, $ARG . "\n"; + push @{$diversions{$curr_array}}, $ARG . "\n"; + + last CONTINUED_LOOP unless / \\ $ /x; + + } while (); + } + } + else + { + warn_before(); + } + + next; + } + + if (/$enum_element_re/) + { + end_curr_string(); + update_max_elem_size(); + + $curr_enum_element = $1; + $have_enum_element = 1; + $curr_elem_size = 0; + + next; + } + + if (/$string_re/) + { + if ($have_sections) + { + Die("strings and blocks can't be mixed in a section") if $have_blocks; + + # Save captured group from `string_re'. + my $string = $1; + + if ($have_enum_element) + { + push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element); + $have_enum_element = 0; + } + + $string = convert_literal($string); + + push @{$diversions{$curr_array}}, " $string\n"; + + $have_strings = 1; + $in_string = 1; + } + else + { + warn_before(); + } + + next; + } + + if (/$block_start_re/) + { + if ($have_sections) + { + Die("strings and blocks can't be mixed in a section") if $have_strings; + + my $depth = 0; + my $block = ""; + my $block_end = 0; + + # Count braces while getting the block. + BRACE_LOOP: + { + do + { + strip_newline(); + + foreach my $substring (split(/$brace_re/)) + { + if ($block_end) + { + Die("invalid data after last matching closing brace") + if $substring !~ /$whitespace_only_re/; + } + + $block .= $substring; + + if ($substring eq '{') + { + $depth++; + } + elsif ($substring eq '}') + { + $depth--; + + $block_end = 1 if $depth == 0; + } + } + + # If we are here, we have run out of substrings, so get next line + # or exit. + last BRACE_LOOP if $block_end; + + $block .= "\n"; + + } while (); + } + + if ($have_enum_element) + { + push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element); + $have_enum_element = 0; + } + + push @{$diversions{$curr_array}}, $block . ",\n"; + + $curr_offset++; + $curr_elem_size++; + + $have_blocks = 1; + } + else + { + warn_before(); + } + + next; + } + + # Garbage. We weren't able to parse the data. + Die("syntax error"); +} + +# Finalize data. +end_curr_string(); +update_max_elem_size(); + + +# Filter stdin to stdout, replacing `@...@' templates. + +sub emit_diversion +{ + my $diversion_name = shift; + return (exists($diversions{$1})) ? "@{$diversions{$1}}" + : "@" . $diversion_name . "@"; +} + + +$LIST_SEPARATOR = ''; + +my $s1 = "This file has been generated by the Perl script \`$prog',"; +my $s1len = length $s1; +my $s2 = "using data from file \`$datafile'."; +my $s2len = length $s2; +my $slen = ($s1len > $s2len) ? $s1len : $s2len; + +print "/* " . $s1 . " " x ($slen - $s1len) . " */\n" + . "/* " . $s2 . " " x ($slen - $s2len) . " */\n" + . "\n"; + +while () +{ + s/ @ ( [A-Za-z0-9_]+? ) @ / emit_diversion($1) /egx; + print; +} + +# EOF diff --git a/vendor/freetype/src/tools/chktrcmp.py b/vendor/freetype/src/tools/chktrcmp.py new file mode 100644 index 00000000000..d072a87866c --- /dev/null +++ b/vendor/freetype/src/tools/chktrcmp.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +# +# Check trace components in FreeType 2 source. +# Author: suzuki toshiya, 2009, 2013, 2020 +# +# This code is explicitly into the public domain. + +import sys +import os +import re + +SRC_FILE_LIST = [] +USED_COMPONENT = {} +KNOWN_COMPONENT = {} + +SRC_FILE_DIRS = ["src"] +TRACE_DEF_FILES = ["include/freetype/internal/fttrace.h"] + + +def usage(): + print("Usage: %s [option]" % sys.argv[0]) + print("Search used-but-defined and defined-but-not-used trace_XXX macros") + print("") + print(" --help:") + print(" Show this help") + print("") + print(" --src-dirs=dir1:dir2:...") + print(" Specify the directories of C source files to be checked") + print(" Default is %s" % ":".join(SRC_FILE_DIRS)) + print("") + print(" --def-files=file1:file2:...") + print(" Specify the header files including FT_TRACE_DEF()") + print(" Default is %s" % ":".join(TRACE_DEF_FILES)) + print("") + + +# -------------------------------------------------------------- +# Parse command line options +# +for i in range(1, len(sys.argv)): + if sys.argv[i].startswith("--help"): + usage() + exit(0) + if sys.argv[i].startswith("--src-dirs="): + SRC_FILE_DIRS = sys.argv[i].replace("--src-dirs=", "", 1).split(":") + elif sys.argv[i].startswith("--def-files="): + TRACE_DEF_FILES = sys.argv[i].replace("--def-files=", "", 1).split(":") + +# -------------------------------------------------------------- +# Scan C source and header files using trace macros. +# + +c_pathname_pat = re.compile('^.*\.[ch]$', re.IGNORECASE) +trace_use_pat = re.compile('^[ \t]*#define[ \t]+FT_COMPONENT[ \t]+') + +for d in SRC_FILE_DIRS: + for (p, dlst, flst) in os.walk(d): + for f in flst: + if c_pathname_pat.match(f) is not None: + src_pathname = os.path.join(p, f) + + line_num = 0 + for src_line in open(src_pathname, 'r'): + line_num = line_num + 1 + src_line = src_line.strip() + if trace_use_pat.match(src_line) is not None: + component_name = trace_use_pat.sub('', src_line) + if component_name in USED_COMPONENT: + USED_COMPONENT[component_name]\ + .append("%s:%d" % (src_pathname, line_num)) + else: + USED_COMPONENT[component_name] =\ + ["%s:%d" % (src_pathname, line_num)] + +# -------------------------------------------------------------- +# Scan header file(s) defining trace macros. +# + +trace_def_pat_opn = re.compile('^.*FT_TRACE_DEF[ \t]*\([ \t]*') +trace_def_pat_cls = re.compile('[ \t\)].*$') + +for f in TRACE_DEF_FILES: + line_num = 0 + for hdr_line in open(f, 'r'): + line_num = line_num + 1 + hdr_line = hdr_line.strip() + if trace_def_pat_opn.match(hdr_line) is not None: + component_name = trace_def_pat_opn.sub('', hdr_line) + component_name = trace_def_pat_cls.sub('', component_name) + if component_name in KNOWN_COMPONENT: + print("trace component %s is defined twice," + " see %s and fttrace.h:%d" % + (component_name, KNOWN_COMPONENT[component_name], + line_num)) + else: + KNOWN_COMPONENT[component_name] =\ + "%s:%d" % (os.path.basename(f), line_num) + +# -------------------------------------------------------------- +# Compare the used and defined trace macros. +# + +print("# Trace component used in the implementations but not defined in " + "fttrace.h.") +cmpnt = list(USED_COMPONENT.keys()) +cmpnt.sort() +for c in cmpnt: + if c not in KNOWN_COMPONENT: + print("Trace component %s (used in %s) is not defined." % + (c, ", ".join(USED_COMPONENT[c]))) + +print("# Trace component is defined but not used in the implementations.") +cmpnt = list(KNOWN_COMPONENT.keys()) +cmpnt.sort() +for c in cmpnt: + if c not in USED_COMPONENT: + if c != "any": + print("Trace component %s (defined in %s) is not used." % + (c, KNOWN_COMPONENT[c])) diff --git a/vendor/freetype/src/tools/cordic.py b/vendor/freetype/src/tools/cordic.py new file mode 100644 index 00000000000..65114298897 --- /dev/null +++ b/vendor/freetype/src/tools/cordic.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# compute arctangent table for CORDIC computations in fttrigon.c +import math + +# units = 64*65536.0 # don't change !! +units = 180 * 2 ** 16 +scale = units / math.pi +shrink = 1.0 +angles2 = [] + +print("") +print("table of arctan( 1/2^n ) for PI = " + repr(units / 65536.0) + " units") + +for n in range(1, 32): + + x = 0.5 ** n # tangent value + + angle = math.atan(x) # arctangent + angle2 = round(angle * scale) # arctangent in FT_Angle units + + if angle2 <= 0: + break + + angles2.append(repr(int(angle2))) + shrink /= math.sqrt(1 + x * x) + +print(", ".join(angles2)) +print("shrink factor = " + repr(shrink)) +print("shrink factor 2 = " + repr(int(shrink * (2 ** 32)))) +print("expansion factor = " + repr(1 / shrink)) +print("") diff --git a/vendor/freetype/src/tools/ftrandom/README b/vendor/freetype/src/tools/ftrandom/README new file mode 100644 index 00000000000..7c610864b6a --- /dev/null +++ b/vendor/freetype/src/tools/ftrandom/README @@ -0,0 +1,69 @@ +ftrandom +======== + +This program expects a set of directories containing good fonts, and a set +of extensions of fonts to be tested. It will randomly pick a font, copy it, +introduce an error and then test it. + +The FreeType tests are quite basic; for each erroneous font ftrandom + + . forks off a new tester, + . initializes the library, + . opens each font in the file, + . loads each glyph, + . optionally reviews the contours of the glyph, + . optionally rasterizes the glyph, and + . closes the face. + +If a tester takes longer than 20 seconds, ftrandom saves the erroneous font +and continues. If the tester exits normally or with an error, then the +superstructure removes the test font and continues. + + +Command line options +-------------------- + + --all Test every font in the directory(ies) no matter + what its extension. + --check-outlines Call `FT_Outline_Decompose' on each glyph. + --dir Append to the list of directories to search + for good fonts. No recursive search. + --error-count Introduce single-byte errors into the + erroneous fonts (default: 1). + --error-fraction Multiply the file size of the font by and + introduce that many errors into the erroneous + font file. should be in the range [0;1] + (default: 0.0). + --ext Add to the set of font types tested. + --help Print out this list of options. + --nohints Specify FT_LOAD_NO_HINTING when loading glyphs. + --rasterize Call `FT_Render_Glyph' as well as loading it. + --result This is the directory in which test files are + placed. + --test Run a single test on a pre-generated testcase. + This is done in the current process so it can be + debugged more easily. + +The default font extensions tested by ftrandom are + + .ttf .otf .ttc .cid .pfb .pfa .bdf .pcf .pfr .fon .otb .cff + +The default font directory is controlled by the macro `GOOD_FONTS_DIR' in +the source code (and can be thus specified during compilation); its default +value is + + /usr/local/share/fonts + +The default result directory is `results' (in the current directory). + + +Compilation +----------- + +Two possible solutions. + +. Run ftrandom within a debugging tool like `valgrind' to catch various + memory issues. + +. Compile FreeType with sanitizer flags as provided by gcc or clang, for + example, then link it with ftrandom. diff --git a/vendor/freetype/src/tools/glnames.py b/vendor/freetype/src/tools/glnames.py new file mode 100644 index 00000000000..0b6d82474fc --- /dev/null +++ b/vendor/freetype/src/tools/glnames.py @@ -0,0 +1,5533 @@ +#!/usr/bin/env python3 + +# +# FreeType 2 glyph name builder +# +# Copyright (C) 1996-2024 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. + + +""" +usage: %s + + This python script generates the glyph names tables defined in the + `psnames' module. + + Its single argument is the name of the header file to be created. +""" + +import os.path +import struct +import sys + +# This table lists the glyphs according to the Macintosh specification. +# It is used by the TrueType Postscript names table. +# +# See +# +# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html +# +# for the official list. +# +mac_standard_names = [ + # 0 + ".notdef", ".null", "nonmarkingreturn", "space", "exclam", + "quotedbl", "numbersign", "dollar", "percent", "ampersand", + + # 10 + "quotesingle", "parenleft", "parenright", "asterisk", "plus", + "comma", "hyphen", "period", "slash", "zero", + + # 20 + "one", "two", "three", "four", "five", + "six", "seven", "eight", "nine", "colon", + + # 30 + "semicolon", "less", "equal", "greater", "question", + "at", "A", "B", "C", "D", + + # 40 + "E", "F", "G", "H", "I", + "J", "K", "L", "M", "N", + + # 50 + "O", "P", "Q", "R", "S", + "T", "U", "V", "W", "X", + + # 60 + "Y", "Z", "bracketleft", "backslash", "bracketright", + "asciicircum", "underscore", "grave", "a", "b", + + # 70 + "c", "d", "e", "f", "g", + "h", "i", "j", "k", "l", + + # 80 + "m", "n", "o", "p", "q", + "r", "s", "t", "u", "v", + + # 90 + "w", "x", "y", "z", "braceleft", + "bar", "braceright", "asciitilde", "Adieresis", "Aring", + + # 100 + "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", + "aacute", "agrave", "acircumflex", "adieresis", "atilde", + + # 110 + "aring", "ccedilla", "eacute", "egrave", "ecircumflex", + "edieresis", "iacute", "igrave", "icircumflex", "idieresis", + + # 120 + "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", + "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", + + # 130 + "dagger", "degree", "cent", "sterling", "section", + "bullet", "paragraph", "germandbls", "registered", "copyright", + + # 140 + "trademark", "acute", "dieresis", "notequal", "AE", + "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", + + # 150 + "yen", "mu", "partialdiff", "summation", "product", + "pi", "integral", "ordfeminine", "ordmasculine", "Omega", + + # 160 + "ae", "oslash", "questiondown", "exclamdown", "logicalnot", + "radical", "florin", "approxequal", "Delta", "guillemotleft", + + # 170 + "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", + "Otilde", "OE", "oe", "endash", "emdash", + + # 180 + "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", + "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", + + # 190 + "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", + "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", + "Acircumflex", + + # 200 + "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", + "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", + + # 210 + "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", + "dotlessi", "circumflex", "tilde", "macron", "breve", + + # 220 + "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", + "caron", "Lslash", "lslash", "Scaron", "scaron", + + # 230 + "Zcaron", "zcaron", "brokenbar", "Eth", "eth", + "Yacute", "yacute", "Thorn", "thorn", "minus", + + # 240 + "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", + "onequarter", "threequarters", "franc", "Gbreve", "gbreve", + + # 250 + "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", + "Ccaron", "ccaron", "dcroat" +] + +# The list of standard `SID' glyph names. For the official list, +# see Annex A of document at +# +# https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf +# +sid_standard_names = [ + # 0 + ".notdef", "space", "exclam", "quotedbl", "numbersign", + "dollar", "percent", "ampersand", "quoteright", "parenleft", + + # 10 + "parenright", "asterisk", "plus", "comma", "hyphen", + "period", "slash", "zero", "one", "two", + + # 20 + "three", "four", "five", "six", "seven", + "eight", "nine", "colon", "semicolon", "less", + + # 30 + "equal", "greater", "question", "at", "A", + "B", "C", "D", "E", "F", + + # 40 + "G", "H", "I", "J", "K", + "L", "M", "N", "O", "P", + + # 50 + "Q", "R", "S", "T", "U", + "V", "W", "X", "Y", "Z", + + # 60 + "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", + "quoteleft", "a", "b", "c", "d", + + # 70 + "e", "f", "g", "h", "i", + "j", "k", "l", "m", "n", + + # 80 + "o", "p", "q", "r", "s", + "t", "u", "v", "w", "x", + + # 90 + "y", "z", "braceleft", "bar", "braceright", + "asciitilde", "exclamdown", "cent", "sterling", "fraction", + + # 100 + "yen", "florin", "section", "currency", "quotesingle", + "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", + + # 110 + "fl", "endash", "dagger", "daggerdbl", "periodcentered", + "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", + + # 120 + "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", + "acute", "circumflex", "tilde", "macron", "breve", + + # 130 + "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", + "ogonek", "caron", "emdash", "AE", "ordfeminine", + + # 140 + "Lslash", "Oslash", "OE", "ordmasculine", "ae", + "dotlessi", "lslash", "oslash", "oe", "germandbls", + + # 150 + "onesuperior", "logicalnot", "mu", "trademark", "Eth", + "onehalf", "plusminus", "Thorn", "onequarter", "divide", + + # 160 + "brokenbar", "degree", "thorn", "threequarters", "twosuperior", + "registered", "minus", "eth", "multiply", "threesuperior", + + # 170 + "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", + "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", + + # 180 + "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", + "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", + + # 190 + "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", + "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", + + # 200 + "aacute", "acircumflex", "adieresis", "agrave", "aring", + "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", + + # 210 + "egrave", "iacute", "icircumflex", "idieresis", "igrave", + "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", + + # 220 + "otilde", "scaron", "uacute", "ucircumflex", "udieresis", + "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", + + # 230 + "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", + "Acutesmall", + "parenleftsuperior", "parenrightsuperior", "twodotenleader", + "onedotenleader", "zerooldstyle", + + # 240 + "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", + "commasuperior", + + # 250 + "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", + "bsuperior", + "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", + + # 260 + "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", + "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", + + # 270 + "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", + "Asmall", + "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", + + # 280 + "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", + "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", + + # 290 + "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", + "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", + + # 300 + "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", + "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", + "Dieresissmall", + + # 310 + "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", + "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", + "questiondownsmall", + + # 320 + "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", + "twothirds", "zerosuperior", "foursuperior", "fivesuperior", + "sixsuperior", + + # 330 + "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", + "oneinferior", + "twoinferior", "threeinferior", "fourinferior", "fiveinferior", + "sixinferior", + + # 340 + "seveninferior", "eightinferior", "nineinferior", "centinferior", + "dollarinferior", + "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", + "Acircumflexsmall", + + # 350 + "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", + "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", + "Igravesmall", + + # 360 + "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", + "Ntildesmall", + "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", + "Odieresissmall", + + # 370 + "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", + "001.000", + + # 380 + "001.001", "001.002", "001.003", "Black", "Bold", + "Book", "Light", "Medium", "Regular", "Roman", + + # 390 + "Semibold" +] + +# This table maps character codes of the Adobe Standard Type 1 +# encoding to glyph indices in the sid_standard_names table. +# +t1_standard_encoding = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, + 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, + 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, + + 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, + 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, + 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, + + 148, 149, 0, 0, 0, 0 +] + +# This table maps character codes of the Adobe Expert Type 1 +# encoding to glyph indices in the sid_standard_names table. +# +t1_expert_encoding = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 229, 230, 0, 231, 232, 233, 234, + 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, + + 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, + 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, + 0, 0, 0, 258, 0, 0, 259, 260, 261, 262, + 0, 0, 263, 264, 265, 0, 266, 109, 110, 267, + 268, 269, 0, 270, 271, 272, 273, 274, 275, 276, + + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 304, 305, 306, 0, 0, 307, 308, 309, 310, + 311, 0, 312, 0, 0, 313, 0, 0, 314, 315, + 0, 0, 316, 317, 318, 0, 0, 0, 158, 155, + 163, 319, 320, 321, 322, 323, 324, 325, 0, 0, + + 326, 150, 164, 169, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + + 373, 374, 375, 376, 377, 378 +] + +# This data has been taken literally from the files `glyphlist.txt' +# and `zapfdingbats.txt' version 2.0, Sept 2002. It is available from +# +# https://github.com/adobe-type-tools/agl-aglfn +# +adobe_glyph_list = """\ +A;0041 +AE;00C6 +AEacute;01FC +AEmacron;01E2 +AEsmall;F7E6 +Aacute;00C1 +Aacutesmall;F7E1 +Abreve;0102 +Abreveacute;1EAE +Abrevecyrillic;04D0 +Abrevedotbelow;1EB6 +Abrevegrave;1EB0 +Abrevehookabove;1EB2 +Abrevetilde;1EB4 +Acaron;01CD +Acircle;24B6 +Acircumflex;00C2 +Acircumflexacute;1EA4 +Acircumflexdotbelow;1EAC +Acircumflexgrave;1EA6 +Acircumflexhookabove;1EA8 +Acircumflexsmall;F7E2 +Acircumflextilde;1EAA +Acute;F6C9 +Acutesmall;F7B4 +Acyrillic;0410 +Adblgrave;0200 +Adieresis;00C4 +Adieresiscyrillic;04D2 +Adieresismacron;01DE +Adieresissmall;F7E4 +Adotbelow;1EA0 +Adotmacron;01E0 +Agrave;00C0 +Agravesmall;F7E0 +Ahookabove;1EA2 +Aiecyrillic;04D4 +Ainvertedbreve;0202 +Alpha;0391 +Alphatonos;0386 +Amacron;0100 +Amonospace;FF21 +Aogonek;0104 +Aring;00C5 +Aringacute;01FA +Aringbelow;1E00 +Aringsmall;F7E5 +Asmall;F761 +Atilde;00C3 +Atildesmall;F7E3 +Aybarmenian;0531 +B;0042 +Bcircle;24B7 +Bdotaccent;1E02 +Bdotbelow;1E04 +Becyrillic;0411 +Benarmenian;0532 +Beta;0392 +Bhook;0181 +Blinebelow;1E06 +Bmonospace;FF22 +Brevesmall;F6F4 +Bsmall;F762 +Btopbar;0182 +C;0043 +Caarmenian;053E +Cacute;0106 +Caron;F6CA +Caronsmall;F6F5 +Ccaron;010C +Ccedilla;00C7 +Ccedillaacute;1E08 +Ccedillasmall;F7E7 +Ccircle;24B8 +Ccircumflex;0108 +Cdot;010A +Cdotaccent;010A +Cedillasmall;F7B8 +Chaarmenian;0549 +Cheabkhasiancyrillic;04BC +Checyrillic;0427 +Chedescenderabkhasiancyrillic;04BE +Chedescendercyrillic;04B6 +Chedieresiscyrillic;04F4 +Cheharmenian;0543 +Chekhakassiancyrillic;04CB +Cheverticalstrokecyrillic;04B8 +Chi;03A7 +Chook;0187 +Circumflexsmall;F6F6 +Cmonospace;FF23 +Coarmenian;0551 +Csmall;F763 +D;0044 +DZ;01F1 +DZcaron;01C4 +Daarmenian;0534 +Dafrican;0189 +Dcaron;010E +Dcedilla;1E10 +Dcircle;24B9 +Dcircumflexbelow;1E12 +Dcroat;0110 +Ddotaccent;1E0A +Ddotbelow;1E0C +Decyrillic;0414 +Deicoptic;03EE +Delta;2206 +Deltagreek;0394 +Dhook;018A +Dieresis;F6CB +DieresisAcute;F6CC +DieresisGrave;F6CD +Dieresissmall;F7A8 +Digammagreek;03DC +Djecyrillic;0402 +Dlinebelow;1E0E +Dmonospace;FF24 +Dotaccentsmall;F6F7 +Dslash;0110 +Dsmall;F764 +Dtopbar;018B +Dz;01F2 +Dzcaron;01C5 +Dzeabkhasiancyrillic;04E0 +Dzecyrillic;0405 +Dzhecyrillic;040F +E;0045 +Eacute;00C9 +Eacutesmall;F7E9 +Ebreve;0114 +Ecaron;011A +Ecedillabreve;1E1C +Echarmenian;0535 +Ecircle;24BA +Ecircumflex;00CA +Ecircumflexacute;1EBE +Ecircumflexbelow;1E18 +Ecircumflexdotbelow;1EC6 +Ecircumflexgrave;1EC0 +Ecircumflexhookabove;1EC2 +Ecircumflexsmall;F7EA +Ecircumflextilde;1EC4 +Ecyrillic;0404 +Edblgrave;0204 +Edieresis;00CB +Edieresissmall;F7EB +Edot;0116 +Edotaccent;0116 +Edotbelow;1EB8 +Efcyrillic;0424 +Egrave;00C8 +Egravesmall;F7E8 +Eharmenian;0537 +Ehookabove;1EBA +Eightroman;2167 +Einvertedbreve;0206 +Eiotifiedcyrillic;0464 +Elcyrillic;041B +Elevenroman;216A +Emacron;0112 +Emacronacute;1E16 +Emacrongrave;1E14 +Emcyrillic;041C +Emonospace;FF25 +Encyrillic;041D +Endescendercyrillic;04A2 +Eng;014A +Enghecyrillic;04A4 +Enhookcyrillic;04C7 +Eogonek;0118 +Eopen;0190 +Epsilon;0395 +Epsilontonos;0388 +Ercyrillic;0420 +Ereversed;018E +Ereversedcyrillic;042D +Escyrillic;0421 +Esdescendercyrillic;04AA +Esh;01A9 +Esmall;F765 +Eta;0397 +Etarmenian;0538 +Etatonos;0389 +Eth;00D0 +Ethsmall;F7F0 +Etilde;1EBC +Etildebelow;1E1A +Euro;20AC +Ezh;01B7 +Ezhcaron;01EE +Ezhreversed;01B8 +F;0046 +Fcircle;24BB +Fdotaccent;1E1E +Feharmenian;0556 +Feicoptic;03E4 +Fhook;0191 +Fitacyrillic;0472 +Fiveroman;2164 +Fmonospace;FF26 +Fourroman;2163 +Fsmall;F766 +G;0047 +GBsquare;3387 +Gacute;01F4 +Gamma;0393 +Gammaafrican;0194 +Gangiacoptic;03EA +Gbreve;011E +Gcaron;01E6 +Gcedilla;0122 +Gcircle;24BC +Gcircumflex;011C +Gcommaaccent;0122 +Gdot;0120 +Gdotaccent;0120 +Gecyrillic;0413 +Ghadarmenian;0542 +Ghemiddlehookcyrillic;0494 +Ghestrokecyrillic;0492 +Gheupturncyrillic;0490 +Ghook;0193 +Gimarmenian;0533 +Gjecyrillic;0403 +Gmacron;1E20 +Gmonospace;FF27 +Grave;F6CE +Gravesmall;F760 +Gsmall;F767 +Gsmallhook;029B +Gstroke;01E4 +H;0048 +H18533;25CF +H18543;25AA +H18551;25AB +H22073;25A1 +HPsquare;33CB +Haabkhasiancyrillic;04A8 +Hadescendercyrillic;04B2 +Hardsigncyrillic;042A +Hbar;0126 +Hbrevebelow;1E2A +Hcedilla;1E28 +Hcircle;24BD +Hcircumflex;0124 +Hdieresis;1E26 +Hdotaccent;1E22 +Hdotbelow;1E24 +Hmonospace;FF28 +Hoarmenian;0540 +Horicoptic;03E8 +Hsmall;F768 +Hungarumlaut;F6CF +Hungarumlautsmall;F6F8 +Hzsquare;3390 +I;0049 +IAcyrillic;042F +IJ;0132 +IUcyrillic;042E +Iacute;00CD +Iacutesmall;F7ED +Ibreve;012C +Icaron;01CF +Icircle;24BE +Icircumflex;00CE +Icircumflexsmall;F7EE +Icyrillic;0406 +Idblgrave;0208 +Idieresis;00CF +Idieresisacute;1E2E +Idieresiscyrillic;04E4 +Idieresissmall;F7EF +Idot;0130 +Idotaccent;0130 +Idotbelow;1ECA +Iebrevecyrillic;04D6 +Iecyrillic;0415 +Ifraktur;2111 +Igrave;00CC +Igravesmall;F7EC +Ihookabove;1EC8 +Iicyrillic;0418 +Iinvertedbreve;020A +Iishortcyrillic;0419 +Imacron;012A +Imacroncyrillic;04E2 +Imonospace;FF29 +Iniarmenian;053B +Iocyrillic;0401 +Iogonek;012E +Iota;0399 +Iotaafrican;0196 +Iotadieresis;03AA +Iotatonos;038A +Ismall;F769 +Istroke;0197 +Itilde;0128 +Itildebelow;1E2C +Izhitsacyrillic;0474 +Izhitsadblgravecyrillic;0476 +J;004A +Jaarmenian;0541 +Jcircle;24BF +Jcircumflex;0134 +Jecyrillic;0408 +Jheharmenian;054B +Jmonospace;FF2A +Jsmall;F76A +K;004B +KBsquare;3385 +KKsquare;33CD +Kabashkircyrillic;04A0 +Kacute;1E30 +Kacyrillic;041A +Kadescendercyrillic;049A +Kahookcyrillic;04C3 +Kappa;039A +Kastrokecyrillic;049E +Kaverticalstrokecyrillic;049C +Kcaron;01E8 +Kcedilla;0136 +Kcircle;24C0 +Kcommaaccent;0136 +Kdotbelow;1E32 +Keharmenian;0554 +Kenarmenian;053F +Khacyrillic;0425 +Kheicoptic;03E6 +Khook;0198 +Kjecyrillic;040C +Klinebelow;1E34 +Kmonospace;FF2B +Koppacyrillic;0480 +Koppagreek;03DE +Ksicyrillic;046E +Ksmall;F76B +L;004C +LJ;01C7 +LL;F6BF +Lacute;0139 +Lambda;039B +Lcaron;013D +Lcedilla;013B +Lcircle;24C1 +Lcircumflexbelow;1E3C +Lcommaaccent;013B +Ldot;013F +Ldotaccent;013F +Ldotbelow;1E36 +Ldotbelowmacron;1E38 +Liwnarmenian;053C +Lj;01C8 +Ljecyrillic;0409 +Llinebelow;1E3A +Lmonospace;FF2C +Lslash;0141 +Lslashsmall;F6F9 +Lsmall;F76C +M;004D +MBsquare;3386 +Macron;F6D0 +Macronsmall;F7AF +Macute;1E3E +Mcircle;24C2 +Mdotaccent;1E40 +Mdotbelow;1E42 +Menarmenian;0544 +Mmonospace;FF2D +Msmall;F76D +Mturned;019C +Mu;039C +N;004E +NJ;01CA +Nacute;0143 +Ncaron;0147 +Ncedilla;0145 +Ncircle;24C3 +Ncircumflexbelow;1E4A +Ncommaaccent;0145 +Ndotaccent;1E44 +Ndotbelow;1E46 +Nhookleft;019D +Nineroman;2168 +Nj;01CB +Njecyrillic;040A +Nlinebelow;1E48 +Nmonospace;FF2E +Nowarmenian;0546 +Nsmall;F76E +Ntilde;00D1 +Ntildesmall;F7F1 +Nu;039D +O;004F +OE;0152 +OEsmall;F6FA +Oacute;00D3 +Oacutesmall;F7F3 +Obarredcyrillic;04E8 +Obarreddieresiscyrillic;04EA +Obreve;014E +Ocaron;01D1 +Ocenteredtilde;019F +Ocircle;24C4 +Ocircumflex;00D4 +Ocircumflexacute;1ED0 +Ocircumflexdotbelow;1ED8 +Ocircumflexgrave;1ED2 +Ocircumflexhookabove;1ED4 +Ocircumflexsmall;F7F4 +Ocircumflextilde;1ED6 +Ocyrillic;041E +Odblacute;0150 +Odblgrave;020C +Odieresis;00D6 +Odieresiscyrillic;04E6 +Odieresissmall;F7F6 +Odotbelow;1ECC +Ogoneksmall;F6FB +Ograve;00D2 +Ogravesmall;F7F2 +Oharmenian;0555 +Ohm;2126 +Ohookabove;1ECE +Ohorn;01A0 +Ohornacute;1EDA +Ohorndotbelow;1EE2 +Ohorngrave;1EDC +Ohornhookabove;1EDE +Ohorntilde;1EE0 +Ohungarumlaut;0150 +Oi;01A2 +Oinvertedbreve;020E +Omacron;014C +Omacronacute;1E52 +Omacrongrave;1E50 +Omega;2126 +Omegacyrillic;0460 +Omegagreek;03A9 +Omegaroundcyrillic;047A +Omegatitlocyrillic;047C +Omegatonos;038F +Omicron;039F +Omicrontonos;038C +Omonospace;FF2F +Oneroman;2160 +Oogonek;01EA +Oogonekmacron;01EC +Oopen;0186 +Oslash;00D8 +Oslashacute;01FE +Oslashsmall;F7F8 +Osmall;F76F +Ostrokeacute;01FE +Otcyrillic;047E +Otilde;00D5 +Otildeacute;1E4C +Otildedieresis;1E4E +Otildesmall;F7F5 +P;0050 +Pacute;1E54 +Pcircle;24C5 +Pdotaccent;1E56 +Pecyrillic;041F +Peharmenian;054A +Pemiddlehookcyrillic;04A6 +Phi;03A6 +Phook;01A4 +Pi;03A0 +Piwrarmenian;0553 +Pmonospace;FF30 +Psi;03A8 +Psicyrillic;0470 +Psmall;F770 +Q;0051 +Qcircle;24C6 +Qmonospace;FF31 +Qsmall;F771 +R;0052 +Raarmenian;054C +Racute;0154 +Rcaron;0158 +Rcedilla;0156 +Rcircle;24C7 +Rcommaaccent;0156 +Rdblgrave;0210 +Rdotaccent;1E58 +Rdotbelow;1E5A +Rdotbelowmacron;1E5C +Reharmenian;0550 +Rfraktur;211C +Rho;03A1 +Ringsmall;F6FC +Rinvertedbreve;0212 +Rlinebelow;1E5E +Rmonospace;FF32 +Rsmall;F772 +Rsmallinverted;0281 +Rsmallinvertedsuperior;02B6 +S;0053 +SF010000;250C +SF020000;2514 +SF030000;2510 +SF040000;2518 +SF050000;253C +SF060000;252C +SF070000;2534 +SF080000;251C +SF090000;2524 +SF100000;2500 +SF110000;2502 +SF190000;2561 +SF200000;2562 +SF210000;2556 +SF220000;2555 +SF230000;2563 +SF240000;2551 +SF250000;2557 +SF260000;255D +SF270000;255C +SF280000;255B +SF360000;255E +SF370000;255F +SF380000;255A +SF390000;2554 +SF400000;2569 +SF410000;2566 +SF420000;2560 +SF430000;2550 +SF440000;256C +SF450000;2567 +SF460000;2568 +SF470000;2564 +SF480000;2565 +SF490000;2559 +SF500000;2558 +SF510000;2552 +SF520000;2553 +SF530000;256B +SF540000;256A +Sacute;015A +Sacutedotaccent;1E64 +Sampigreek;03E0 +Scaron;0160 +Scarondotaccent;1E66 +Scaronsmall;F6FD +Scedilla;015E +Schwa;018F +Schwacyrillic;04D8 +Schwadieresiscyrillic;04DA +Scircle;24C8 +Scircumflex;015C +Scommaaccent;0218 +Sdotaccent;1E60 +Sdotbelow;1E62 +Sdotbelowdotaccent;1E68 +Seharmenian;054D +Sevenroman;2166 +Shaarmenian;0547 +Shacyrillic;0428 +Shchacyrillic;0429 +Sheicoptic;03E2 +Shhacyrillic;04BA +Shimacoptic;03EC +Sigma;03A3 +Sixroman;2165 +Smonospace;FF33 +Softsigncyrillic;042C +Ssmall;F773 +Stigmagreek;03DA +T;0054 +Tau;03A4 +Tbar;0166 +Tcaron;0164 +Tcedilla;0162 +Tcircle;24C9 +Tcircumflexbelow;1E70 +Tcommaaccent;0162 +Tdotaccent;1E6A +Tdotbelow;1E6C +Tecyrillic;0422 +Tedescendercyrillic;04AC +Tenroman;2169 +Tetsecyrillic;04B4 +Theta;0398 +Thook;01AC +Thorn;00DE +Thornsmall;F7FE +Threeroman;2162 +Tildesmall;F6FE +Tiwnarmenian;054F +Tlinebelow;1E6E +Tmonospace;FF34 +Toarmenian;0539 +Tonefive;01BC +Tonesix;0184 +Tonetwo;01A7 +Tretroflexhook;01AE +Tsecyrillic;0426 +Tshecyrillic;040B +Tsmall;F774 +Twelveroman;216B +Tworoman;2161 +U;0055 +Uacute;00DA +Uacutesmall;F7FA +Ubreve;016C +Ucaron;01D3 +Ucircle;24CA +Ucircumflex;00DB +Ucircumflexbelow;1E76 +Ucircumflexsmall;F7FB +Ucyrillic;0423 +Udblacute;0170 +Udblgrave;0214 +Udieresis;00DC +Udieresisacute;01D7 +Udieresisbelow;1E72 +Udieresiscaron;01D9 +Udieresiscyrillic;04F0 +Udieresisgrave;01DB +Udieresismacron;01D5 +Udieresissmall;F7FC +Udotbelow;1EE4 +Ugrave;00D9 +Ugravesmall;F7F9 +Uhookabove;1EE6 +Uhorn;01AF +Uhornacute;1EE8 +Uhorndotbelow;1EF0 +Uhorngrave;1EEA +Uhornhookabove;1EEC +Uhorntilde;1EEE +Uhungarumlaut;0170 +Uhungarumlautcyrillic;04F2 +Uinvertedbreve;0216 +Ukcyrillic;0478 +Umacron;016A +Umacroncyrillic;04EE +Umacrondieresis;1E7A +Umonospace;FF35 +Uogonek;0172 +Upsilon;03A5 +Upsilon1;03D2 +Upsilonacutehooksymbolgreek;03D3 +Upsilonafrican;01B1 +Upsilondieresis;03AB +Upsilondieresishooksymbolgreek;03D4 +Upsilonhooksymbol;03D2 +Upsilontonos;038E +Uring;016E +Ushortcyrillic;040E +Usmall;F775 +Ustraightcyrillic;04AE +Ustraightstrokecyrillic;04B0 +Utilde;0168 +Utildeacute;1E78 +Utildebelow;1E74 +V;0056 +Vcircle;24CB +Vdotbelow;1E7E +Vecyrillic;0412 +Vewarmenian;054E +Vhook;01B2 +Vmonospace;FF36 +Voarmenian;0548 +Vsmall;F776 +Vtilde;1E7C +W;0057 +Wacute;1E82 +Wcircle;24CC +Wcircumflex;0174 +Wdieresis;1E84 +Wdotaccent;1E86 +Wdotbelow;1E88 +Wgrave;1E80 +Wmonospace;FF37 +Wsmall;F777 +X;0058 +Xcircle;24CD +Xdieresis;1E8C +Xdotaccent;1E8A +Xeharmenian;053D +Xi;039E +Xmonospace;FF38 +Xsmall;F778 +Y;0059 +Yacute;00DD +Yacutesmall;F7FD +Yatcyrillic;0462 +Ycircle;24CE +Ycircumflex;0176 +Ydieresis;0178 +Ydieresissmall;F7FF +Ydotaccent;1E8E +Ydotbelow;1EF4 +Yericyrillic;042B +Yerudieresiscyrillic;04F8 +Ygrave;1EF2 +Yhook;01B3 +Yhookabove;1EF6 +Yiarmenian;0545 +Yicyrillic;0407 +Yiwnarmenian;0552 +Ymonospace;FF39 +Ysmall;F779 +Ytilde;1EF8 +Yusbigcyrillic;046A +Yusbigiotifiedcyrillic;046C +Yuslittlecyrillic;0466 +Yuslittleiotifiedcyrillic;0468 +Z;005A +Zaarmenian;0536 +Zacute;0179 +Zcaron;017D +Zcaronsmall;F6FF +Zcircle;24CF +Zcircumflex;1E90 +Zdot;017B +Zdotaccent;017B +Zdotbelow;1E92 +Zecyrillic;0417 +Zedescendercyrillic;0498 +Zedieresiscyrillic;04DE +Zeta;0396 +Zhearmenian;053A +Zhebrevecyrillic;04C1 +Zhecyrillic;0416 +Zhedescendercyrillic;0496 +Zhedieresiscyrillic;04DC +Zlinebelow;1E94 +Zmonospace;FF3A +Zsmall;F77A +Zstroke;01B5 +a;0061 +aabengali;0986 +aacute;00E1 +aadeva;0906 +aagujarati;0A86 +aagurmukhi;0A06 +aamatragurmukhi;0A3E +aarusquare;3303 +aavowelsignbengali;09BE +aavowelsigndeva;093E +aavowelsigngujarati;0ABE +abbreviationmarkarmenian;055F +abbreviationsigndeva;0970 +abengali;0985 +abopomofo;311A +abreve;0103 +abreveacute;1EAF +abrevecyrillic;04D1 +abrevedotbelow;1EB7 +abrevegrave;1EB1 +abrevehookabove;1EB3 +abrevetilde;1EB5 +acaron;01CE +acircle;24D0 +acircumflex;00E2 +acircumflexacute;1EA5 +acircumflexdotbelow;1EAD +acircumflexgrave;1EA7 +acircumflexhookabove;1EA9 +acircumflextilde;1EAB +acute;00B4 +acutebelowcmb;0317 +acutecmb;0301 +acutecomb;0301 +acutedeva;0954 +acutelowmod;02CF +acutetonecmb;0341 +acyrillic;0430 +adblgrave;0201 +addakgurmukhi;0A71 +adeva;0905 +adieresis;00E4 +adieresiscyrillic;04D3 +adieresismacron;01DF +adotbelow;1EA1 +adotmacron;01E1 +ae;00E6 +aeacute;01FD +aekorean;3150 +aemacron;01E3 +afii00208;2015 +afii08941;20A4 +afii10017;0410 +afii10018;0411 +afii10019;0412 +afii10020;0413 +afii10021;0414 +afii10022;0415 +afii10023;0401 +afii10024;0416 +afii10025;0417 +afii10026;0418 +afii10027;0419 +afii10028;041A +afii10029;041B +afii10030;041C +afii10031;041D +afii10032;041E +afii10033;041F +afii10034;0420 +afii10035;0421 +afii10036;0422 +afii10037;0423 +afii10038;0424 +afii10039;0425 +afii10040;0426 +afii10041;0427 +afii10042;0428 +afii10043;0429 +afii10044;042A +afii10045;042B +afii10046;042C +afii10047;042D +afii10048;042E +afii10049;042F +afii10050;0490 +afii10051;0402 +afii10052;0403 +afii10053;0404 +afii10054;0405 +afii10055;0406 +afii10056;0407 +afii10057;0408 +afii10058;0409 +afii10059;040A +afii10060;040B +afii10061;040C +afii10062;040E +afii10063;F6C4 +afii10064;F6C5 +afii10065;0430 +afii10066;0431 +afii10067;0432 +afii10068;0433 +afii10069;0434 +afii10070;0435 +afii10071;0451 +afii10072;0436 +afii10073;0437 +afii10074;0438 +afii10075;0439 +afii10076;043A +afii10077;043B +afii10078;043C +afii10079;043D +afii10080;043E +afii10081;043F +afii10082;0440 +afii10083;0441 +afii10084;0442 +afii10085;0443 +afii10086;0444 +afii10087;0445 +afii10088;0446 +afii10089;0447 +afii10090;0448 +afii10091;0449 +afii10092;044A +afii10093;044B +afii10094;044C +afii10095;044D +afii10096;044E +afii10097;044F +afii10098;0491 +afii10099;0452 +afii10100;0453 +afii10101;0454 +afii10102;0455 +afii10103;0456 +afii10104;0457 +afii10105;0458 +afii10106;0459 +afii10107;045A +afii10108;045B +afii10109;045C +afii10110;045E +afii10145;040F +afii10146;0462 +afii10147;0472 +afii10148;0474 +afii10192;F6C6 +afii10193;045F +afii10194;0463 +afii10195;0473 +afii10196;0475 +afii10831;F6C7 +afii10832;F6C8 +afii10846;04D9 +afii299;200E +afii300;200F +afii301;200D +afii57381;066A +afii57388;060C +afii57392;0660 +afii57393;0661 +afii57394;0662 +afii57395;0663 +afii57396;0664 +afii57397;0665 +afii57398;0666 +afii57399;0667 +afii57400;0668 +afii57401;0669 +afii57403;061B +afii57407;061F +afii57409;0621 +afii57410;0622 +afii57411;0623 +afii57412;0624 +afii57413;0625 +afii57414;0626 +afii57415;0627 +afii57416;0628 +afii57417;0629 +afii57418;062A +afii57419;062B +afii57420;062C +afii57421;062D +afii57422;062E +afii57423;062F +afii57424;0630 +afii57425;0631 +afii57426;0632 +afii57427;0633 +afii57428;0634 +afii57429;0635 +afii57430;0636 +afii57431;0637 +afii57432;0638 +afii57433;0639 +afii57434;063A +afii57440;0640 +afii57441;0641 +afii57442;0642 +afii57443;0643 +afii57444;0644 +afii57445;0645 +afii57446;0646 +afii57448;0648 +afii57449;0649 +afii57450;064A +afii57451;064B +afii57452;064C +afii57453;064D +afii57454;064E +afii57455;064F +afii57456;0650 +afii57457;0651 +afii57458;0652 +afii57470;0647 +afii57505;06A4 +afii57506;067E +afii57507;0686 +afii57508;0698 +afii57509;06AF +afii57511;0679 +afii57512;0688 +afii57513;0691 +afii57514;06BA +afii57519;06D2 +afii57534;06D5 +afii57636;20AA +afii57645;05BE +afii57658;05C3 +afii57664;05D0 +afii57665;05D1 +afii57666;05D2 +afii57667;05D3 +afii57668;05D4 +afii57669;05D5 +afii57670;05D6 +afii57671;05D7 +afii57672;05D8 +afii57673;05D9 +afii57674;05DA +afii57675;05DB +afii57676;05DC +afii57677;05DD +afii57678;05DE +afii57679;05DF +afii57680;05E0 +afii57681;05E1 +afii57682;05E2 +afii57683;05E3 +afii57684;05E4 +afii57685;05E5 +afii57686;05E6 +afii57687;05E7 +afii57688;05E8 +afii57689;05E9 +afii57690;05EA +afii57694;FB2A +afii57695;FB2B +afii57700;FB4B +afii57705;FB1F +afii57716;05F0 +afii57717;05F1 +afii57718;05F2 +afii57723;FB35 +afii57793;05B4 +afii57794;05B5 +afii57795;05B6 +afii57796;05BB +afii57797;05B8 +afii57798;05B7 +afii57799;05B0 +afii57800;05B2 +afii57801;05B1 +afii57802;05B3 +afii57803;05C2 +afii57804;05C1 +afii57806;05B9 +afii57807;05BC +afii57839;05BD +afii57841;05BF +afii57842;05C0 +afii57929;02BC +afii61248;2105 +afii61289;2113 +afii61352;2116 +afii61573;202C +afii61574;202D +afii61575;202E +afii61664;200C +afii63167;066D +afii64937;02BD +agrave;00E0 +agujarati;0A85 +agurmukhi;0A05 +ahiragana;3042 +ahookabove;1EA3 +aibengali;0990 +aibopomofo;311E +aideva;0910 +aiecyrillic;04D5 +aigujarati;0A90 +aigurmukhi;0A10 +aimatragurmukhi;0A48 +ainarabic;0639 +ainfinalarabic;FECA +aininitialarabic;FECB +ainmedialarabic;FECC +ainvertedbreve;0203 +aivowelsignbengali;09C8 +aivowelsigndeva;0948 +aivowelsigngujarati;0AC8 +akatakana;30A2 +akatakanahalfwidth;FF71 +akorean;314F +alef;05D0 +alefarabic;0627 +alefdageshhebrew;FB30 +aleffinalarabic;FE8E +alefhamzaabovearabic;0623 +alefhamzaabovefinalarabic;FE84 +alefhamzabelowarabic;0625 +alefhamzabelowfinalarabic;FE88 +alefhebrew;05D0 +aleflamedhebrew;FB4F +alefmaddaabovearabic;0622 +alefmaddaabovefinalarabic;FE82 +alefmaksuraarabic;0649 +alefmaksurafinalarabic;FEF0 +alefmaksurainitialarabic;FEF3 +alefmaksuramedialarabic;FEF4 +alefpatahhebrew;FB2E +alefqamatshebrew;FB2F +aleph;2135 +allequal;224C +alpha;03B1 +alphatonos;03AC +amacron;0101 +amonospace;FF41 +ampersand;0026 +ampersandmonospace;FF06 +ampersandsmall;F726 +amsquare;33C2 +anbopomofo;3122 +angbopomofo;3124 +angkhankhuthai;0E5A +angle;2220 +anglebracketleft;3008 +anglebracketleftvertical;FE3F +anglebracketright;3009 +anglebracketrightvertical;FE40 +angleleft;2329 +angleright;232A +angstrom;212B +anoteleia;0387 +anudattadeva;0952 +anusvarabengali;0982 +anusvaradeva;0902 +anusvaragujarati;0A82 +aogonek;0105 +apaatosquare;3300 +aparen;249C +apostrophearmenian;055A +apostrophemod;02BC +apple;F8FF +approaches;2250 +approxequal;2248 +approxequalorimage;2252 +approximatelyequal;2245 +araeaekorean;318E +araeakorean;318D +arc;2312 +arighthalfring;1E9A +aring;00E5 +aringacute;01FB +aringbelow;1E01 +arrowboth;2194 +arrowdashdown;21E3 +arrowdashleft;21E0 +arrowdashright;21E2 +arrowdashup;21E1 +arrowdblboth;21D4 +arrowdbldown;21D3 +arrowdblleft;21D0 +arrowdblright;21D2 +arrowdblup;21D1 +arrowdown;2193 +arrowdownleft;2199 +arrowdownright;2198 +arrowdownwhite;21E9 +arrowheaddownmod;02C5 +arrowheadleftmod;02C2 +arrowheadrightmod;02C3 +arrowheadupmod;02C4 +arrowhorizex;F8E7 +arrowleft;2190 +arrowleftdbl;21D0 +arrowleftdblstroke;21CD +arrowleftoverright;21C6 +arrowleftwhite;21E6 +arrowright;2192 +arrowrightdblstroke;21CF +arrowrightheavy;279E +arrowrightoverleft;21C4 +arrowrightwhite;21E8 +arrowtableft;21E4 +arrowtabright;21E5 +arrowup;2191 +arrowupdn;2195 +arrowupdnbse;21A8 +arrowupdownbase;21A8 +arrowupleft;2196 +arrowupleftofdown;21C5 +arrowupright;2197 +arrowupwhite;21E7 +arrowvertex;F8E6 +asciicircum;005E +asciicircummonospace;FF3E +asciitilde;007E +asciitildemonospace;FF5E +ascript;0251 +ascriptturned;0252 +asmallhiragana;3041 +asmallkatakana;30A1 +asmallkatakanahalfwidth;FF67 +asterisk;002A +asteriskaltonearabic;066D +asteriskarabic;066D +asteriskmath;2217 +asteriskmonospace;FF0A +asterisksmall;FE61 +asterism;2042 +asuperior;F6E9 +asymptoticallyequal;2243 +at;0040 +atilde;00E3 +atmonospace;FF20 +atsmall;FE6B +aturned;0250 +aubengali;0994 +aubopomofo;3120 +audeva;0914 +augujarati;0A94 +augurmukhi;0A14 +aulengthmarkbengali;09D7 +aumatragurmukhi;0A4C +auvowelsignbengali;09CC +auvowelsigndeva;094C +auvowelsigngujarati;0ACC +avagrahadeva;093D +aybarmenian;0561 +ayin;05E2 +ayinaltonehebrew;FB20 +ayinhebrew;05E2 +b;0062 +babengali;09AC +backslash;005C +backslashmonospace;FF3C +badeva;092C +bagujarati;0AAC +bagurmukhi;0A2C +bahiragana;3070 +bahtthai;0E3F +bakatakana;30D0 +bar;007C +barmonospace;FF5C +bbopomofo;3105 +bcircle;24D1 +bdotaccent;1E03 +bdotbelow;1E05 +beamedsixteenthnotes;266C +because;2235 +becyrillic;0431 +beharabic;0628 +behfinalarabic;FE90 +behinitialarabic;FE91 +behiragana;3079 +behmedialarabic;FE92 +behmeeminitialarabic;FC9F +behmeemisolatedarabic;FC08 +behnoonfinalarabic;FC6D +bekatakana;30D9 +benarmenian;0562 +bet;05D1 +beta;03B2 +betasymbolgreek;03D0 +betdagesh;FB31 +betdageshhebrew;FB31 +bethebrew;05D1 +betrafehebrew;FB4C +bhabengali;09AD +bhadeva;092D +bhagujarati;0AAD +bhagurmukhi;0A2D +bhook;0253 +bihiragana;3073 +bikatakana;30D3 +bilabialclick;0298 +bindigurmukhi;0A02 +birusquare;3331 +blackcircle;25CF +blackdiamond;25C6 +blackdownpointingtriangle;25BC +blackleftpointingpointer;25C4 +blackleftpointingtriangle;25C0 +blacklenticularbracketleft;3010 +blacklenticularbracketleftvertical;FE3B +blacklenticularbracketright;3011 +blacklenticularbracketrightvertical;FE3C +blacklowerlefttriangle;25E3 +blacklowerrighttriangle;25E2 +blackrectangle;25AC +blackrightpointingpointer;25BA +blackrightpointingtriangle;25B6 +blacksmallsquare;25AA +blacksmilingface;263B +blacksquare;25A0 +blackstar;2605 +blackupperlefttriangle;25E4 +blackupperrighttriangle;25E5 +blackuppointingsmalltriangle;25B4 +blackuppointingtriangle;25B2 +blank;2423 +blinebelow;1E07 +block;2588 +bmonospace;FF42 +bobaimaithai;0E1A +bohiragana;307C +bokatakana;30DC +bparen;249D +bqsquare;33C3 +braceex;F8F4 +braceleft;007B +braceleftbt;F8F3 +braceleftmid;F8F2 +braceleftmonospace;FF5B +braceleftsmall;FE5B +bracelefttp;F8F1 +braceleftvertical;FE37 +braceright;007D +bracerightbt;F8FE +bracerightmid;F8FD +bracerightmonospace;FF5D +bracerightsmall;FE5C +bracerighttp;F8FC +bracerightvertical;FE38 +bracketleft;005B +bracketleftbt;F8F0 +bracketleftex;F8EF +bracketleftmonospace;FF3B +bracketlefttp;F8EE +bracketright;005D +bracketrightbt;F8FB +bracketrightex;F8FA +bracketrightmonospace;FF3D +bracketrighttp;F8F9 +breve;02D8 +brevebelowcmb;032E +brevecmb;0306 +breveinvertedbelowcmb;032F +breveinvertedcmb;0311 +breveinverteddoublecmb;0361 +bridgebelowcmb;032A +bridgeinvertedbelowcmb;033A +brokenbar;00A6 +bstroke;0180 +bsuperior;F6EA +btopbar;0183 +buhiragana;3076 +bukatakana;30D6 +bullet;2022 +bulletinverse;25D8 +bulletoperator;2219 +bullseye;25CE +c;0063 +caarmenian;056E +cabengali;099A +cacute;0107 +cadeva;091A +cagujarati;0A9A +cagurmukhi;0A1A +calsquare;3388 +candrabindubengali;0981 +candrabinducmb;0310 +candrabindudeva;0901 +candrabindugujarati;0A81 +capslock;21EA +careof;2105 +caron;02C7 +caronbelowcmb;032C +caroncmb;030C +carriagereturn;21B5 +cbopomofo;3118 +ccaron;010D +ccedilla;00E7 +ccedillaacute;1E09 +ccircle;24D2 +ccircumflex;0109 +ccurl;0255 +cdot;010B +cdotaccent;010B +cdsquare;33C5 +cedilla;00B8 +cedillacmb;0327 +cent;00A2 +centigrade;2103 +centinferior;F6DF +centmonospace;FFE0 +centoldstyle;F7A2 +centsuperior;F6E0 +chaarmenian;0579 +chabengali;099B +chadeva;091B +chagujarati;0A9B +chagurmukhi;0A1B +chbopomofo;3114 +cheabkhasiancyrillic;04BD +checkmark;2713 +checyrillic;0447 +chedescenderabkhasiancyrillic;04BF +chedescendercyrillic;04B7 +chedieresiscyrillic;04F5 +cheharmenian;0573 +chekhakassiancyrillic;04CC +cheverticalstrokecyrillic;04B9 +chi;03C7 +chieuchacirclekorean;3277 +chieuchaparenkorean;3217 +chieuchcirclekorean;3269 +chieuchkorean;314A +chieuchparenkorean;3209 +chochangthai;0E0A +chochanthai;0E08 +chochingthai;0E09 +chochoethai;0E0C +chook;0188 +cieucacirclekorean;3276 +cieucaparenkorean;3216 +cieuccirclekorean;3268 +cieuckorean;3148 +cieucparenkorean;3208 +cieucuparenkorean;321C +circle;25CB +circlemultiply;2297 +circleot;2299 +circleplus;2295 +circlepostalmark;3036 +circlewithlefthalfblack;25D0 +circlewithrighthalfblack;25D1 +circumflex;02C6 +circumflexbelowcmb;032D +circumflexcmb;0302 +clear;2327 +clickalveolar;01C2 +clickdental;01C0 +clicklateral;01C1 +clickretroflex;01C3 +club;2663 +clubsuitblack;2663 +clubsuitwhite;2667 +cmcubedsquare;33A4 +cmonospace;FF43 +cmsquaredsquare;33A0 +coarmenian;0581 +colon;003A +colonmonetary;20A1 +colonmonospace;FF1A +colonsign;20A1 +colonsmall;FE55 +colontriangularhalfmod;02D1 +colontriangularmod;02D0 +comma;002C +commaabovecmb;0313 +commaaboverightcmb;0315 +commaaccent;F6C3 +commaarabic;060C +commaarmenian;055D +commainferior;F6E1 +commamonospace;FF0C +commareversedabovecmb;0314 +commareversedmod;02BD +commasmall;FE50 +commasuperior;F6E2 +commaturnedabovecmb;0312 +commaturnedmod;02BB +compass;263C +congruent;2245 +contourintegral;222E +control;2303 +controlACK;0006 +controlBEL;0007 +controlBS;0008 +controlCAN;0018 +controlCR;000D +controlDC1;0011 +controlDC2;0012 +controlDC3;0013 +controlDC4;0014 +controlDEL;007F +controlDLE;0010 +controlEM;0019 +controlENQ;0005 +controlEOT;0004 +controlESC;001B +controlETB;0017 +controlETX;0003 +controlFF;000C +controlFS;001C +controlGS;001D +controlHT;0009 +controlLF;000A +controlNAK;0015 +controlRS;001E +controlSI;000F +controlSO;000E +controlSOT;0002 +controlSTX;0001 +controlSUB;001A +controlSYN;0016 +controlUS;001F +controlVT;000B +copyright;00A9 +copyrightsans;F8E9 +copyrightserif;F6D9 +cornerbracketleft;300C +cornerbracketlefthalfwidth;FF62 +cornerbracketleftvertical;FE41 +cornerbracketright;300D +cornerbracketrighthalfwidth;FF63 +cornerbracketrightvertical;FE42 +corporationsquare;337F +cosquare;33C7 +coverkgsquare;33C6 +cparen;249E +cruzeiro;20A2 +cstretched;0297 +curlyand;22CF +curlyor;22CE +currency;00A4 +cyrBreve;F6D1 +cyrFlex;F6D2 +cyrbreve;F6D4 +cyrflex;F6D5 +d;0064 +daarmenian;0564 +dabengali;09A6 +dadarabic;0636 +dadeva;0926 +dadfinalarabic;FEBE +dadinitialarabic;FEBF +dadmedialarabic;FEC0 +dagesh;05BC +dageshhebrew;05BC +dagger;2020 +daggerdbl;2021 +dagujarati;0AA6 +dagurmukhi;0A26 +dahiragana;3060 +dakatakana;30C0 +dalarabic;062F +dalet;05D3 +daletdagesh;FB33 +daletdageshhebrew;FB33 +dalethatafpatah;05D3 05B2 +dalethatafpatahhebrew;05D3 05B2 +dalethatafsegol;05D3 05B1 +dalethatafsegolhebrew;05D3 05B1 +dalethebrew;05D3 +dalethiriq;05D3 05B4 +dalethiriqhebrew;05D3 05B4 +daletholam;05D3 05B9 +daletholamhebrew;05D3 05B9 +daletpatah;05D3 05B7 +daletpatahhebrew;05D3 05B7 +daletqamats;05D3 05B8 +daletqamatshebrew;05D3 05B8 +daletqubuts;05D3 05BB +daletqubutshebrew;05D3 05BB +daletsegol;05D3 05B6 +daletsegolhebrew;05D3 05B6 +daletsheva;05D3 05B0 +daletshevahebrew;05D3 05B0 +dalettsere;05D3 05B5 +dalettserehebrew;05D3 05B5 +dalfinalarabic;FEAA +dammaarabic;064F +dammalowarabic;064F +dammatanaltonearabic;064C +dammatanarabic;064C +danda;0964 +dargahebrew;05A7 +dargalefthebrew;05A7 +dasiapneumatacyrilliccmb;0485 +dblGrave;F6D3 +dblanglebracketleft;300A +dblanglebracketleftvertical;FE3D +dblanglebracketright;300B +dblanglebracketrightvertical;FE3E +dblarchinvertedbelowcmb;032B +dblarrowleft;21D4 +dblarrowright;21D2 +dbldanda;0965 +dblgrave;F6D6 +dblgravecmb;030F +dblintegral;222C +dbllowline;2017 +dbllowlinecmb;0333 +dbloverlinecmb;033F +dblprimemod;02BA +dblverticalbar;2016 +dblverticallineabovecmb;030E +dbopomofo;3109 +dbsquare;33C8 +dcaron;010F +dcedilla;1E11 +dcircle;24D3 +dcircumflexbelow;1E13 +dcroat;0111 +ddabengali;09A1 +ddadeva;0921 +ddagujarati;0AA1 +ddagurmukhi;0A21 +ddalarabic;0688 +ddalfinalarabic;FB89 +dddhadeva;095C +ddhabengali;09A2 +ddhadeva;0922 +ddhagujarati;0AA2 +ddhagurmukhi;0A22 +ddotaccent;1E0B +ddotbelow;1E0D +decimalseparatorarabic;066B +decimalseparatorpersian;066B +decyrillic;0434 +degree;00B0 +dehihebrew;05AD +dehiragana;3067 +deicoptic;03EF +dekatakana;30C7 +deleteleft;232B +deleteright;2326 +delta;03B4 +deltaturned;018D +denominatorminusonenumeratorbengali;09F8 +dezh;02A4 +dhabengali;09A7 +dhadeva;0927 +dhagujarati;0AA7 +dhagurmukhi;0A27 +dhook;0257 +dialytikatonos;0385 +dialytikatonoscmb;0344 +diamond;2666 +diamondsuitwhite;2662 +dieresis;00A8 +dieresisacute;F6D7 +dieresisbelowcmb;0324 +dieresiscmb;0308 +dieresisgrave;F6D8 +dieresistonos;0385 +dihiragana;3062 +dikatakana;30C2 +dittomark;3003 +divide;00F7 +divides;2223 +divisionslash;2215 +djecyrillic;0452 +dkshade;2593 +dlinebelow;1E0F +dlsquare;3397 +dmacron;0111 +dmonospace;FF44 +dnblock;2584 +dochadathai;0E0E +dodekthai;0E14 +dohiragana;3069 +dokatakana;30C9 +dollar;0024 +dollarinferior;F6E3 +dollarmonospace;FF04 +dollaroldstyle;F724 +dollarsmall;FE69 +dollarsuperior;F6E4 +dong;20AB +dorusquare;3326 +dotaccent;02D9 +dotaccentcmb;0307 +dotbelowcmb;0323 +dotbelowcomb;0323 +dotkatakana;30FB +dotlessi;0131 +dotlessj;F6BE +dotlessjstrokehook;0284 +dotmath;22C5 +dottedcircle;25CC +doubleyodpatah;FB1F +doubleyodpatahhebrew;FB1F +downtackbelowcmb;031E +downtackmod;02D5 +dparen;249F +dsuperior;F6EB +dtail;0256 +dtopbar;018C +duhiragana;3065 +dukatakana;30C5 +dz;01F3 +dzaltone;02A3 +dzcaron;01C6 +dzcurl;02A5 +dzeabkhasiancyrillic;04E1 +dzecyrillic;0455 +dzhecyrillic;045F +e;0065 +eacute;00E9 +earth;2641 +ebengali;098F +ebopomofo;311C +ebreve;0115 +ecandradeva;090D +ecandragujarati;0A8D +ecandravowelsigndeva;0945 +ecandravowelsigngujarati;0AC5 +ecaron;011B +ecedillabreve;1E1D +echarmenian;0565 +echyiwnarmenian;0587 +ecircle;24D4 +ecircumflex;00EA +ecircumflexacute;1EBF +ecircumflexbelow;1E19 +ecircumflexdotbelow;1EC7 +ecircumflexgrave;1EC1 +ecircumflexhookabove;1EC3 +ecircumflextilde;1EC5 +ecyrillic;0454 +edblgrave;0205 +edeva;090F +edieresis;00EB +edot;0117 +edotaccent;0117 +edotbelow;1EB9 +eegurmukhi;0A0F +eematragurmukhi;0A47 +efcyrillic;0444 +egrave;00E8 +egujarati;0A8F +eharmenian;0567 +ehbopomofo;311D +ehiragana;3048 +ehookabove;1EBB +eibopomofo;311F +eight;0038 +eightarabic;0668 +eightbengali;09EE +eightcircle;2467 +eightcircleinversesansserif;2791 +eightdeva;096E +eighteencircle;2471 +eighteenparen;2485 +eighteenperiod;2499 +eightgujarati;0AEE +eightgurmukhi;0A6E +eighthackarabic;0668 +eighthangzhou;3028 +eighthnotebeamed;266B +eightideographicparen;3227 +eightinferior;2088 +eightmonospace;FF18 +eightoldstyle;F738 +eightparen;247B +eightperiod;248F +eightpersian;06F8 +eightroman;2177 +eightsuperior;2078 +eightthai;0E58 +einvertedbreve;0207 +eiotifiedcyrillic;0465 +ekatakana;30A8 +ekatakanahalfwidth;FF74 +ekonkargurmukhi;0A74 +ekorean;3154 +elcyrillic;043B +element;2208 +elevencircle;246A +elevenparen;247E +elevenperiod;2492 +elevenroman;217A +ellipsis;2026 +ellipsisvertical;22EE +emacron;0113 +emacronacute;1E17 +emacrongrave;1E15 +emcyrillic;043C +emdash;2014 +emdashvertical;FE31 +emonospace;FF45 +emphasismarkarmenian;055B +emptyset;2205 +enbopomofo;3123 +encyrillic;043D +endash;2013 +endashvertical;FE32 +endescendercyrillic;04A3 +eng;014B +engbopomofo;3125 +enghecyrillic;04A5 +enhookcyrillic;04C8 +enspace;2002 +eogonek;0119 +eokorean;3153 +eopen;025B +eopenclosed;029A +eopenreversed;025C +eopenreversedclosed;025E +eopenreversedhook;025D +eparen;24A0 +epsilon;03B5 +epsilontonos;03AD +equal;003D +equalmonospace;FF1D +equalsmall;FE66 +equalsuperior;207C +equivalence;2261 +erbopomofo;3126 +ercyrillic;0440 +ereversed;0258 +ereversedcyrillic;044D +escyrillic;0441 +esdescendercyrillic;04AB +esh;0283 +eshcurl;0286 +eshortdeva;090E +eshortvowelsigndeva;0946 +eshreversedloop;01AA +eshsquatreversed;0285 +esmallhiragana;3047 +esmallkatakana;30A7 +esmallkatakanahalfwidth;FF6A +estimated;212E +esuperior;F6EC +eta;03B7 +etarmenian;0568 +etatonos;03AE +eth;00F0 +etilde;1EBD +etildebelow;1E1B +etnahtafoukhhebrew;0591 +etnahtafoukhlefthebrew;0591 +etnahtahebrew;0591 +etnahtalefthebrew;0591 +eturned;01DD +eukorean;3161 +euro;20AC +evowelsignbengali;09C7 +evowelsigndeva;0947 +evowelsigngujarati;0AC7 +exclam;0021 +exclamarmenian;055C +exclamdbl;203C +exclamdown;00A1 +exclamdownsmall;F7A1 +exclammonospace;FF01 +exclamsmall;F721 +existential;2203 +ezh;0292 +ezhcaron;01EF +ezhcurl;0293 +ezhreversed;01B9 +ezhtail;01BA +f;0066 +fadeva;095E +fagurmukhi;0A5E +fahrenheit;2109 +fathaarabic;064E +fathalowarabic;064E +fathatanarabic;064B +fbopomofo;3108 +fcircle;24D5 +fdotaccent;1E1F +feharabic;0641 +feharmenian;0586 +fehfinalarabic;FED2 +fehinitialarabic;FED3 +fehmedialarabic;FED4 +feicoptic;03E5 +female;2640 +ff;FB00 +ffi;FB03 +ffl;FB04 +fi;FB01 +fifteencircle;246E +fifteenparen;2482 +fifteenperiod;2496 +figuredash;2012 +filledbox;25A0 +filledrect;25AC +finalkaf;05DA +finalkafdagesh;FB3A +finalkafdageshhebrew;FB3A +finalkafhebrew;05DA +finalkafqamats;05DA 05B8 +finalkafqamatshebrew;05DA 05B8 +finalkafsheva;05DA 05B0 +finalkafshevahebrew;05DA 05B0 +finalmem;05DD +finalmemhebrew;05DD +finalnun;05DF +finalnunhebrew;05DF +finalpe;05E3 +finalpehebrew;05E3 +finaltsadi;05E5 +finaltsadihebrew;05E5 +firsttonechinese;02C9 +fisheye;25C9 +fitacyrillic;0473 +five;0035 +fivearabic;0665 +fivebengali;09EB +fivecircle;2464 +fivecircleinversesansserif;278E +fivedeva;096B +fiveeighths;215D +fivegujarati;0AEB +fivegurmukhi;0A6B +fivehackarabic;0665 +fivehangzhou;3025 +fiveideographicparen;3224 +fiveinferior;2085 +fivemonospace;FF15 +fiveoldstyle;F735 +fiveparen;2478 +fiveperiod;248C +fivepersian;06F5 +fiveroman;2174 +fivesuperior;2075 +fivethai;0E55 +fl;FB02 +florin;0192 +fmonospace;FF46 +fmsquare;3399 +fofanthai;0E1F +fofathai;0E1D +fongmanthai;0E4F +forall;2200 +four;0034 +fourarabic;0664 +fourbengali;09EA +fourcircle;2463 +fourcircleinversesansserif;278D +fourdeva;096A +fourgujarati;0AEA +fourgurmukhi;0A6A +fourhackarabic;0664 +fourhangzhou;3024 +fourideographicparen;3223 +fourinferior;2084 +fourmonospace;FF14 +fournumeratorbengali;09F7 +fouroldstyle;F734 +fourparen;2477 +fourperiod;248B +fourpersian;06F4 +fourroman;2173 +foursuperior;2074 +fourteencircle;246D +fourteenparen;2481 +fourteenperiod;2495 +fourthai;0E54 +fourthtonechinese;02CB +fparen;24A1 +fraction;2044 +franc;20A3 +g;0067 +gabengali;0997 +gacute;01F5 +gadeva;0917 +gafarabic;06AF +gaffinalarabic;FB93 +gafinitialarabic;FB94 +gafmedialarabic;FB95 +gagujarati;0A97 +gagurmukhi;0A17 +gahiragana;304C +gakatakana;30AC +gamma;03B3 +gammalatinsmall;0263 +gammasuperior;02E0 +gangiacoptic;03EB +gbopomofo;310D +gbreve;011F +gcaron;01E7 +gcedilla;0123 +gcircle;24D6 +gcircumflex;011D +gcommaaccent;0123 +gdot;0121 +gdotaccent;0121 +gecyrillic;0433 +gehiragana;3052 +gekatakana;30B2 +geometricallyequal;2251 +gereshaccenthebrew;059C +gereshhebrew;05F3 +gereshmuqdamhebrew;059D +germandbls;00DF +gershayimaccenthebrew;059E +gershayimhebrew;05F4 +getamark;3013 +ghabengali;0998 +ghadarmenian;0572 +ghadeva;0918 +ghagujarati;0A98 +ghagurmukhi;0A18 +ghainarabic;063A +ghainfinalarabic;FECE +ghaininitialarabic;FECF +ghainmedialarabic;FED0 +ghemiddlehookcyrillic;0495 +ghestrokecyrillic;0493 +gheupturncyrillic;0491 +ghhadeva;095A +ghhagurmukhi;0A5A +ghook;0260 +ghzsquare;3393 +gihiragana;304E +gikatakana;30AE +gimarmenian;0563 +gimel;05D2 +gimeldagesh;FB32 +gimeldageshhebrew;FB32 +gimelhebrew;05D2 +gjecyrillic;0453 +glottalinvertedstroke;01BE +glottalstop;0294 +glottalstopinverted;0296 +glottalstopmod;02C0 +glottalstopreversed;0295 +glottalstopreversedmod;02C1 +glottalstopreversedsuperior;02E4 +glottalstopstroke;02A1 +glottalstopstrokereversed;02A2 +gmacron;1E21 +gmonospace;FF47 +gohiragana;3054 +gokatakana;30B4 +gparen;24A2 +gpasquare;33AC +gradient;2207 +grave;0060 +gravebelowcmb;0316 +gravecmb;0300 +gravecomb;0300 +gravedeva;0953 +gravelowmod;02CE +gravemonospace;FF40 +gravetonecmb;0340 +greater;003E +greaterequal;2265 +greaterequalorless;22DB +greatermonospace;FF1E +greaterorequivalent;2273 +greaterorless;2277 +greateroverequal;2267 +greatersmall;FE65 +gscript;0261 +gstroke;01E5 +guhiragana;3050 +guillemotleft;00AB +guillemotright;00BB +guilsinglleft;2039 +guilsinglright;203A +gukatakana;30B0 +guramusquare;3318 +gysquare;33C9 +h;0068 +haabkhasiancyrillic;04A9 +haaltonearabic;06C1 +habengali;09B9 +hadescendercyrillic;04B3 +hadeva;0939 +hagujarati;0AB9 +hagurmukhi;0A39 +haharabic;062D +hahfinalarabic;FEA2 +hahinitialarabic;FEA3 +hahiragana;306F +hahmedialarabic;FEA4 +haitusquare;332A +hakatakana;30CF +hakatakanahalfwidth;FF8A +halantgurmukhi;0A4D +hamzaarabic;0621 +hamzadammaarabic;0621 064F +hamzadammatanarabic;0621 064C +hamzafathaarabic;0621 064E +hamzafathatanarabic;0621 064B +hamzalowarabic;0621 +hamzalowkasraarabic;0621 0650 +hamzalowkasratanarabic;0621 064D +hamzasukunarabic;0621 0652 +hangulfiller;3164 +hardsigncyrillic;044A +harpoonleftbarbup;21BC +harpoonrightbarbup;21C0 +hasquare;33CA +hatafpatah;05B2 +hatafpatah16;05B2 +hatafpatah23;05B2 +hatafpatah2f;05B2 +hatafpatahhebrew;05B2 +hatafpatahnarrowhebrew;05B2 +hatafpatahquarterhebrew;05B2 +hatafpatahwidehebrew;05B2 +hatafqamats;05B3 +hatafqamats1b;05B3 +hatafqamats28;05B3 +hatafqamats34;05B3 +hatafqamatshebrew;05B3 +hatafqamatsnarrowhebrew;05B3 +hatafqamatsquarterhebrew;05B3 +hatafqamatswidehebrew;05B3 +hatafsegol;05B1 +hatafsegol17;05B1 +hatafsegol24;05B1 +hatafsegol30;05B1 +hatafsegolhebrew;05B1 +hatafsegolnarrowhebrew;05B1 +hatafsegolquarterhebrew;05B1 +hatafsegolwidehebrew;05B1 +hbar;0127 +hbopomofo;310F +hbrevebelow;1E2B +hcedilla;1E29 +hcircle;24D7 +hcircumflex;0125 +hdieresis;1E27 +hdotaccent;1E23 +hdotbelow;1E25 +he;05D4 +heart;2665 +heartsuitblack;2665 +heartsuitwhite;2661 +hedagesh;FB34 +hedageshhebrew;FB34 +hehaltonearabic;06C1 +heharabic;0647 +hehebrew;05D4 +hehfinalaltonearabic;FBA7 +hehfinalalttwoarabic;FEEA +hehfinalarabic;FEEA +hehhamzaabovefinalarabic;FBA5 +hehhamzaaboveisolatedarabic;FBA4 +hehinitialaltonearabic;FBA8 +hehinitialarabic;FEEB +hehiragana;3078 +hehmedialaltonearabic;FBA9 +hehmedialarabic;FEEC +heiseierasquare;337B +hekatakana;30D8 +hekatakanahalfwidth;FF8D +hekutaarusquare;3336 +henghook;0267 +herutusquare;3339 +het;05D7 +hethebrew;05D7 +hhook;0266 +hhooksuperior;02B1 +hieuhacirclekorean;327B +hieuhaparenkorean;321B +hieuhcirclekorean;326D +hieuhkorean;314E +hieuhparenkorean;320D +hihiragana;3072 +hikatakana;30D2 +hikatakanahalfwidth;FF8B +hiriq;05B4 +hiriq14;05B4 +hiriq21;05B4 +hiriq2d;05B4 +hiriqhebrew;05B4 +hiriqnarrowhebrew;05B4 +hiriqquarterhebrew;05B4 +hiriqwidehebrew;05B4 +hlinebelow;1E96 +hmonospace;FF48 +hoarmenian;0570 +hohipthai;0E2B +hohiragana;307B +hokatakana;30DB +hokatakanahalfwidth;FF8E +holam;05B9 +holam19;05B9 +holam26;05B9 +holam32;05B9 +holamhebrew;05B9 +holamnarrowhebrew;05B9 +holamquarterhebrew;05B9 +holamwidehebrew;05B9 +honokhukthai;0E2E +hookabovecomb;0309 +hookcmb;0309 +hookpalatalizedbelowcmb;0321 +hookretroflexbelowcmb;0322 +hoonsquare;3342 +horicoptic;03E9 +horizontalbar;2015 +horncmb;031B +hotsprings;2668 +house;2302 +hparen;24A3 +hsuperior;02B0 +hturned;0265 +huhiragana;3075 +huiitosquare;3333 +hukatakana;30D5 +hukatakanahalfwidth;FF8C +hungarumlaut;02DD +hungarumlautcmb;030B +hv;0195 +hyphen;002D +hypheninferior;F6E5 +hyphenmonospace;FF0D +hyphensmall;FE63 +hyphensuperior;F6E6 +hyphentwo;2010 +i;0069 +iacute;00ED +iacyrillic;044F +ibengali;0987 +ibopomofo;3127 +ibreve;012D +icaron;01D0 +icircle;24D8 +icircumflex;00EE +icyrillic;0456 +idblgrave;0209 +ideographearthcircle;328F +ideographfirecircle;328B +ideographicallianceparen;323F +ideographiccallparen;323A +ideographiccentrecircle;32A5 +ideographicclose;3006 +ideographiccomma;3001 +ideographiccommaleft;FF64 +ideographiccongratulationparen;3237 +ideographiccorrectcircle;32A3 +ideographicearthparen;322F +ideographicenterpriseparen;323D +ideographicexcellentcircle;329D +ideographicfestivalparen;3240 +ideographicfinancialcircle;3296 +ideographicfinancialparen;3236 +ideographicfireparen;322B +ideographichaveparen;3232 +ideographichighcircle;32A4 +ideographiciterationmark;3005 +ideographiclaborcircle;3298 +ideographiclaborparen;3238 +ideographicleftcircle;32A7 +ideographiclowcircle;32A6 +ideographicmedicinecircle;32A9 +ideographicmetalparen;322E +ideographicmoonparen;322A +ideographicnameparen;3234 +ideographicperiod;3002 +ideographicprintcircle;329E +ideographicreachparen;3243 +ideographicrepresentparen;3239 +ideographicresourceparen;323E +ideographicrightcircle;32A8 +ideographicsecretcircle;3299 +ideographicselfparen;3242 +ideographicsocietyparen;3233 +ideographicspace;3000 +ideographicspecialparen;3235 +ideographicstockparen;3231 +ideographicstudyparen;323B +ideographicsunparen;3230 +ideographicsuperviseparen;323C +ideographicwaterparen;322C +ideographicwoodparen;322D +ideographiczero;3007 +ideographmetalcircle;328E +ideographmooncircle;328A +ideographnamecircle;3294 +ideographsuncircle;3290 +ideographwatercircle;328C +ideographwoodcircle;328D +ideva;0907 +idieresis;00EF +idieresisacute;1E2F +idieresiscyrillic;04E5 +idotbelow;1ECB +iebrevecyrillic;04D7 +iecyrillic;0435 +ieungacirclekorean;3275 +ieungaparenkorean;3215 +ieungcirclekorean;3267 +ieungkorean;3147 +ieungparenkorean;3207 +igrave;00EC +igujarati;0A87 +igurmukhi;0A07 +ihiragana;3044 +ihookabove;1EC9 +iibengali;0988 +iicyrillic;0438 +iideva;0908 +iigujarati;0A88 +iigurmukhi;0A08 +iimatragurmukhi;0A40 +iinvertedbreve;020B +iishortcyrillic;0439 +iivowelsignbengali;09C0 +iivowelsigndeva;0940 +iivowelsigngujarati;0AC0 +ij;0133 +ikatakana;30A4 +ikatakanahalfwidth;FF72 +ikorean;3163 +ilde;02DC +iluyhebrew;05AC +imacron;012B +imacroncyrillic;04E3 +imageorapproximatelyequal;2253 +imatragurmukhi;0A3F +imonospace;FF49 +increment;2206 +infinity;221E +iniarmenian;056B +integral;222B +integralbottom;2321 +integralbt;2321 +integralex;F8F5 +integraltop;2320 +integraltp;2320 +intersection;2229 +intisquare;3305 +invbullet;25D8 +invcircle;25D9 +invsmileface;263B +iocyrillic;0451 +iogonek;012F +iota;03B9 +iotadieresis;03CA +iotadieresistonos;0390 +iotalatin;0269 +iotatonos;03AF +iparen;24A4 +irigurmukhi;0A72 +ismallhiragana;3043 +ismallkatakana;30A3 +ismallkatakanahalfwidth;FF68 +issharbengali;09FA +istroke;0268 +isuperior;F6ED +iterationhiragana;309D +iterationkatakana;30FD +itilde;0129 +itildebelow;1E2D +iubopomofo;3129 +iucyrillic;044E +ivowelsignbengali;09BF +ivowelsigndeva;093F +ivowelsigngujarati;0ABF +izhitsacyrillic;0475 +izhitsadblgravecyrillic;0477 +j;006A +jaarmenian;0571 +jabengali;099C +jadeva;091C +jagujarati;0A9C +jagurmukhi;0A1C +jbopomofo;3110 +jcaron;01F0 +jcircle;24D9 +jcircumflex;0135 +jcrossedtail;029D +jdotlessstroke;025F +jecyrillic;0458 +jeemarabic;062C +jeemfinalarabic;FE9E +jeeminitialarabic;FE9F +jeemmedialarabic;FEA0 +jeharabic;0698 +jehfinalarabic;FB8B +jhabengali;099D +jhadeva;091D +jhagujarati;0A9D +jhagurmukhi;0A1D +jheharmenian;057B +jis;3004 +jmonospace;FF4A +jparen;24A5 +jsuperior;02B2 +k;006B +kabashkircyrillic;04A1 +kabengali;0995 +kacute;1E31 +kacyrillic;043A +kadescendercyrillic;049B +kadeva;0915 +kaf;05DB +kafarabic;0643 +kafdagesh;FB3B +kafdageshhebrew;FB3B +kaffinalarabic;FEDA +kafhebrew;05DB +kafinitialarabic;FEDB +kafmedialarabic;FEDC +kafrafehebrew;FB4D +kagujarati;0A95 +kagurmukhi;0A15 +kahiragana;304B +kahookcyrillic;04C4 +kakatakana;30AB +kakatakanahalfwidth;FF76 +kappa;03BA +kappasymbolgreek;03F0 +kapyeounmieumkorean;3171 +kapyeounphieuphkorean;3184 +kapyeounpieupkorean;3178 +kapyeounssangpieupkorean;3179 +karoriisquare;330D +kashidaautoarabic;0640 +kashidaautonosidebearingarabic;0640 +kasmallkatakana;30F5 +kasquare;3384 +kasraarabic;0650 +kasratanarabic;064D +kastrokecyrillic;049F +katahiraprolongmarkhalfwidth;FF70 +kaverticalstrokecyrillic;049D +kbopomofo;310E +kcalsquare;3389 +kcaron;01E9 +kcedilla;0137 +kcircle;24DA +kcommaaccent;0137 +kdotbelow;1E33 +keharmenian;0584 +kehiragana;3051 +kekatakana;30B1 +kekatakanahalfwidth;FF79 +kenarmenian;056F +kesmallkatakana;30F6 +kgreenlandic;0138 +khabengali;0996 +khacyrillic;0445 +khadeva;0916 +khagujarati;0A96 +khagurmukhi;0A16 +khaharabic;062E +khahfinalarabic;FEA6 +khahinitialarabic;FEA7 +khahmedialarabic;FEA8 +kheicoptic;03E7 +khhadeva;0959 +khhagurmukhi;0A59 +khieukhacirclekorean;3278 +khieukhaparenkorean;3218 +khieukhcirclekorean;326A +khieukhkorean;314B +khieukhparenkorean;320A +khokhaithai;0E02 +khokhonthai;0E05 +khokhuatthai;0E03 +khokhwaithai;0E04 +khomutthai;0E5B +khook;0199 +khorakhangthai;0E06 +khzsquare;3391 +kihiragana;304D +kikatakana;30AD +kikatakanahalfwidth;FF77 +kiroguramusquare;3315 +kiromeetorusquare;3316 +kirosquare;3314 +kiyeokacirclekorean;326E +kiyeokaparenkorean;320E +kiyeokcirclekorean;3260 +kiyeokkorean;3131 +kiyeokparenkorean;3200 +kiyeoksioskorean;3133 +kjecyrillic;045C +klinebelow;1E35 +klsquare;3398 +kmcubedsquare;33A6 +kmonospace;FF4B +kmsquaredsquare;33A2 +kohiragana;3053 +kohmsquare;33C0 +kokaithai;0E01 +kokatakana;30B3 +kokatakanahalfwidth;FF7A +kooposquare;331E +koppacyrillic;0481 +koreanstandardsymbol;327F +koroniscmb;0343 +kparen;24A6 +kpasquare;33AA +ksicyrillic;046F +ktsquare;33CF +kturned;029E +kuhiragana;304F +kukatakana;30AF +kukatakanahalfwidth;FF78 +kvsquare;33B8 +kwsquare;33BE +l;006C +labengali;09B2 +lacute;013A +ladeva;0932 +lagujarati;0AB2 +lagurmukhi;0A32 +lakkhangyaothai;0E45 +lamaleffinalarabic;FEFC +lamalefhamzaabovefinalarabic;FEF8 +lamalefhamzaaboveisolatedarabic;FEF7 +lamalefhamzabelowfinalarabic;FEFA +lamalefhamzabelowisolatedarabic;FEF9 +lamalefisolatedarabic;FEFB +lamalefmaddaabovefinalarabic;FEF6 +lamalefmaddaaboveisolatedarabic;FEF5 +lamarabic;0644 +lambda;03BB +lambdastroke;019B +lamed;05DC +lameddagesh;FB3C +lameddageshhebrew;FB3C +lamedhebrew;05DC +lamedholam;05DC 05B9 +lamedholamdagesh;05DC 05B9 05BC +lamedholamdageshhebrew;05DC 05B9 05BC +lamedholamhebrew;05DC 05B9 +lamfinalarabic;FEDE +lamhahinitialarabic;FCCA +laminitialarabic;FEDF +lamjeeminitialarabic;FCC9 +lamkhahinitialarabic;FCCB +lamlamhehisolatedarabic;FDF2 +lammedialarabic;FEE0 +lammeemhahinitialarabic;FD88 +lammeeminitialarabic;FCCC +lammeemjeeminitialarabic;FEDF FEE4 FEA0 +lammeemkhahinitialarabic;FEDF FEE4 FEA8 +largecircle;25EF +lbar;019A +lbelt;026C +lbopomofo;310C +lcaron;013E +lcedilla;013C +lcircle;24DB +lcircumflexbelow;1E3D +lcommaaccent;013C +ldot;0140 +ldotaccent;0140 +ldotbelow;1E37 +ldotbelowmacron;1E39 +leftangleabovecmb;031A +lefttackbelowcmb;0318 +less;003C +lessequal;2264 +lessequalorgreater;22DA +lessmonospace;FF1C +lessorequivalent;2272 +lessorgreater;2276 +lessoverequal;2266 +lesssmall;FE64 +lezh;026E +lfblock;258C +lhookretroflex;026D +lira;20A4 +liwnarmenian;056C +lj;01C9 +ljecyrillic;0459 +ll;F6C0 +lladeva;0933 +llagujarati;0AB3 +llinebelow;1E3B +llladeva;0934 +llvocalicbengali;09E1 +llvocalicdeva;0961 +llvocalicvowelsignbengali;09E3 +llvocalicvowelsigndeva;0963 +lmiddletilde;026B +lmonospace;FF4C +lmsquare;33D0 +lochulathai;0E2C +logicaland;2227 +logicalnot;00AC +logicalnotreversed;2310 +logicalor;2228 +lolingthai;0E25 +longs;017F +lowlinecenterline;FE4E +lowlinecmb;0332 +lowlinedashed;FE4D +lozenge;25CA +lparen;24A7 +lslash;0142 +lsquare;2113 +lsuperior;F6EE +ltshade;2591 +luthai;0E26 +lvocalicbengali;098C +lvocalicdeva;090C +lvocalicvowelsignbengali;09E2 +lvocalicvowelsigndeva;0962 +lxsquare;33D3 +m;006D +mabengali;09AE +macron;00AF +macronbelowcmb;0331 +macroncmb;0304 +macronlowmod;02CD +macronmonospace;FFE3 +macute;1E3F +madeva;092E +magujarati;0AAE +magurmukhi;0A2E +mahapakhhebrew;05A4 +mahapakhlefthebrew;05A4 +mahiragana;307E +maichattawalowleftthai;F895 +maichattawalowrightthai;F894 +maichattawathai;0E4B +maichattawaupperleftthai;F893 +maieklowleftthai;F88C +maieklowrightthai;F88B +maiekthai;0E48 +maiekupperleftthai;F88A +maihanakatleftthai;F884 +maihanakatthai;0E31 +maitaikhuleftthai;F889 +maitaikhuthai;0E47 +maitholowleftthai;F88F +maitholowrightthai;F88E +maithothai;0E49 +maithoupperleftthai;F88D +maitrilowleftthai;F892 +maitrilowrightthai;F891 +maitrithai;0E4A +maitriupperleftthai;F890 +maiyamokthai;0E46 +makatakana;30DE +makatakanahalfwidth;FF8F +male;2642 +mansyonsquare;3347 +maqafhebrew;05BE +mars;2642 +masoracirclehebrew;05AF +masquare;3383 +mbopomofo;3107 +mbsquare;33D4 +mcircle;24DC +mcubedsquare;33A5 +mdotaccent;1E41 +mdotbelow;1E43 +meemarabic;0645 +meemfinalarabic;FEE2 +meeminitialarabic;FEE3 +meemmedialarabic;FEE4 +meemmeeminitialarabic;FCD1 +meemmeemisolatedarabic;FC48 +meetorusquare;334D +mehiragana;3081 +meizierasquare;337E +mekatakana;30E1 +mekatakanahalfwidth;FF92 +mem;05DE +memdagesh;FB3E +memdageshhebrew;FB3E +memhebrew;05DE +menarmenian;0574 +merkhahebrew;05A5 +merkhakefulahebrew;05A6 +merkhakefulalefthebrew;05A6 +merkhalefthebrew;05A5 +mhook;0271 +mhzsquare;3392 +middledotkatakanahalfwidth;FF65 +middot;00B7 +mieumacirclekorean;3272 +mieumaparenkorean;3212 +mieumcirclekorean;3264 +mieumkorean;3141 +mieumpansioskorean;3170 +mieumparenkorean;3204 +mieumpieupkorean;316E +mieumsioskorean;316F +mihiragana;307F +mikatakana;30DF +mikatakanahalfwidth;FF90 +minus;2212 +minusbelowcmb;0320 +minuscircle;2296 +minusmod;02D7 +minusplus;2213 +minute;2032 +miribaarusquare;334A +mirisquare;3349 +mlonglegturned;0270 +mlsquare;3396 +mmcubedsquare;33A3 +mmonospace;FF4D +mmsquaredsquare;339F +mohiragana;3082 +mohmsquare;33C1 +mokatakana;30E2 +mokatakanahalfwidth;FF93 +molsquare;33D6 +momathai;0E21 +moverssquare;33A7 +moverssquaredsquare;33A8 +mparen;24A8 +mpasquare;33AB +mssquare;33B3 +msuperior;F6EF +mturned;026F +mu;00B5 +mu1;00B5 +muasquare;3382 +muchgreater;226B +muchless;226A +mufsquare;338C +mugreek;03BC +mugsquare;338D +muhiragana;3080 +mukatakana;30E0 +mukatakanahalfwidth;FF91 +mulsquare;3395 +multiply;00D7 +mumsquare;339B +munahhebrew;05A3 +munahlefthebrew;05A3 +musicalnote;266A +musicalnotedbl;266B +musicflatsign;266D +musicsharpsign;266F +mussquare;33B2 +muvsquare;33B6 +muwsquare;33BC +mvmegasquare;33B9 +mvsquare;33B7 +mwmegasquare;33BF +mwsquare;33BD +n;006E +nabengali;09A8 +nabla;2207 +nacute;0144 +nadeva;0928 +nagujarati;0AA8 +nagurmukhi;0A28 +nahiragana;306A +nakatakana;30CA +nakatakanahalfwidth;FF85 +napostrophe;0149 +nasquare;3381 +nbopomofo;310B +nbspace;00A0 +ncaron;0148 +ncedilla;0146 +ncircle;24DD +ncircumflexbelow;1E4B +ncommaaccent;0146 +ndotaccent;1E45 +ndotbelow;1E47 +nehiragana;306D +nekatakana;30CD +nekatakanahalfwidth;FF88 +newsheqelsign;20AA +nfsquare;338B +ngabengali;0999 +ngadeva;0919 +ngagujarati;0A99 +ngagurmukhi;0A19 +ngonguthai;0E07 +nhiragana;3093 +nhookleft;0272 +nhookretroflex;0273 +nieunacirclekorean;326F +nieunaparenkorean;320F +nieuncieuckorean;3135 +nieuncirclekorean;3261 +nieunhieuhkorean;3136 +nieunkorean;3134 +nieunpansioskorean;3168 +nieunparenkorean;3201 +nieunsioskorean;3167 +nieuntikeutkorean;3166 +nihiragana;306B +nikatakana;30CB +nikatakanahalfwidth;FF86 +nikhahitleftthai;F899 +nikhahitthai;0E4D +nine;0039 +ninearabic;0669 +ninebengali;09EF +ninecircle;2468 +ninecircleinversesansserif;2792 +ninedeva;096F +ninegujarati;0AEF +ninegurmukhi;0A6F +ninehackarabic;0669 +ninehangzhou;3029 +nineideographicparen;3228 +nineinferior;2089 +ninemonospace;FF19 +nineoldstyle;F739 +nineparen;247C +nineperiod;2490 +ninepersian;06F9 +nineroman;2178 +ninesuperior;2079 +nineteencircle;2472 +nineteenparen;2486 +nineteenperiod;249A +ninethai;0E59 +nj;01CC +njecyrillic;045A +nkatakana;30F3 +nkatakanahalfwidth;FF9D +nlegrightlong;019E +nlinebelow;1E49 +nmonospace;FF4E +nmsquare;339A +nnabengali;09A3 +nnadeva;0923 +nnagujarati;0AA3 +nnagurmukhi;0A23 +nnnadeva;0929 +nohiragana;306E +nokatakana;30CE +nokatakanahalfwidth;FF89 +nonbreakingspace;00A0 +nonenthai;0E13 +nonuthai;0E19 +noonarabic;0646 +noonfinalarabic;FEE6 +noonghunnaarabic;06BA +noonghunnafinalarabic;FB9F +noonhehinitialarabic;FEE7 FEEC +nooninitialarabic;FEE7 +noonjeeminitialarabic;FCD2 +noonjeemisolatedarabic;FC4B +noonmedialarabic;FEE8 +noonmeeminitialarabic;FCD5 +noonmeemisolatedarabic;FC4E +noonnoonfinalarabic;FC8D +notcontains;220C +notelement;2209 +notelementof;2209 +notequal;2260 +notgreater;226F +notgreaternorequal;2271 +notgreaternorless;2279 +notidentical;2262 +notless;226E +notlessnorequal;2270 +notparallel;2226 +notprecedes;2280 +notsubset;2284 +notsucceeds;2281 +notsuperset;2285 +nowarmenian;0576 +nparen;24A9 +nssquare;33B1 +nsuperior;207F +ntilde;00F1 +nu;03BD +nuhiragana;306C +nukatakana;30CC +nukatakanahalfwidth;FF87 +nuktabengali;09BC +nuktadeva;093C +nuktagujarati;0ABC +nuktagurmukhi;0A3C +numbersign;0023 +numbersignmonospace;FF03 +numbersignsmall;FE5F +numeralsigngreek;0374 +numeralsignlowergreek;0375 +numero;2116 +nun;05E0 +nundagesh;FB40 +nundageshhebrew;FB40 +nunhebrew;05E0 +nvsquare;33B5 +nwsquare;33BB +nyabengali;099E +nyadeva;091E +nyagujarati;0A9E +nyagurmukhi;0A1E +o;006F +oacute;00F3 +oangthai;0E2D +obarred;0275 +obarredcyrillic;04E9 +obarreddieresiscyrillic;04EB +obengali;0993 +obopomofo;311B +obreve;014F +ocandradeva;0911 +ocandragujarati;0A91 +ocandravowelsigndeva;0949 +ocandravowelsigngujarati;0AC9 +ocaron;01D2 +ocircle;24DE +ocircumflex;00F4 +ocircumflexacute;1ED1 +ocircumflexdotbelow;1ED9 +ocircumflexgrave;1ED3 +ocircumflexhookabove;1ED5 +ocircumflextilde;1ED7 +ocyrillic;043E +odblacute;0151 +odblgrave;020D +odeva;0913 +odieresis;00F6 +odieresiscyrillic;04E7 +odotbelow;1ECD +oe;0153 +oekorean;315A +ogonek;02DB +ogonekcmb;0328 +ograve;00F2 +ogujarati;0A93 +oharmenian;0585 +ohiragana;304A +ohookabove;1ECF +ohorn;01A1 +ohornacute;1EDB +ohorndotbelow;1EE3 +ohorngrave;1EDD +ohornhookabove;1EDF +ohorntilde;1EE1 +ohungarumlaut;0151 +oi;01A3 +oinvertedbreve;020F +okatakana;30AA +okatakanahalfwidth;FF75 +okorean;3157 +olehebrew;05AB +omacron;014D +omacronacute;1E53 +omacrongrave;1E51 +omdeva;0950 +omega;03C9 +omega1;03D6 +omegacyrillic;0461 +omegalatinclosed;0277 +omegaroundcyrillic;047B +omegatitlocyrillic;047D +omegatonos;03CE +omgujarati;0AD0 +omicron;03BF +omicrontonos;03CC +omonospace;FF4F +one;0031 +onearabic;0661 +onebengali;09E7 +onecircle;2460 +onecircleinversesansserif;278A +onedeva;0967 +onedotenleader;2024 +oneeighth;215B +onefitted;F6DC +onegujarati;0AE7 +onegurmukhi;0A67 +onehackarabic;0661 +onehalf;00BD +onehangzhou;3021 +oneideographicparen;3220 +oneinferior;2081 +onemonospace;FF11 +onenumeratorbengali;09F4 +oneoldstyle;F731 +oneparen;2474 +oneperiod;2488 +onepersian;06F1 +onequarter;00BC +oneroman;2170 +onesuperior;00B9 +onethai;0E51 +onethird;2153 +oogonek;01EB +oogonekmacron;01ED +oogurmukhi;0A13 +oomatragurmukhi;0A4B +oopen;0254 +oparen;24AA +openbullet;25E6 +option;2325 +ordfeminine;00AA +ordmasculine;00BA +orthogonal;221F +oshortdeva;0912 +oshortvowelsigndeva;094A +oslash;00F8 +oslashacute;01FF +osmallhiragana;3049 +osmallkatakana;30A9 +osmallkatakanahalfwidth;FF6B +ostrokeacute;01FF +osuperior;F6F0 +otcyrillic;047F +otilde;00F5 +otildeacute;1E4D +otildedieresis;1E4F +oubopomofo;3121 +overline;203E +overlinecenterline;FE4A +overlinecmb;0305 +overlinedashed;FE49 +overlinedblwavy;FE4C +overlinewavy;FE4B +overscore;00AF +ovowelsignbengali;09CB +ovowelsigndeva;094B +ovowelsigngujarati;0ACB +p;0070 +paampssquare;3380 +paasentosquare;332B +pabengali;09AA +pacute;1E55 +padeva;092A +pagedown;21DF +pageup;21DE +pagujarati;0AAA +pagurmukhi;0A2A +pahiragana;3071 +paiyannoithai;0E2F +pakatakana;30D1 +palatalizationcyrilliccmb;0484 +palochkacyrillic;04C0 +pansioskorean;317F +paragraph;00B6 +parallel;2225 +parenleft;0028 +parenleftaltonearabic;FD3E +parenleftbt;F8ED +parenleftex;F8EC +parenleftinferior;208D +parenleftmonospace;FF08 +parenleftsmall;FE59 +parenleftsuperior;207D +parenlefttp;F8EB +parenleftvertical;FE35 +parenright;0029 +parenrightaltonearabic;FD3F +parenrightbt;F8F8 +parenrightex;F8F7 +parenrightinferior;208E +parenrightmonospace;FF09 +parenrightsmall;FE5A +parenrightsuperior;207E +parenrighttp;F8F6 +parenrightvertical;FE36 +partialdiff;2202 +paseqhebrew;05C0 +pashtahebrew;0599 +pasquare;33A9 +patah;05B7 +patah11;05B7 +patah1d;05B7 +patah2a;05B7 +patahhebrew;05B7 +patahnarrowhebrew;05B7 +patahquarterhebrew;05B7 +patahwidehebrew;05B7 +pazerhebrew;05A1 +pbopomofo;3106 +pcircle;24DF +pdotaccent;1E57 +pe;05E4 +pecyrillic;043F +pedagesh;FB44 +pedageshhebrew;FB44 +peezisquare;333B +pefinaldageshhebrew;FB43 +peharabic;067E +peharmenian;057A +pehebrew;05E4 +pehfinalarabic;FB57 +pehinitialarabic;FB58 +pehiragana;307A +pehmedialarabic;FB59 +pekatakana;30DA +pemiddlehookcyrillic;04A7 +perafehebrew;FB4E +percent;0025 +percentarabic;066A +percentmonospace;FF05 +percentsmall;FE6A +period;002E +periodarmenian;0589 +periodcentered;00B7 +periodhalfwidth;FF61 +periodinferior;F6E7 +periodmonospace;FF0E +periodsmall;FE52 +periodsuperior;F6E8 +perispomenigreekcmb;0342 +perpendicular;22A5 +perthousand;2030 +peseta;20A7 +pfsquare;338A +phabengali;09AB +phadeva;092B +phagujarati;0AAB +phagurmukhi;0A2B +phi;03C6 +phi1;03D5 +phieuphacirclekorean;327A +phieuphaparenkorean;321A +phieuphcirclekorean;326C +phieuphkorean;314D +phieuphparenkorean;320C +philatin;0278 +phinthuthai;0E3A +phisymbolgreek;03D5 +phook;01A5 +phophanthai;0E1E +phophungthai;0E1C +phosamphaothai;0E20 +pi;03C0 +pieupacirclekorean;3273 +pieupaparenkorean;3213 +pieupcieuckorean;3176 +pieupcirclekorean;3265 +pieupkiyeokkorean;3172 +pieupkorean;3142 +pieupparenkorean;3205 +pieupsioskiyeokkorean;3174 +pieupsioskorean;3144 +pieupsiostikeutkorean;3175 +pieupthieuthkorean;3177 +pieuptikeutkorean;3173 +pihiragana;3074 +pikatakana;30D4 +pisymbolgreek;03D6 +piwrarmenian;0583 +plus;002B +plusbelowcmb;031F +pluscircle;2295 +plusminus;00B1 +plusmod;02D6 +plusmonospace;FF0B +plussmall;FE62 +plussuperior;207A +pmonospace;FF50 +pmsquare;33D8 +pohiragana;307D +pointingindexdownwhite;261F +pointingindexleftwhite;261C +pointingindexrightwhite;261E +pointingindexupwhite;261D +pokatakana;30DD +poplathai;0E1B +postalmark;3012 +postalmarkface;3020 +pparen;24AB +precedes;227A +prescription;211E +primemod;02B9 +primereversed;2035 +product;220F +projective;2305 +prolongedkana;30FC +propellor;2318 +propersubset;2282 +propersuperset;2283 +proportion;2237 +proportional;221D +psi;03C8 +psicyrillic;0471 +psilipneumatacyrilliccmb;0486 +pssquare;33B0 +puhiragana;3077 +pukatakana;30D7 +pvsquare;33B4 +pwsquare;33BA +q;0071 +qadeva;0958 +qadmahebrew;05A8 +qafarabic;0642 +qaffinalarabic;FED6 +qafinitialarabic;FED7 +qafmedialarabic;FED8 +qamats;05B8 +qamats10;05B8 +qamats1a;05B8 +qamats1c;05B8 +qamats27;05B8 +qamats29;05B8 +qamats33;05B8 +qamatsde;05B8 +qamatshebrew;05B8 +qamatsnarrowhebrew;05B8 +qamatsqatanhebrew;05B8 +qamatsqatannarrowhebrew;05B8 +qamatsqatanquarterhebrew;05B8 +qamatsqatanwidehebrew;05B8 +qamatsquarterhebrew;05B8 +qamatswidehebrew;05B8 +qarneyparahebrew;059F +qbopomofo;3111 +qcircle;24E0 +qhook;02A0 +qmonospace;FF51 +qof;05E7 +qofdagesh;FB47 +qofdageshhebrew;FB47 +qofhatafpatah;05E7 05B2 +qofhatafpatahhebrew;05E7 05B2 +qofhatafsegol;05E7 05B1 +qofhatafsegolhebrew;05E7 05B1 +qofhebrew;05E7 +qofhiriq;05E7 05B4 +qofhiriqhebrew;05E7 05B4 +qofholam;05E7 05B9 +qofholamhebrew;05E7 05B9 +qofpatah;05E7 05B7 +qofpatahhebrew;05E7 05B7 +qofqamats;05E7 05B8 +qofqamatshebrew;05E7 05B8 +qofqubuts;05E7 05BB +qofqubutshebrew;05E7 05BB +qofsegol;05E7 05B6 +qofsegolhebrew;05E7 05B6 +qofsheva;05E7 05B0 +qofshevahebrew;05E7 05B0 +qoftsere;05E7 05B5 +qoftserehebrew;05E7 05B5 +qparen;24AC +quarternote;2669 +qubuts;05BB +qubuts18;05BB +qubuts25;05BB +qubuts31;05BB +qubutshebrew;05BB +qubutsnarrowhebrew;05BB +qubutsquarterhebrew;05BB +qubutswidehebrew;05BB +question;003F +questionarabic;061F +questionarmenian;055E +questiondown;00BF +questiondownsmall;F7BF +questiongreek;037E +questionmonospace;FF1F +questionsmall;F73F +quotedbl;0022 +quotedblbase;201E +quotedblleft;201C +quotedblmonospace;FF02 +quotedblprime;301E +quotedblprimereversed;301D +quotedblright;201D +quoteleft;2018 +quoteleftreversed;201B +quotereversed;201B +quoteright;2019 +quoterightn;0149 +quotesinglbase;201A +quotesingle;0027 +quotesinglemonospace;FF07 +r;0072 +raarmenian;057C +rabengali;09B0 +racute;0155 +radeva;0930 +radical;221A +radicalex;F8E5 +radoverssquare;33AE +radoverssquaredsquare;33AF +radsquare;33AD +rafe;05BF +rafehebrew;05BF +ragujarati;0AB0 +ragurmukhi;0A30 +rahiragana;3089 +rakatakana;30E9 +rakatakanahalfwidth;FF97 +ralowerdiagonalbengali;09F1 +ramiddlediagonalbengali;09F0 +ramshorn;0264 +ratio;2236 +rbopomofo;3116 +rcaron;0159 +rcedilla;0157 +rcircle;24E1 +rcommaaccent;0157 +rdblgrave;0211 +rdotaccent;1E59 +rdotbelow;1E5B +rdotbelowmacron;1E5D +referencemark;203B +reflexsubset;2286 +reflexsuperset;2287 +registered;00AE +registersans;F8E8 +registerserif;F6DA +reharabic;0631 +reharmenian;0580 +rehfinalarabic;FEAE +rehiragana;308C +rehyehaleflamarabic;0631 FEF3 FE8E 0644 +rekatakana;30EC +rekatakanahalfwidth;FF9A +resh;05E8 +reshdageshhebrew;FB48 +reshhatafpatah;05E8 05B2 +reshhatafpatahhebrew;05E8 05B2 +reshhatafsegol;05E8 05B1 +reshhatafsegolhebrew;05E8 05B1 +reshhebrew;05E8 +reshhiriq;05E8 05B4 +reshhiriqhebrew;05E8 05B4 +reshholam;05E8 05B9 +reshholamhebrew;05E8 05B9 +reshpatah;05E8 05B7 +reshpatahhebrew;05E8 05B7 +reshqamats;05E8 05B8 +reshqamatshebrew;05E8 05B8 +reshqubuts;05E8 05BB +reshqubutshebrew;05E8 05BB +reshsegol;05E8 05B6 +reshsegolhebrew;05E8 05B6 +reshsheva;05E8 05B0 +reshshevahebrew;05E8 05B0 +reshtsere;05E8 05B5 +reshtserehebrew;05E8 05B5 +reversedtilde;223D +reviahebrew;0597 +reviamugrashhebrew;0597 +revlogicalnot;2310 +rfishhook;027E +rfishhookreversed;027F +rhabengali;09DD +rhadeva;095D +rho;03C1 +rhook;027D +rhookturned;027B +rhookturnedsuperior;02B5 +rhosymbolgreek;03F1 +rhotichookmod;02DE +rieulacirclekorean;3271 +rieulaparenkorean;3211 +rieulcirclekorean;3263 +rieulhieuhkorean;3140 +rieulkiyeokkorean;313A +rieulkiyeoksioskorean;3169 +rieulkorean;3139 +rieulmieumkorean;313B +rieulpansioskorean;316C +rieulparenkorean;3203 +rieulphieuphkorean;313F +rieulpieupkorean;313C +rieulpieupsioskorean;316B +rieulsioskorean;313D +rieulthieuthkorean;313E +rieultikeutkorean;316A +rieulyeorinhieuhkorean;316D +rightangle;221F +righttackbelowcmb;0319 +righttriangle;22BF +rihiragana;308A +rikatakana;30EA +rikatakanahalfwidth;FF98 +ring;02DA +ringbelowcmb;0325 +ringcmb;030A +ringhalfleft;02BF +ringhalfleftarmenian;0559 +ringhalfleftbelowcmb;031C +ringhalfleftcentered;02D3 +ringhalfright;02BE +ringhalfrightbelowcmb;0339 +ringhalfrightcentered;02D2 +rinvertedbreve;0213 +rittorusquare;3351 +rlinebelow;1E5F +rlongleg;027C +rlonglegturned;027A +rmonospace;FF52 +rohiragana;308D +rokatakana;30ED +rokatakanahalfwidth;FF9B +roruathai;0E23 +rparen;24AD +rrabengali;09DC +rradeva;0931 +rragurmukhi;0A5C +rreharabic;0691 +rrehfinalarabic;FB8D +rrvocalicbengali;09E0 +rrvocalicdeva;0960 +rrvocalicgujarati;0AE0 +rrvocalicvowelsignbengali;09C4 +rrvocalicvowelsigndeva;0944 +rrvocalicvowelsigngujarati;0AC4 +rsuperior;F6F1 +rtblock;2590 +rturned;0279 +rturnedsuperior;02B4 +ruhiragana;308B +rukatakana;30EB +rukatakanahalfwidth;FF99 +rupeemarkbengali;09F2 +rupeesignbengali;09F3 +rupiah;F6DD +ruthai;0E24 +rvocalicbengali;098B +rvocalicdeva;090B +rvocalicgujarati;0A8B +rvocalicvowelsignbengali;09C3 +rvocalicvowelsigndeva;0943 +rvocalicvowelsigngujarati;0AC3 +s;0073 +sabengali;09B8 +sacute;015B +sacutedotaccent;1E65 +sadarabic;0635 +sadeva;0938 +sadfinalarabic;FEBA +sadinitialarabic;FEBB +sadmedialarabic;FEBC +sagujarati;0AB8 +sagurmukhi;0A38 +sahiragana;3055 +sakatakana;30B5 +sakatakanahalfwidth;FF7B +sallallahoualayhewasallamarabic;FDFA +samekh;05E1 +samekhdagesh;FB41 +samekhdageshhebrew;FB41 +samekhhebrew;05E1 +saraaathai;0E32 +saraaethai;0E41 +saraaimaimalaithai;0E44 +saraaimaimuanthai;0E43 +saraamthai;0E33 +saraathai;0E30 +saraethai;0E40 +saraiileftthai;F886 +saraiithai;0E35 +saraileftthai;F885 +saraithai;0E34 +saraothai;0E42 +saraueeleftthai;F888 +saraueethai;0E37 +saraueleftthai;F887 +sarauethai;0E36 +sarauthai;0E38 +sarauuthai;0E39 +sbopomofo;3119 +scaron;0161 +scarondotaccent;1E67 +scedilla;015F +schwa;0259 +schwacyrillic;04D9 +schwadieresiscyrillic;04DB +schwahook;025A +scircle;24E2 +scircumflex;015D +scommaaccent;0219 +sdotaccent;1E61 +sdotbelow;1E63 +sdotbelowdotaccent;1E69 +seagullbelowcmb;033C +second;2033 +secondtonechinese;02CA +section;00A7 +seenarabic;0633 +seenfinalarabic;FEB2 +seeninitialarabic;FEB3 +seenmedialarabic;FEB4 +segol;05B6 +segol13;05B6 +segol1f;05B6 +segol2c;05B6 +segolhebrew;05B6 +segolnarrowhebrew;05B6 +segolquarterhebrew;05B6 +segoltahebrew;0592 +segolwidehebrew;05B6 +seharmenian;057D +sehiragana;305B +sekatakana;30BB +sekatakanahalfwidth;FF7E +semicolon;003B +semicolonarabic;061B +semicolonmonospace;FF1B +semicolonsmall;FE54 +semivoicedmarkkana;309C +semivoicedmarkkanahalfwidth;FF9F +sentisquare;3322 +sentosquare;3323 +seven;0037 +sevenarabic;0667 +sevenbengali;09ED +sevencircle;2466 +sevencircleinversesansserif;2790 +sevendeva;096D +seveneighths;215E +sevengujarati;0AED +sevengurmukhi;0A6D +sevenhackarabic;0667 +sevenhangzhou;3027 +sevenideographicparen;3226 +seveninferior;2087 +sevenmonospace;FF17 +sevenoldstyle;F737 +sevenparen;247A +sevenperiod;248E +sevenpersian;06F7 +sevenroman;2176 +sevensuperior;2077 +seventeencircle;2470 +seventeenparen;2484 +seventeenperiod;2498 +seventhai;0E57 +sfthyphen;00AD +shaarmenian;0577 +shabengali;09B6 +shacyrillic;0448 +shaddaarabic;0651 +shaddadammaarabic;FC61 +shaddadammatanarabic;FC5E +shaddafathaarabic;FC60 +shaddafathatanarabic;0651 064B +shaddakasraarabic;FC62 +shaddakasratanarabic;FC5F +shade;2592 +shadedark;2593 +shadelight;2591 +shademedium;2592 +shadeva;0936 +shagujarati;0AB6 +shagurmukhi;0A36 +shalshelethebrew;0593 +shbopomofo;3115 +shchacyrillic;0449 +sheenarabic;0634 +sheenfinalarabic;FEB6 +sheeninitialarabic;FEB7 +sheenmedialarabic;FEB8 +sheicoptic;03E3 +sheqel;20AA +sheqelhebrew;20AA +sheva;05B0 +sheva115;05B0 +sheva15;05B0 +sheva22;05B0 +sheva2e;05B0 +shevahebrew;05B0 +shevanarrowhebrew;05B0 +shevaquarterhebrew;05B0 +shevawidehebrew;05B0 +shhacyrillic;04BB +shimacoptic;03ED +shin;05E9 +shindagesh;FB49 +shindageshhebrew;FB49 +shindageshshindot;FB2C +shindageshshindothebrew;FB2C +shindageshsindot;FB2D +shindageshsindothebrew;FB2D +shindothebrew;05C1 +shinhebrew;05E9 +shinshindot;FB2A +shinshindothebrew;FB2A +shinsindot;FB2B +shinsindothebrew;FB2B +shook;0282 +sigma;03C3 +sigma1;03C2 +sigmafinal;03C2 +sigmalunatesymbolgreek;03F2 +sihiragana;3057 +sikatakana;30B7 +sikatakanahalfwidth;FF7C +siluqhebrew;05BD +siluqlefthebrew;05BD +similar;223C +sindothebrew;05C2 +siosacirclekorean;3274 +siosaparenkorean;3214 +sioscieuckorean;317E +sioscirclekorean;3266 +sioskiyeokkorean;317A +sioskorean;3145 +siosnieunkorean;317B +siosparenkorean;3206 +siospieupkorean;317D +siostikeutkorean;317C +six;0036 +sixarabic;0666 +sixbengali;09EC +sixcircle;2465 +sixcircleinversesansserif;278F +sixdeva;096C +sixgujarati;0AEC +sixgurmukhi;0A6C +sixhackarabic;0666 +sixhangzhou;3026 +sixideographicparen;3225 +sixinferior;2086 +sixmonospace;FF16 +sixoldstyle;F736 +sixparen;2479 +sixperiod;248D +sixpersian;06F6 +sixroman;2175 +sixsuperior;2076 +sixteencircle;246F +sixteencurrencydenominatorbengali;09F9 +sixteenparen;2483 +sixteenperiod;2497 +sixthai;0E56 +slash;002F +slashmonospace;FF0F +slong;017F +slongdotaccent;1E9B +smileface;263A +smonospace;FF53 +sofpasuqhebrew;05C3 +softhyphen;00AD +softsigncyrillic;044C +sohiragana;305D +sokatakana;30BD +sokatakanahalfwidth;FF7F +soliduslongoverlaycmb;0338 +solidusshortoverlaycmb;0337 +sorusithai;0E29 +sosalathai;0E28 +sosothai;0E0B +sosuathai;0E2A +space;0020 +spacehackarabic;0020 +spade;2660 +spadesuitblack;2660 +spadesuitwhite;2664 +sparen;24AE +squarebelowcmb;033B +squarecc;33C4 +squarecm;339D +squarediagonalcrosshatchfill;25A9 +squarehorizontalfill;25A4 +squarekg;338F +squarekm;339E +squarekmcapital;33CE +squareln;33D1 +squarelog;33D2 +squaremg;338E +squaremil;33D5 +squaremm;339C +squaremsquared;33A1 +squareorthogonalcrosshatchfill;25A6 +squareupperlefttolowerrightfill;25A7 +squareupperrighttolowerleftfill;25A8 +squareverticalfill;25A5 +squarewhitewithsmallblack;25A3 +srsquare;33DB +ssabengali;09B7 +ssadeva;0937 +ssagujarati;0AB7 +ssangcieuckorean;3149 +ssanghieuhkorean;3185 +ssangieungkorean;3180 +ssangkiyeokkorean;3132 +ssangnieunkorean;3165 +ssangpieupkorean;3143 +ssangsioskorean;3146 +ssangtikeutkorean;3138 +ssuperior;F6F2 +sterling;00A3 +sterlingmonospace;FFE1 +strokelongoverlaycmb;0336 +strokeshortoverlaycmb;0335 +subset;2282 +subsetnotequal;228A +subsetorequal;2286 +succeeds;227B +suchthat;220B +suhiragana;3059 +sukatakana;30B9 +sukatakanahalfwidth;FF7D +sukunarabic;0652 +summation;2211 +sun;263C +superset;2283 +supersetnotequal;228B +supersetorequal;2287 +svsquare;33DC +syouwaerasquare;337C +t;0074 +tabengali;09A4 +tackdown;22A4 +tackleft;22A3 +tadeva;0924 +tagujarati;0AA4 +tagurmukhi;0A24 +taharabic;0637 +tahfinalarabic;FEC2 +tahinitialarabic;FEC3 +tahiragana;305F +tahmedialarabic;FEC4 +taisyouerasquare;337D +takatakana;30BF +takatakanahalfwidth;FF80 +tatweelarabic;0640 +tau;03C4 +tav;05EA +tavdages;FB4A +tavdagesh;FB4A +tavdageshhebrew;FB4A +tavhebrew;05EA +tbar;0167 +tbopomofo;310A +tcaron;0165 +tccurl;02A8 +tcedilla;0163 +tcheharabic;0686 +tchehfinalarabic;FB7B +tchehinitialarabic;FB7C +tchehmedialarabic;FB7D +tchehmeeminitialarabic;FB7C FEE4 +tcircle;24E3 +tcircumflexbelow;1E71 +tcommaaccent;0163 +tdieresis;1E97 +tdotaccent;1E6B +tdotbelow;1E6D +tecyrillic;0442 +tedescendercyrillic;04AD +teharabic;062A +tehfinalarabic;FE96 +tehhahinitialarabic;FCA2 +tehhahisolatedarabic;FC0C +tehinitialarabic;FE97 +tehiragana;3066 +tehjeeminitialarabic;FCA1 +tehjeemisolatedarabic;FC0B +tehmarbutaarabic;0629 +tehmarbutafinalarabic;FE94 +tehmedialarabic;FE98 +tehmeeminitialarabic;FCA4 +tehmeemisolatedarabic;FC0E +tehnoonfinalarabic;FC73 +tekatakana;30C6 +tekatakanahalfwidth;FF83 +telephone;2121 +telephoneblack;260E +telishagedolahebrew;05A0 +telishaqetanahebrew;05A9 +tencircle;2469 +tenideographicparen;3229 +tenparen;247D +tenperiod;2491 +tenroman;2179 +tesh;02A7 +tet;05D8 +tetdagesh;FB38 +tetdageshhebrew;FB38 +tethebrew;05D8 +tetsecyrillic;04B5 +tevirhebrew;059B +tevirlefthebrew;059B +thabengali;09A5 +thadeva;0925 +thagujarati;0AA5 +thagurmukhi;0A25 +thalarabic;0630 +thalfinalarabic;FEAC +thanthakhatlowleftthai;F898 +thanthakhatlowrightthai;F897 +thanthakhatthai;0E4C +thanthakhatupperleftthai;F896 +theharabic;062B +thehfinalarabic;FE9A +thehinitialarabic;FE9B +thehmedialarabic;FE9C +thereexists;2203 +therefore;2234 +theta;03B8 +theta1;03D1 +thetasymbolgreek;03D1 +thieuthacirclekorean;3279 +thieuthaparenkorean;3219 +thieuthcirclekorean;326B +thieuthkorean;314C +thieuthparenkorean;320B +thirteencircle;246C +thirteenparen;2480 +thirteenperiod;2494 +thonangmonthothai;0E11 +thook;01AD +thophuthaothai;0E12 +thorn;00FE +thothahanthai;0E17 +thothanthai;0E10 +thothongthai;0E18 +thothungthai;0E16 +thousandcyrillic;0482 +thousandsseparatorarabic;066C +thousandsseparatorpersian;066C +three;0033 +threearabic;0663 +threebengali;09E9 +threecircle;2462 +threecircleinversesansserif;278C +threedeva;0969 +threeeighths;215C +threegujarati;0AE9 +threegurmukhi;0A69 +threehackarabic;0663 +threehangzhou;3023 +threeideographicparen;3222 +threeinferior;2083 +threemonospace;FF13 +threenumeratorbengali;09F6 +threeoldstyle;F733 +threeparen;2476 +threeperiod;248A +threepersian;06F3 +threequarters;00BE +threequartersemdash;F6DE +threeroman;2172 +threesuperior;00B3 +threethai;0E53 +thzsquare;3394 +tihiragana;3061 +tikatakana;30C1 +tikatakanahalfwidth;FF81 +tikeutacirclekorean;3270 +tikeutaparenkorean;3210 +tikeutcirclekorean;3262 +tikeutkorean;3137 +tikeutparenkorean;3202 +tilde;02DC +tildebelowcmb;0330 +tildecmb;0303 +tildecomb;0303 +tildedoublecmb;0360 +tildeoperator;223C +tildeoverlaycmb;0334 +tildeverticalcmb;033E +timescircle;2297 +tipehahebrew;0596 +tipehalefthebrew;0596 +tippigurmukhi;0A70 +titlocyrilliccmb;0483 +tiwnarmenian;057F +tlinebelow;1E6F +tmonospace;FF54 +toarmenian;0569 +tohiragana;3068 +tokatakana;30C8 +tokatakanahalfwidth;FF84 +tonebarextrahighmod;02E5 +tonebarextralowmod;02E9 +tonebarhighmod;02E6 +tonebarlowmod;02E8 +tonebarmidmod;02E7 +tonefive;01BD +tonesix;0185 +tonetwo;01A8 +tonos;0384 +tonsquare;3327 +topatakthai;0E0F +tortoiseshellbracketleft;3014 +tortoiseshellbracketleftsmall;FE5D +tortoiseshellbracketleftvertical;FE39 +tortoiseshellbracketright;3015 +tortoiseshellbracketrightsmall;FE5E +tortoiseshellbracketrightvertical;FE3A +totaothai;0E15 +tpalatalhook;01AB +tparen;24AF +trademark;2122 +trademarksans;F8EA +trademarkserif;F6DB +tretroflexhook;0288 +triagdn;25BC +triaglf;25C4 +triagrt;25BA +triagup;25B2 +ts;02A6 +tsadi;05E6 +tsadidagesh;FB46 +tsadidageshhebrew;FB46 +tsadihebrew;05E6 +tsecyrillic;0446 +tsere;05B5 +tsere12;05B5 +tsere1e;05B5 +tsere2b;05B5 +tserehebrew;05B5 +tserenarrowhebrew;05B5 +tserequarterhebrew;05B5 +tserewidehebrew;05B5 +tshecyrillic;045B +tsuperior;F6F3 +ttabengali;099F +ttadeva;091F +ttagujarati;0A9F +ttagurmukhi;0A1F +tteharabic;0679 +ttehfinalarabic;FB67 +ttehinitialarabic;FB68 +ttehmedialarabic;FB69 +tthabengali;09A0 +tthadeva;0920 +tthagujarati;0AA0 +tthagurmukhi;0A20 +tturned;0287 +tuhiragana;3064 +tukatakana;30C4 +tukatakanahalfwidth;FF82 +tusmallhiragana;3063 +tusmallkatakana;30C3 +tusmallkatakanahalfwidth;FF6F +twelvecircle;246B +twelveparen;247F +twelveperiod;2493 +twelveroman;217B +twentycircle;2473 +twentyhangzhou;5344 +twentyparen;2487 +twentyperiod;249B +two;0032 +twoarabic;0662 +twobengali;09E8 +twocircle;2461 +twocircleinversesansserif;278B +twodeva;0968 +twodotenleader;2025 +twodotleader;2025 +twodotleadervertical;FE30 +twogujarati;0AE8 +twogurmukhi;0A68 +twohackarabic;0662 +twohangzhou;3022 +twoideographicparen;3221 +twoinferior;2082 +twomonospace;FF12 +twonumeratorbengali;09F5 +twooldstyle;F732 +twoparen;2475 +twoperiod;2489 +twopersian;06F2 +tworoman;2171 +twostroke;01BB +twosuperior;00B2 +twothai;0E52 +twothirds;2154 +u;0075 +uacute;00FA +ubar;0289 +ubengali;0989 +ubopomofo;3128 +ubreve;016D +ucaron;01D4 +ucircle;24E4 +ucircumflex;00FB +ucircumflexbelow;1E77 +ucyrillic;0443 +udattadeva;0951 +udblacute;0171 +udblgrave;0215 +udeva;0909 +udieresis;00FC +udieresisacute;01D8 +udieresisbelow;1E73 +udieresiscaron;01DA +udieresiscyrillic;04F1 +udieresisgrave;01DC +udieresismacron;01D6 +udotbelow;1EE5 +ugrave;00F9 +ugujarati;0A89 +ugurmukhi;0A09 +uhiragana;3046 +uhookabove;1EE7 +uhorn;01B0 +uhornacute;1EE9 +uhorndotbelow;1EF1 +uhorngrave;1EEB +uhornhookabove;1EED +uhorntilde;1EEF +uhungarumlaut;0171 +uhungarumlautcyrillic;04F3 +uinvertedbreve;0217 +ukatakana;30A6 +ukatakanahalfwidth;FF73 +ukcyrillic;0479 +ukorean;315C +umacron;016B +umacroncyrillic;04EF +umacrondieresis;1E7B +umatragurmukhi;0A41 +umonospace;FF55 +underscore;005F +underscoredbl;2017 +underscoremonospace;FF3F +underscorevertical;FE33 +underscorewavy;FE4F +union;222A +universal;2200 +uogonek;0173 +uparen;24B0 +upblock;2580 +upperdothebrew;05C4 +upsilon;03C5 +upsilondieresis;03CB +upsilondieresistonos;03B0 +upsilonlatin;028A +upsilontonos;03CD +uptackbelowcmb;031D +uptackmod;02D4 +uragurmukhi;0A73 +uring;016F +ushortcyrillic;045E +usmallhiragana;3045 +usmallkatakana;30A5 +usmallkatakanahalfwidth;FF69 +ustraightcyrillic;04AF +ustraightstrokecyrillic;04B1 +utilde;0169 +utildeacute;1E79 +utildebelow;1E75 +uubengali;098A +uudeva;090A +uugujarati;0A8A +uugurmukhi;0A0A +uumatragurmukhi;0A42 +uuvowelsignbengali;09C2 +uuvowelsigndeva;0942 +uuvowelsigngujarati;0AC2 +uvowelsignbengali;09C1 +uvowelsigndeva;0941 +uvowelsigngujarati;0AC1 +v;0076 +vadeva;0935 +vagujarati;0AB5 +vagurmukhi;0A35 +vakatakana;30F7 +vav;05D5 +vavdagesh;FB35 +vavdagesh65;FB35 +vavdageshhebrew;FB35 +vavhebrew;05D5 +vavholam;FB4B +vavholamhebrew;FB4B +vavvavhebrew;05F0 +vavyodhebrew;05F1 +vcircle;24E5 +vdotbelow;1E7F +vecyrillic;0432 +veharabic;06A4 +vehfinalarabic;FB6B +vehinitialarabic;FB6C +vehmedialarabic;FB6D +vekatakana;30F9 +venus;2640 +verticalbar;007C +verticallineabovecmb;030D +verticallinebelowcmb;0329 +verticallinelowmod;02CC +verticallinemod;02C8 +vewarmenian;057E +vhook;028B +vikatakana;30F8 +viramabengali;09CD +viramadeva;094D +viramagujarati;0ACD +visargabengali;0983 +visargadeva;0903 +visargagujarati;0A83 +vmonospace;FF56 +voarmenian;0578 +voicediterationhiragana;309E +voicediterationkatakana;30FE +voicedmarkkana;309B +voicedmarkkanahalfwidth;FF9E +vokatakana;30FA +vparen;24B1 +vtilde;1E7D +vturned;028C +vuhiragana;3094 +vukatakana;30F4 +w;0077 +wacute;1E83 +waekorean;3159 +wahiragana;308F +wakatakana;30EF +wakatakanahalfwidth;FF9C +wakorean;3158 +wasmallhiragana;308E +wasmallkatakana;30EE +wattosquare;3357 +wavedash;301C +wavyunderscorevertical;FE34 +wawarabic;0648 +wawfinalarabic;FEEE +wawhamzaabovearabic;0624 +wawhamzaabovefinalarabic;FE86 +wbsquare;33DD +wcircle;24E6 +wcircumflex;0175 +wdieresis;1E85 +wdotaccent;1E87 +wdotbelow;1E89 +wehiragana;3091 +weierstrass;2118 +wekatakana;30F1 +wekorean;315E +weokorean;315D +wgrave;1E81 +whitebullet;25E6 +whitecircle;25CB +whitecircleinverse;25D9 +whitecornerbracketleft;300E +whitecornerbracketleftvertical;FE43 +whitecornerbracketright;300F +whitecornerbracketrightvertical;FE44 +whitediamond;25C7 +whitediamondcontainingblacksmalldiamond;25C8 +whitedownpointingsmalltriangle;25BF +whitedownpointingtriangle;25BD +whiteleftpointingsmalltriangle;25C3 +whiteleftpointingtriangle;25C1 +whitelenticularbracketleft;3016 +whitelenticularbracketright;3017 +whiterightpointingsmalltriangle;25B9 +whiterightpointingtriangle;25B7 +whitesmallsquare;25AB +whitesmilingface;263A +whitesquare;25A1 +whitestar;2606 +whitetelephone;260F +whitetortoiseshellbracketleft;3018 +whitetortoiseshellbracketright;3019 +whiteuppointingsmalltriangle;25B5 +whiteuppointingtriangle;25B3 +wihiragana;3090 +wikatakana;30F0 +wikorean;315F +wmonospace;FF57 +wohiragana;3092 +wokatakana;30F2 +wokatakanahalfwidth;FF66 +won;20A9 +wonmonospace;FFE6 +wowaenthai;0E27 +wparen;24B2 +wring;1E98 +wsuperior;02B7 +wturned;028D +wynn;01BF +x;0078 +xabovecmb;033D +xbopomofo;3112 +xcircle;24E7 +xdieresis;1E8D +xdotaccent;1E8B +xeharmenian;056D +xi;03BE +xmonospace;FF58 +xparen;24B3 +xsuperior;02E3 +y;0079 +yaadosquare;334E +yabengali;09AF +yacute;00FD +yadeva;092F +yaekorean;3152 +yagujarati;0AAF +yagurmukhi;0A2F +yahiragana;3084 +yakatakana;30E4 +yakatakanahalfwidth;FF94 +yakorean;3151 +yamakkanthai;0E4E +yasmallhiragana;3083 +yasmallkatakana;30E3 +yasmallkatakanahalfwidth;FF6C +yatcyrillic;0463 +ycircle;24E8 +ycircumflex;0177 +ydieresis;00FF +ydotaccent;1E8F +ydotbelow;1EF5 +yeharabic;064A +yehbarreearabic;06D2 +yehbarreefinalarabic;FBAF +yehfinalarabic;FEF2 +yehhamzaabovearabic;0626 +yehhamzaabovefinalarabic;FE8A +yehhamzaaboveinitialarabic;FE8B +yehhamzaabovemedialarabic;FE8C +yehinitialarabic;FEF3 +yehmedialarabic;FEF4 +yehmeeminitialarabic;FCDD +yehmeemisolatedarabic;FC58 +yehnoonfinalarabic;FC94 +yehthreedotsbelowarabic;06D1 +yekorean;3156 +yen;00A5 +yenmonospace;FFE5 +yeokorean;3155 +yeorinhieuhkorean;3186 +yerahbenyomohebrew;05AA +yerahbenyomolefthebrew;05AA +yericyrillic;044B +yerudieresiscyrillic;04F9 +yesieungkorean;3181 +yesieungpansioskorean;3183 +yesieungsioskorean;3182 +yetivhebrew;059A +ygrave;1EF3 +yhook;01B4 +yhookabove;1EF7 +yiarmenian;0575 +yicyrillic;0457 +yikorean;3162 +yinyang;262F +yiwnarmenian;0582 +ymonospace;FF59 +yod;05D9 +yoddagesh;FB39 +yoddageshhebrew;FB39 +yodhebrew;05D9 +yodyodhebrew;05F2 +yodyodpatahhebrew;FB1F +yohiragana;3088 +yoikorean;3189 +yokatakana;30E8 +yokatakanahalfwidth;FF96 +yokorean;315B +yosmallhiragana;3087 +yosmallkatakana;30E7 +yosmallkatakanahalfwidth;FF6E +yotgreek;03F3 +yoyaekorean;3188 +yoyakorean;3187 +yoyakthai;0E22 +yoyingthai;0E0D +yparen;24B4 +ypogegrammeni;037A +ypogegrammenigreekcmb;0345 +yr;01A6 +yring;1E99 +ysuperior;02B8 +ytilde;1EF9 +yturned;028E +yuhiragana;3086 +yuikorean;318C +yukatakana;30E6 +yukatakanahalfwidth;FF95 +yukorean;3160 +yusbigcyrillic;046B +yusbigiotifiedcyrillic;046D +yuslittlecyrillic;0467 +yuslittleiotifiedcyrillic;0469 +yusmallhiragana;3085 +yusmallkatakana;30E5 +yusmallkatakanahalfwidth;FF6D +yuyekorean;318B +yuyeokorean;318A +yyabengali;09DF +yyadeva;095F +z;007A +zaarmenian;0566 +zacute;017A +zadeva;095B +zagurmukhi;0A5B +zaharabic;0638 +zahfinalarabic;FEC6 +zahinitialarabic;FEC7 +zahiragana;3056 +zahmedialarabic;FEC8 +zainarabic;0632 +zainfinalarabic;FEB0 +zakatakana;30B6 +zaqefgadolhebrew;0595 +zaqefqatanhebrew;0594 +zarqahebrew;0598 +zayin;05D6 +zayindagesh;FB36 +zayindageshhebrew;FB36 +zayinhebrew;05D6 +zbopomofo;3117 +zcaron;017E +zcircle;24E9 +zcircumflex;1E91 +zcurl;0291 +zdot;017C +zdotaccent;017C +zdotbelow;1E93 +zecyrillic;0437 +zedescendercyrillic;0499 +zedieresiscyrillic;04DF +zehiragana;305C +zekatakana;30BC +zero;0030 +zeroarabic;0660 +zerobengali;09E6 +zerodeva;0966 +zerogujarati;0AE6 +zerogurmukhi;0A66 +zerohackarabic;0660 +zeroinferior;2080 +zeromonospace;FF10 +zerooldstyle;F730 +zeropersian;06F0 +zerosuperior;2070 +zerothai;0E50 +zerowidthjoiner;FEFF +zerowidthnonjoiner;200C +zerowidthspace;200B +zeta;03B6 +zhbopomofo;3113 +zhearmenian;056A +zhebrevecyrillic;04C2 +zhecyrillic;0436 +zhedescendercyrillic;0497 +zhedieresiscyrillic;04DD +zihiragana;3058 +zikatakana;30B8 +zinorhebrew;05AE +zlinebelow;1E95 +zmonospace;FF5A +zohiragana;305E +zokatakana;30BE +zparen;24B5 +zretroflexhook;0290 +zstroke;01B6 +zuhiragana;305A +zukatakana;30BA +a100;275E +a101;2761 +a102;2762 +a103;2763 +a104;2764 +a105;2710 +a106;2765 +a107;2766 +a108;2767 +a109;2660 +a10;2721 +a110;2665 +a111;2666 +a112;2663 +a117;2709 +a118;2708 +a119;2707 +a11;261B +a120;2460 +a121;2461 +a122;2462 +a123;2463 +a124;2464 +a125;2465 +a126;2466 +a127;2467 +a128;2468 +a129;2469 +a12;261E +a130;2776 +a131;2777 +a132;2778 +a133;2779 +a134;277A +a135;277B +a136;277C +a137;277D +a138;277E +a139;277F +a13;270C +a140;2780 +a141;2781 +a142;2782 +a143;2783 +a144;2784 +a145;2785 +a146;2786 +a147;2787 +a148;2788 +a149;2789 +a14;270D +a150;278A +a151;278B +a152;278C +a153;278D +a154;278E +a155;278F +a156;2790 +a157;2791 +a158;2792 +a159;2793 +a15;270E +a160;2794 +a161;2192 +a162;27A3 +a163;2194 +a164;2195 +a165;2799 +a166;279B +a167;279C +a168;279D +a169;279E +a16;270F +a170;279F +a171;27A0 +a172;27A1 +a173;27A2 +a174;27A4 +a175;27A5 +a176;27A6 +a177;27A7 +a178;27A8 +a179;27A9 +a17;2711 +a180;27AB +a181;27AD +a182;27AF +a183;27B2 +a184;27B3 +a185;27B5 +a186;27B8 +a187;27BA +a188;27BB +a189;27BC +a18;2712 +a190;27BD +a191;27BE +a192;279A +a193;27AA +a194;27B6 +a195;27B9 +a196;2798 +a197;27B4 +a198;27B7 +a199;27AC +a19;2713 +a1;2701 +a200;27AE +a201;27B1 +a202;2703 +a203;2750 +a204;2752 +a205;276E +a206;2770 +a20;2714 +a21;2715 +a22;2716 +a23;2717 +a24;2718 +a25;2719 +a26;271A +a27;271B +a28;271C +a29;2722 +a2;2702 +a30;2723 +a31;2724 +a32;2725 +a33;2726 +a34;2727 +a35;2605 +a36;2729 +a37;272A +a38;272B +a39;272C +a3;2704 +a40;272D +a41;272E +a42;272F +a43;2730 +a44;2731 +a45;2732 +a46;2733 +a47;2734 +a48;2735 +a49;2736 +a4;260E +a50;2737 +a51;2738 +a52;2739 +a53;273A +a54;273B +a55;273C +a56;273D +a57;273E +a58;273F +a59;2740 +a5;2706 +a60;2741 +a61;2742 +a62;2743 +a63;2744 +a64;2745 +a65;2746 +a66;2747 +a67;2748 +a68;2749 +a69;274A +a6;271D +a70;274B +a71;25CF +a72;274D +a73;25A0 +a74;274F +a75;2751 +a76;25B2 +a77;25BC +a78;25C6 +a79;2756 +a7;271E +a81;25D7 +a82;2758 +a83;2759 +a84;275A +a85;276F +a86;2771 +a87;2772 +a88;2773 +a89;2768 +a8;271F +a90;2769 +a91;276C +a92;276D +a93;276A +a94;276B +a95;2774 +a96;2775 +a97;275B +a98;275C +a99;275D +a9;2720 +""" + + +# string table management +# +class StringTable: + def __init__(self, name_list, master_table_name): + self.names = name_list + self.master_table = master_table_name + self.indices = {} + index = 0 + + for name in name_list: + self.indices[name] = index + index += len(name) + 1 + + self.total = index + + def dump(self, file): + write = file.write + write("#ifndef DEFINE_PS_TABLES_DATA\n") + write("#ifdef __cplusplus\n") + write(' extern "C"\n') + write("#else\n") + write(" extern\n") + write("#endif\n") + write("#endif\n") + write(" const char " + self.master_table + + "[" + repr(self.total) + "]\n") + write("#ifdef DEFINE_PS_TABLES_DATA\n") + write(" =\n") + write(" {\n") + + line = "" + for name in self.names: + line += " '" + line += "','".join(list(name)) + line += "', 0,\n" + + write(line) + write(" }\n") + write("#endif /* DEFINE_PS_TABLES_DATA */\n") + write(" ;\n\n\n") + + def dump_sublist(self, file, table_name, macro_name, sublist): + write = file.write + write("#define " + macro_name + " " + repr(len(sublist)) + "\n\n") + + write(" /* Values are offsets into the `" + + self.master_table + "' table */\n\n") + write("#ifndef DEFINE_PS_TABLES_DATA\n") + write("#ifdef __cplusplus\n") + write(' extern "C"\n') + write("#else\n") + write(" extern\n") + write("#endif\n") + write("#endif\n") + write(" const short " + table_name + + "[" + macro_name + "]\n") + write("#ifdef DEFINE_PS_TABLES_DATA\n") + write(" =\n") + write(" {\n") + + line = " " + comma = "" + col = 0 + + for name in sublist: + line += comma + line += "%4d" % self.indices[name] + col += 1 + comma = "," + if col == 14: + col = 0 + comma = ",\n " + + write(line) + write("\n") + write(" }\n") + write("#endif /* DEFINE_PS_TABLES_DATA */\n") + write(" ;\n\n\n") + + +# We now store the Adobe Glyph List in compressed form. The list is put +# into a data structure called `trie' (because it has a tree-like +# appearance). Consider, for example, that you want to store the +# following name mapping: +# +# A => 1 +# Aacute => 6 +# Abalon => 2 +# Abstract => 4 +# +# It is possible to store the entries as follows. +# +# A => 1 +# | +# +-acute => 6 +# | +# +-b +# | +# +-alon => 2 +# | +# +-stract => 4 +# +# We see that each node in the trie has: +# +# - one or more `letters' +# - an optional value +# - zero or more child nodes +# +# The first step is to call +# +# root = StringNode( "", 0 ) +# for word in map.values(): +# root.add( word, map[word] ) +# +# which creates a large trie where each node has only one children. +# +# Executing +# +# root = root.optimize() +# +# optimizes the trie by merging the letters of successive nodes whenever +# possible. +# +# Each node of the trie is stored as follows. +# +# - First the node's letter, according to the following scheme. We +# use the fact that in the AGL no name contains character codes > 127. +# +# name bitsize description +# ---------------------------------------------------------------- +# notlast 1 Set to 1 if this is not the last letter +# in the word. +# ascii 7 The letter's ASCII value. +# +# - The letter is followed by a children count and the value of the +# current key (if any). Again we can do some optimization because all +# AGL entries are from the BMP; this means that 16 bits are sufficient +# to store its Unicode values. Additionally, no node has more than +# 127 children. +# +# name bitsize description +# ----------------------------------------- +# hasvalue 1 Set to 1 if a 16-bit Unicode value follows. +# num_children 7 Number of children. Can be 0 only if +# `hasvalue' is set to 1. +# value 16 Optional Unicode value. +# +# - A node is finished by a list of 16bit absolute offsets to the +# children, which must be sorted in increasing order of their first +# letter. +# +# For simplicity, all 16bit quantities are stored in big-endian order. +# +# The root node has first letter = 0, and no value. +# +class StringNode: + def __init__(self, letter, value): + self.letter = letter + self.value = value + self.children = {} + + def __cmp__(self, other): + return ord(self.letter[0]) - ord(other.letter[0]) + + def __lt__(self, other): + return self.letter[0] < other.letter[0] + + def add(self, word, value): + if len(word) == 0: + self.value = value + return + + letter = word[0] + word = word[1:] + + if letter in self.children: + child = self.children[letter] + else: + child = StringNode(letter, 0) + self.children[letter] = child + + child.add(word, value) + + def optimize(self): + # optimize all children first + children = list(self.children.values()) + self.children = {} + + for child in children: + self.children[child.letter[0]] = child.optimize() + + # don't optimize if there's a value, + # if we don't have any child or if we + # have more than one child + if (self.value != 0) or (not children) or len(children) > 1: + return self + + child = children[0] + + self.letter += child.letter + self.value = child.value + self.children = child.children + + return self + + def dump_debug(self, write, margin): + # this is used during debugging + line = margin + "+-" + if len(self.letter) == 0: + line += "" + else: + line += self.letter + + if self.value: + line += " => " + repr(self.value) + + write(line + "\n") + + if self.children: + margin += "| " + for child in self.children.values(): + child.dump_debug(write, margin) + + def locate(self, index): + self.index = index + if len(self.letter) > 0: + index += len(self.letter) + 1 + else: + index += 2 + + if self.value != 0: + index += 2 + + children = list(self.children.values()) + children.sort() + + index += 2 * len(children) + for child in children: + index = child.locate(index) + + return index + + def store(self, storage): + # write the letters + length = len(self.letter) + if length == 0: + storage += struct.pack("B", 0) + else: + for n in range(length): + val = ord(self.letter[n]) + if n < length - 1: + val += 128 + storage += struct.pack("B", val) + + # write the count + children = list(self.children.values()) + children.sort() + + count = len(children) + + if self.value != 0: + storage += struct.pack("!BH", count + 128, self.value) + else: + storage += struct.pack("B", count) + + for child in children: + storage += struct.pack("!H", child.index) + + for child in children: + storage = child.store(storage) + + return storage + + +def adobe_glyph_values(): + """return the list of glyph names and their unicode values""" + + lines = adobe_glyph_list.split("\n") + glyphs = [] + values = [] + + for line in lines: + if line: + fields = line.split(';') + # print fields[1] + ' - ' + fields[0] + subfields = fields[1].split(' ') + if len(subfields) == 1: + glyphs.append(fields[0]) + values.append(fields[1]) + + return glyphs, values + + +def filter_glyph_names(alist, filter): + """filter `alist' by taking _out_ all glyph names that are in `filter'""" + + count = 0 + extras = [] + + for name in alist: + try: + filtered_index = filter.index(name) + except: + extras.append(name) + + return extras + + +def dump_encoding(file, encoding_name, encoding_list): + """dump a given encoding""" + + write = file.write + write(" /* the following are indices into the SID name table */\n") + write("#ifndef DEFINE_PS_TABLES_DATA\n") + write("#ifdef __cplusplus\n") + write(' extern "C"\n') + write("#else\n") + write(" extern\n") + write("#endif\n") + write("#endif\n") + write(" const unsigned short " + encoding_name + + "[" + repr(len(encoding_list)) + "]\n") + write("#ifdef DEFINE_PS_TABLES_DATA\n") + write(" =\n") + write(" {\n") + + line = " " + comma = "" + col = 0 + for value in encoding_list: + line += comma + line += "%3d" % value + comma = "," + col += 1 + if col == 16: + col = 0 + comma = ",\n " + + write(line) + write("\n") + write(" }\n") + write("#endif /* DEFINE_PS_TABLES_DATA */\n") + write(" ;\n\n\n") + + +def dump_array(the_array, write, array_name): + """dumps a given encoding""" + + write("#ifndef DEFINE_PS_TABLES_DATA\n") + write("#ifdef __cplusplus\n") + write(' extern "C"\n') + write("#else\n") + write(" extern\n") + write("#endif\n") + write("#endif\n") + write(" const unsigned char " + array_name + + "[" + repr(len(the_array)) + "L]\n") + write("#ifdef DEFINE_PS_TABLES_DATA\n") + write(" =\n") + write(" {\n") + + line = "" + comma = " " + col = 0 + + for value in the_array: + line += comma + line += "%3d" % value + comma = "," + col += 1 + + if col == 16: + col = 0 + comma = ",\n " + + if len(line) > 1024: + write(line) + line = "" + + write(line) + write("\n") + write(" }\n") + write("#endif /* DEFINE_PS_TABLES_DATA */\n") + write(" ;\n\n\n") + + +def main(): + """main program body""" + + if len(sys.argv) != 2: + print(__doc__ % sys.argv[0]) + sys.exit(1) + + file = open(sys.argv[1], "w") + write = file.write + + count_sid = len(sid_standard_names) + + # `mac_extras' contains the list of glyph names in the Macintosh standard + # encoding which are not in the SID Standard Names. + # + mac_extras = filter_glyph_names(mac_standard_names, sid_standard_names) + + # `base_list' contains the names of our final glyph names table. + # It consists of the `mac_extras' glyph names, followed by the SID + # standard names. + # + mac_extras_count = len(mac_extras) + base_list = mac_extras + sid_standard_names + + write("/*\n") + write(" *\n") + write(" * %-71s\n" % os.path.basename(sys.argv[1])) + write(" *\n") + write(" * PostScript glyph names.\n") + write(" *\n") + write(" * Copyright 2005-2022 by\n") + write(" * David Turner, Robert Wilhelm, and Werner Lemberg.\n") + write(" *\n") + write(" * This file is part of the FreeType project, and may only be " + "used,\n") + write(" * modified, and distributed under the terms of the FreeType " + "project\n") + write(" * license, LICENSE.TXT. By continuing to use, modify, or " + "distribute\n") + write(" * this file you indicate that you have read the license and\n") + write(" * understand and accept it fully.\n") + write(" *\n") + write(" */\n") + write("\n") + write("\n") + write(" /* This file has been generated automatically -- do not edit! */" + "\n") + write("\n") + write("\n") + + # dump final glyph list (mac extras + sid standard names) + # + st = StringTable(base_list, "ft_standard_glyph_names") + + st.dump(file) + st.dump_sublist(file, "ft_mac_names", + "FT_NUM_MAC_NAMES", mac_standard_names) + st.dump_sublist(file, "ft_sid_names", + "FT_NUM_SID_NAMES", sid_standard_names) + + dump_encoding(file, "t1_standard_encoding", t1_standard_encoding) + dump_encoding(file, "t1_expert_encoding", t1_expert_encoding) + + # dump the AGL in its compressed form + # + agl_glyphs, agl_values = adobe_glyph_values() + dictionary = StringNode("", 0) + + for g in range(len(agl_glyphs)): + dictionary.add(agl_glyphs[g], eval("0x" + agl_values[g])) + + dictionary = dictionary.optimize() + dict_len = dictionary.locate(0) + dict_array = dictionary.store(b"") + + write("""\ + /* + * This table is a compressed version of the Adobe Glyph List (AGL), + * optimized for efficient searching. It has been generated by the + * `glnames.py' python script located in the `src/tools' directory. + * + * The lookup function to get the Unicode value for a given string + * is defined below the table. + */ + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + +""") + + dump_array(dict_array, write, "ft_adobe_glyph_list") + + # write the lookup routine now + # + write("""\ +#ifdef DEFINE_PS_TABLES + /* + * This function searches the compressed table efficiently. + */ + static unsigned long + ft_get_adobe_glyph_index( const char* name, + const char* limit ) + { + int c = 0; + int count, min, max; + const unsigned char* p = ft_adobe_glyph_list; + + + if ( name == 0 || name >= limit ) + goto NotFound; + + c = *name++; + count = p[1]; + p += 2; + + min = 0; + max = count; + + while ( min < max ) + { + int mid = ( min + max ) >> 1; + const unsigned char* q = p + mid * 2; + int c2; + + + q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] ); + + c2 = q[0] & 127; + if ( c2 == c ) + { + p = q; + goto Found; + } + if ( c2 < c ) + min = mid + 1; + else + max = mid; + } + goto NotFound; + + Found: + for (;;) + { + /* assert (*p & 127) == c */ + + if ( name >= limit ) + { + if ( (p[0] & 128) == 0 && + (p[1] & 128) != 0 ) + return (unsigned long)( ( (int)p[2] << 8 ) | p[3] ); + + goto NotFound; + } + c = *name++; + if ( p[0] & 128 ) + { + p++; + if ( c != (p[0] & 127) ) + goto NotFound; + + continue; + } + + p++; + count = p[0] & 127; + if ( p[0] & 128 ) + p += 2; + + p++; + + for ( ; count > 0; count--, p += 2 ) + { + int offset = ( (int)p[0] << 8 ) | p[1]; + const unsigned char* q = ft_adobe_glyph_list + offset; + + if ( c == ( q[0] & 127 ) ) + { + p = q; + goto NextIter; + } + } + goto NotFound; + + NextIter: + ; + } + + NotFound: + return 0; + } +#endif /* DEFINE_PS_TABLES */ + +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + +""") + + if 0: # generate unit test, or don't + # + # now write the unit test to check that everything works OK + # + write("#ifdef TEST\n\n") + + write("static const char* const the_names[] = {\n") + for name in agl_glyphs: + write(' "' + name + '",\n') + write(" 0\n};\n") + + write("static const unsigned long the_values[] = {\n") + for val in agl_values: + write(' 0x' + val + ',\n') + write(" 0\n};\n") + + write(""" +#include +#include +#include + +int +main( void ) +{ +int result = 0; +const char* const* names = the_names; +const unsigned long* values = the_values; + + +for ( ; *names; names++, values++ ) +{ + const char* name = *names; + unsigned long reference = *values; + unsigned long value; + + + value = ft_get_adobe_glyph_index( name, name + strlen( name ) ); + if ( value != reference ) + { + result = 1; + fprintf( stderr, "name '%s' => %04x instead of %04x\\n", + name, value, reference ); + } +} + +return result; +} +""") + + write("#endif /* TEST */\n") + + write("\n/* END */\n") + + +# Now run the main routine +# +main() + +# END diff --git a/vendor/freetype/src/tools/make_distribution_archives.py b/vendor/freetype/src/tools/make_distribution_archives.py new file mode 100644 index 00000000000..f29eb128c7a --- /dev/null +++ b/vendor/freetype/src/tools/make_distribution_archives.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python3 +"""Generate distribution archives for a given FreeType 2 release.""" + +from __future__ import print_function + +import argparse +import atexit +import os +import shutil +import subprocess +import sys +import tempfile + +_TOP_DIR = os.path.abspath(os.path.join(__file__, "..", "..", "..")) +_SCRIPT_DIR = os.path.dirname(os.path.join(_TOP_DIR, "builds", "meson", "")) + + +def get_cmd_output(cmd, cwd=None): + """Run a command and return its output as a string.""" + if cwd is not None: + out = subprocess.check_output(cmd, cwd=cwd) + else: + out = subprocess.check_output(cmd) + return out.decode("utf-8").rstrip() + + +def is_git_dir_clean(git_dir): + """Return True iff |git_dir| is a git directory in clean state.""" + out = get_cmd_output(["git", "status", "--porcelain"], cwd=git_dir) + return len(out) == 0 + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--source_dir", default=_TOP_DIR, help="Source directory path." + ) + + parser.add_argument( + "--version", + help=( + "Specify alternate FreeType version (it is otherwise extracted" + " from current sources by default)." + ), + ) + + parser.add_argument( + "--gnu-config-dir", + help=( + "Path of input directory containing recent `config.guess` and" + " `config.sub` files from GNU config." + ), + ) + + parser.add_argument( + "--build-dir", + help="Specify build directory. Only used for debugging this script.", + ) + + parser.add_argument( + "--ignore-clean-check", + action="store_true", + help=( + "Do not check for a clean source git repository. Only used for" + " debugging this script." + ), + ) + + parser.add_argument( + "output_dir", help="Output directory for generated archives." + ) + + args = parser.parse_args() + + git_dir = args.source_dir if args.source_dir else _TOP_DIR + if not args.ignore_clean_check and not is_git_dir_clean(git_dir): + sys.stderr.write( + "ERROR: Your git repository is not in a clean state: %s\n" + % git_dir + ) + return 1 + + if args.version: + version = args.version + else: + # Extract FreeType version from sources. + version = get_cmd_output( + [ + sys.executable, + os.path.join(_SCRIPT_DIR, "extract_freetype_version.py"), + os.path.join(_TOP_DIR, "include", "freetype", "freetype.h"), + ] + ) + + # Determine the build directory. This will be a temporary file that is + # cleaned up on script exit by default, unless --build-dir=DIR is used, + # in which case we only create and empty the directory, but never remove + # its content on exit. + if args.build_dir: + build_dir = args.build_dir + if not os.path.exists(build_dir): + os.makedirs(build_dir) + else: + # Remove anything from the build directory, if any. + for item in os.listdir(build_dir): + file_path = os.path.join(build_dir, item) + if os.path.isdir(file_path): + shutil.rmtree(file_path) + else: + os.unlink(file_path) + else: + # Create a temporary directory, and ensure it is removed on exit. + build_dir = tempfile.mkdtemp(prefix="freetype-dist-") + + def clean_build_dir(): + shutil.rmtree(build_dir) + + atexit.register(clean_build_dir) + + # Copy all source files known to git into $BUILD_DIR/freetype-$VERSION + # with the exception of .gitignore and .mailmap files. + source_files = [ + f + for f in get_cmd_output(["git", "ls-files"], cwd=git_dir).split("\n") + if os.path.basename(f) not in (".gitignore", ".mailmap") + ] + + freetype_dir = "freetype-" + version + tmp_src_dir = os.path.join(build_dir, freetype_dir) + os.makedirs(tmp_src_dir) + + for src in source_files: + dst = os.path.join(tmp_src_dir, src) + dst_dir = os.path.dirname(dst) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + shutil.copy(os.path.join(git_dir, src), dst) + + # Run autogen.sh in directory. + subprocess.check_call(["/bin/sh", "autogen.sh"], cwd=tmp_src_dir) + shutil.rmtree( + os.path.join(tmp_src_dir, "builds", "unix", "autom4te.cache") + ) + + # Copy config.guess and config.sub if possible! + if args.gnu_config_dir: + for f in ("config.guess", "config.sub"): + shutil.copy( + os.path.join(args.gnu_config_dir, f), + os.path.join(tmp_src_dir, "builds", "unix", f), + ) + + # Generate reference documentation under docs/ + subprocess.check_call( + [ + sys.executable, + os.path.join(_SCRIPT_DIR, "generate_reference_docs.py"), + "--input-dir", + tmp_src_dir, + "--version", + version, + "--output-dir", + os.path.join(tmp_src_dir, "docs"), + ] + ) + + shutil.rmtree(os.path.join(tmp_src_dir, "docs", "markdown")) + os.unlink(os.path.join(tmp_src_dir, "docs", "mkdocs.yml")) + + # Generate our archives + freetype_tar = freetype_dir + ".tar" + + subprocess.check_call( + ["tar", "-H", "ustar", "-chf", freetype_tar, freetype_dir], + cwd=build_dir, + ) + + subprocess.check_call( + ["gzip", "-9", "--keep", freetype_tar], cwd=build_dir + ) + + subprocess.check_call(["xz", "--keep", freetype_tar], cwd=build_dir) + + ftwinversion = "ft" + "".join(version.split(".")) + subprocess.check_call( + ["zip", "-qlr9", ftwinversion + ".zip", freetype_dir], cwd=build_dir + ) + + # Copy file to output directory now. + if not os.path.exists(args.output_dir): + os.makedirs(args.output_dir) + + for f in ( + freetype_tar + ".gz", + freetype_tar + ".xz", + ftwinversion + ".zip", + ): + shutil.copy( + os.path.join(build_dir, f), os.path.join(args.output_dir, f) + ) + + # Done! + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/vendor/freetype/src/tools/no-copyright b/vendor/freetype/src/tools/no-copyright new file mode 100644 index 00000000000..e171b76f3a7 --- /dev/null +++ b/vendor/freetype/src/tools/no-copyright @@ -0,0 +1,66 @@ +# Files that don't get a copyright, or which are taken from elsewhere. +# +# All lines in this file are patterns (relative to the top-level directory), +# including the comment lines; this means that e.g. `FTL.TXT' matches all +# files that have this string in the file name (including the path relative +# to the current directory, always starting with `./'). +# +# Don't put empty lines into this file! +# +builds/unix/pkg.m4 +# +docs/FTL.TXT +docs/GPLv2.TXT +# +include/freetype/internal/fthash.h +# +src/base/fthash.c +src/base/md5.c +src/base/md5.h +# +src/bdf/bdf.c +src/bdf/bdf.h +src/bdf/bdfdrivr.c +src/bdf/bdfdrivr.h +src/bdf/bdferror.h +src/bdf/bdflib.c +src/bdf/module.mk +src/bdf/README +src/bdf/rules.mk +# +src/pcf/module.mk +src/pcf/pcf.c +src/pcf/pcf.h +src/pcf/pcfdrivr.c +src/pcf/pcfdrivr.h +src/pcf/pcferror.h +src/pcf/pcfread.c +src/pcf/pcfread.h +src/pcf/pcfutil.c +src/pcf/pcfutil.h +src/pcf/README +src/pcf/rules.mk +# +src/gzip/adler32.c +src/gzip/ftzconf.c +src/gzip/infblock.c +src/gzip/infblock.h +src/gzip/infcodes.c +src/gzip/infcodes.h +src/gzip/inffixed.h +src/gzip/inflate.c +src/gzip/inftrees.c +src/gzip/inftrees.h +src/gzip/infutil.c +src/gzip/infutil.h +src/gzip/zconf.h +src/gzip/zlib.h +src/gzip/zutil.c +src/gzip/zutil.h +# +src/tools/apinames.c +src/tools/ftrandom/ftrandom.c +# +subprojects/dlg +# +# EOF diff --git a/vendor/freetype/src/tools/update-copyright b/vendor/freetype/src/tools/update-copyright new file mode 100644 index 00000000000..674823ceb21 --- /dev/null +++ b/vendor/freetype/src/tools/update-copyright @@ -0,0 +1,14 @@ +#!/bin/sh + +# Run the `update-copyright-year' script on all files in the git repository, +# taking care of exceptions stored in file `no-copyright'. + +topdir=`git rev-parse --show-toplevel` +toolsdir=`dirname $0` + +git ls-files --full-name $topdir \ +| sed "s|^|$topdir/|" \ +| grep -vFf $toolsdir/no-copyright \ +| xargs $toolsdir/update-copyright-year + +# EOF diff --git a/vendor/freetype/src/tools/update-copyright-year b/vendor/freetype/src/tools/update-copyright-year new file mode 100644 index 00000000000..6b359ff668b --- /dev/null +++ b/vendor/freetype/src/tools/update-copyright-year @@ -0,0 +1,157 @@ +eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}' + & eval 'exec perl -wS -i "$0" $argv:q' + if 0; + +# Copyright (C) 2015-2024 by +# 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 script is expected to be called by the shell, which in turn +# calls perl automatically. The nifty start-up code above is based on +# gnulib's `update-copyright' script; it is a more portable replacement for +# the shebang, using the first `perl' program in the shell's path instead.] + +# Usage: +# +# update-copyright-year file1 [file2 ...] + + +# This script handles copyright entries like +# +# Copyright 2000 by +# foobar +# +# or +# +# /* Copyright (c) 2000, 2001, 2004-2007 by */ +# /* foobar */ +# +# and replaces them uniformly with +# +# Copyright (C) 2000-2021 +# foobar +# +# and +# +# /* Copyright (C) 2000-2021 by */ +# /* foobar */ +# +# (assuming that the current year is 2021). As can be seen, the line length +# is retained if there is non-whitespace after the word `by' on the same +# line. + +use strict; + + +my (undef, undef, undef, + undef, undef, $year, + undef, undef, undef) = localtime(time); +$year += 1900; + +my $replaced = 0; + + +# Loop over all input files; option `-i' (issued at the very beginning of +# this script) makes perl edit them in-place. +while (<>) +{ + # Only handle the first copyright notice in a file. + if (!$replaced) + { + # First try: Search multiple copyright years. + s { + (?.*) + Copyright + (?(\ + + | \ +\(C\)\ +)) + (?[12][0-9][0-9][0-9]) + (?.+) + (?[12][0-9][0-9][0-9]) + (?\ +) + by + (?\ *) + (?.*) + } + { + # Fill line to the same length (if appropriate); we skip the middle + # part but insert `(C)', three spaces, and `-'. + my $space = length($+{space1}) + + length($+{middle}) + + length($+{space2}) + + length($+{space3}) + - (length("(C)") + 3 + 1); + + print "$+{begin}"; + print "Copyright\ (C)\ $+{first}-$year\ by"; + print ' ' x $space if length($+{end}); + print "$+{end}\n"; + $replaced = 1; + }ex + || + # Second try: Search a single copyright year. + s { + (?.*) + Copyright + (?(\ + + | \ +\(C\)\ +)) + (?[12][0-9][0-9][0-9]) + (?\ +) + by + (?\ *) + (?.*) + } + { + if ($+{first} < $year) + { + # Fill line to the same length (if appropriate); we insert three + # spaces, the string `(C)', a `-', and the current year. + my $space = length($+{space1}) + + length($+{space2}) + + length($+{space3}) + - (length($year) + length("(C)") + 3 + 1); + + print "$+{begin}"; + print "Copyright\ (C)\ $+{first}-$year\ by"; + # If $space is negative this inserts nothing. + print ' ' x $space if length($+{end}); + print "$+{end}\n"; + $replaced = 1; + } + else + { + # Fill line to the same length (if appropriate); we insert three + # spaces and the string `(C)'. + my $space = length($+{space1}) + + length($+{space2}) + + length($+{space3}) + - (length("(C)") + 3); + + print "$+{begin}"; + print "Copyright\ (C)\ $+{first}\ by"; + # If $space is negative this inserts nothing. + print ' ' x $space if length($+{end}); + print "$+{end}\n"; + $replaced = 1; + } + }ex + || + # Otherwise print line unaltered. + print; + } + else + { + print; + } +} +continue +{ + # Reset $replaced before processing the next file. + $replaced = 0 if eof; +} + +# EOF diff --git a/vendor/freetype/src/truetype/module.mk b/vendor/freetype/src/truetype/module.mk new file mode 100644 index 00000000000..a53cb64c3a2 --- /dev/null +++ b/vendor/freetype/src/truetype/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 TrueType module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += TRUETYPE_DRIVER + +define TRUETYPE_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, tt_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/truetype/rules.mk b/vendor/freetype/src/truetype/rules.mk new file mode 100644 index 00000000000..0552d68e6f1 --- /dev/null +++ b/vendor/freetype/src/truetype/rules.mk @@ -0,0 +1,75 @@ +# +# FreeType 2 TrueType driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# TrueType driver directory +# +TT_DIR := $(SRC_DIR)/truetype + + +# compilation flags for the driver +# +TT_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(TT_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# TrueType driver sources (i.e., C files) +# +TT_DRV_SRC := $(TT_DIR)/ttdriver.c \ + $(TT_DIR)/ttgload.c \ + $(TT_DIR)/ttgxvar.c \ + $(TT_DIR)/ttinterp.c \ + $(TT_DIR)/ttobjs.c \ + $(TT_DIR)/ttpload.c + +# TrueType driver headers +# +TT_DRV_H := $(TT_DRV_SRC:%.c=%.h) \ + $(TT_DIR)/tterrors.h + + +# TrueType driver object(s) +# +# TT_DRV_OBJ_M is used during `multi' builds +# TT_DRV_OBJ_S is used during `single' builds +# +TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR)/%.c=$(OBJ_DIR)/%.$O) +TT_DRV_OBJ_S := $(OBJ_DIR)/truetype.$O + +# TrueType driver source file for single build +# +TT_DRV_SRC_S := $(TT_DIR)/truetype.c + + +# TrueType driver - single object +# +$(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H) + $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TT_DRV_SRC_S)) + + +# driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(TT_DIR)/%.c $(FREETYPE_H) $(TT_DRV_H) + $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(TT_DRV_OBJ_S) +DRV_OBJS_M += $(TT_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/truetype/ttdriver.c b/vendor/freetype/src/truetype/ttdriver.c index 4ab68eb9a12..41a21d19d3e 100644 --- a/vendor/freetype/src/truetype/ttdriver.c +++ b/vendor/freetype/src/truetype/ttdriver.c @@ -220,12 +220,12 @@ { /* Use 'kern' table if available since that can be faster; otherwise */ /* use GPOS kerning pairs if available. */ - if ( ttface->kern_avail_bits != 0 ) + if ( ttface->kern_avail_bits ) kerning->x = sfnt->get_kerning( ttface, left_glyph, right_glyph ); #ifdef TT_CONFIG_OPTION_GPOS_KERNING - else if ( ttface->gpos_kerning_available ) + else if ( ttface->num_gpos_lookups_kerning ) kerning->x = sfnt->get_gpos_kerning( ttface, left_glyph, right_glyph ); diff --git a/vendor/freetype/src/truetype/ttgload.c b/vendor/freetype/src/truetype/ttgload.c index e93f6a5c067..f1853ef8df0 100644 --- a/vendor/freetype/src/truetype/ttgload.c +++ b/vendor/freetype/src/truetype/ttgload.c @@ -660,7 +660,7 @@ } while ( subglyph->flags & MORE_COMPONENTS ); gloader->current.num_subglyphs = num_subglyphs; - FT_TRACE5(( " %d component%s\n", + FT_TRACE5(( " %u component%s\n", num_subglyphs, num_subglyphs > 1 ? "s" : "" )); @@ -674,7 +674,7 @@ for ( i = 0; i < num_subglyphs; i++ ) { if ( num_subglyphs > 1 ) - FT_TRACE7(( " subglyph %d:\n", i )); + FT_TRACE7(( " subglyph %u:\n", i )); FT_TRACE7(( " glyph index: %d\n", subglyph->index )); @@ -777,15 +777,11 @@ TT_Hint_Glyph( TT_Loader loader, FT_Bool is_composite ) { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - TT_Face face = loader->face; - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); -#endif - TT_GlyphZone zone = &loader->zone; #ifdef TT_USE_BYTECODE_INTERPRETER TT_ExecContext exec = loader->exec; + TT_Size size = loader->size; FT_Long n_ins = exec->glyphSize; #else FT_UNUSED( is_composite ); @@ -797,9 +793,6 @@ if ( n_ins > 0 ) FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points ); - /* Reset graphics state. */ - exec->GS = loader->size->GS; - /* XXX: UNDOCUMENTED! Hinting instructions of a composite glyph */ /* completely refer to the (already) hinted subglyphs. */ if ( is_composite ) @@ -811,8 +804,8 @@ } else { - exec->metrics.x_scale = loader->size->metrics->x_scale; - exec->metrics.y_scale = loader->size->metrics->y_scale; + exec->metrics.x_scale = size->metrics->x_scale; + exec->metrics.y_scale = size->metrics->y_scale; } #endif @@ -838,7 +831,7 @@ exec->is_composite = is_composite; exec->pts = *zone; - error = TT_Run_Context( exec ); + error = TT_Run_Context( exec, size ); if ( error && exec->pedantic_hinting ) return error; @@ -854,8 +847,7 @@ /* to change bearings or advance widths. */ #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && - exec->backward_compatibility ) + if ( exec->backward_compatibility ) return FT_Err_Ok; #endif @@ -1152,30 +1144,15 @@ x = FT_MulFix( x, x_scale ); y = FT_MulFix( y, y_scale ); - if ( subglyph->flags & ROUND_XY_TO_GRID ) + if ( subglyph->flags & ROUND_XY_TO_GRID && + IS_HINTED( loader->load_flags ) ) { - TT_Face face = loader->face; - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); - +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL + if ( !loader->exec->backward_compatibility ) +#endif + x = FT_PIX_ROUND( x ); - if ( IS_HINTED( loader->load_flags ) ) - { - /* - * We round the horizontal offset only if there is hinting along - * the x axis; this corresponds to integer advance width values. - * - * Theoretically, a glyph's bytecode can toggle ClearType's - * `backward compatibility' mode, which would allow modification - * of the advance width. In reality, however, applications - * neither allow nor expect modified advance widths if subpixel - * rendering is active. - * - */ - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_35 ) - x = FT_PIX_ROUND( x ); - - y = FT_PIX_ROUND( y ); - } + y = FT_PIX_ROUND( y ); } } } @@ -1378,8 +1355,9 @@ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && loader->exec && - loader->exec->subpixel_hinting_lean && - loader->exec->grayscale_cleartype ) + loader->exec->mode != FT_RENDER_MODE_MONO && + loader->exec->mode != FT_RENDER_MODE_LCD && + loader->exec->mode != FT_RENDER_MODE_LCD_V ) { loader->pp3.x = loader->advance / 2; loader->pp4.x = loader->advance / 2; @@ -1444,13 +1422,13 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( recurse_count ) - FT_TRACE5(( " nesting level: %d\n", recurse_count )); + FT_TRACE5(( " nesting level: %u\n", recurse_count )); #endif /* some fonts have an incorrect value of `maxComponentDepth' */ if ( recurse_count > face->max_profile.maxComponentDepth ) { - FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %d\n", + FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %u\n", recurse_count )); face->max_profile.maxComponentDepth = (FT_UShort)recurse_count; } @@ -1577,8 +1555,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) || - FT_IS_VARIATION( FT_FACE( face ) ) ) + if ( !IS_DEFAULT_INSTANCE( FT_FACE( face ) ) ) { /* a small outline structure with four elements for */ /* communication with `TT_Vary_Apply_Glyph_Deltas' */ @@ -1731,8 +1708,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) || - FT_IS_VARIATION( FT_FACE( face ) ) ) + if ( !IS_DEFAULT_INSTANCE( FT_FACE( face ) ) ) { FT_UShort i, limit; FT_SubGlyph subglyph; @@ -2108,7 +2084,6 @@ { TT_Face face = (TT_Face)glyph->face; SFNT_Service sfnt = (SFNT_Service)face->sfnt; - FT_Stream stream = face->root.stream; FT_Error error; TT_SBit_MetricsRec sbit_metrics; @@ -2117,7 +2092,7 @@ size->strike_index, glyph_index, (FT_UInt)load_flags, - stream, + face->root.stream, &glyph->bitmap, &sbit_metrics ); if ( !error ) @@ -2205,15 +2180,6 @@ FT_Bool glyf_table_only ) { TT_Face face = (TT_Face)glyph->face; - FT_Stream stream = face->root.stream; - -#ifdef TT_USE_BYTECODE_INTERPRETER - FT_Error error; - FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face ); -#endif -#endif FT_ZERO( loader ); @@ -2223,122 +2189,78 @@ /* load execution context */ if ( IS_HINTED( load_flags ) && !glyf_table_only ) { + FT_Error error; TT_ExecContext exec; - FT_Bool grayscale = TRUE; + FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags ); + FT_Bool grayscale = FT_BOOL( mode != FT_RENDER_MODE_MONO ); + FT_Bool reexecute = FALSE; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - FT_Bool subpixel_hinting_lean; - FT_Bool grayscale_cleartype; + TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face ); #endif - FT_Bool reexecute = FALSE; - - if ( size->bytecode_ready < 0 || size->cvt_ready < 0 ) + if ( size->bytecode_ready > 0 ) + return size->bytecode_ready; + if ( size->bytecode_ready < 0 ) { - error = tt_size_ready_bytecode( size, pedantic ); + FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); + + + error = tt_size_init_bytecode( size, pedantic ); if ( error ) return error; } - else if ( size->bytecode_ready ) - return size->bytecode_ready; - else if ( size->cvt_ready ) - return size->cvt_ready; - /* query new execution context */ exec = size->context; - if ( !exec ) - return FT_THROW( Could_Not_Find_Context ); - - grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - FT_RENDER_MODE_MONO ); #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) { - subpixel_hinting_lean = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - FT_RENDER_MODE_MONO ); - grayscale_cleartype = - FT_BOOL( subpixel_hinting_lean && - !( ( load_flags & - FT_LOAD_TARGET_LCD ) || - ( load_flags & - FT_LOAD_TARGET_LCD_V ) ) ); - exec->vertical_lcd_lean = - FT_BOOL( subpixel_hinting_lean && - ( load_flags & - FT_LOAD_TARGET_LCD_V ) ); - grayscale = FT_BOOL( grayscale && !subpixel_hinting_lean ); - } - else - { - subpixel_hinting_lean = FALSE; - grayscale_cleartype = FALSE; - exec->vertical_lcd_lean = FALSE; - } -#endif + grayscale = FALSE; - error = TT_Load_Context( exec, face, size ); - if ( error ) - return error; - - { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) + /* any mode change requires a re-execution of the CVT program */ + if ( mode != exec->mode ) { - /* a change from mono to subpixel rendering (and vice versa) */ - /* requires a re-execution of the CVT program */ - if ( subpixel_hinting_lean != exec->subpixel_hinting_lean ) - { - FT_TRACE4(( "tt_loader_init: subpixel hinting change," - " re-executing `prep' table\n" )); - - exec->subpixel_hinting_lean = subpixel_hinting_lean; - reexecute = TRUE; - } - - /* a change from colored to grayscale subpixel rendering (and */ - /* vice versa) requires a re-execution of the CVT program */ - if ( grayscale_cleartype != exec->grayscale_cleartype ) - { - FT_TRACE4(( "tt_loader_init: grayscale subpixel hinting change," - " re-executing `prep' table\n" )); + FT_TRACE4(( "tt_loader_init: render mode change," + " re-executing `prep' table\n" )); - exec->grayscale_cleartype = grayscale_cleartype; - reexecute = TRUE; - } + exec->mode = mode; + reexecute = TRUE; } + } #endif - /* a change from mono to grayscale rendering (and vice versa) */ - /* requires a re-execution of the CVT program */ - if ( grayscale != exec->grayscale ) - { - FT_TRACE4(( "tt_loader_init: grayscale hinting change," - " re-executing `prep' table\n" )); + /* a change from mono to grayscale rendering (and vice versa) */ + /* requires a re-execution of the CVT program */ + if ( grayscale != exec->grayscale ) + { + FT_TRACE4(( "tt_loader_init: grayscale hinting change," + " re-executing `prep' table\n" )); - exec->grayscale = grayscale; - reexecute = TRUE; - } + exec->grayscale = grayscale; + reexecute = TRUE; } - if ( reexecute ) + if ( size->cvt_ready > 0 ) + return size->cvt_ready; + if ( size->cvt_ready < 0 || reexecute ) { - error = tt_size_run_prep( size, pedantic ); - if ( error ) - return error; - error = TT_Load_Context( exec, face, size ); + error = tt_size_run_prep( size ); if ( error ) return error; } + error = TT_Load_Context( exec, face, size ); + if ( error ) + return error; + /* check whether the cvt program has disabled hinting */ - if ( exec->GS.instruct_control & 1 ) + if ( size->GS.instruct_control & 1 ) load_flags |= FT_LOAD_NO_HINTING; - /* load default graphics state -- if needed */ - if ( exec->GS.instruct_control & 2 ) - exec->GS = tt_default_graphics_state; + /* check whether GS modifications should be reverted */ + if ( size->GS.instruct_control & 2 ) + size->GS = tt_default_graphics_state; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* @@ -2355,28 +2277,25 @@ * */ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && - subpixel_hinting_lean && + mode != FT_RENDER_MODE_MONO && !FT_IS_TRICKY( glyph->face ) ) - exec->backward_compatibility = !( exec->GS.instruct_control & 4 ); + exec->backward_compatibility = ( size->GS.instruct_control & 4 ) ^ 4; else - exec->backward_compatibility = FALSE; + exec->backward_compatibility = 0; #endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */ - exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); loader->exec = exec; - loader->instructions = exec->glyphIns; /* Use the hdmx table if any unless FT_LOAD_COMPUTE_METRICS */ /* is set or backward compatibility mode of the v38 or v40 */ /* interpreters is active. See `ttinterp.h' for details on */ /* backward compatibility mode. */ - if ( IS_HINTED( loader->load_flags ) && - !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) && + if ( IS_HINTED( load_flags ) && + !( load_flags & FT_LOAD_COMPUTE_METRICS ) && #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && - exec->backward_compatibility ) && + !exec->backward_compatibility && #endif - !face->postscript.isFixedPitch ) + !face->postscript.isFixedPitch ) { loader->widthp = size->widthp; } @@ -2401,7 +2320,7 @@ loader->face = face; loader->size = size; loader->glyph = (FT_GlyphSlot)glyph; - loader->stream = stream; + loader->stream = face->root.stream; loader->composites.head = NULL; loader->composites.tail = NULL; @@ -2463,7 +2382,7 @@ TT_LoaderRec loader; - FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index )); + FT_TRACE1(( "TT_Load_Glyph: glyph index %u\n", glyph_index )); #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -2544,7 +2463,7 @@ #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */ - if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid ) + if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.ppem ) { error = FT_THROW( Invalid_Size_Handle ); goto Exit; diff --git a/vendor/freetype/src/truetype/ttgxvar.c b/vendor/freetype/src/truetype/ttgxvar.c index 20860665d17..267dcfe9c2f 100644 --- a/vendor/freetype/src/truetype/ttgxvar.c +++ b/vendor/freetype/src/truetype/ttgxvar.c @@ -489,8 +489,9 @@ FT_UShort axis_count; FT_UInt region_count; - FT_UInt i, j; - FT_Bool long_words; + FT_UInt i, j; + FT_Byte* bytes; + FT_Bool long_words; GX_Blend blend = ttface->blend; FT_ULong* dataOffsetArray = NULL; @@ -526,11 +527,15 @@ if ( FT_QNEW_ARRAY( dataOffsetArray, data_count ) ) goto Exit; + if ( FT_FRAME_ENTER( data_count * 4 ) ) + goto Exit; + + bytes = stream->cursor; + for ( i = 0; i < data_count; i++ ) - { - if ( FT_READ_ULONG( dataOffsetArray[i] ) ) - goto Exit; - } + dataOffsetArray[i] = FT_NEXT_ULONG( bytes ); + + FT_FRAME_EXIT(); /* parse array of region records (region list) */ if ( FT_STREAM_SEEK( offset + region_offset ) ) @@ -564,13 +569,26 @@ goto Exit; itemStore->regionCount = region_count; - for ( i = 0; i < itemStore->regionCount; i++ ) + if ( FT_FRAME_ENTER( (FT_Long)region_count * axis_count * 6 ) ) + { + FT_TRACE2(( "tt_var_load_item_variation_store:" + " not enough data for variation regions\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + bytes = stream->cursor; + + for ( i = 0; i < region_count; i++ ) { GX_AxisCoords axisCoords; if ( FT_NEW_ARRAY( itemStore->varRegionList[i].axisList, axis_count ) ) + { + FT_FRAME_EXIT(); goto Exit; + } axisCoords = itemStore->varRegionList[i].axisList; @@ -579,10 +597,9 @@ FT_Int start, peak, end; - if ( FT_READ_SHORT( start ) || - FT_READ_SHORT( peak ) || - FT_READ_SHORT( end ) ) - goto Exit; + start = FT_NEXT_SHORT( bytes ); + peak = FT_NEXT_SHORT( bytes ); + end = FT_NEXT_SHORT( bytes ); /* immediately tag invalid ranges with special peak = 0 */ if ( ( start < 0 && end > 0 ) || start > peak || peak > end ) @@ -594,6 +611,8 @@ } } + FT_FRAME_EXIT(); + /* end of region list parse */ /* use dataOffsetArray now to parse varData items */ @@ -625,7 +644,7 @@ /* check some data consistency */ if ( word_delta_count > region_idx_count ) { - FT_TRACE2(( "bad short count %d or region count %d\n", + FT_TRACE2(( "bad short count %d or region count %u\n", word_delta_count, region_idx_count )); error = FT_THROW( Invalid_Table ); @@ -634,7 +653,7 @@ if ( region_idx_count > itemStore->regionCount ) { - FT_TRACE2(( "inconsistent regionCount %d in varData[%d]\n", + FT_TRACE2(( "inconsistent regionCount %u in varData[%u]\n", region_idx_count, i )); error = FT_THROW( Invalid_Table ); @@ -648,20 +667,32 @@ varData->wordDeltaCount = word_delta_count; varData->longWords = long_words; + if ( FT_FRAME_ENTER( region_idx_count * 2 ) ) + { + FT_TRACE2(( "tt_var_load_item_variation_store:" + " not enough data for region indices\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + bytes = stream->cursor; + for ( j = 0; j < varData->regionIdxCount; j++ ) { - if ( FT_READ_USHORT( varData->regionIndices[j] ) ) - goto Exit; + varData->regionIndices[j] = FT_NEXT_USHORT( bytes ); if ( varData->regionIndices[j] >= itemStore->regionCount ) { - FT_TRACE2(( "bad region index %d\n", + FT_TRACE2(( "bad region index %u\n", varData->regionIndices[j] )); + FT_FRAME_EXIT(); error = FT_THROW( Invalid_Table ); goto Exit; } } + FT_FRAME_EXIT(); + per_region_size = word_delta_count + region_idx_count; if ( long_words ) per_region_size *= 2; @@ -706,6 +737,7 @@ FT_UInt innerIndexMask; FT_ULong i; FT_UInt j; + FT_Byte* bytes; if ( FT_STREAM_SEEK( offset ) || @@ -757,6 +789,16 @@ if ( FT_NEW_ARRAY( map->outerIndex, map->mapCount ) ) goto Exit; + if ( FT_FRAME_ENTER( map->mapCount * entrySize ) ) + { + FT_TRACE2(( "tt_var_load_delta_set_index_mapping:" + " invalid number of delta-set index mappings\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + bytes = stream->cursor; + for ( i = 0; i < map->mapCount; i++ ) { FT_UInt mapData = 0; @@ -769,9 +811,7 @@ FT_Byte data; - if ( FT_READ_BYTE( data ) ) - goto Exit; - + data = FT_NEXT_BYTE( bytes ); mapData = ( mapData << 8 ) | data; } @@ -789,7 +829,7 @@ if ( outerIndex >= itemStore->dataCount ) { - FT_TRACE2(( "outerIndex[%ld] == %d out of range\n", + FT_TRACE2(( "outerIndex[%lu] == %u out of range\n", i, outerIndex )); error = FT_THROW( Invalid_Table ); @@ -802,7 +842,7 @@ if ( innerIndex >= itemStore->varData[outerIndex].itemCount ) { - FT_TRACE2(( "innerIndex[%ld] == %d out of range\n", + FT_TRACE2(( "innerIndex[%lu] == %u out of range\n", i, innerIndex )); error = FT_THROW( Invalid_Table ); @@ -812,6 +852,8 @@ map->innerIndex[i] = innerIndex; } + FT_FRAME_EXIT(); + Exit: return error; } @@ -965,28 +1007,181 @@ } + static FT_Fixed + tt_calculate_scalar( GX_AxisCoords axis, + FT_UInt axisCount, + FT_Fixed* normalizedcoords ) + { + FT_Fixed scalar = 0x10000L; + FT_UInt j; + + + /* Inner loop steps through axes in this region. */ + for ( j = 0; j < axisCount; j++, axis++ ) + { + FT_Fixed ncv = normalizedcoords[j]; + + + /* Compute the scalar contribution of this axis, */ + /* with peak of 0 used for invalid axes. */ + if ( axis->peakCoord == ncv || + axis->peakCoord == 0 ) + continue; + + /* Ignore this region if coordinates are out of range. */ + else if ( ncv <= axis->startCoord || + ncv >= axis->endCoord ) + { + scalar = 0; + break; + } + + /* Cumulative product of all the axis scalars. */ + else if ( ncv < axis->peakCoord ) + scalar = FT_MulDiv( scalar, + ncv - axis->startCoord, + axis->peakCoord - axis->startCoord ); + else /* ncv > axis->peakCoord */ + scalar = FT_MulDiv( scalar, + axis->endCoord - ncv, + axis->endCoord - axis->peakCoord ); + + } /* per-axis loop */ + + return scalar; + } + + + static FT_Int64 + ft_mul_add_delta_scalar( FT_Int64 returnValue, + FT_Int32 delta, + FT_Int32 scalar ) + { + +#ifdef FT_INT64 + + return returnValue + (FT_Int64)delta * scalar; + +#else /* !FT_INT64 */ + + if ( (FT_UInt32)( delta + 0x8000 ) <= 0x20000 ) + { + /* Fast path: multiplication result fits into 32 bits. */ + + FT_Int32 lo = delta * scalar; + + + returnValue.lo += (FT_UInt32)lo; + + if ( returnValue.lo < (FT_UInt32)lo ) + returnValue.hi += ( lo < 0 ) ? 0 : 1; + + if ( lo < 0 ) + returnValue.hi -= 1; + + return returnValue; + } + else + { + /* Slow path: full 32x32 -> 64-bit signed multiplication. */ + + FT_Int64 product; + + /* Get absolute values. */ + FT_UInt32 a = ( delta < 0 ) ? -delta : delta; + FT_UInt32 b = ( scalar < 0 ) ? -scalar : scalar; + + /* Prepare unsigned multiplication. */ + FT_UInt32 a_lo = a & 0xFFFF; + FT_UInt32 a_hi = a >> 16; + + FT_UInt32 b_lo = b & 0xFFFF; + FT_UInt32 b_hi = b >> 16; + + /* Partial products. */ + FT_UInt32 p0 = a_lo * b_lo; + FT_UInt32 p1 = a_lo * b_hi; + FT_UInt32 p2 = a_hi * b_lo; + FT_UInt32 p3 = a_hi * b_hi; + + /* Combine: result = p3 << 32 + (p1 + p2) << 16 + p0 */ + FT_UInt32 mid = p1 + p2; + FT_UInt32 mid_carry = ( mid < p1 ); + + FT_UInt32 carry; + + + product.lo = ( mid << 16 ) + ( p0 & 0xFFFF ); + carry = ( product.lo < ( p0 & 0xFFFF ) ) ? 1 : 0; + product.hi = p3 + ( mid >> 16 ) + mid_carry + carry; + + /* If result should be negative, negate. */ + if ( ( delta < 0 ) ^ ( scalar < 0 ) ) + { + product.lo = ~product.lo + 1; + product.hi = ~product.hi + ( product.lo == 0 ? 1 : 0 ); + } + + /* Add to `returnValue`. */ + returnValue.lo += product.lo; + if ( returnValue.lo < product.lo ) + returnValue.hi++; + returnValue.hi += product.hi; + + return returnValue; + } + +#endif /* !FT_INT64 */ + + } + + + static FT_ItemVarDelta + ft_round_and_shift16( FT_Int64 returnValue ) + { + +#ifdef FT_INT64 + + return (FT_ItemVarDelta)( returnValue + 0x8000L ) >> 16; + +#else /* !FT_INT64 */ + + FT_UInt hi = returnValue.hi; + FT_UInt lo = returnValue.lo; + + FT_UInt delta; + + + /* Add 0x8000 to round. */ + lo += 0x8000; + if ( lo < 0x8000 ) /* overflow occurred */ + hi += 1; + + /* Shift right by 16 bits. */ + delta = ( hi << 16 ) | ( lo >> 16 ); + + return (FT_ItemVarDelta)delta; + +#endif /* !FT_INT64 */ + + } + + FT_LOCAL_DEF( FT_ItemVarDelta ) tt_var_get_item_delta( FT_Face face, /* TT_Face */ GX_ItemVarStore itemStore, FT_UInt outerIndex, FT_UInt innerIndex ) { - TT_Face ttface = (TT_Face)face; - FT_Stream stream = FT_FACE_STREAM( face ); - FT_Memory memory = stream->memory; - FT_Error error = FT_Err_Ok; - - GX_ItemVarData varData; - FT_ItemVarDelta* deltaSet = NULL; - FT_ItemVarDelta deltaSetStack[16]; + TT_Face ttface = (TT_Face)face; - FT_Fixed* scalars = NULL; - FT_Fixed scalarsStack[16]; + GX_ItemVarData varData; - FT_UInt master, j; - FT_ItemVarDelta returnValue = 0; - FT_UInt per_region_size; - FT_Byte* bytes; + FT_UInt master; + FT_Int64 returnValue = FT_INT64_ZERO; + FT_UInt shift_base = 1; + FT_UInt per_region_size; + FT_Byte* bytes; if ( !ttface->blend || !ttface->blend->normalizedcoords ) @@ -1011,113 +1206,63 @@ if ( varData->regionIdxCount == 0 ) return 0; /* Avoid "applying zero offset to null pointer". */ - if ( varData->regionIdxCount < 16 ) - { - deltaSet = deltaSetStack; - scalars = scalarsStack; - } - else - { - if ( FT_QNEW_ARRAY( deltaSet, varData->regionIdxCount ) ) - goto Exit; - if ( FT_QNEW_ARRAY( scalars, varData->regionIdxCount ) ) - goto Exit; - } - /* Parse delta set. */ /* */ /* Deltas are (word_delta_count + region_idx_count) bytes each */ /* if `longWords` isn't set, and twice as much otherwise. */ per_region_size = varData->wordDeltaCount + varData->regionIdxCount; if ( varData->longWords ) + { + shift_base = 2; per_region_size *= 2; + } bytes = varData->deltaSet + per_region_size * innerIndex; - if ( varData->longWords ) - { - for ( master = 0; master < varData->wordDeltaCount; master++ ) - deltaSet[master] = FT_NEXT_LONG( bytes ); - for ( ; master < varData->regionIdxCount; master++ ) - deltaSet[master] = FT_NEXT_SHORT( bytes ); - } - else - { - for ( master = 0; master < varData->wordDeltaCount; master++ ) - deltaSet[master] = FT_NEXT_SHORT( bytes ); - for ( ; master < varData->regionIdxCount; master++ ) - deltaSet[master] = FT_NEXT_CHAR( bytes ); - } - /* outer loop steps through master designs to be blended */ for ( master = 0; master < varData->regionIdxCount; master++ ) { - FT_Fixed scalar = 0x10000L; - FT_UInt regionIndex = varData->regionIndices[master]; + FT_UInt regionIndex = varData->regionIndices[master]; GX_AxisCoords axis = itemStore->varRegionList[regionIndex].axisList; + FT_Fixed scalar = tt_calculate_scalar( + axis, + itemStore->axisCount, + ttface->blend->normalizedcoords ); - /* inner loop steps through axes in this region */ - for ( j = 0; j < itemStore->axisCount; j++, axis++ ) - { - FT_Fixed ncv = ttface->blend->normalizedcoords[j]; + if ( scalar ) + { + FT_Int delta; - /* compute the scalar contribution of this axis */ - /* with peak of 0 used for invalid axes */ - if ( axis->peakCoord == ncv || - axis->peakCoord == 0 ) - continue; - /* ignore this region if coords are out of range */ - else if ( ncv <= axis->startCoord || - ncv >= axis->endCoord ) + if ( varData->longWords ) { - scalar = 0; - break; + if ( master < varData->wordDeltaCount ) + delta = FT_NEXT_LONG( bytes ); + else + delta = FT_NEXT_SHORT( bytes ); + } + else + { + if ( master < varData->wordDeltaCount ) + delta = FT_NEXT_SHORT( bytes ); + else + delta = FT_NEXT_CHAR( bytes ); } - /* cumulative product of all the axis scalars */ - else if ( ncv < axis->peakCoord ) - scalar = FT_MulDiv( scalar, - ncv - axis->startCoord, - axis->peakCoord - axis->startCoord ); - else /* ncv > axis->peakCoord */ - scalar = FT_MulDiv( scalar, - axis->endCoord - ncv, - axis->endCoord - axis->peakCoord ); - - } /* per-axis loop */ - - scalars[master] = scalar; + returnValue = ft_mul_add_delta_scalar( returnValue, delta, scalar ); + } + else + { + /* Branch-free, yay. */ + bytes += shift_base << ( master < varData->wordDeltaCount ); + } } /* per-region loop */ - - /* Compute the scaled delta for this region. - * - * From: https://docs.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#item-variation-store-header-and-item-variation-data-subtables: - * - * `Fixed` is a 32-bit (16.16) type and, in the general case, requires - * 32-bit deltas. As described above, the `DeltaSet` record can - * accommodate deltas that are, logically, either 16-bit or 32-bit. - * When scaled deltas are applied to `Fixed` values, the `Fixed` value - * is treated like a 32-bit integer. - * - * `FT_MulAddFix` internally uses 64-bit precision; it thus can handle - * deltas ranging from small 8-bit to large 32-bit values that are - * applied to 16.16 `FT_Fixed` / OpenType `Fixed` values. - */ - returnValue = FT_MulAddFix( scalars, deltaSet, varData->regionIdxCount ); - - Exit: - if ( scalars != scalarsStack ) - FT_FREE( scalars ); - if ( deltaSet != deltaSetStack ) - FT_FREE( deltaSet ); - - return returnValue; + return ft_round_and_shift16( returnValue ); } @@ -1643,6 +1788,7 @@ GX_Blend blend = face->blend; FT_Error error; FT_UInt i, j; + FT_Byte* bytes; FT_ULong table_len; FT_ULong gvar_start; FT_ULong offsetToData; @@ -1734,6 +1880,8 @@ if ( FT_FRAME_ENTER( offsets_len ) ) goto Exit; + bytes = stream->cursor; + /* offsets (one more offset than glyphs, to mark size of last) */ if ( FT_QNEW_ARRAY( blend->glyphoffsets, gvar_head.glyphCount + 1 ) ) goto Fail2; @@ -1744,16 +1892,24 @@ FT_ULong max_offset = 0; + if ( stream->limit - stream->cursor < gvar_head.glyphCount * 4 ) + { + FT_TRACE2(( "ft_var_load_gvar:" + " glyph variation data offset not enough\n" )); + error = FT_THROW( Invalid_Table ); + goto Fail; + } + for ( i = 0; i <= gvar_head.glyphCount; i++ ) { - blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG(); + blend->glyphoffsets[i] = offsetToData + FT_NEXT_ULONG( bytes ); if ( max_offset <= blend->glyphoffsets[i] ) max_offset = blend->glyphoffsets[i]; else { FT_TRACE2(( "ft_var_load_gvar:" - " glyph variation data offset %d not monotonic\n", + " glyph variation data offset %u not monotonic\n", i )); blend->glyphoffsets[i] = max_offset; } @@ -1762,7 +1918,7 @@ if ( limit < blend->glyphoffsets[i] ) { FT_TRACE2(( "ft_var_load_gvar:" - " glyph variation data offset %d out of range\n", + " glyph variation data offset %u out of range\n", i )); blend->glyphoffsets[i] = limit; } @@ -1774,16 +1930,24 @@ FT_ULong max_offset = 0; + if ( stream->limit - stream->cursor < gvar_head.glyphCount * 2 ) + { + FT_TRACE2(( "ft_var_load_gvar:" + " glyph variation data offset not enough\n" )); + error = FT_THROW( Invalid_Table ); + goto Fail; + } + for ( i = 0; i <= gvar_head.glyphCount; i++ ) { - blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2; + blend->glyphoffsets[i] = offsetToData + FT_NEXT_USHORT( bytes ) * 2; if ( max_offset <= blend->glyphoffsets[i] ) max_offset = blend->glyphoffsets[i]; else { FT_TRACE2(( "ft_var_load_gvar:" - " glyph variation data offset %d not monotonic\n", + " glyph variation data offset %u not monotonic\n", i )); blend->glyphoffsets[i] = max_offset; } @@ -1792,7 +1956,7 @@ if ( limit < blend->glyphoffsets[i] ) { FT_TRACE2(( "ft_var_load_gvar:" - " glyph variation data offset %d out of range\n", + " glyph variation data offset %u out of range\n", i )); blend->glyphoffsets[i] = limit; } @@ -1814,6 +1978,8 @@ goto Fail; } + bytes = stream->cursor; + if ( FT_QNEW_ARRAY( blend->tuplecoords, gvar_head.axisCount * gvar_head.globalCoordCount ) ) goto Fail2; @@ -1824,13 +1990,17 @@ for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ ) { blend->tuplecoords[i * gvar_head.axisCount + j] = - FT_fdot14ToFixed( FT_GET_SHORT() ); + FT_fdot14ToFixed( FT_NEXT_SHORT( bytes ) ); FT_TRACE5(( "%.5f ", (double)blend->tuplecoords[i * gvar_head.axisCount + j] / 65536 )); } FT_TRACE5(( "]\n" )); } + if ( FT_NEW_ARRAY( blend->tuplescalars, + gvar_head.globalCoordCount ) ) + goto Fail2; + blend->tuplecount = gvar_head.globalCoordCount; FT_TRACE5(( "\n" )); @@ -1896,15 +2066,25 @@ for ( i = 0; i < blend->num_axis; i++ ) { - FT_Fixed ncv = blend->normalizedcoords[i]; + FT_Fixed ncv; + + + if ( tuple_coords[i] == 0 ) + { + FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); + continue; + } + ncv = blend->normalizedcoords[i]; - FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 )); + FT_TRACE6(( " axis %u coordinate %.5f:\n", i, (double)ncv / 65536 )); - /* It's not clear why (for intermediate tuples) we don't need */ - /* to check against start/end -- the documentation says we don't. */ - /* Similarly, it's unclear why we don't need to scale along the */ - /* axis. */ + if ( ncv == 0 ) + { + FT_TRACE6(( " axis coordinate is zero, stop\n" )); + apply = 0; + break; + } if ( tuple_coords[i] == ncv ) { @@ -1914,12 +2094,6 @@ continue; } - if ( tuple_coords[i] == 0 ) - { - FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); - continue; - } - if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) { /* not an intermediate tuple */ @@ -2001,7 +2175,7 @@ if ( num_coords > mmvar->num_axis ) { FT_TRACE2(( "ft_var_to_normalized:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", mmvar->num_axis, num_coords )); num_coords = mmvar->num_axis; } @@ -2016,7 +2190,7 @@ FT_Fixed coord = coords[i]; - FT_TRACE5(( " %d: %.5f\n", i, (double)coord / 65536 )); + FT_TRACE5(( " %u: %.5f\n", i, (double)coord / 65536 )); if ( coord > a->maximum || coord < a->minimum ) { FT_TRACE1(( "ft_var_to_normalized: design coordinate %.5f\n", @@ -2156,7 +2330,7 @@ if ( num_coords > blend->num_axis ) { FT_TRACE2(( "ft_var_to_design:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", blend->num_axis, num_coords )); nc = blend->num_axis; } @@ -2516,7 +2690,7 @@ " minimum default maximum flags\n" )); /* " XXXX.XXXXX XXXX.XXXXX XXXX.XXXXX 0xXXXX" */ - FT_TRACE5(( " %3d `%s'" + FT_TRACE5(( " %3u `%s'" " %10.5f %10.5f %10.5f 0x%04X%s\n", i, a->name, @@ -2608,7 +2782,7 @@ (void)FT_STREAM_SEEK( pos ); - FT_TRACE5(( " named instance %d (%s%s%s, %s%s%s)\n", + FT_TRACE5(( " named instance %u (%s%s%s, %s%s%s)\n", i, strname ? "name: `" : "", strname ? strname : "unnamed", @@ -2636,7 +2810,7 @@ FT_UInt strid = ~0U; - /* The default instance is missing in array the */ + /* The default instance is missing in the array */ /* of named instances; try to synthesize an entry. */ /* If this fails, `default_named_instance` remains */ /* at value zero, which doesn't do any harm. */ @@ -2766,10 +2940,18 @@ } manageCvt; - face->doblend = FALSE; - if ( !face->blend ) { + face->doblend = FALSE; + for ( i = 0; i < num_coords; i++ ) + if ( coords[i] ) + { + face->doblend = TRUE; + break; + } + if ( !face->doblend ) + goto Exit; + if ( FT_SET_ERROR( TT_Get_MM_Var( FT_FACE( face ), NULL ) ) ) goto Exit; } @@ -2780,7 +2962,7 @@ if ( num_coords > mmvar->num_axis ) { FT_TRACE2(( "TT_Set_MM_Blend:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", mmvar->num_axis, num_coords )); num_coords = mmvar->num_axis; } @@ -2882,11 +3064,7 @@ /* return value -1 indicates `no change' */ if ( !have_diff ) - { - face->doblend = TRUE; - return -1; - } for ( ; i < mmvar->num_axis; i++ ) { @@ -2915,7 +3093,15 @@ blend->normalizedcoords, blend->coords ); - face->doblend = TRUE; + face->doblend = FALSE; + for ( i = 0; i < blend->num_axis; i++ ) + { + if ( blend->normalizedcoords[i] ) + { + face->doblend = TRUE; + break; + } + } if ( face->cvt ) { @@ -2941,6 +3127,9 @@ } } + for ( i = 0 ; i < blend->tuplecount ; i++ ) + blend->tuplescalars[i] = (FT_Fixed)-0x20000L; + Exit: return error; } @@ -2980,7 +3169,24 @@ FT_UInt num_coords, FT_Fixed* coords ) { - return tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 ); + FT_Error error = FT_Err_Ok; + + + error = tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 ); + if ( error == FT_Err_Ok ) + { + FT_UInt i; + + + for ( i = 0; i < num_coords; i++ ) + if ( coords[i] ) + { + error = -2; /* -2 means is_variable. */ + break; + } + } + + return error; } @@ -3043,7 +3249,7 @@ if ( num_coords > blend->num_axis ) { FT_TRACE2(( "TT_Get_MM_Blend:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", blend->num_axis, num_coords )); nc = blend->num_axis; } @@ -3125,7 +3331,7 @@ if ( num_coords > mmvar->num_axis ) { FT_TRACE2(( "TT_Set_Var_Design:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", mmvar->num_axis, num_coords )); num_coords = mmvar->num_axis; } @@ -3201,6 +3407,15 @@ if ( error ) goto Exit; + for ( i = 0; i < num_coords; i++ ) + { + if ( normalized[i] ) + { + error = -2; /* -2 means is_variable. */ + break; + } + } + Exit: FT_FREE( normalized ); return error; @@ -3237,10 +3452,12 @@ FT_UInt num_coords, FT_Fixed* coords ) { - TT_Face ttface = (TT_Face)face; - FT_Error error = FT_Err_Ok; - GX_Blend blend; - FT_UInt i, nc; + TT_Face ttface = (TT_Face)face; + FT_Error error = FT_Err_Ok; + GX_Blend blend; + FT_MM_Var* mmvar; + FT_Var_Axis* a; + FT_UInt i, nc; if ( !ttface->blend ) @@ -3263,24 +3480,26 @@ if ( num_coords > blend->num_axis ) { FT_TRACE2(( "TT_Get_Var_Design:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", blend->num_axis, num_coords )); nc = blend->num_axis; } + mmvar = blend->mmvar; + a = mmvar->axis; if ( ttface->doblend ) { - for ( i = 0; i < nc; i++ ) + for ( i = 0; i < nc; i++, a++ ) coords[i] = blend->coords[i]; } else { - for ( i = 0; i < nc; i++ ) - coords[i] = 0; + for ( i = 0; i < nc; i++, a++ ) + coords[i] = a->def; } - for ( ; i < num_coords; i++ ) - coords[i] = 0; + for ( ; i < num_coords; i++, a++ ) + coords[i] = a->def; return FT_Err_Ok; } @@ -3373,6 +3592,9 @@ error = TT_Set_Var_Design( face, 0, NULL ); } + if ( error == -1 || error == -2 ) + error = FT_Err_Ok; + Exit: return error; } @@ -3591,7 +3813,7 @@ FT_Stream_SeekSet( stream, here ); } - FT_TRACE5(( "cvar: there %s %d tuple%s:\n", + FT_TRACE5(( "cvar: there %s %u tuple%s:\n", ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are", tupleCount & GX_TC_TUPLE_COUNT_MASK, ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" )); @@ -3610,7 +3832,7 @@ FT_Fixed apply; - FT_TRACE6(( " tuple %d:\n", i )); + FT_TRACE6(( " tuple %u:\n", i )); tupleDataSize = FT_GET_USHORT(); tupleIndex = FT_GET_USHORT(); @@ -3697,7 +3919,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( old_cvt_delta != cvt_deltas[j] ) { - FT_TRACE7(( " %d: %f -> %f\n", + FT_TRACE7(( " %u: %f -> %f\n", j, (double)( FT_fdot6ToFixed( face->cvt[j] ) + old_cvt_delta ) / 65536, @@ -4027,7 +4249,7 @@ FT_Outline* outline, FT_Vector* unrounded ) { - FT_Error error; + FT_Error error = FT_Err_Ok; TT_Face face = loader->face; FT_Stream stream = face->root.stream; FT_Memory memory = stream->memory; @@ -4047,6 +4269,15 @@ FT_ULong here; FT_UInt i, j; + FT_UInt peak_coords_size; + FT_UInt point_deltas_x_size; + FT_UInt points_org_size; + FT_UInt points_out_size; + FT_UInt has_delta_size; + FT_UInt pool_size; + FT_Byte* pool = NULL; + FT_Byte* p; + FT_Fixed* peak_coords = NULL; FT_Fixed* tuple_coords; FT_Fixed* im_start_coords; @@ -4067,21 +4298,24 @@ FT_Fixed* point_deltas_y = NULL; - if ( !face->doblend || !blend ) - return FT_THROW( Invalid_Argument ); - for ( i = 0; i < n_points; i++ ) { unrounded[i].x = INT_TO_F26DOT6( outline->points[i].x ); unrounded[i].y = INT_TO_F26DOT6( outline->points[i].y ); } + if ( !face->doblend ) + goto Exit; + + if ( !blend ) + return FT_THROW( Invalid_Argument ); + if ( glyph_index >= blend->gv_glyphcnt || blend->glyphoffsets[glyph_index] == blend->glyphoffsets[glyph_index + 1] ) { FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" - " no variation data for glyph %d\n", glyph_index )); + " no variation data for glyph %u\n", glyph_index )); return FT_Err_Ok; } @@ -4125,18 +4359,41 @@ FT_Stream_SeekSet( stream, here ); } - FT_TRACE5(( "gvar: there %s %d tuple%s:\n", + FT_TRACE5(( "gvar: there %s %u tuple%s:\n", ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are", tupleCount & GX_TC_TUPLE_COUNT_MASK, ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" )); - if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) || - FT_NEW_ARRAY( point_deltas_x, 2 * n_points ) || - FT_QNEW_ARRAY( points_org, n_points ) || - FT_QNEW_ARRAY( points_out, n_points ) || - FT_QNEW_ARRAY( has_delta, n_points ) ) + peak_coords_size = ALIGN_SIZE( 3 * blend->num_axis * + sizeof ( *peak_coords ) ); + point_deltas_x_size = ALIGN_SIZE( 2 * n_points * + sizeof ( *point_deltas_x ) ); + points_org_size = ALIGN_SIZE( n_points * sizeof ( *points_org ) ); + points_out_size = ALIGN_SIZE( n_points * sizeof ( *points_out ) ); + has_delta_size = ALIGN_SIZE( n_points * sizeof ( *has_delta ) ); + + pool_size = peak_coords_size + + point_deltas_x_size + + points_org_size + + points_out_size + + has_delta_size; + + if ( FT_ALLOC( pool, pool_size ) ) goto Exit; + p = pool; + peak_coords = (FT_Fixed*)p; + p += peak_coords_size; + point_deltas_x = (FT_Fixed*)p; + p += point_deltas_x_size; + points_org = (FT_Vector*)p; + p += points_org_size; + points_out = (FT_Vector*)p; + p += points_out_size; + has_delta = (FT_Bool*)p; + + FT_ARRAY_ZERO( point_deltas_x, 2 * n_points ); + im_start_coords = peak_coords + blend->num_axis; im_end_coords = im_start_coords + blend->num_axis; point_deltas_y = point_deltas_x + n_points; @@ -4147,27 +4404,70 @@ points_org[j].y = FT_intToFixed( outline->points[j].y ); } - for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ ) + p = stream->cursor; + + tupleCount &= GX_TC_TUPLE_COUNT_MASK; + for ( i = 0; i < tupleCount; i++ ) { - FT_UInt tupleDataSize; - FT_UInt tupleIndex; - FT_Fixed apply; + FT_UInt tupleDataSize; + FT_UInt tupleIndex; + FT_Fixed apply; + FT_Fixed* tupleScalars; - FT_TRACE6(( " tuple %d:\n", i )); + FT_TRACE6(( " tuple %u:\n", i )); - tupleDataSize = FT_GET_USHORT(); - tupleIndex = FT_GET_USHORT(); + tupleScalars = blend->tuplescalars; + + /* Enter frame for four bytes. */ + if ( 4 > stream->limit - p ) + { + FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" + " invalid glyph variation array header\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + tupleDataSize = FT_NEXT_USHORT( p ); + tupleIndex = FT_NEXT_USHORT( p ); + + if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) + tupleScalars = NULL; if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) { + if ( 2 * blend->num_axis > (FT_UInt)( stream->limit - p ) ) + { + FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" + " invalid glyph variation array header\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + for ( j = 0; j < blend->num_axis; j++ ) - peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + peak_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) ); + tuple_coords = peak_coords; + tupleScalars = NULL; } else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount ) + { + FT_Fixed scalar = + tupleScalars + ? tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK] + : (FT_Fixed)-0x20000; + + + if ( scalar != (FT_Fixed)-0x20000 ) + { + apply = scalar; + goto apply_found; + } + tuple_coords = blend->tuplecoords + - ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis; + ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * + blend->num_axis; + } else { FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" @@ -4179,10 +4479,18 @@ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) { + if ( 4 * blend->num_axis > (FT_UInt)( stream->limit - p ) ) + { + FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" + " invalid glyph variation array header\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + for ( j = 0; j < blend->num_axis; j++ ) - im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + im_start_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) ); for ( j = 0; j < blend->num_axis; j++ ) - im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + im_end_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) ); } apply = ft_var_apply_tuple( blend, @@ -4191,6 +4499,11 @@ im_start_coords, im_end_coords ); + if ( tupleScalars ) + tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK] = apply; + + apply_found: + if ( apply == 0 ) /* tuple isn't active for our blend */ { offsetToData += tupleDataSize; @@ -4247,7 +4560,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( point_delta_x || point_delta_y ) { - FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n", + FT_TRACE7(( " %u: (%f, %f) -> (%f, %f)\n", j, (double)( FT_intToFixed( outline->points[j].x ) + old_point_delta_x ) / 65536, @@ -4321,7 +4634,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( point_delta_x || point_delta_y ) { - FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n", + FT_TRACE7(( " %u: (%f, %f) -> (%f, %f)\n", j, (double)( FT_intToFixed( outline->points[j].x ) + old_point_delta_x ) / 65536, @@ -4402,11 +4715,7 @@ Exit: if ( sharedpoints != ALL_POINTS ) FT_FREE( sharedpoints ); - FT_FREE( points_org ); - FT_FREE( points_out ); - FT_FREE( has_delta ); - FT_FREE( peak_coords ); - FT_FREE( point_deltas_x ); + FT_FREE( pool ); FExit: FT_FRAME_EXIT(); @@ -4577,6 +4886,7 @@ FT_FREE( blend->mvar_table ); } + FT_FREE( blend->tuplescalars ); FT_FREE( blend->tuplecoords ); FT_FREE( blend->glyphoffsets ); FT_FREE( blend ); diff --git a/vendor/freetype/src/truetype/ttgxvar.h b/vendor/freetype/src/truetype/ttgxvar.h index 9326011e3a2..fe8f1f6b6a5 100644 --- a/vendor/freetype/src/truetype/ttgxvar.h +++ b/vendor/freetype/src/truetype/ttgxvar.h @@ -255,6 +255,10 @@ FT_BEGIN_HEADER * A two-dimensional array that holds the shared tuple coordinates * in the `gvar' table. * + * tuplescalars :: + * A one-dimensional array that holds the shared tuple + * scalars in the `gvar' table for current face coordinates. + * * gv_glyphcnt :: * The number of glyphs handled in the `gvar' table. * @@ -293,6 +297,7 @@ FT_BEGIN_HEADER FT_UInt tuplecount; FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */ + FT_Fixed* tuplescalars; /* tuplescalars[tuplecount] */ FT_UInt gv_glyphcnt; FT_ULong* glyphoffsets; /* glyphoffsets[gv_glyphcnt + 1] */ diff --git a/vendor/freetype/src/truetype/ttinterp.c b/vendor/freetype/src/truetype/ttinterp.c index 951891dbf51..cfad9d77af8 100644 --- a/vendor/freetype/src/truetype/ttinterp.c +++ b/vendor/freetype/src/truetype/ttinterp.c @@ -89,58 +89,37 @@ #define FAILURE 1 - /************************************************************************** - * - * CODERANGE FUNCTIONS - * - */ + /* The default value for `scan_control' is documented as FALSE in the */ + /* TrueType specification. This is confusing since it implies a */ + /* Boolean value. However, this is not the case, thus both the */ + /* default values of our `scan_type' and `scan_control' fields (which */ + /* the documentation's `scan_control' variable is split into) are */ + /* zero. */ + /* */ + /* The rounding compensation should logically belong here but poorly */ + /* described in the OpenType specs. It was probably important in the */ + /* days of dot matrix printers. The values are referenced by color */ + /* as Gray, Black, and White in order. The Apple specification says */ + /* that the Gray compensation is always zero. The fourth value is */ + /* not described at all, but Greg says that it is the same as Gray. */ + /* FreeType sets all compensation values to zero. */ + + const TT_GraphicsState tt_default_graphics_state = + { + 0, 0, 0, 1, 1, 1, + { 0x4000, 0 }, { 0x4000, 0 }, { 0x4000, 0 }, + 1, 1, { 0, 0, 0, 0 }, + + 64, 68, 0, 0, 9, 3, + TRUE, 0, FALSE, 0 + }; /************************************************************************** * - * @Function: - * TT_Goto_CodeRange - * - * @Description: - * Switches to a new code range (updates the code related elements in - * `exec', and `IP'). - * - * @Input: - * range :: - * The new execution code range. - * - * IP :: - * The new IP in the new code range. + * CODERANGE FUNCTIONS * - * @InOut: - * exec :: - * The target execution context. */ - FT_LOCAL_DEF( void ) - TT_Goto_CodeRange( TT_ExecContext exec, - FT_Int range, - FT_Long IP ) - { - TT_CodeRange* coderange; - - - FT_ASSERT( range >= 1 && range <= 3 ); - - coderange = &exec->codeRangeTable[range - 1]; - - FT_ASSERT( coderange->base ); - - /* NOTE: Because the last instruction of a program may be a CALL */ - /* which will return to the first byte *after* the code */ - /* range, we test for IP <= Size instead of IP < Size. */ - /* */ - FT_ASSERT( IP <= coderange->size ); - - exec->code = coderange->base; - exec->codeSize = coderange->size; - exec->IP = IP; - exec->curRange = range; - } /************************************************************************** @@ -168,13 +147,19 @@ FT_LOCAL_DEF( void ) TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, - void* base, + FT_Byte* base, FT_Long length ) { FT_ASSERT( range >= 1 && range <= 3 ); - exec->codeRangeTable[range - 1].base = (FT_Byte*)base; + exec->codeRangeTable[range - 1].base = base; exec->codeRangeTable[range - 1].size = length; + + exec->code = base; + exec->codeSize = length; + exec->IP = 0; + exec->curRange = range; + exec->iniRange = range; } @@ -224,9 +209,6 @@ * exec :: * A handle to the target execution context. * - * memory :: - * A handle to the parent memory object. - * * @Note: * Only the glyph loader and debugger should call this function. */ @@ -240,10 +222,6 @@ exec->maxPoints = 0; exec->maxContours = 0; - /* free stack */ - FT_FREE( exec->stack ); - exec->stackSize = 0; - /* free glyf cvt working area */ FT_FREE( exec->glyfCvt ); exec->glyfCvtSize = 0; @@ -300,72 +278,26 @@ TT_Face face, TT_Size size ) { - FT_Int i; - TT_MaxProfile* maxp; - FT_Error error; - FT_Memory memory = exec->memory; + FT_Memory memory = exec->memory; exec->face = face; - maxp = &face->max_profile; exec->size = size; - if ( size ) - { - exec->numFDefs = size->num_function_defs; - exec->maxFDefs = size->max_function_defs; - exec->numIDefs = size->num_instruction_defs; - exec->maxIDefs = size->max_instruction_defs; - exec->FDefs = size->function_defs; - exec->IDefs = size->instruction_defs; - exec->pointSize = size->point_size; - exec->tt_metrics = size->ttmetrics; - exec->metrics = *size->metrics; - - exec->maxFunc = size->max_func; - exec->maxIns = size->max_ins; - - for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) - exec->codeRangeTable[i] = size->codeRangeTable[i]; - - /* set graphics state */ - exec->GS = size->GS; - - exec->cvtSize = size->cvt_size; - exec->cvt = size->cvt; - - exec->storeSize = size->storage_size; - exec->storage = size->storage; - - exec->twilight = size->twilight; - - /* In case of multi-threading it can happen that the old size object */ - /* no longer exists, thus we must clear all glyph zone references. */ - FT_ZERO( &exec->zp0 ); - exec->zp1 = exec->zp0; - exec->zp2 = exec->zp0; - } - - /* XXX: We reserve a little more elements on the stack to deal safely */ - /* with broken fonts like arialbs, courbs, timesbs, etc. */ - if ( FT_QRENEW_ARRAY( exec->stack, - exec->stackSize, - maxp->maxStackElements + 32 ) ) - return error; - exec->stackSize = maxp->maxStackElements + 32; + /* CVT and storage are not persistent in FreeType */ + /* reset them after they might have been modifief */ + exec->storage = exec->stack + exec->stackSize; + exec->cvt = exec->storage + exec->storeSize; /* free previous glyph code range */ FT_FREE( exec->glyphIns ); exec->glyphSize = 0; - exec->pts.n_points = 0; - exec->pts.n_contours = 0; - - exec->zp1 = exec->pts; - exec->zp2 = exec->pts; - exec->zp0 = exec->pts; + exec->pointSize = size->point_size; + exec->tt_metrics = size->ttmetrics; + exec->metrics = *size->metrics; - exec->instruction_trap = FALSE; + exec->twilight = size->twilight; return FT_Err_Ok; } @@ -394,89 +326,22 @@ TT_Save_Context( TT_ExecContext exec, TT_Size size ) { - FT_Int i; - - - /* XXX: Will probably disappear soon with all the code range */ - /* management, which is now rather obsolete. */ - /* */ - size->num_function_defs = exec->numFDefs; - size->num_instruction_defs = exec->numIDefs; - - size->max_func = exec->maxFunc; - size->max_ins = exec->maxIns; - - for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) - size->codeRangeTable[i] = exec->codeRangeTable[i]; - } - - - /************************************************************************** - * - * @Function: - * TT_Run_Context - * - * @Description: - * Executes one or more instructions in the execution context. - * - * @Input: - * exec :: - * A handle to the target execution context. - * - * @Return: - * TrueType error code. 0 means success. - */ - FT_LOCAL_DEF( FT_Error ) - TT_Run_Context( TT_ExecContext exec ) - { - TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ); - - exec->zp0 = exec->pts; - exec->zp1 = exec->pts; - exec->zp2 = exec->pts; + /* UNDOCUMENTED! */ + /* Only these GS values can be modified by the CVT program. */ - exec->GS.gep0 = 1; - exec->GS.gep1 = 1; - exec->GS.gep2 = 1; - - exec->GS.projVector.x = 0x4000; - exec->GS.projVector.y = 0x0000; - - exec->GS.freeVector = exec->GS.projVector; - exec->GS.dualVector = exec->GS.projVector; - - exec->GS.round_state = 1; - exec->GS.loop = 1; - - /* some glyphs leave something on the stack. so we clean it */ - /* before a new execution. */ - exec->top = 0; - exec->callTop = 0; - - return exec->face->interpreter( exec ); + size->GS.minimum_distance = exec->GS.minimum_distance; + size->GS.control_value_cutin = exec->GS.control_value_cutin; + size->GS.single_width_cutin = exec->GS.single_width_cutin; + size->GS.single_width_value = exec->GS.single_width_value; + size->GS.delta_base = exec->GS.delta_base; + size->GS.delta_shift = exec->GS.delta_shift; + size->GS.auto_flip = exec->GS.auto_flip; + size->GS.instruct_control = exec->GS.instruct_control; + size->GS.scan_control = exec->GS.scan_control; + size->GS.scan_type = exec->GS.scan_type; } - /* The default value for `scan_control' is documented as FALSE in the */ - /* TrueType specification. This is confusing since it implies a */ - /* Boolean value. However, this is not the case, thus both the */ - /* default values of our `scan_type' and `scan_control' fields (which */ - /* the documentation's `scan_control' variable is split into) are */ - /* zero. */ - - const TT_GraphicsState tt_default_graphics_state = - { - 0, 0, 0, - { 0x4000, 0 }, - { 0x4000, 0 }, - { 0x4000, 0 }, - - 1, 64, 1, - TRUE, 68, 0, 0, 9, 3, - 0, FALSE, 0, 1, 1, 1 - }; - - /* documentation is in ttinterp.h */ FT_EXPORT_DEF( TT_ExecContext ) @@ -485,7 +350,8 @@ FT_Memory memory; FT_Error error; - TT_ExecContext exec = NULL; + TT_ExecContext exec = NULL; + FT_DebugHook_Func interp; if ( !driver ) @@ -497,6 +363,15 @@ if ( FT_NEW( exec ) ) goto Fail; + /* set `exec->interpreter' according to the debug hook present, */ + /* which is used by 'ttdebug'. */ + interp = driver->root.root.library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; + + if ( interp ) + exec->interpreter = (TT_Interpreter)interp; + else + exec->interpreter = (TT_Interpreter)TT_RunIns; + /* create callStack here, other allocations delayed */ exec->memory = memory; exec->callSize = 32; @@ -1160,20 +1035,35 @@ #undef PACK -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER +#ifdef FT_INT64 + +#define TT_MulFix14( a, b ) TT_MulFix14_64( a, b ) + + static inline FT_F26Dot6 + TT_MulFix14_64( FT_F26Dot6 a, + FT_F2Dot14 b ) + { + FT_Int64 ab = MUL_INT64( a, b ); + + + ab = ADD_INT64( ab, 0x2000 + ( ab >> 63 ) ); /* rounding phase */ + + return (FT_F26Dot6)( ab >> 14 ); + } + +#elif !defined( FT_CONFIG_OPTION_NO_ASSEMBLER ) #if defined( __arm__ ) && \ ( defined( __thumb2__ ) || !defined( __thumb__ ) ) #define TT_MulFix14 TT_MulFix14_arm - static FT_Int32 + static __inline FT_Int32 TT_MulFix14_arm( FT_Int32 a, - FT_Int b ) + FT_Int32 b ) { FT_Int32 t, t2; - #if defined( __CC_ARM ) || defined( __ARMCC__ ) __asm @@ -1199,8 +1089,8 @@ #endif "adds %1, %1, %0\n\t" /* %1 += %0 */ "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #14\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #18\n\t" /* %0 |= %2 << 16 */ + "mov %0, %1, lsr #14\n\t" /* %0 = %1 >> 14 */ + "orr %0, %0, %2, lsl #18\n\t" /* %0 |= %2 << 18 */ : "=r"(a), "=&r"(t2), "=&r"(t) : "r"(a), "r"(b) : "cc" ); @@ -1210,49 +1100,60 @@ return a; } -#endif /* __arm__ && ( __thumb2__ || !__thumb__ ) */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - +#elif defined( __i386__ ) || defined( _M_IX86 ) -#if defined( __GNUC__ ) && \ - ( defined( __i386__ ) || defined( __x86_64__ ) ) +#define TT_MulFix14 TT_MulFix14_i386 -#define TT_MulFix14 TT_MulFix14_long_long + /* documentation is in freetype.h */ - /* Temporarily disable the warning that C90 doesn't support `long long'. */ -#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 -#pragma GCC diagnostic push -#endif -#pragma GCC diagnostic ignored "-Wlong-long" - - /* This is declared `noinline' because inlining the function results */ - /* in slower code. The `pure' attribute indicates that the result */ - /* only depends on the parameters. */ - static __attribute__(( noinline )) - __attribute__(( pure )) FT_Int32 - TT_MulFix14_long_long( FT_Int32 a, - FT_Int b ) + static __inline FT_Int32 + TT_MulFixi14_i386( FT_Int32 a, + FT_Int32 b ) { + FT_Int32 result; - long long ret = (long long)a * b; +#if defined( __GNUC__ ) - /* The following line assumes that right shifting of signed values */ - /* will actually preserve the sign bit. The exact behaviour is */ - /* undefined, but this is true on x86 and x86_64. */ - long long tmp = ret >> 63; + __asm__ __volatile__ ( + "imul %%edx\n" + "movl %%edx, %%ecx\n" + "sarl $31, %%ecx\n" + "addl $0x2000, %%ecx\n" + "addl %%ecx, %%eax\n" + "adcl $0, %%edx\n" + "shrl $14, %%eax\n" + "shll $18, %%edx\n" + "addl %%edx, %%eax\n" + : "=a"(result), "=d"(b) + : "a"(a), "d"(b) + : "%ecx", "cc" ); + +#elif defined( _MSC_VER) + __asm + { + mov eax, a + mov edx, b + imul edx + mov ecx, edx + sar ecx, 31 + add ecx, 2000h + add eax, ecx + adc edx, 0 + shr eax, 14 + shl edx, 18 + add eax, edx + mov result, eax + } - ret += 0x2000 + tmp; +#endif - return (FT_Int32)( ret >> 14 ); + return result; } -#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 -#pragma GCC diagnostic pop -#endif +#endif /* __i386__ || _M_IX86 */ -#endif /* __GNUC__ && ( __i386__ || __x86_64__ ) */ +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ #ifndef TT_MulFix14 @@ -1262,92 +1163,59 @@ /* for platforms where sizeof(int) == 2. */ static FT_Int32 TT_MulFix14( FT_Int32 a, - FT_Int b ) + FT_Int16 b ) { - FT_Int32 sign; - FT_UInt32 ah, al, mid, lo, hi; - + FT_Int32 m, hi; + FT_UInt32 l, lo; - sign = a ^ b; - if ( a < 0 ) - a = -a; - if ( b < 0 ) - b = -b; + /* compute a*b as 64-bit (hi_lo) value */ + l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); + m = ( a >> 16 ) * b; - ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU ); - al = (FT_UInt32)( a & 0xFFFFU ); + lo = l + ( (FT_UInt32)m << 16 ); + hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); - lo = al * b; - mid = ah * b; - hi = mid >> 16; - mid = ( mid << 16 ) + ( 1 << 13 ); /* rounding */ - lo += mid; - if ( lo < mid ) - hi += 1; - - mid = ( lo >> 14 ) | ( hi << 18 ); + /* divide the result by 2^14 with rounding */ + l = lo + 0x2000U + (FT_UInt32)( hi >> 31 ); /* rounding phase */ + hi += ( l < lo ); - return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid; + return (FT_F26Dot6)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) ); } #endif /* !TT_MulFix14 */ -#if defined( __GNUC__ ) && \ - ( defined( __i386__ ) || \ - defined( __x86_64__ ) || \ - defined( __arm__ ) ) - -#define TT_DotFix14 TT_DotFix14_long_long - -#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 -#pragma GCC diagnostic push -#endif -#pragma GCC diagnostic ignored "-Wlong-long" +#ifdef FT_INT64 - static __attribute__(( pure )) FT_Int32 - TT_DotFix14_long_long( FT_Int32 ax, - FT_Int32 ay, - FT_Int bx, - FT_Int by ) + /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */ + static inline FT_F26Dot6 + TT_DotFix14( FT_F26Dot6 ax, + FT_F26Dot6 ay, + FT_F2Dot14 bx, + FT_F2Dot14 by ) { - /* Temporarily disable the warning that C90 doesn't support */ - /* `long long'. */ - - long long temp1 = (long long)ax * bx; - long long temp2 = (long long)ay * by; + FT_Int64 c = ADD_INT64( MUL_INT64( ax, bx ), MUL_INT64( ay, by ) ); - temp1 += temp2; - temp2 = temp1 >> 63; - temp1 += 0x2000 + temp2; - - return (FT_Int32)( temp1 >> 14 ); + c = ADD_INT64( c, 0x2000 + ( c >> 63 ) ); /* rounding phase */ + return (FT_F26Dot6)( c >> 14 ); } -#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 -#pragma GCC diagnostic pop -#endif - -#endif /* __GNUC__ && (__arm__ || __i386__ || __x86_64__) */ - - -#ifndef TT_DotFix14 +#else - /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */ - static FT_Int32 - TT_DotFix14( FT_Int32 ax, - FT_Int32 ay, - FT_Int bx, - FT_Int by ) + static inline FT_F26Dot6 + TT_DotFix14( FT_F26Dot6 ax, + FT_F26Dot6 ay, + FT_F2Dot14 bx, + FT_F2Dot14 by ) { - FT_Int32 m, s, hi1, hi2, hi; + FT_Int32 m, hi1, hi2, hi; FT_UInt32 l, lo1, lo2, lo; - /* compute ax*bx as 64-bit value */ + /* compute ax*bx as 64-bit (hi_lo) value */ l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx ); m = ( ax >> 16 ) * bx; @@ -1366,18 +1234,13 @@ hi = hi1 + hi2 + ( lo < lo1 ); /* divide the result by 2^14 with rounding */ - s = hi >> 31; - l = lo + (FT_UInt32)s; - hi += s + ( l < lo ); - lo = l; - - l = lo + 0x2000U; + l = lo + 0x2000U + (FT_UInt32)( hi >> 31 ); /* rounding phase */ hi += ( l < lo ); - return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) ); + return (FT_F26Dot6)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) ); } -#endif /* TT_DotFix14 */ +#endif /* !FT_INT64 */ /************************************************************************** @@ -1531,31 +1394,6 @@ } - /************************************************************************** - * - * @Function: - * GetShortIns - * - * @Description: - * Returns a short integer taken from the instruction stream at - * address IP. - * - * @Return: - * Short read at code[IP]. - * - * @Note: - * This one could become a macro. - */ - static FT_Short - GetShortIns( TT_ExecContext exc ) - { - /* Reading a byte stream so there is no endianness (DaveP) */ - exc->IP += 2; - return (FT_Short)( ( exc->code[exc->IP - 2] << 8 ) + - exc->code[exc->IP - 1] ); - } - - /************************************************************************** * * @Function: @@ -1609,6 +1447,7 @@ exc->code = range->base; exc->codeSize = range->size; exc->IP = aIP; + exc->length = 0; exc->curRange = aRange; return SUCCESS; @@ -1671,48 +1510,33 @@ FT_UShort point, FT_F26Dot6 distance ) { - FT_F26Dot6 v; - + FT_Fixed v; - v = exc->GS.freeVector.x; + v = exc->moveVector.x; if ( v != 0 ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* Exception to the post-IUP curfew: Allow the x component of */ /* diagonal moves, but only post-IUP. DejaVu tries to adjust */ /* diagonal stems like on `Z' and `z' post-IUP. */ - if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility ) - zone->cur[point].x = ADD_LONG( zone->cur[point].x, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); - else + if ( !exc->backward_compatibility ) #endif - - if ( NO_SUBPIXEL_HINTING ) zone->cur[point].x = ADD_LONG( zone->cur[point].x, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); + FT_MulFix( distance, v ) ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; } - v = exc->GS.freeVector.y; - + v = exc->moveVector.y; if ( v != 0 ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( !( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && - exc->iupy_called ) ) + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( exc->backward_compatibility != 0x7 ) #endif zone->cur[point].y = ADD_LONG( zone->cur[point].y, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); + FT_MulFix( distance, v ) ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; } @@ -1745,24 +1569,20 @@ FT_UShort point, FT_F26Dot6 distance ) { - FT_F26Dot6 v; + FT_Fixed v; - v = exc->GS.freeVector.x; + v = exc->moveVector.x; if ( v != 0 ) zone->org[point].x = ADD_LONG( zone->org[point].x, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); + FT_MulFix( distance, v ) ); - v = exc->GS.freeVector.y; + v = exc->moveVector.y; if ( v != 0 ) zone->org[point].y = ADD_LONG( zone->org[point].y, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); + FT_MulFix( distance, v ) ); } @@ -1784,12 +1604,8 @@ FT_F26Dot6 distance ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility ) - zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance ); - else + if ( !exc->backward_compatibility ) #endif - - if ( NO_SUBPIXEL_HINTING ) zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; @@ -1805,9 +1621,8 @@ FT_UNUSED( exc ); #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( !( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && exc->iupy_called ) ) + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( exc->backward_compatibility != 0x7 ) #endif zone->cur[point].y = ADD_LONG( zone->cur[point].y, distance ); @@ -1860,8 +1675,8 @@ * distance :: * The distance (not) to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * The compensated distance. @@ -1869,10 +1684,10 @@ static FT_F26Dot6 Round_None( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -1903,8 +1718,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -1912,10 +1727,10 @@ static FT_F26Dot6 Round_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -1948,8 +1763,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -1957,10 +1772,10 @@ static FT_F26Dot6 Round_To_Half_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -1995,8 +1810,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -2004,10 +1819,10 @@ static FT_F26Dot6 Round_Down_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -2039,8 +1854,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -2048,10 +1863,10 @@ static FT_F26Dot6 Round_Up_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -2084,8 +1899,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -2093,10 +1908,10 @@ static FT_F26Dot6 Round_To_Double_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; + FT_UNUSED( exc ); if ( distance >= 0 ) @@ -2129,8 +1944,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -2144,9 +1959,8 @@ static FT_F26Dot6 Round_Super( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; @@ -2185,8 +1999,8 @@ * distance :: * The distance to round. * - * color :: - * The engine compensation color. + * compensation :: + * The engine compensation. * * @Return: * Rounded distance. @@ -2198,9 +2012,8 @@ static FT_F26Dot6 Round_Super_45( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ) + FT_F26Dot6 compensation ) { - FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; @@ -2227,59 +2040,6 @@ } - /************************************************************************** - * - * @Function: - * Compute_Round - * - * @Description: - * Sets the rounding mode. - * - * @Input: - * round_mode :: - * The rounding mode to be used. - */ - static void - Compute_Round( TT_ExecContext exc, - FT_Byte round_mode ) - { - switch ( round_mode ) - { - case TT_Round_Off: - exc->func_round = (TT_Round_Func)Round_None; - break; - - case TT_Round_To_Grid: - exc->func_round = (TT_Round_Func)Round_To_Grid; - break; - - case TT_Round_Up_To_Grid: - exc->func_round = (TT_Round_Func)Round_Up_To_Grid; - break; - - case TT_Round_Down_To_Grid: - exc->func_round = (TT_Round_Func)Round_Down_To_Grid; - break; - - case TT_Round_To_Half_Grid: - exc->func_round = (TT_Round_Func)Round_To_Half_Grid; - break; - - case TT_Round_To_Double_Grid: - exc->func_round = (TT_Round_Func)Round_To_Double_Grid; - break; - - case TT_Round_Super: - exc->func_round = (TT_Round_Func)Round_Super; - break; - - case TT_Round_Super_45: - exc->func_round = (TT_Round_Func)Round_Super_45; - break; - } - } - - /************************************************************************** * * @Function: @@ -2481,14 +2241,45 @@ static void Compute_Funcs( TT_ExecContext exc ) { - if ( exc->GS.freeVector.x == 0x4000 ) - exc->F_dot_P = exc->GS.projVector.x; - else if ( exc->GS.freeVector.y == 0x4000 ) - exc->F_dot_P = exc->GS.projVector.y; + FT_Long F_dot_P = + ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x + + (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y + + 0x2000L ) >> 14; + + + if ( F_dot_P >= 0x3FFEL ) + { + /* commonly collinear */ + exc->moveVector.x = exc->GS.freeVector.x * 4; + exc->moveVector.y = exc->GS.freeVector.y * 4; + } + else if ( -0x400L < F_dot_P && F_dot_P < 0x400L ) + { + /* prohibitively orthogonal */ + exc->moveVector.x = 0; + exc->moveVector.y = 0; + } + else + { + exc->moveVector.x = exc->GS.freeVector.x * 0x10000L / F_dot_P; + exc->moveVector.y = exc->GS.freeVector.y * 0x10000L / F_dot_P; + } + + if ( F_dot_P >= 0x3FFEL && exc->GS.freeVector.x == 0x4000 ) + { + exc->func_move = (TT_Move_Func)Direct_Move_X; + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; + } + else if ( F_dot_P >= 0x3FFEL && exc->GS.freeVector.y == 0x4000 ) + { + exc->func_move = (TT_Move_Func)Direct_Move_Y; + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; + } else - exc->F_dot_P = - ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x + - (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y ) >> 14; + { + exc->func_move = (TT_Move_Func)Direct_Move; + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig; + } if ( exc->GS.projVector.x == 0x4000 ) exc->func_project = (TT_Project_Func)Project_x; @@ -2504,29 +2295,6 @@ else exc->func_dualproj = (TT_Project_Func)Dual_Project; - exc->func_move = (TT_Move_Func)Direct_Move; - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig; - - if ( exc->F_dot_P == 0x4000L ) - { - if ( exc->GS.freeVector.x == 0x4000 ) - { - exc->func_move = (TT_Move_Func)Direct_Move_X; - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; - } - else if ( exc->GS.freeVector.y == 0x4000 ) - { - exc->func_move = (TT_Move_Func)Direct_Move_Y; - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; - } - } - - /* at small sizes, F_dot_P can become too small, resulting */ - /* in overflows and `spikes' in a number of glyphs like `w'. */ - - if ( FT_ABS( exc->F_dot_P ) < 0x400L ) - exc->F_dot_P = 0x4000L; - /* Disable cached aspect ratio */ exc->tt_metrics.ratio = 0; } @@ -2799,7 +2567,7 @@ Ins_ODD( TT_ExecContext exc, FT_Long* args ) { - args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 64 ); + args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 64 ) == 64 ); } @@ -2813,7 +2581,7 @@ Ins_EVEN( TT_ExecContext exc, FT_Long* args ) { - args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 0 ); + args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 64 ) == 0 ); } @@ -3020,7 +2788,7 @@ FT_MEM_QRENEW_ARRAY( exc->glyfStorage, exc->glyfStoreSize, exc->storeSize ); - exc->error = error; + exc->error = error; if ( error ) return; @@ -3143,7 +2911,8 @@ Ins_ROUND( TT_ExecContext exc, FT_Long* args ) { - args[0] = exc->func_round( exc, args[0], exc->opcode & 3 ); + args[0] = exc->func_round( exc, args[0], + exc->GS.compensation[exc->opcode & 3] ); } @@ -3157,7 +2926,8 @@ Ins_NROUND( TT_ExecContext exc, FT_Long* args ) { - args[0] = Round_None( exc, args[0], exc->opcode & 3 ); + args[0] = Round_None( exc, args[0], + exc->GS.compensation[exc->opcode & 3] ); } @@ -3211,13 +2981,11 @@ } else { - K = exc->stack[exc->args - L]; + K = args[-L]; - FT_ARRAY_MOVE( &exc->stack[exc->args - L ], - &exc->stack[exc->args - L + 1], - ( L - 1 ) ); + FT_ARRAY_MOVE( args - L, args - L + 1, L - 1 ); - exc->stack[exc->args - 1] = K; + args[-1] = K; } } @@ -3244,7 +3012,7 @@ args[0] = 0; } else - args[0] = exc->stack[exc->args - L]; + args[0] = args[-L]; } @@ -3314,8 +3082,7 @@ exc->length = 2 - exc->length * exc->code[exc->IP + 1]; } - if ( exc->IP + exc->length <= exc->codeSize ) - return SUCCESS; + return SUCCESS; } Fail_Overflow: @@ -3363,6 +3130,9 @@ nIfs--; Out = FT_BOOL( nIfs == 0 ); break; + + default: + break; } } while ( Out == 0 ); } @@ -3396,6 +3166,9 @@ case 0x59: /* EIF */ nIfs--; break; + + default: + break; } } while ( nIfs != 0 ); } @@ -3439,7 +3212,7 @@ return; } - exc->step_ins = FALSE; + exc->length = 0; if ( args[0] < 0 ) { @@ -3540,10 +3313,10 @@ return; } - rec->range = exc->curRange; - rec->opc = (FT_UInt16)n; - rec->start = exc->IP + 1; - rec->active = TRUE; + rec->range = exc->curRange; + rec->opc = (FT_UInt16)n; + rec->start = exc->IP + 1; + rec->active = TRUE; if ( n > exc->maxFunc ) exc->maxFunc = (FT_UInt16)n; @@ -3555,14 +3328,17 @@ { switch ( exc->opcode ) { - case 0x89: /* IDEF */ - case 0x2C: /* FDEF */ + case 0x89: /* IDEF */ + case 0x2C: /* FDEF */ exc->error = FT_THROW( Nested_DEFS ); return; case 0x2D: /* ENDF */ rec->end = exc->IP; return; + + default: + break; } } } @@ -3592,12 +3368,11 @@ pRec->Cur_Count--; - exc->step_ins = FALSE; - if ( pRec->Cur_Count > 0 ) { exc->callTop++; - exc->IP = pRec->Def->start; + exc->IP = pRec->Def->start; + exc->length = 0; } else /* Loop through the current function */ @@ -3685,8 +3460,6 @@ Ins_Goto_CodeRange( exc, def->range, def->start ); - exc->step_ins = FALSE; - return; Fail: @@ -3764,8 +3537,6 @@ Ins_Goto_CodeRange( exc, def->range, def->start ); - exc->step_ins = FALSE; - exc->loopcall_counter += (FT_ULong)args[0]; if ( exc->loopcall_counter > exc->loopcall_counter_max ) exc->error = FT_THROW( Execution_Too_Long ); @@ -3845,9 +3616,13 @@ case 0x2C: /* FDEF */ exc->error = FT_THROW( Nested_DEFS ); return; + case 0x2D: /* ENDF */ def->end = exc->IP; return; + + default: + break; } } } @@ -3870,21 +3645,35 @@ Ins_NPUSHB( TT_ExecContext exc, FT_Long* args ) { - FT_UShort L, K; + FT_Long IP = exc->IP; + FT_Int L, K; - L = (FT_UShort)exc->code[exc->IP + 1]; - - if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) ) + if ( ++IP >= exc->codeSize ) { - exc->error = FT_THROW( Stack_Overflow ); + exc->error = FT_THROW( Code_Overflow ); return; } - for ( K = 1; K <= L; K++ ) - args[K - 1] = exc->code[exc->IP + K + 1]; + L = exc->code[IP]; + + if ( IP + L >= exc->codeSize ) + { + exc->error = FT_THROW( Code_Overflow ); + return; + } + + if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) ) + { + exc->error = FT_THROW( Stack_Overflow ); + return; + } + + for ( K = 0; K < L; K++ ) + args[K] = exc->code[++IP]; exc->new_top += L; + exc->IP = IP; } @@ -3898,10 +3687,23 @@ Ins_NPUSHW( TT_ExecContext exc, FT_Long* args ) { - FT_UShort L, K; + FT_Long IP = exc->IP; + FT_Int L, K; - L = (FT_UShort)exc->code[exc->IP + 1]; + if ( ++IP >= exc->codeSize ) + { + exc->error = FT_THROW( Code_Overflow ); + return; + } + + L = exc->code[IP]; + + if ( IP + 2 * L >= exc->codeSize ) + { + exc->error = FT_THROW( Code_Overflow ); + return; + } if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) ) { @@ -3909,13 +3711,12 @@ return; } - exc->IP += 2; - - for ( K = 0; K < L; K++ ) - args[K] = GetShortIns( exc ); + /* note casting for sign-extension */ + for ( K = 0; K < L; K++, IP += 2 ) + args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2]; - exc->step_ins = FALSE; exc->new_top += L; + exc->IP = IP; } @@ -3929,10 +3730,17 @@ Ins_PUSHB( TT_ExecContext exc, FT_Long* args ) { - FT_UShort L, K; + FT_Long IP = exc->IP; + FT_Int L, K; - L = (FT_UShort)( exc->opcode - 0xB0 + 1 ); + L = exc->opcode - 0xB0 + 1; + + if ( IP + L >= exc->codeSize ) + { + exc->error = FT_THROW( Code_Overflow ); + return; + } if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) ) { @@ -3940,8 +3748,10 @@ return; } - for ( K = 1; K <= L; K++ ) - args[K - 1] = exc->code[exc->IP + K]; + for ( K = 0; K < L; K++ ) + args[K] = exc->code[++IP]; + + exc->IP = IP; } @@ -3955,10 +3765,17 @@ Ins_PUSHW( TT_ExecContext exc, FT_Long* args ) { - FT_UShort L, K; + FT_Long IP = exc->IP; + FT_Int L, K; + + L = exc->opcode - 0xB8 + 1; - L = (FT_UShort)( exc->opcode - 0xB8 + 1 ); + if ( IP + 2 * L >= exc->codeSize ) + { + exc->error = FT_THROW( Code_Overflow ); + return; + } if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) ) { @@ -3966,12 +3783,11 @@ return; } - exc->IP++; - - for ( K = 0; K < L; K++ ) - args[K] = GetShortIns( exc ); + /* note casting for sign-extension */ + for ( K = 0; K < L; K++, IP += 2 ) + args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2]; - exc->step_ins = FALSE; + exc->IP = IP; } @@ -4142,15 +3958,12 @@ Ins_SPVFS( TT_ExecContext exc, FT_Long* args ) { - FT_Short S; FT_Long X, Y; /* Only use low 16bits, then sign extend */ - S = (FT_Short)args[1]; - Y = (FT_Long)S; - S = (FT_Short)args[0]; - X = (FT_Long)S; + Y = (FT_Short)args[1]; + X = (FT_Short)args[0]; Normalize( X, Y, &exc->GS.projVector ); @@ -4169,15 +3982,12 @@ Ins_SFVFS( TT_ExecContext exc, FT_Long* args ) { - FT_Short S; FT_Long X, Y; /* Only use low 16bits, then sign extend */ - S = (FT_Short)args[1]; - Y = (FT_Long)S; - S = (FT_Short)args[0]; - X = S; + Y = (FT_Short)args[1]; + X = (FT_Short)args[0]; Normalize( X, Y, &exc->GS.freeVector ); Compute_Funcs( exc ); @@ -4915,7 +4725,7 @@ /* compatibility hacks and lets them program points to the grid like */ /* it's 1996. They might sign a waiver for just one glyph, though. */ if ( SUBPIXEL_HINTING_MINIMAL ) - exc->backward_compatibility = !FT_BOOL( L == 4 ); + exc->backward_compatibility = ( L & 4 ) ^ 4; #endif } else if ( exc->pedantic_hinting ) @@ -4999,32 +4809,31 @@ * Stack: uint32... --> */ static void - Ins_FLIPPT( TT_ExecContext exc ) + Ins_FLIPPT( TT_ExecContext exc, + FT_Long* args ) { + FT_Long loop = exc->GS.loop; FT_UShort point; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - /* See `ttinterp.h' for details on backward compatibility mode. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && - exc->iupy_called ) - goto Fail; -#endif - - if ( exc->top < exc->GS.loop ) + if ( exc->new_top < loop ) { if ( exc->pedantic_hinting ) exc->error = FT_THROW( Too_Few_Arguments ); goto Fail; } - while ( exc->GS.loop > 0 ) - { - exc->args--; + exc->new_top -= loop; - point = (FT_UShort)exc->stack[exc->args]; +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( exc->backward_compatibility == 0x7 ) + goto Fail; +#endif + + while ( loop-- ) + { + point = (FT_UShort)*(--args); if ( BOUNDS( point, exc->pts.n_points ) ) { @@ -5036,13 +4845,10 @@ } else exc->pts.tags[point] ^= FT_CURVE_TAG_ON; - - exc->GS.loop--; } Fail: exc->GS.loop = 1; - exc->new_top = exc->args; } @@ -5061,10 +4867,7 @@ #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* See `ttinterp.h' for details on backward compatibility mode. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && - exc->iupy_called ) + if ( exc->backward_compatibility == 0x7 ) return; #endif @@ -5099,10 +4902,7 @@ #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* See `ttinterp.h' for details on backward compatibility mode. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && - exc->iupy_called ) + if ( exc->backward_compatibility == 0x7 ) return; #endif @@ -5158,8 +4958,8 @@ d = PROJECT( zp.cur + p, zp.org + p ); - *x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P ); - *y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P ); + *x = FT_MulFix( d, exc->moveVector.x ); + *y = FT_MulFix( d, exc->moveVector.y ); return SUCCESS; } @@ -5176,8 +4976,8 @@ if ( exc->GS.freeVector.x != 0 ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( !( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility ) ) + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( !exc->backward_compatibility ) #endif exc->zp2.cur[point].x = ADD_LONG( exc->zp2.cur[point].x, dx ); @@ -5188,10 +4988,8 @@ if ( exc->GS.freeVector.y != 0 ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( !( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility && - exc->iupx_called && - exc->iupy_called ) ) + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( exc->backward_compatibility != 0x7 ) #endif exc->zp2.cur[point].y = ADD_LONG( exc->zp2.cur[point].y, dy ); @@ -5208,8 +5006,10 @@ * Stack: uint32... --> */ static void - Ins_SHP( TT_ExecContext exc ) + Ins_SHP( TT_ExecContext exc, + FT_Long* args ) { + FT_Long loop = exc->GS.loop; TT_GlyphZoneRec zp; FT_UShort refp; @@ -5217,20 +5017,21 @@ FT_UShort point; - if ( exc->top < exc->GS.loop ) + if ( exc->new_top < loop ) { if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); + exc->error = FT_THROW( Too_Few_Arguments ); goto Fail; } + exc->new_top -= loop; + if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) ) return; - while ( exc->GS.loop > 0 ) + while ( loop-- ) { - exc->args--; - point = (FT_UShort)exc->stack[exc->args]; + point = (FT_UShort)*(--args); if ( BOUNDS( point, exc->zp2.n_points ) ) { @@ -5242,13 +5043,10 @@ } else Move_Zp2_Point( exc, point, dx, dy, TRUE ); - - exc->GS.loop--; } Fail: exc->GS.loop = 1; - exc->new_top = exc->args; } @@ -5364,6 +5162,7 @@ Ins_SHPIX( TT_ExecContext exc, FT_Long* args ) { + FT_Long loop = exc->GS.loop; FT_F26Dot6 dx, dy; FT_UShort point; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL @@ -5373,22 +5172,21 @@ #endif - - if ( exc->top < exc->GS.loop + 1 ) + if ( exc->new_top < loop ) { if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); + exc->error = FT_THROW( Too_Few_Arguments ); goto Fail; } + exc->new_top -= loop; + dx = TT_MulFix14( args[0], exc->GS.freeVector.x ); dy = TT_MulFix14( args[0], exc->GS.freeVector.y ); - while ( exc->GS.loop > 0 ) + while ( loop-- ) { - exc->args--; - - point = (FT_UShort)exc->stack[exc->args]; + point = (FT_UShort)*(--args); if ( BOUNDS( point, exc->zp2.n_points ) ) { @@ -5400,8 +5198,7 @@ } else #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility ) + if ( exc->backward_compatibility ) { /* Special case: allow SHPIX to move points in the twilight zone. */ /* Otherwise, treat SHPIX the same as DELTAP. Unbreaks various */ @@ -5409,7 +5206,7 @@ /* that would glitch severely after calling ALIGNRP after a */ /* blocked SHPIX. */ if ( in_twilight || - ( !( exc->iupx_called && exc->iupy_called ) && + ( exc->backward_compatibility != 0x7 && ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ) ) ) Move_Zp2_Point( exc, point, 0, dy, TRUE ); @@ -5417,13 +5214,10 @@ else #endif Move_Zp2_Point( exc, point, dx, dy, TRUE ); - - exc->GS.loop--; } Fail: exc->GS.loop = 1; - exc->new_top = exc->args; } @@ -5502,7 +5296,7 @@ if ( ( exc->opcode & 1 ) != 0 ) { cur_dist = FAST_PROJECT( &exc->zp0.cur[point] ); - distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist ); + distance = SUB_LONG( exc->func_round( exc, cur_dist, 0 ), cur_dist ); } else distance = 0; @@ -5566,7 +5360,7 @@ if ( exc->GS.gep0 == 0 ) /* If in twilight zone */ { exc->zp0.org[point].x = TT_MulFix14( distance, - exc->GS.freeVector.x ); + exc->GS.freeVector.x ); exc->zp0.org[point].y = TT_MulFix14( distance, exc->GS.freeVector.y ); exc->zp0.cur[point] = exc->zp0.org[point]; @@ -5587,7 +5381,7 @@ if ( delta > control_value_cutin ) distance = org_dist; - distance = exc->func_round( exc, distance, 3 ); + distance = exc->func_round( exc, distance, 0 ); } exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) ); @@ -5609,7 +5403,7 @@ FT_Long* args ) { FT_UShort point = 0; - FT_F26Dot6 org_dist, distance; + FT_F26Dot6 org_dist, distance, compensation; point = (FT_UShort)args[0]; @@ -5678,12 +5472,12 @@ /* round flag */ + compensation = exc->GS.compensation[exc->opcode & 3]; + if ( ( exc->opcode & 4 ) != 0 ) - { - distance = exc->func_round( exc, org_dist, exc->opcode & 3 ); - } + distance = exc->func_round( exc, org_dist, compensation ); else - distance = Round_None( exc, org_dist, exc->opcode & 3 ); + distance = Round_None( exc, org_dist, compensation ); /* minimum distance flag */ @@ -5735,7 +5529,8 @@ FT_F26Dot6 cvt_dist, distance, cur_dist, - org_dist; + org_dist, + compensation; FT_F26Dot6 delta; @@ -5801,6 +5596,8 @@ /* control value cut-in and round */ + compensation = exc->GS.compensation[exc->opcode & 3]; + if ( ( exc->opcode & 4 ) != 0 ) { /* XXX: UNDOCUMENTED! Only perform cut-in test when both points */ @@ -5831,16 +5628,16 @@ cvt_dist = org_dist; } - distance = exc->func_round( exc, cvt_dist, exc->opcode & 3 ); + distance = exc->func_round( exc, cvt_dist, compensation ); } else - distance = Round_None( exc, cvt_dist, exc->opcode & 3 ); + distance = Round_None( exc, cvt_dist, compensation ); /* minimum distance test */ if ( ( exc->opcode & 8 ) != 0 ) { - FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; + FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; if ( org_dist >= 0 ) @@ -5862,11 +5659,10 @@ Fail: exc->GS.rp1 = exc->GS.rp0; + exc->GS.rp2 = point; if ( ( exc->opcode & 16 ) != 0 ) exc->GS.rp0 = point; - - exc->GS.rp2 = point; } @@ -5877,25 +5673,33 @@ * Stack: uint32 uint32... --> */ static void - Ins_ALIGNRP( TT_ExecContext exc ) + Ins_ALIGNRP( TT_ExecContext exc, + FT_Long* args ) { + FT_Long loop = exc->GS.loop; FT_UShort point; FT_F26Dot6 distance; - if ( exc->top < exc->GS.loop || - BOUNDS( exc->GS.rp0, exc->zp0.n_points ) ) + if ( exc->new_top < loop ) { if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); + exc->error = FT_THROW( Too_Few_Arguments ); goto Fail; } - while ( exc->GS.loop > 0 ) + exc->new_top -= loop; + + if ( BOUNDS( exc->GS.rp0, exc->zp0.n_points ) ) { - exc->args--; + if ( exc->pedantic_hinting ) + exc->error = FT_THROW( Invalid_Reference ); + goto Fail; + } - point = (FT_UShort)exc->stack[exc->args]; + while ( loop-- ) + { + point = (FT_UShort)*(--args); if ( BOUNDS( point, exc->zp1.n_points ) ) { @@ -5912,13 +5716,10 @@ exc->func_move( exc, &exc->zp1, point, NEG_LONG( distance ) ); } - - exc->GS.loop--; } Fail: exc->GS.loop = 1; - exc->new_top = exc->args; } @@ -6060,15 +5861,26 @@ /* SOMETIMES, DUMBER CODE IS BETTER CODE */ static void - Ins_IP( TT_ExecContext exc ) + Ins_IP( TT_ExecContext exc, + FT_Long* args ) { + FT_Long loop = exc->GS.loop; FT_F26Dot6 old_range, cur_range; FT_Vector* orus_base; FT_Vector* cur_base; FT_Int twilight; - if ( exc->top < exc->GS.loop ) + if ( exc->new_top < loop ) + { + if ( exc->pedantic_hinting ) + exc->error = FT_THROW( Too_Few_Arguments ); + goto Fail; + } + + exc->new_top -= loop; + + if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) ) { if ( exc->pedantic_hinting ) exc->error = FT_THROW( Invalid_Reference ); @@ -6084,13 +5896,6 @@ exc->GS.gep1 == 0 || exc->GS.gep2 == 0 ); - if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) ) - { - if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); - goto Fail; - } - if ( twilight ) orus_base = &exc->zp0.org[exc->GS.rp1]; else @@ -6102,8 +5907,7 @@ /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ /* calling IP[] with bad values of rp[12]. */ /* Do something sane when this odd thing happens. */ - if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) || - BOUNDS( exc->GS.rp2, exc->zp1.n_points ) ) + if ( BOUNDS( exc->GS.rp2, exc->zp1.n_points ) ) { old_range = 0; cur_range = 0; @@ -6132,9 +5936,9 @@ cur_range = PROJECT( &exc->zp1.cur[exc->GS.rp2], cur_base ); } - for ( ; exc->GS.loop > 0; exc->GS.loop-- ) + while ( loop-- ) { - FT_UInt point = (FT_UInt)exc->stack[--exc->args]; + FT_UInt point = (FT_UInt)*(--args); FT_F26Dot6 org_dist, cur_dist, new_dist; @@ -6206,7 +6010,6 @@ Fail: exc->GS.loop = 1; - exc->new_top = exc->args; } @@ -6405,17 +6208,10 @@ /* See `ttinterp.h' for details on backward compatibility mode. */ /* Allow IUP until it has been called on both axes. Immediately */ /* return on subsequent ones. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility ) - { - if ( exc->iupx_called && exc->iupy_called ) - return; - - if ( exc->opcode & 1 ) - exc->iupx_called = TRUE; - else - exc->iupy_called = TRUE; - } + if ( exc->backward_compatibility == 0x7 ) + return; + else if ( exc->backward_compatibility ) + exc->backward_compatibility |= 1 << ( exc->opcode & 1 ); #endif /* ignore empty outlines */ @@ -6507,30 +6303,50 @@ Ins_DELTAP( TT_ExecContext exc, FT_Long* args ) { - FT_ULong nump, k; + FT_Long nump; FT_UShort A; - FT_ULong C, P; - FT_Long B; + FT_Long B, P, F; - P = (FT_ULong)exc->func_cur_ppem( exc ); - nump = (FT_ULong)args[0]; /* some points theoretically may occur more - than once, thus UShort isn't enough */ + nump = args[0]; /* signed value for convenience */ - for ( k = 1; k <= nump; k++ ) + if ( nump < 0 || nump > exc->new_top / 2 ) { - if ( exc->args < 2 ) - { - if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Too_Few_Arguments ); - exc->args = 0; - goto Fail; - } + if ( exc->pedantic_hinting ) + exc->error = FT_THROW( Too_Few_Arguments ); + + nump = exc->new_top / 2; + } + + exc->new_top -= 2 * nump; + + P = exc->func_cur_ppem( exc ) - exc->GS.delta_base; + + switch ( exc->opcode ) + { + case 0x5D: + break; - exc->args -= 2; + case 0x71: + P -= 16; + break; + + case 0x72: + P -= 32; + break; + } + + /* check applicable range of adjusted ppem */ + if ( P & ~0xF ) /* P < 0 || P > 15 */ + return; - A = (FT_UShort)exc->stack[exc->args + 1]; - B = exc->stack[exc->args]; + P <<= 4; + F = 1L << ( 6 - exc->GS.delta_shift ); + + while ( nump-- ) + { + A = (FT_UShort)*(--args); + B = *(--args); /* XXX: Because some popular fonts contain some invalid DeltaP */ /* instructions, we simply ignore them when the stacked */ @@ -6538,41 +6354,28 @@ /* error. As a delta instruction doesn't change a glyph */ /* in great ways, this shouldn't be a problem. */ - if ( !BOUNDS( A, exc->zp0.n_points ) ) + if ( BOUNDS( A, exc->zp0.n_points ) ) { - C = ( (FT_ULong)B & 0xF0 ) >> 4; - - switch ( exc->opcode ) + if ( exc->pedantic_hinting ) { - case 0x5D: - break; - - case 0x71: - C += 16; - break; - - case 0x72: - C += 32; - break; + exc->error = FT_THROW( Invalid_Reference ); + return; } - - C += exc->GS.delta_base; - - if ( P == C ) + } + else + { + if ( ( B & 0xF0 ) == P ) { - B = ( (FT_ULong)B & 0xF ) - 8; + B = ( B & 0xF ) - 8; if ( B >= 0 ) B++; - B *= 1L << ( 6 - exc->GS.delta_shift ); - + B *= F; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - /* See `ttinterp.h' for details on backward compatibility */ - /* mode. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility ) + /* See `ttinterp.h' for details on backward compatibility mode. */ + if ( exc->backward_compatibility ) { - if ( !( exc->iupx_called && exc->iupy_called ) && + if ( exc->backward_compatibility != 0x7 && ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) ) exc->func_move( exc, &exc->zp0, A, B ); @@ -6582,13 +6385,7 @@ exc->func_move( exc, &exc->zp0, A, B ); } } - else - if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); } - - Fail: - exc->new_top = exc->args; } @@ -6602,28 +6399,50 @@ Ins_DELTAC( TT_ExecContext exc, FT_Long* args ) { - FT_ULong nump, k; - FT_ULong A, C, P; - FT_Long B; + FT_Long nump; + FT_ULong A; + FT_Long B, P, F; - P = (FT_ULong)exc->func_cur_ppem( exc ); - nump = (FT_ULong)args[0]; + nump = args[0]; /* signed value for convenience */ - for ( k = 1; k <= nump; k++ ) + if ( nump < 0 || nump > exc->new_top / 2 ) { - if ( exc->args < 2 ) - { - if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Too_Few_Arguments ); - exc->args = 0; - goto Fail; - } + if ( exc->pedantic_hinting ) + exc->error = FT_THROW( Too_Few_Arguments ); - exc->args -= 2; + nump = exc->new_top / 2; + } + + exc->new_top -= 2 * nump; - A = (FT_ULong)exc->stack[exc->args + 1]; - B = exc->stack[exc->args]; + P = exc->func_cur_ppem( exc ) - exc->GS.delta_base; + + switch ( exc->opcode ) + { + case 0x73: + break; + + case 0x74: + P -= 16; + break; + + case 0x75: + P -= 32; + break; + } + + /* check applicable range of adjusted ppem */ + if ( P & ~0xF ) /* P < 0 || P > 15 */ + return; + + P <<= 4; + F = 1L << ( 6 - exc->GS.delta_shift ); + + while ( nump-- ) + { + A = (FT_ULong)*(--args); + B = *(--args); if ( BOUNDSL( A, exc->cvtSize ) ) { @@ -6635,38 +6454,17 @@ } else { - C = ( (FT_ULong)B & 0xF0 ) >> 4; - - switch ( exc->opcode ) - { - case 0x73: - break; - - case 0x74: - C += 16; - break; - - case 0x75: - C += 32; - break; - } - - C += exc->GS.delta_base; - - if ( P == C ) + if ( ( B & 0xF0 ) == P ) { - B = ( (FT_ULong)B & 0xF ) - 8; + B = ( B & 0xF ) - 8; if ( B >= 0 ) B++; - B *= 1L << ( 6 - exc->GS.delta_shift ); + B *= F; exc->func_move_cvt( exc, A, B ); } } } - - Fail: - exc->new_top = exc->args; } @@ -6736,7 +6534,7 @@ /* Otherwise, instructions may behave weirdly and rendering results */ /* may differ between v35 and v40 mode, e.g., in `Times New Roman */ /* Bold Italic'. */ - if ( SUBPIXEL_HINTING_MINIMAL && exc->subpixel_hinting_lean ) + if ( SUBPIXEL_HINTING_MINIMAL && exc->mode != FT_RENDER_MODE_MONO ) { /********************************* * HINTING FOR SUBPIXEL @@ -6753,7 +6551,7 @@ * Selector Bit: 8 * Return Bit(s): 15 */ - if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd_lean ) + if ( ( args[0] & 256 ) != 0 && exc->mode == FT_RENDER_MODE_LCD_V ) K |= 1 << 15; /********************************* @@ -6774,7 +6572,7 @@ * The only smoothing method FreeType supports unless someone sets * FT_LOAD_TARGET_MONO. */ - if ( ( args[0] & 2048 ) != 0 && exc->subpixel_hinting_lean ) + if ( ( args[0] & 2048 ) != 0 && exc->mode != FT_RENDER_MODE_MONO ) K |= 1 << 18; /********************************* @@ -6786,7 +6584,10 @@ * Grayscale rendering is what FreeType does anyway unless someone * sets FT_LOAD_TARGET_MONO or FT_LOAD_TARGET_LCD(_V) */ - if ( ( args[0] & 4096 ) != 0 && exc->grayscale_cleartype ) + if ( ( args[0] & 4096 ) != 0 && + exc->mode != FT_RENDER_MODE_MONO && + exc->mode != FT_RENDER_MODE_LCD && + exc->mode != FT_RENDER_MODE_LCD_V ) K |= 1 << 19; } #endif @@ -6833,6 +6634,8 @@ for ( i = 0; i < num_axes; i++ ) args[i] = 0; } + + exc->new_top += num_axes; } @@ -6883,7 +6686,6 @@ Ins_Goto_CodeRange( exc, def->range, def->start ); - exc->step_ins = FALSE; return; } } @@ -6928,96 +6730,22 @@ TT_RunIns( void* exec ) { TT_ExecContext exc = (TT_ExecContext)exec; + FT_ULong ins_counter = 0; - FT_ULong ins_counter = 0; /* executed instructions counter */ - FT_ULong num_twilight_points; - FT_UShort i; - - - /* We restrict the number of twilight points to a reasonable, */ - /* heuristic value to avoid slow execution of malformed bytecode. */ - num_twilight_points = FT_MAX( 30, - 2 * ( exc->pts.n_points + exc->cvtSize ) ); - if ( exc->twilight.n_points > num_twilight_points ) - { - if ( num_twilight_points > 0xFFFFU ) - num_twilight_points = 0xFFFFU; - - FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n" )); - FT_TRACE5(( " from %d to the more reasonable value %ld\n", - exc->twilight.n_points, - num_twilight_points )); - exc->twilight.n_points = (FT_UShort)num_twilight_points; - } - - /* Set up loop detectors. We restrict the number of LOOPCALL loops */ - /* and the number of JMPR, JROT, and JROF calls with a negative */ - /* argument to values that depend on various parameters like the */ - /* size of the CVT table or the number of points in the current */ - /* glyph (if applicable). */ - /* */ - /* The idea is that in real-world bytecode you either iterate over */ - /* all CVT entries (in the `prep' table), or over all points (or */ - /* contours, in the `glyf' table) of a glyph, and such iterations */ - /* don't happen very often. */ - exc->loopcall_counter = 0; - exc->neg_jump_counter = 0; - - /* The maximum values are heuristic. */ - if ( exc->pts.n_points ) - exc->loopcall_counter_max = FT_MAX( 50, - 10 * exc->pts.n_points ) + - FT_MAX( 50, - exc->cvtSize / 10 ); - else - exc->loopcall_counter_max = 300 + 22 * exc->cvtSize; - - /* as a protection against an unreasonable number of CVT entries */ - /* we assume at most 100 control values per glyph for the counter */ - if ( exc->loopcall_counter_max > - 100 * (FT_ULong)exc->face->root.num_glyphs ) - exc->loopcall_counter_max = 100 * (FT_ULong)exc->face->root.num_glyphs; - - FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL" - " to %ld\n", exc->loopcall_counter_max )); - - exc->neg_jump_counter_max = exc->loopcall_counter_max; - FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps" - " to %ld\n", exc->neg_jump_counter_max )); - - /* set PPEM and CVT functions */ - exc->tt_metrics.ratio = 0; - if ( exc->metrics.x_ppem != exc->metrics.y_ppem ) - { - /* non-square pixels, use the stretched routines */ - exc->func_cur_ppem = Current_Ppem_Stretched; - exc->func_read_cvt = Read_CVT_Stretched; - exc->func_write_cvt = Write_CVT_Stretched; - exc->func_move_cvt = Move_CVT_Stretched; - } - else - { - /* square pixels, use normal routines */ - exc->func_cur_ppem = Current_Ppem; - exc->func_read_cvt = Read_CVT; - exc->func_write_cvt = Write_CVT; - exc->func_move_cvt = Move_CVT; - } - - exc->iniRange = exc->curRange; - - Compute_Funcs( exc ); - Compute_Round( exc, (FT_Byte)exc->GS.round_state ); - - /* These flags cancel execution of some opcodes after IUP is called */ -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - exc->iupx_called = FALSE; - exc->iupy_called = FALSE; -#endif do { + /* increment instruction counter and check if we didn't */ + /* run this program for too long (e.g. infinite loops). */ + if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES ) + { + exc->error = FT_THROW( Execution_Too_Long ); + goto LErrorLabel_; + } + + exc->error = FT_Err_Ok; exc->opcode = exc->code[exc->IP]; + exc->length = 1; #ifdef FT_DEBUG_LEVEL_TRACE if ( ft_trace_levels[trace_ttinterp] >= 6 ) @@ -7041,17 +6769,6 @@ } #endif /* FT_DEBUG_LEVEL_TRACE */ - if ( ( exc->length = opcode_length[exc->opcode] ) < 0 ) - { - if ( exc->IP + 1 >= exc->codeSize ) - goto LErrorCodeOverflow_; - - exc->length = 2 - exc->length * exc->code[exc->IP + 1]; - } - - if ( exc->IP + exc->length > exc->codeSize ) - goto LErrorCodeOverflow_; - /* First, let's check for empty stack and overflow */ exc->args = exc->top - ( Pop_Push_Count[exc->opcode] >> 4 ); @@ -7059,6 +6776,9 @@ /* One can also interpret it as the index of the last argument. */ if ( exc->args < 0 ) { + FT_UShort i; + + if ( exc->pedantic_hinting ) { exc->error = FT_THROW( Too_Few_Arguments ); @@ -7071,21 +6791,7 @@ exc->args = 0; } -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( exc->opcode == 0x91 ) - { - /* this is very special: GETVARIATION returns */ - /* a variable number of arguments */ - - /* it is the job of the application to `activate' GX handling, */ - /* that is, calling any of the GX API functions on the current */ - /* font to select a variation instance */ - if ( exc->face->blend ) - exc->new_top = exc->args + exc->face->blend->num_axis; - } - else -#endif - exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 ); + exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 ); /* `new_top' is the new top of the stack, after the instruction's */ /* execution. `top' will be set to `new_top' after the `switch' */ @@ -7096,9 +6802,6 @@ goto LErrorLabel_; } - exc->step_ins = TRUE; - exc->error = FT_Err_Ok; - { FT_Long* args = exc->stack + exc->args; FT_Byte opcode = exc->opcode; @@ -7281,7 +6984,7 @@ case 0x32: /* SHP */ case 0x33: /* SHP */ - Ins_SHP( exc ); + Ins_SHP( exc, args ); break; case 0x34: /* SHC */ @@ -7299,7 +7002,7 @@ break; case 0x39: /* IP */ - Ins_IP( exc ); + Ins_IP( exc, args ); break; case 0x3A: /* MSIRP */ @@ -7308,7 +7011,7 @@ break; case 0x3C: /* AlignRP */ - Ins_ALIGNRP( exc ); + Ins_ALIGNRP( exc, args ); break; case 0x3D: /* RTDG */ @@ -7544,7 +7247,7 @@ break; case 0x80: /* FLIPPT */ - Ins_FLIPPT( exc ); + Ins_FLIPPT( exc, args ); break; case 0x81: /* FLIPRGON */ @@ -7642,13 +7345,13 @@ { switch ( exc->error ) { - /* looking for redefined instructions */ case FT_ERR( Invalid_Opcode ): { TT_DefRecord* def = exc->IDefs; TT_DefRecord* limit = FT_OFFSET( def, exc->numIDefs ); + /* looking for redefined instructions */ for ( ; def < limit; def++ ) { if ( def->active && exc->opcode == (FT_Byte)def->opc ) @@ -7678,37 +7381,15 @@ } } } - - exc->error = FT_THROW( Invalid_Opcode ); - goto LErrorLabel_; - -#if 0 - break; /* Unreachable code warning suppression. */ - /* Leave to remind in case a later change the editor */ - /* to consider break; */ -#endif + FALL_THROUGH; default: goto LErrorLabel_; - -#if 0 - break; -#endif } } exc->top = exc->new_top; - - if ( exc->step_ins ) - exc->IP += exc->length; - - /* increment instruction counter and check if we didn't */ - /* run this program for too long (e.g. infinite loops). */ - if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES ) - { - exc->error = FT_THROW( Execution_Too_Long ); - goto LErrorLabel_; - } + exc->IP += exc->length; LSuiteLabel_: if ( exc->IP >= exc->codeSize ) @@ -7724,15 +7405,12 @@ } while ( !exc->instruction_trap ); LNo_Error_: - FT_TRACE4(( " %ld instruction%s executed\n", + FT_TRACE4(( " %lu instruction%s executed\n", ins_counter, ins_counter == 1 ? "" : "s" )); return FT_Err_Ok; - LErrorCodeOverflow_: - exc->error = FT_THROW( Code_Overflow ); - LErrorLabel_: if ( exc->error && !exc->instruction_trap ) FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error )); @@ -7740,6 +7418,120 @@ return exc->error; } + + /************************************************************************** + * + * @Function: + * TT_Run_Context + * + * @Description: + * Executes one or more instructions in the execution context. + * + * @Input: + * exec :: + * A handle to the target execution context. + * + * @Return: + * TrueType error code. 0 means success. + */ + FT_LOCAL_DEF( FT_Error ) + TT_Run_Context( TT_ExecContext exec, + TT_Size size ) + { + FT_ULong num_twilight_points; + + + exec->zp0 = exec->pts; + exec->zp1 = exec->pts; + exec->zp2 = exec->pts; + + /* We restrict the number of twilight points to a reasonable, */ + /* heuristic value to avoid slow execution of malformed bytecode. */ + /* The selected value is large enough to support fonts hinted */ + /* with `ttfautohint`, which uses twilight points to store */ + /* vertical coordinates of (auto-hinter) segments. */ + num_twilight_points = FT_MAX( 30, + 2 * ( exec->pts.n_points + exec->cvtSize ) ); + if ( exec->twilight.n_points > num_twilight_points ) + { + if ( num_twilight_points > 0xFFFFU ) + num_twilight_points = 0xFFFFU; + + FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n" )); + FT_TRACE5(( " from %d to the more reasonable value %lu\n", + exec->twilight.n_points, + num_twilight_points )); + exec->twilight.n_points = (FT_UShort)num_twilight_points; + } + + /* Set up loop detectors. We restrict the number of LOOPCALL loops */ + /* and the number of JMPR, JROT, and JROF calls with a negative */ + /* argument to values that depend on various parameters like the */ + /* size of the CVT table or the number of points in the current */ + /* glyph (if applicable). */ + /* */ + /* The idea is that in real-world bytecode you either iterate over */ + /* all CVT entries (in the `prep' table), or over all points (or */ + /* contours, in the `glyf' table) of a glyph, and such iterations */ + /* don't happen very often. */ + exec->loopcall_counter = 0; + exec->neg_jump_counter = 0; + + /* The maximum values are heuristic. */ + if ( exec->pts.n_points ) + exec->loopcall_counter_max = FT_MAX( 50, + 10 * exec->pts.n_points ) + + FT_MAX( 50, + exec->cvtSize / 10 ); + else + exec->loopcall_counter_max = 300 + 22 * exec->cvtSize; + + /* as a protection against an unreasonable number of CVT entries */ + /* we assume at most 100 control values per glyph for the counter */ + if ( exec->loopcall_counter_max > + 100 * (FT_ULong)exec->face->root.num_glyphs ) + exec->loopcall_counter_max = 100 * (FT_ULong)exec->face->root.num_glyphs; + + FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL" + " to %lu\n", exec->loopcall_counter_max )); + + exec->neg_jump_counter_max = exec->loopcall_counter_max; + FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps" + " to %lu\n", exec->neg_jump_counter_max )); + + /* set PPEM and CVT functions */ + if ( exec->metrics.x_ppem != exec->metrics.y_ppem ) + { + /* non-square pixels, use the stretched routines */ + exec->func_cur_ppem = Current_Ppem_Stretched; + exec->func_read_cvt = Read_CVT_Stretched; + exec->func_write_cvt = Write_CVT_Stretched; + exec->func_move_cvt = Move_CVT_Stretched; + } + else + { + /* square pixels, use normal routines */ + exec->func_cur_ppem = Current_Ppem; + exec->func_read_cvt = Read_CVT; + exec->func_write_cvt = Write_CVT; + exec->func_move_cvt = Move_CVT; + } + + /* reset graphics state */ + exec->GS = size->GS; + exec->func_round = (TT_Round_Func)Round_To_Grid; + Compute_Funcs( exec ); + + /* some glyphs leave something on the stack, */ + /* so we clean it before a new execution. */ + exec->top = 0; + exec->callTop = 0; + + exec->instruction_trap = FALSE; + + return exec->interpreter( exec ); + } + #else /* !TT_USE_BYTECODE_INTERPRETER */ /* ANSI C doesn't like empty source files */ diff --git a/vendor/freetype/src/truetype/ttinterp.h b/vendor/freetype/src/truetype/ttinterp.h index 4f1a9bbc679..c485371e5f6 100644 --- a/vendor/freetype/src/truetype/ttinterp.h +++ b/vendor/freetype/src/truetype/ttinterp.h @@ -39,6 +39,60 @@ FT_BEGIN_HEADER #define TT_Round_Super_45 7 + /************************************************************************** + * + * EXECUTION SUBTABLES + * + * These sub-tables relate to instruction execution. + * + */ + + +#define TT_MAX_CODE_RANGES 3 + + + /************************************************************************** + * + * There can only be 3 active code ranges at once: + * - the Font Program + * - the CVT Program + * - a glyph's instructions set + */ + typedef enum TT_CodeRange_Tag_ + { + tt_coderange_none = 0, + tt_coderange_font, + tt_coderange_cvt, + tt_coderange_glyph + + } TT_CodeRange_Tag; + + + typedef struct TT_CodeRange_ + { + FT_Byte* base; + FT_Long size; + + } TT_CodeRange; + + typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES]; + + + /************************************************************************** + * + * Defines a function/instruction definition record. + */ + typedef struct TT_DefRecord_ + { + FT_Int range; /* in which code range is it located? */ + FT_Long start; /* where does it start? */ + FT_Long end; /* where does it end? */ + FT_UInt opc; /* function #, or instruction code */ + FT_Bool active; /* is it active? */ + + } TT_DefRecord, *TT_DefArray; + + /************************************************************************** * * Function types used by the interpreter, depending on various modes @@ -51,7 +105,7 @@ FT_BEGIN_HEADER typedef FT_F26Dot6 (*TT_Round_Func)( TT_ExecContext exc, FT_F26Dot6 distance, - FT_Int color ); + FT_F26Dot6 compensation ); /* Point displacement along the freedom vector routine */ typedef void @@ -111,12 +165,13 @@ FT_BEGIN_HEADER TT_Face face; /* ! */ TT_Size size; /* ! */ FT_Memory memory; + TT_Interpreter interpreter; /* instructions state */ FT_Error error; /* last execution error */ - FT_Long top; /* @ top of exec. stack */ + FT_Long top; /* @! top of exec. stack */ FT_Long stackSize; /* ! size of exec. stack */ FT_Long* stack; /* ! current exec. stack */ @@ -142,11 +197,9 @@ FT_BEGIN_HEADER FT_Long IP; /* current instruction pointer */ FT_Long codeSize; /* size of current range */ - FT_Byte opcode; /* current opcode */ - FT_Int length; /* length of current opcode */ + FT_Byte opcode; /* current opcode */ + FT_Int length; /* opcode length or increment */ - FT_Bool step_ins; /* true if the interpreter must */ - /* increment IP after ins. exec */ FT_ULong cvtSize; /* ! */ FT_Long* cvt; /* ! */ FT_ULong glyfCvtSize; @@ -166,9 +219,9 @@ FT_BEGIN_HEADER FT_UInt maxFunc; /* ! maximum function index */ FT_UInt maxIns; /* ! maximum instruction index */ - FT_Int callTop, /* @ top of call stack during execution */ - callSize; /* size of call stack */ - TT_CallStack callStack; /* call stack */ + FT_Int callTop, /* @! top of call stack during execution */ + callSize; /* size of call stack */ + TT_CallStack callStack; /* call stack */ FT_UShort maxPoints; /* capacity of this context's `pts' */ FT_Short maxContours; /* record, expressed in points and */ @@ -189,16 +242,14 @@ FT_BEGIN_HEADER FT_Bool instruction_trap; /* ! If `True', the interpreter */ /* exits after each instruction */ - TT_GraphicsState default_GS; /* graphics state resulting from */ - /* the prep program */ FT_Bool is_composite; /* true if the glyph is composite */ FT_Bool pedantic_hinting; /* true if pedantic interpretation */ /* latest interpreter additions */ - FT_Long F_dot_P; /* dot product of freedom and projection */ - /* vectors */ - TT_Round_Func func_round; /* current rounding function */ + TT_Round_Func func_round; /* current rounding function */ + + FT_Vector moveVector; /* "projected" freedom vector */ TT_Project_Func func_project, /* current projection function */ func_dualproj, /* current dual proj. function */ @@ -327,34 +378,13 @@ FT_BEGIN_HEADER * */ - /* Using v40 implies subpixel hinting, unless FT_RENDER_MODE_MONO has been - * requested. Used to detect interpreter */ - /* version switches. `_lean' to differentiate from the Infinality */ - /* `subpixel_hinting', which is managed differently. */ - FT_Bool subpixel_hinting_lean; - - /* Long side of a LCD subpixel is vertical (e.g., screen is rotated). */ - /* `_lean' to differentiate from the Infinality `vertical_lcd', which */ - /* is managed differently. */ - FT_Bool vertical_lcd_lean; - - /* Default to backward compatibility mode in v40 interpreter. If */ - /* this is false, it implies the interpreter is in v35 or in native */ - /* ClearType mode. */ - FT_Bool backward_compatibility; - - /* Useful for detecting and denying post-IUP trickery that is usually */ - /* used to fix pixel patterns (`superhinting'). */ - FT_Bool iupx_called; - FT_Bool iupy_called; - - /* ClearType hinting and grayscale rendering, as used by Universal */ - /* Windows Platform apps (Windows 8 and above). Like the standard */ - /* colorful ClearType mode, it utilizes a vastly increased virtual */ - /* resolution on the x axis. Different from bi-level hinting and */ - /* grayscale rendering, the old mode from Win9x days that roughly */ - /* adheres to the physical pixel grid on both axes. */ - FT_Bool grayscale_cleartype; + /* Activate backward compatibility (bit 2) and track IUP (bits 0-1). */ + /* If this is zero, it means that the interpreter is either in v35 */ + /* or in native ClearType mode. */ + FT_Int backward_compatibility; + + FT_Render_Mode mode; /* target render mode */ + #endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */ /* We maintain two counters (in addition to the instruction counter) */ @@ -372,15 +402,10 @@ FT_BEGIN_HEADER #ifdef TT_USE_BYTECODE_INTERPRETER - FT_LOCAL( void ) - TT_Goto_CodeRange( TT_ExecContext exec, - FT_Int range, - FT_Long IP ); - FT_LOCAL( void ) TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, - void* base, + FT_Byte* base, FT_Long length ); FT_LOCAL( void ) @@ -424,10 +449,11 @@ FT_BEGIN_HEADER FT_LOCAL( void ) TT_Save_Context( TT_ExecContext exec, - TT_Size ins ); + TT_Size size ); FT_LOCAL( FT_Error ) - TT_Run_Context( TT_ExecContext exec ); + TT_Run_Context( TT_ExecContext exec, + TT_Size size ); #endif /* TT_USE_BYTECODE_INTERPRETER */ diff --git a/vendor/freetype/src/truetype/ttobjs.c b/vendor/freetype/src/truetype/ttobjs.c index 8033edb50a2..ac54e01a573 100644 --- a/vendor/freetype/src/truetype/ttobjs.c +++ b/vendor/freetype/src/truetype/ttobjs.c @@ -67,23 +67,13 @@ * A pointer to the target glyph zone. */ FT_LOCAL_DEF( void ) - tt_glyphzone_done( TT_GlyphZone zone ) + tt_glyphzone_done( FT_Memory memory, + TT_GlyphZone zone ) { - FT_Memory memory = zone->memory; + FT_FREE( zone->org ); - - if ( memory ) - { - FT_FREE( zone->contours ); - FT_FREE( zone->tags ); - FT_FREE( zone->cur ); - FT_FREE( zone->org ); - FT_FREE( zone->orus ); - - zone->max_points = zone->n_points = 0; - zone->max_contours = zone->n_contours = 0; - zone->memory = NULL; - } + zone->n_points = 0; + zone->n_contours = 0; } @@ -119,23 +109,22 @@ TT_GlyphZone zone ) { FT_Error error; + FT_Long size = 3 * maxPoints * sizeof ( FT_Vector ) + + maxContours * sizeof ( FT_UShort ) + + maxPoints * sizeof ( FT_Byte ); - FT_ZERO( zone ); - zone->memory = memory; - - if ( FT_NEW_ARRAY( zone->org, maxPoints ) || - FT_NEW_ARRAY( zone->cur, maxPoints ) || - FT_NEW_ARRAY( zone->orus, maxPoints ) || - FT_NEW_ARRAY( zone->tags, maxPoints ) || - FT_NEW_ARRAY( zone->contours, maxContours ) ) + if ( !FT_ALLOC( zone->org, size ) ) { - tt_glyphzone_done( zone ); - } - else - { - zone->max_points = maxPoints; - zone->max_contours = maxContours; + zone->n_points = maxPoints; + zone->n_contours = maxContours; + + zone->cur = zone->org + maxPoints; + zone->orus = zone->cur + maxPoints; + zone->contours = (FT_UShort*)( zone->orus + maxPoints ); + zone->tags = (FT_Byte*)( zone->contours + maxContours ); + + zone->first_point = 0; } return error; @@ -488,8 +477,7 @@ int j, k; - FT_MEM_SET( num_matched_ids, 0, - sizeof ( int ) * TRICK_SFNT_IDS_NUM_FACES ); + FT_ARRAY_ZERO( num_matched_ids, TRICK_SFNT_IDS_NUM_FACES ); has_cvt = FALSE; has_fpgm = FALSE; has_prep = FALSE; @@ -787,7 +775,7 @@ FT_UInt instance_index = (FT_UInt)face_index >> 16; - if ( FT_HAS_MULTIPLE_MASTERS( ttface ) ) + if ( instance_index && FT_HAS_MULTIPLE_MASTERS( ttface ) ) { error = FT_Set_Named_Instance( ttface, instance_index ); if ( error ) @@ -885,70 +873,38 @@ * size :: * A handle to the size object. * - * pedantic :: - * Set if bytecode execution should be pedantic. - * * @Return: * FreeType error code. 0 means success. */ FT_LOCAL_DEF( FT_Error ) - tt_size_run_fpgm( TT_Size size, - FT_Bool pedantic ) + tt_size_run_fpgm( TT_Size size ) { TT_Face face = (TT_Face)size->root.face; - TT_ExecContext exec; + TT_ExecContext exec = size->context; FT_Error error; - exec = size->context; - error = TT_Load_Context( exec, face, size ); if ( error ) return error; - exec->callTop = 0; - exec->top = 0; - - exec->period = 64; - exec->phase = 0; - exec->threshold = 0; - - exec->instruction_trap = FALSE; - exec->F_dot_P = 0x4000L; - - exec->pedantic_hinting = pedantic; - - { - FT_Size_Metrics* size_metrics = &exec->metrics; - TT_Size_Metrics* tt_metrics = &exec->tt_metrics; - - - size_metrics->x_ppem = 0; - size_metrics->y_ppem = 0; - size_metrics->x_scale = 0; - size_metrics->y_scale = 0; - - tt_metrics->ppem = 0; - tt_metrics->scale = 0; - tt_metrics->ratio = 0x10000L; - } - - /* allow font program execution */ - TT_Set_CodeRange( exec, - tt_coderange_font, - face->font_program, - (FT_Long)face->font_program_size ); - /* disable CVT and glyph programs coderange */ TT_Clear_CodeRange( exec, tt_coderange_cvt ); TT_Clear_CodeRange( exec, tt_coderange_glyph ); if ( face->font_program_size > 0 ) { - TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); + /* allow font program execution */ + TT_Set_CodeRange( exec, + tt_coderange_font, + face->font_program, + (FT_Long)face->font_program_size ); + + exec->pts.n_points = 0; + exec->pts.n_contours = 0; FT_TRACE4(( "Executing `fpgm' table.\n" )); - error = face->interpreter( exec ); + error = TT_Run_Context( exec, size ); FT_TRACE4(( error ? " failed (error code 0x%x)\n" : "", error )); } @@ -976,62 +932,62 @@ * size :: * A handle to the size object. * - * pedantic :: - * Set if bytecode execution should be pedantic. - * * @Return: * FreeType error code. 0 means success. */ FT_LOCAL_DEF( FT_Error ) - tt_size_run_prep( TT_Size size, - FT_Bool pedantic ) + tt_size_run_prep( TT_Size size ) { TT_Face face = (TT_Face)size->root.face; - TT_ExecContext exec; + TT_ExecContext exec = size->context; FT_Error error; FT_UInt i; + /* set default GS, twilight points, and storage */ + /* before CV program can modify them. */ + size->GS = tt_default_graphics_state; + + /* all twilight points are originally zero */ + FT_ARRAY_ZERO( size->twilight.org, size->twilight.n_points ); + FT_ARRAY_ZERO( size->twilight.cur, size->twilight.n_points ); + + error = TT_Load_Context( exec, face, size ); + if ( error ) + return error; + + /* clear storage area */ + FT_ARRAY_ZERO( exec->storage, exec->storeSize ); + /* Scale the cvt values to the new ppem. */ /* By default, we use the y ppem value for scaling. */ FT_TRACE6(( "CVT values:\n" )); - for ( i = 0; i < size->cvt_size; i++ ) + for ( i = 0; i < exec->cvtSize; i++ ) { /* Unscaled CVT values are already stored in 26.6 format. */ /* Note that this scaling operation is very sensitive to rounding; */ /* the integer division by 64 must be applied to the first argument. */ - size->cvt[i] = FT_MulFix( face->cvt[i] / 64, size->ttmetrics.scale ); - FT_TRACE6(( " %3d: %f (%f)\n", - i, (double)face->cvt[i] / 64, (double)size->cvt[i] / 64 )); + exec->cvt[i] = FT_MulFix( face->cvt[i] / 64, size->ttmetrics.scale ); + FT_TRACE6(( " %3u: %f (%f)\n", + i, (double)face->cvt[i] / 64, (double)exec->cvt[i] / 64 )); } FT_TRACE6(( "\n" )); - exec = size->context; - - error = TT_Load_Context( exec, face, size ); - if ( error ) - return error; - - exec->callTop = 0; - exec->top = 0; - - exec->instruction_trap = FALSE; - - exec->pedantic_hinting = pedantic; - - TT_Set_CodeRange( exec, - tt_coderange_cvt, - face->cvt_program, - (FT_Long)face->cvt_program_size ); - TT_Clear_CodeRange( exec, tt_coderange_glyph ); if ( face->cvt_program_size > 0 ) { - TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); + /* allow CV program execution */ + TT_Set_CodeRange( exec, + tt_coderange_cvt, + face->cvt_program, + (FT_Long)face->cvt_program_size ); + + exec->pts.n_points = 0; + exec->pts.n_contours = 0; FT_TRACE4(( "Executing `prep' table.\n" )); - error = face->interpreter( exec ); + error = TT_Run_Context( exec, size ); FT_TRACE4(( error ? " failed (error code 0x%x)\n" : "", error )); } @@ -1040,145 +996,82 @@ size->cvt_ready = error; - /* UNDOCUMENTED! The MS rasterizer doesn't allow the following */ - /* graphics state variables to be modified by the CVT program. */ - - exec->GS.dualVector.x = 0x4000; - exec->GS.dualVector.y = 0; - exec->GS.projVector.x = 0x4000; - exec->GS.projVector.y = 0x0; - exec->GS.freeVector.x = 0x4000; - exec->GS.freeVector.y = 0x0; - - exec->GS.rp0 = 0; - exec->GS.rp1 = 0; - exec->GS.rp2 = 0; - - exec->GS.gep0 = 1; - exec->GS.gep1 = 1; - exec->GS.gep2 = 1; - - exec->GS.loop = 1; - - /* save as default graphics state */ - size->GS = exec->GS; - - TT_Save_Context( exec, size ); + if ( !error ) + TT_Save_Context( exec, size ); return error; } static void - tt_size_done_bytecode( FT_Size ftsize ) + tt_size_done_bytecode( TT_Size size ) { - TT_Size size = (TT_Size)ftsize; - TT_Face face = (TT_Face)ftsize->face; - FT_Memory memory = face->root.memory; + FT_Memory memory = size->root.face->memory; + TT_ExecContext exec = size->context; - if ( size->context ) + + if ( exec ) { - TT_Done_Context( size->context ); + FT_FREE( exec->stack ); + FT_FREE( exec->FDefs ); + + TT_Done_Context( exec ); size->context = NULL; } - FT_FREE( size->cvt ); - size->cvt_size = 0; - - /* free storage area */ - FT_FREE( size->storage ); - size->storage_size = 0; - /* twilight zone */ - tt_glyphzone_done( &size->twilight ); - - FT_FREE( size->function_defs ); - FT_FREE( size->instruction_defs ); - - size->num_function_defs = 0; - size->max_function_defs = 0; - size->num_instruction_defs = 0; - size->max_instruction_defs = 0; - - size->max_func = 0; - size->max_ins = 0; - - size->bytecode_ready = -1; - size->cvt_ready = -1; + tt_glyphzone_done( memory, &size->twilight ); } /* Initialize bytecode-related fields in the size object. */ /* We do this only if bytecode interpretation is really needed. */ - static FT_Error - tt_size_init_bytecode( FT_Size ftsize, + FT_LOCAL_DEF( FT_Error ) + tt_size_init_bytecode( TT_Size size, FT_Bool pedantic ) { FT_Error error; - TT_Size size = (TT_Size)ftsize; - TT_Face face = (TT_Face)ftsize->face; - FT_Memory memory = face->root.memory; + TT_Face face = (TT_Face)size->root.face; + FT_Memory memory = size->root.face->memory; FT_UShort n_twilight; TT_MaxProfile* maxp = &face->max_profile; + TT_ExecContext exec; - /* clean up bytecode related data */ - FT_FREE( size->function_defs ); - FT_FREE( size->instruction_defs ); - FT_FREE( size->cvt ); - FT_FREE( size->storage ); - - if ( size->context ) - TT_Done_Context( size->context ); - tt_glyphzone_done( &size->twilight ); + exec = TT_New_Context( (TT_Driver)face->root.driver ); + if ( !exec ) + return FT_THROW( Could_Not_Find_Context ); - size->bytecode_ready = -1; - size->cvt_ready = -1; + exec->pedantic_hinting = pedantic; - size->context = TT_New_Context( (TT_Driver)face->root.driver ); + exec->maxFDefs = maxp->maxFunctionDefs; + exec->maxIDefs = maxp->maxInstructionDefs; - size->max_function_defs = maxp->maxFunctionDefs; - size->max_instruction_defs = maxp->maxInstructionDefs; + if ( FT_NEW_ARRAY( exec->FDefs, exec->maxFDefs + exec->maxIDefs ) ) + goto Exit; - size->num_function_defs = 0; - size->num_instruction_defs = 0; + exec->IDefs = exec->FDefs + exec->maxFDefs; - size->max_func = 0; - size->max_ins = 0; + exec->numFDefs = 0; + exec->numIDefs = 0; - size->cvt_size = face->cvt_size; - size->storage_size = maxp->maxStorage; + exec->maxFunc = 0; + exec->maxIns = 0; - /* Set default metrics */ - { - TT_Size_Metrics* tt_metrics = &size->ttmetrics; - - - tt_metrics->rotated = FALSE; - tt_metrics->stretched = FALSE; - - /* Set default engine compensation. Value 3 is not described */ - /* in the OpenType specification (as of Mai 2019), but Greg */ - /* says that MS handles it the same as `gray'. */ - /* */ - /* The Apple specification says that the compensation for */ - /* `gray' is always zero. FreeType doesn't do any */ - /* compensation at all. */ - tt_metrics->compensations[0] = 0; /* gray */ - tt_metrics->compensations[1] = 0; /* black */ - tt_metrics->compensations[2] = 0; /* white */ - tt_metrics->compensations[3] = 0; /* zero */ - } + /* XXX: We reserve a little more elements on the stack to deal */ + /* with broken fonts like arialbs, courbs, timesbs, etc. */ + exec->stackSize = maxp->maxStackElements + 32; + exec->storeSize = maxp->maxStorage; + exec->cvtSize = face->cvt_size; - /* allocate function defs, instruction defs, cvt, and storage area */ - if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || - FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || - FT_NEW_ARRAY( size->cvt, size->cvt_size ) || - FT_NEW_ARRAY( size->storage, size->storage_size ) ) + if ( FT_NEW_ARRAY( exec->stack, + exec->stackSize + + (FT_Long)( exec->storeSize + exec->cvtSize ) ) ) goto Exit; - /* reserve twilight zone */ + /* reserve twilight zone and set GS before fpgm is executed, */ + /* just in case, even though fpgm should not touch them */ n_twilight = maxp->maxTwilightPoints; /* there are 4 phantom points (do we need this?) */ @@ -1188,20 +1081,12 @@ if ( error ) goto Exit; - size->twilight.n_points = n_twilight; - - size->GS = tt_default_graphics_state; - - /* set `face->interpreter' according to the debug hook present */ - { - FT_Library library = face->root.driver->root.library; - + size->GS = tt_default_graphics_state; + size->cvt_ready = -1; + size->context = exec; - face->interpreter = (TT_Interpreter) - library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; - if ( !face->interpreter ) - face->interpreter = (TT_Interpreter)TT_RunIns; - } + size->ttmetrics.rotated = FALSE; + size->ttmetrics.stretched = FALSE; /* Fine, now run the font program! */ @@ -1211,59 +1096,13 @@ /* to be executed just once; calling it again is completely useless */ /* and might even lead to extremely slow behaviour if it is malformed */ /* (containing an infinite loop, for example). */ - error = tt_size_run_fpgm( size, pedantic ); + error = tt_size_run_fpgm( size ); return error; Exit: if ( error ) - tt_size_done_bytecode( ftsize ); - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_size_ready_bytecode( TT_Size size, - FT_Bool pedantic ) - { - FT_Error error = FT_Err_Ok; - - - if ( size->bytecode_ready < 0 ) - error = tt_size_init_bytecode( (FT_Size)size, pedantic ); - else - error = size->bytecode_ready; - - if ( error ) - goto Exit; - - /* rescale CVT when needed */ - if ( size->cvt_ready < 0 ) - { - FT_UShort i; + tt_size_done_bytecode( size ); - - /* all twilight points are originally zero */ - for ( i = 0; i < size->twilight.n_points; i++ ) - { - size->twilight.org[i].x = 0; - size->twilight.org[i].y = 0; - size->twilight.cur[i].x = 0; - size->twilight.cur[i].y = 0; - } - - /* clear storage area */ - for ( i = 0; i < size->storage_size; i++ ) - size->storage[i] = 0; - - size->GS = tt_default_graphics_state; - - error = tt_size_run_prep( size, pedantic ); - } - else - error = size->cvt_ready; - - Exit: return error; } @@ -1294,11 +1133,9 @@ #ifdef TT_USE_BYTECODE_INTERPRETER size->bytecode_ready = -1; - size->cvt_ready = -1; #endif - size->ttmetrics.valid = FALSE; - size->strike_index = 0xFFFFFFFFUL; + size->strike_index = 0xFFFFFFFFUL; return error; } @@ -1323,10 +1160,8 @@ #ifdef TT_USE_BYTECODE_INTERPRETER - tt_size_done_bytecode( ttsize ); + tt_size_done_bytecode( size ); #endif - - size->ttmetrics.valid = FALSE; } @@ -1347,21 +1182,13 @@ * function must take `FT_Size` as a result. The passed `FT_Size` is * expected to point to a `TT_Size`. */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) tt_size_reset_height( FT_Size ft_size ) { TT_Size size = (TT_Size)ft_size; - TT_Face face = (TT_Face)size->root.face; + TT_Face face = (TT_Face)ft_size->face; FT_Size_Metrics* size_metrics = &size->hinted_metrics; - size->ttmetrics.valid = FALSE; - - /* copy the result from base layer */ - *size_metrics = size->root.metrics; - - if ( size_metrics->x_ppem < 1 || size_metrics->y_ppem < 1 ) - return FT_THROW( Invalid_PPem ); - /* This bit flag, if set, indicates that the ppems must be */ /* rounded to integers. Nearly all TrueType fonts have this bit */ /* set, as hinting won't work really well otherwise. */ @@ -1379,10 +1206,6 @@ FT_MulFix( face->root.height, size_metrics->y_scale ) ); } - - size->ttmetrics.valid = TRUE; - - return FT_Err_Ok; } @@ -1402,14 +1225,20 @@ FT_LOCAL_DEF( FT_Error ) tt_size_reset( TT_Size size ) { - FT_Error error; TT_Face face = (TT_Face)size->root.face; FT_Size_Metrics* size_metrics = &size->hinted_metrics; - error = tt_size_reset_height( (FT_Size)size ); - if ( error ) - return error; + /* invalidate the size object first */ + size->ttmetrics.ppem = 0; + + if ( size->root.metrics.x_ppem == 0 || size->root.metrics.y_ppem == 0 ) + return FT_THROW( Invalid_PPem ); + + /* copy the result from base layer */ + *size_metrics = size->root.metrics; + + tt_size_reset_height( (FT_Size)size ); if ( face->header.Flags & 8 ) { diff --git a/vendor/freetype/src/truetype/ttobjs.h b/vendor/freetype/src/truetype/ttobjs.h index 9c36ca78362..0d8c8eb7916 100644 --- a/vendor/freetype/src/truetype/ttobjs.h +++ b/vendor/freetype/src/truetype/ttobjs.h @@ -53,6 +53,8 @@ FT_BEGIN_HEADER typedef FT_GlyphSlot TT_GlyphSlot; +#ifdef TT_USE_BYTECODE_INTERPRETER + /************************************************************************** * * @Struct: @@ -67,21 +69,27 @@ FT_BEGIN_HEADER FT_UShort rp1; FT_UShort rp2; + FT_UShort gep0; + FT_UShort gep1; + FT_UShort gep2; + FT_UnitVector dualVector; FT_UnitVector projVector; FT_UnitVector freeVector; FT_Long loop; - FT_F26Dot6 minimum_distance; FT_Int round_state; + FT_F26Dot6 compensation[4]; /* device-specific compensations */ - FT_Bool auto_flip; + /* default values below can be modified by 'fpgm' and 'prep' */ + FT_F26Dot6 minimum_distance; FT_F26Dot6 control_value_cutin; FT_F26Dot6 single_width_cutin; FT_F26Dot6 single_width_value; FT_UShort delta_base; FT_UShort delta_shift; + FT_Bool auto_flip; FT_Byte instruct_control; /* According to Greg Hitchcock from Microsoft, the `scan_control' */ /* variable as documented in the TrueType specification is a 32-bit */ @@ -90,17 +98,12 @@ FT_BEGIN_HEADER FT_Bool scan_control; FT_Int scan_type; - FT_UShort gep0; - FT_UShort gep1; - FT_UShort gep2; - } TT_GraphicsState; -#ifdef TT_USE_BYTECODE_INTERPRETER - FT_LOCAL( void ) - tt_glyphzone_done( TT_GlyphZone zone ); + tt_glyphzone_done( FT_Memory memory, + TT_GlyphZone zone ); FT_LOCAL( FT_Error ) tt_glyphzone_new( FT_Memory memory, @@ -112,73 +115,6 @@ FT_BEGIN_HEADER - /************************************************************************** - * - * EXECUTION SUBTABLES - * - * These sub-tables relate to instruction execution. - * - */ - - -#define TT_MAX_CODE_RANGES 3 - - - /************************************************************************** - * - * There can only be 3 active code ranges at once: - * - the Font Program - * - the CVT Program - * - a glyph's instructions set - */ - typedef enum TT_CodeRange_Tag_ - { - tt_coderange_none = 0, - tt_coderange_font, - tt_coderange_cvt, - tt_coderange_glyph - - } TT_CodeRange_Tag; - - - typedef struct TT_CodeRange_ - { - FT_Byte* base; - FT_Long size; - - } TT_CodeRange; - - typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES]; - - - /************************************************************************** - * - * Defines a function/instruction definition record. - */ - typedef struct TT_DefRecord_ - { - FT_Int range; /* in which code range is it located? */ - FT_Long start; /* where does it start? */ - FT_Long end; /* where does it end? */ - FT_UInt opc; /* function #, or instruction code */ - FT_Bool active; /* is it active? */ - - } TT_DefRecord, *TT_DefArray; - - - /************************************************************************** - * - * Subglyph transformation record. - */ - typedef struct TT_Transform_ - { - FT_Fixed xx, xy; /* transformation matrix coefficients */ - FT_Fixed yx, yy; - FT_F26Dot6 ox, oy; /* offsets */ - - } TT_Transform; - - /************************************************************************** * * A note regarding non-squared pixels: @@ -251,13 +187,9 @@ FT_BEGIN_HEADER FT_Long x_ratio; FT_Long y_ratio; - FT_UShort ppem; /* maximum ppem size */ FT_Long ratio; /* current ratio */ FT_Fixed scale; - - FT_F26Dot6 compensations[4]; /* device-specific compensations */ - - FT_Bool valid; + FT_UShort ppem; /* maximum ppem size */ FT_Bool rotated; /* `is the glyph rotated?'-flag */ FT_Bool stretched; /* `is the glyph stretched?'-flag */ @@ -288,27 +220,8 @@ FT_BEGIN_HEADER FT_Long point_size; /* for the `MPS' bytecode instruction */ - FT_UInt num_function_defs; /* number of function definitions */ - FT_UInt max_function_defs; - TT_DefArray function_defs; /* table of function definitions */ - - FT_UInt num_instruction_defs; /* number of ins. definitions */ - FT_UInt max_instruction_defs; - TT_DefArray instruction_defs; /* table of ins. definitions */ - - FT_UInt max_func; - FT_UInt max_ins; - - TT_CodeRangeTable codeRangeTable; - TT_GraphicsState GS; - FT_ULong cvt_size; /* the scaled control value table */ - FT_Long* cvt; - - FT_UShort storage_size; /* The storage area is now part of */ - FT_Long* storage; /* the instance */ - TT_GlyphZoneRec twilight; /* The instance's twilight zone */ TT_ExecContext context; @@ -375,20 +288,18 @@ FT_BEGIN_HEADER #ifdef TT_USE_BYTECODE_INTERPRETER FT_LOCAL( FT_Error ) - tt_size_run_fpgm( TT_Size size, - FT_Bool pedantic ); + tt_size_run_fpgm( TT_Size size ); FT_LOCAL( FT_Error ) - tt_size_run_prep( TT_Size size, - FT_Bool pedantic ); + tt_size_run_prep( TT_Size size ); FT_LOCAL( FT_Error ) - tt_size_ready_bytecode( TT_Size size, - FT_Bool pedantic ); + tt_size_init_bytecode( TT_Size size, + FT_Bool pedantic ); #endif /* TT_USE_BYTECODE_INTERPRETER */ - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) tt_size_reset_height( FT_Size size ); FT_LOCAL( FT_Error ) diff --git a/vendor/freetype/src/truetype/ttpload.c b/vendor/freetype/src/truetype/ttpload.c index 9505b5f179f..fe9d5418a5f 100644 --- a/vendor/freetype/src/truetype/ttpload.c +++ b/vendor/freetype/src/truetype/ttpload.c @@ -110,7 +110,7 @@ if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 ) { - FT_TRACE2(( "glyph count mismatch! loca: %ld, maxp: %ld\n", + FT_TRACE2(( "glyph count mismatch! loca: %lu, maxp: %ld\n", face->num_locations - 1, face->root.num_glyphs )); /* we only handle the case where `maxp' gives a larger value */ @@ -151,7 +151,7 @@ face->num_locations = (FT_ULong)face->root.num_glyphs + 1; table_len = new_loca_len; - FT_TRACE2(( "adjusting num_locations to %ld\n", + FT_TRACE2(( "adjusting num_locations to %lu\n", face->num_locations )); } else @@ -225,7 +225,7 @@ if ( pos1 > ttface->glyf_len ) { FT_TRACE1(( "tt_face_get_location:" - " too large offset (0x%08lx) found for glyph index %d,\n", + " too large offset (0x%08lx) found for glyph index %u,\n", pos1, gindex )); FT_TRACE1(( " " " exceeding the end of `glyf' table (0x%08lx)\n", @@ -240,17 +240,17 @@ if ( gindex == ttface->num_locations - 2 ) { FT_TRACE1(( "tt_face_get_location:" - " too large size (%ld bytes) found for glyph index %d,\n", + " too large size (%lu bytes) found for glyph index %u,\n", pos2 - pos1, gindex )); FT_TRACE1(( " " - " truncating at the end of `glyf' table to %ld bytes\n", + " truncating at the end of `glyf' table to %lu bytes\n", ttface->glyf_len - pos1 )); pos2 = ttface->glyf_len; } else { FT_TRACE1(( "tt_face_get_location:" - " too large offset (0x%08lx) found for glyph index %d,\n", + " too large offset (0x%08lx) found for glyph index %u,\n", pos2, gindex + 1 )); FT_TRACE1(( " " " exceeding the end of `glyf' table (0x%08lx)\n", @@ -419,7 +419,7 @@ if ( FT_FRAME_EXTRACT( table_len, face->font_program ) ) goto Exit; - FT_TRACE2(( "loaded, %12ld bytes\n", face->font_program_size )); + FT_TRACE2(( "loaded, %12lu bytes\n", face->font_program_size )); } Exit: @@ -482,7 +482,7 @@ if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) ) goto Exit; - FT_TRACE2(( "loaded, %12ld bytes\n", face->cvt_program_size )); + FT_TRACE2(( "loaded, %12lu bytes\n", face->cvt_program_size )); } Exit: diff --git a/vendor/freetype/src/type1/module.mk b/vendor/freetype/src/type1/module.mk new file mode 100644 index 00000000000..97d6111cf20 --- /dev/null +++ b/vendor/freetype/src/type1/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 Type1 module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += TYPE1_DRIVER + +define TYPE1_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, t1_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)type1 $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/type1/rules.mk b/vendor/freetype/src/type1/rules.mk new file mode 100644 index 00000000000..7cabd14b07b --- /dev/null +++ b/vendor/freetype/src/type1/rules.mk @@ -0,0 +1,76 @@ +# +# FreeType 2 Type1 driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# Type1 driver directory +# +T1_DIR := $(SRC_DIR)/type1 + + +# compilation flags for the driver +# +T1_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(T1_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# Type1 driver sources (i.e., C files) +# +T1_DRV_SRC := $(T1_DIR)/t1parse.c \ + $(T1_DIR)/t1load.c \ + $(T1_DIR)/t1driver.c \ + $(T1_DIR)/t1afm.c \ + $(T1_DIR)/t1gload.c \ + $(T1_DIR)/t1objs.c + +# Type1 driver headers +# +T1_DRV_H := $(T1_DRV_SRC:%.c=%.h) \ + $(T1_DIR)/t1tokens.h \ + $(T1_DIR)/t1errors.h + + +# Type1 driver object(s) +# +# T1_DRV_OBJ_M is used during `multi' builds +# T1_DRV_OBJ_S is used during `single' builds +# +T1_DRV_OBJ_M := $(T1_DRV_SRC:$(T1_DIR)/%.c=$(OBJ_DIR)/%.$O) +T1_DRV_OBJ_S := $(OBJ_DIR)/type1.$O + +# Type1 driver source file for single build +# +T1_DRV_SRC_S := $(T1_DIR)/type1.c + + +# Type1 driver - single object +# +$(T1_DRV_OBJ_S): $(T1_DRV_SRC_S) $(T1_DRV_SRC) $(FREETYPE_H) $(T1_DRV_H) + $(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T1_DRV_SRC_S)) + + +# Type1 driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(T1_DIR)/%.c $(FREETYPE_H) $(T1_DRV_H) + $(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(T1_DRV_OBJ_S) +DRV_OBJS_M += $(T1_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/type1/t1gload.c b/vendor/freetype/src/type1/t1gload.c index b289762594c..7c097034674 100644 --- a/vendor/freetype/src/type1/t1gload.c +++ b/vendor/freetype/src/type1/t1gload.c @@ -70,8 +70,13 @@ /* For incremental fonts get the character data using the */ /* callback function. */ if ( inc ) + { + /* So `free_glyph_data` knows whether to free it. */ + char_string->pointer = NULL; + error = inc->funcs->get_glyph_data( inc->object, glyph_index, char_string ); + } else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ @@ -155,6 +160,9 @@ decoder->builder.advance.y = INT_TO_FIXED( metrics.advance_v ); } + if ( error && inc ) + inc->funcs->free_glyph_data( inc->object, char_string ); + #endif /* FT_CONFIG_OPTION_INCREMENTAL */ return error; @@ -295,7 +303,7 @@ { advances[nn] = 0; - FT_TRACE5(( " idx %d: advance height 0 font units\n", + FT_TRACE5(( " idx %u: advance height 0 font units\n", first + nn )); } @@ -333,7 +341,7 @@ else advances[nn] = 0; - FT_TRACE5(( " idx %d: advance width %ld font unit%s\n", + FT_TRACE5(( " idx %u: advance width %ld font unit%s\n", first + nn, advances[nn], advances[nn] == 1 ? "" : "s" )); @@ -380,7 +388,7 @@ goto Exit; } - FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index )); + FT_TRACE1(( "T1_Load_Glyph: glyph index %u\n", glyph_index )); FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); diff --git a/vendor/freetype/src/type1/t1load.c b/vendor/freetype/src/type1/t1load.c index ee7fb42a517..47b1f2d42a2 100644 --- a/vendor/freetype/src/type1/t1load.c +++ b/vendor/freetype/src/type1/t1load.c @@ -471,7 +471,7 @@ nc = num_coords; if ( num_coords > blend->num_axis ) { - FT_TRACE2(( "T1_Get_MM_Blend: only using first %d of %d coordinates\n", + FT_TRACE2(( "T1_Get_MM_Blend: only using first %u of %u coordinates\n", blend->num_axis, num_coords )); nc = blend->num_axis; } @@ -640,7 +640,7 @@ { FT_UNUSED( instance_index ); - return T1_Set_MM_Blend( face, 0, NULL ); + return T1_Set_MM_WeightVector( face, 0, NULL ); } @@ -691,7 +691,7 @@ if ( num_coords > blend->num_axis ) { FT_TRACE2(( "T1_Get_Var_Design:" - " only using first %d of %d coordinates\n", + " only using first %u of %u coordinates\n", blend->num_axis, num_coords )); nc = blend->num_axis; } diff --git a/vendor/freetype/src/type42/module.mk b/vendor/freetype/src/type42/module.mk new file mode 100644 index 00000000000..7895f48c003 --- /dev/null +++ b/vendor/freetype/src/type42/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 Type42 module definition +# + + +# Copyright (C) 2002-2024 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. + + +FTMODULE_H_COMMANDS += TYPE42_DRIVER + +define TYPE42_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, t42_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)type42 $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/type42/rules.mk b/vendor/freetype/src/type42/rules.mk new file mode 100644 index 00000000000..87f62a2827c --- /dev/null +++ b/vendor/freetype/src/type42/rules.mk @@ -0,0 +1,73 @@ +# +# FreeType 2 Type42 driver configuration rules +# + + +# Copyright (C) 2002-2024 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. + + +# Type42 driver directory +# +T42_DIR := $(SRC_DIR)/type42 + + +# compilation flags for the driver +# +T42_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# Type42 driver source +# +T42_DRV_SRC := $(T42_DIR)/t42objs.c \ + $(T42_DIR)/t42parse.c \ + $(T42_DIR)/t42drivr.c + +# Type42 driver headers +# +T42_DRV_H := $(T42_DRV_SRC:%.c=%.h) \ + $(T42_DIR)/t42error.h \ + $(T42_DIR)/t42types.h + + +# Type42 driver object(s) +# +# T42_DRV_OBJ_M is used during `multi' builds +# T42_DRV_OBJ_S is used during `single' builds +# +T42_DRV_OBJ_M := $(T42_DRV_SRC:$(T42_DIR)/%.c=$(OBJ_DIR)/%.$O) +T42_DRV_OBJ_S := $(OBJ_DIR)/type42.$O + +# Type42 driver source file for single build +# +T42_DRV_SRC_S := $(T42_DIR)/type42.c + + +# Type42 driver - single object +# +$(T42_DRV_OBJ_S): $(T42_DRV_SRC_S) $(T42_DRV_SRC) $(FREETYPE_H) $(T42_DRV_H) + $(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T42_DRV_SRC_S)) + + +# Type42 driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(T42_DIR)/%.c $(FREETYPE_H) $(T42_DRV_H) + $(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(T42_DRV_OBJ_S) +DRV_OBJS_M += $(T42_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/type42/t42objs.c b/vendor/freetype/src/type42/t42objs.c index 7010ba86ed1..c97201ac115 100644 --- a/vendor/freetype/src/type42/t42objs.c +++ b/vendor/freetype/src/type42/t42objs.c @@ -510,9 +510,10 @@ error = FT_New_Size( t42face->ttf_face, &ttsize ); if ( !error ) + { t42size->ttsize = ttsize; - - FT_Activate_Size( ttsize ); + FT_Activate_Size( ttsize ); + } return error; } @@ -657,7 +658,7 @@ FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; - FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index )); + FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %u\n", glyph_index )); /* map T42 glyph index to embedded TTF's glyph index */ glyph_index = (FT_UInt)ft_strtol( diff --git a/vendor/freetype/src/type42/t42parse.c b/vendor/freetype/src/type42/t42parse.c index e53d3528736..27c3357c424 100644 --- a/vendor/freetype/src/type42/t42parse.c +++ b/vendor/freetype/src/type42/t42parse.c @@ -310,7 +310,7 @@ FT_Byte* cur; FT_Byte* limit = parser->root.limit; - PSAux_Service psaux = (PSAux_Service)t42face->psaux; + PSAux_Service psaux = (PSAux_Service)t42face->psaux; T1_Skip_Spaces( parser ); @@ -697,7 +697,7 @@ goto Fail; } - FT_TRACE2(( " PS string size %5lu bytes, offset 0x%08lx (%lu)\n", + FT_TRACE2(( " PS string size %5lu bytes, offset 0x%08lx (%ld)\n", string_size, ttf_count, ttf_count )); /* The whole TTF is now loaded into `string_buf'. We are */ diff --git a/vendor/freetype/src/winfonts/module.mk b/vendor/freetype/src/winfonts/module.mk new file mode 100644 index 00000000000..f2d8ace2b82 --- /dev/null +++ b/vendor/freetype/src/winfonts/module.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 Windows FNT/FON module definition +# + + +# Copyright (C) 1996-2024 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. + + +FTMODULE_H_COMMANDS += WINDOWS_DRIVER + +define WINDOWS_DRIVER +$(OPEN_DRIVER) FT_Driver_ClassRec, winfnt_driver_class $(CLOSE_DRIVER) +$(ECHO_DRIVER)winfnt $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE) +endef + +# EOF diff --git a/vendor/freetype/src/winfonts/rules.mk b/vendor/freetype/src/winfonts/rules.mk new file mode 100644 index 00000000000..1a0b87aa746 --- /dev/null +++ b/vendor/freetype/src/winfonts/rules.mk @@ -0,0 +1,68 @@ +# +# FreeType 2 Windows FNT/FON driver configuration rules +# + + +# Copyright (C) 1996-2024 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. + + +# Windows driver directory +# +FNT_DIR := $(SRC_DIR)/winfonts + + +FNT_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(FNT_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) + + +# Windows driver sources (i.e., C files) +# +FNT_DRV_SRC := $(FNT_DIR)/winfnt.c + +# Windows driver headers +# +FNT_DRV_H := $(FNT_DRV_SRC:%.c=%.h) \ + $(FNT_DIR)/fnterrs.h + + +# Windows driver object(s) +# +# FNT_DRV_OBJ_M is used during `multi' builds +# FNT_DRV_OBJ_S is used during `single' builds +# +FNT_DRV_OBJ_M := $(FNT_DRV_SRC:$(FNT_DIR)/%.c=$(OBJ_DIR)/%.$O) +FNT_DRV_OBJ_S := $(OBJ_DIR)/winfnt.$O + +# Windows driver source file for single build +# +FNT_DRV_SRC_S := $(FNT_DIR)/winfnt.c + + +# Windows driver - single object +# +$(FNT_DRV_OBJ_S): $(FNT_DRV_SRC_S) $(FNT_DRV_SRC) $(FREETYPE_H) $(FNT_DRV_H) + $(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(FNT_DRV_SRC_S)) + + +# Windows driver - multiple objects +# +$(OBJ_DIR)/%.$O: $(FNT_DIR)/%.c $(FREETYPE_H) $(FNT_DRV_H) + $(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) + + +# update main driver object lists +# +DRV_OBJS_S += $(FNT_DRV_OBJ_S) +DRV_OBJS_M += $(FNT_DRV_OBJ_M) + + +# EOF diff --git a/vendor/freetype/src/winfonts/winfnt.c b/vendor/freetype/src/winfonts/winfnt.c index 74a06416cd4..daa39bea1d0 100644 --- a/vendor/freetype/src/winfonts/winfnt.c +++ b/vendor/freetype/src/winfonts/winfnt.c @@ -1031,7 +1031,7 @@ goto Exit; } - FT_TRACE1(( "FNT_Load_Glyph: glyph index %d\n", glyph_index )); + FT_TRACE1(( "FNT_Load_Glyph: glyph index %u\n", glyph_index )); if ( glyph_index > 0 ) glyph_index--; /* revert to real index */