mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Merge pull request #5861 from akien-mga/pr-freetype-2.6.5
Upgrade FreeType to upstream version 2.6.5
This commit is contained in:
commit
e7884246eb
drivers/freetype
SCsub
freetype
include
src
include/freetype
config
freetype.hftadvanc.hftautoh.hftbbox.hftbdf.hftbitmap.hftbzip2.hftcache.hftcffdrv.hftchapters.hftcid.hfterrdef.hfterrors.hftfntfmt.hftgasp.hftglyph.hftgxval.hftgzip.hftimage.hftincrem.hftlcdfil.hftlist.hftlzw.hftmac.hftmm.hftmodapi.hftmoderr.hftotval.hftoutln.hftpfr.hftrender.hftsizes.hftsnames.hftstroke.hftsynth.hftsystem.hfttrigon.hftttdrv.hfttypes.hftwinfnt.hinternal
autohint.hftcalc.hftdebug.hftdriver.hftgloadr.hfthash.hftmemory.hftobjs.hftpic.hftrfork.hftserv.hftstream.hfttrace.hftvalid.hinternal.hpsaux.hpshints.h
t1tables.httnameid.htttables.htttags.httunpat.hservices
svbdf.hsvcid.hsvfntfmt.hsvgldict.hsvgxval.hsvkern.hsvmm.hsvotval.hsvpfr.hsvpostnm.hsvprop.hsvpscmap.hsvpsinfo.hsvsfnt.hsvttcmap.hsvtteng.hsvttglyf.hsvwinfnt.h
sfnt.ht1types.htttypes.h@ -1,59 +1,58 @@
|
||||
Import('env')
|
||||
|
||||
ft_sources=[\
|
||||
"freetype/src/pfr/pfr.c",\
|
||||
"freetype/src/psaux/psaux.c",\
|
||||
"freetype/src/pcf/pcf.c",\
|
||||
"freetype/src/otvalid/otvalid.c",\
|
||||
"freetype/src/raster/raster.c",\
|
||||
"freetype/src/type1/type1.c",\
|
||||
"freetype/src/pshinter/pshinter.c",\
|
||||
"freetype/src/cff/cff.c",\
|
||||
"freetype/src/truetype/truetype.c",\
|
||||
"freetype/src/bdf/bdf.c",\
|
||||
"freetype/src/cache/ftcache.c",\
|
||||
"freetype/src/sfnt/sfnt.c",\
|
||||
"freetype/src/winfonts/winfnt.c",\
|
||||
"freetype/src/psnames/psnames.c",\
|
||||
"freetype/src/cid/type1cid.c",\
|
||||
"freetype/src/autofit/autofit.c",\
|
||||
"freetype/src/gxvalid/gxvalid.c",\
|
||||
"freetype/src/smooth/smooth.c",\
|
||||
"freetype/src/type42/type42.c",\
|
||||
"freetype/src/base/ftapi.c",\
|
||||
"freetype/src/base/ftbase.c",\
|
||||
"freetype/src/base/ftbbox.c",\
|
||||
"freetype/src/base/ftbdf.c",\
|
||||
"freetype/src/base/ftbitmap.c",\
|
||||
"freetype/src/base/ftcid.c",\
|
||||
"freetype/src/base/ftdebug.c",\
|
||||
"freetype/src/base/ftfstype.c",\
|
||||
"freetype/src/base/ftgasp.c",\
|
||||
"freetype/src/base/ftglyph.c",\
|
||||
"freetype/src/base/ftgxval.c",\
|
||||
"freetype/src/base/ftinit.c",\
|
||||
"freetype/src/base/ftlcdfil.c",\
|
||||
"freetype/src/base/ftmm.c",\
|
||||
"freetype/src/base/ftotval.c",\
|
||||
"freetype/src/base/ftpatent.c",\
|
||||
"freetype/src/base/ftpfr.c",\
|
||||
"freetype/src/base/ftpic.c",\
|
||||
"freetype/src/base/ftstroke.c",\
|
||||
"freetype/src/base/ftsynth.c",\
|
||||
"freetype/src/base/ftsystem.c",\
|
||||
"freetype/src/base/fttype1.c",\
|
||||
"freetype/src/base/ftwinfnt.c",\
|
||||
"freetype/src/base/ftxf86.c",\
|
||||
|
||||
"src/autofit/autofit.c",\
|
||||
"src/base/ftapi.c",\
|
||||
"src/base/ftbase.c",\
|
||||
"src/base/ftbbox.c",\
|
||||
"src/base/ftbdf.c",\
|
||||
"src/base/ftbitmap.c",\
|
||||
"src/base/ftcid.c",\
|
||||
"src/base/ftdebug.c",\
|
||||
"src/base/ftfntfmt.c",\
|
||||
"src/base/ftfstype.c",\
|
||||
"src/base/ftgasp.c",\
|
||||
"src/base/ftglyph.c",\
|
||||
"src/base/ftgxval.c",\
|
||||
"src/base/ftinit.c",\
|
||||
"src/base/ftlcdfil.c",\
|
||||
"src/base/ftmm.c",\
|
||||
"src/base/ftotval.c",\
|
||||
"src/base/ftpatent.c",\
|
||||
"src/base/ftpfr.c",\
|
||||
"src/base/ftpic.c",\
|
||||
"src/base/ftstroke.c",\
|
||||
"src/base/ftsynth.c",\
|
||||
"src/base/ftsystem.c",\
|
||||
"src/base/fttype1.c",\
|
||||
"src/base/ftwinfnt.c",\
|
||||
"src/bdf/bdf.c",\
|
||||
"src/cache/ftcache.c",\
|
||||
"src/cff/cff.c",\
|
||||
"src/cid/type1cid.c",\
|
||||
"src/gxvalid/gxvalid.c",\
|
||||
"src/otvalid/otvalid.c",\
|
||||
"src/pcf/pcf.c",\
|
||||
"src/pfr/pfr.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",\
|
||||
"src/winfonts/winfnt.c",\
|
||||
]
|
||||
|
||||
|
||||
if (env["freetype"]=="builtin"):
|
||||
#fix for windows command line i too long, split in two libraries
|
||||
# fix for Windows' shell miserably failing on long lines, split in two libraries
|
||||
half1=[]
|
||||
half2=[]
|
||||
for x in ft_sources:
|
||||
if (x.find("freetype/src/base")==0):
|
||||
if (x.find("src/base")==0 or x.find("src/sfnt")==0):
|
||||
half2.append(x)
|
||||
else:
|
||||
half1.append(x)
|
||||
@ -63,9 +62,7 @@ if (env["freetype"]=="builtin"):
|
||||
lib = env.Library("freetype_builtin2",half1)
|
||||
env.Append(LIBS=[lib])
|
||||
|
||||
# lib = env.Library("freetype_builtin",ft_sources)
|
||||
# env.Prepend(LIBS=[lib])
|
||||
|
||||
env.Append(CPPPATH=["#drivers/freetype/include"])
|
||||
|
||||
|
||||
Export('env')
|
||||
|
@ -1,151 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcffdrv.h */
|
||||
/* */
|
||||
/* FreeType API for controlling the CFF driver (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013 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 __FTCFFDRV_H__
|
||||
#define __FTCFFDRV_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* cff_driver
|
||||
*
|
||||
* @title:
|
||||
* The CFF driver
|
||||
*
|
||||
* @abstract:
|
||||
* Controlling the CFF driver module.
|
||||
*
|
||||
* @description:
|
||||
* While FreeType's CFF driver doesn't expose API functions by itself,
|
||||
* it is possible to control its behaviour with @FT_Property_Set and
|
||||
* @FT_Property_Get. The following lists the available properties
|
||||
* together with the necessary macros and structures.
|
||||
*
|
||||
* The CFF driver's module name is `cff'.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* hinting-engine
|
||||
*
|
||||
* @description:
|
||||
* Thanks to Adobe, which contributed a new hinting (and parsing)
|
||||
* engine, an application can select between `freetype' and `adobe' if
|
||||
* compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
|
||||
* macro isn't defined, `hinting-engine' does nothing.
|
||||
*
|
||||
* The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
|
||||
* defined, and `adobe' otherwise.
|
||||
*
|
||||
* The following example code demonstrates how to select Adobe's hinting
|
||||
* engine (omitting the error handling).
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Face face;
|
||||
* FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "cff",
|
||||
* "hinting-engine", &hinting_engine );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_CFF_HINTING_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of constants used for the @hinting-engine property to select
|
||||
* the hinting engine for CFF fonts.
|
||||
*
|
||||
* @values:
|
||||
* FT_CFF_HINTING_FREETYPE ::
|
||||
* Use the old FreeType hinting engine.
|
||||
*
|
||||
* FT_CFF_HINTING_ADOBE ::
|
||||
* Use the hinting engine contributed by Adobe.
|
||||
*
|
||||
*/
|
||||
#define FT_CFF_HINTING_FREETYPE 0
|
||||
#define FT_CFF_HINTING_ADOBE 1
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* no-stem-darkening
|
||||
*
|
||||
* @description:
|
||||
* By default, the Adobe CFF engine darkens stems at smaller sizes,
|
||||
* regardless of hinting, to enhance contrast. Setting this property,
|
||||
* stem darkening gets switched off.
|
||||
*
|
||||
* Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Face face;
|
||||
* FT_Bool no_stem_darkening = TRUE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "cff",
|
||||
* "no-stem-darkening", &no_stem_darkening );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCFFDRV_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,150 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftttdrv.h */
|
||||
/* */
|
||||
/* FreeType API for controlling the TrueType driver */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013 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 __FTTTDRV_H__
|
||||
#define __FTTTDRV_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* tt_driver
|
||||
*
|
||||
* @title:
|
||||
* The TrueType driver
|
||||
*
|
||||
* @abstract:
|
||||
* Controlling the TrueType driver module.
|
||||
*
|
||||
* @description:
|
||||
* While FreeType's TrueType driver doesn't expose API functions by
|
||||
* itself, it is possible to control its behaviour with @FT_Property_Set
|
||||
* and @FT_Property_Get. The following lists the available properties
|
||||
* together with the necessary macros and structures.
|
||||
*
|
||||
* The TrueType driver's module name is `truetype'.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* interpreter-version
|
||||
*
|
||||
* @description:
|
||||
* Currently, two versions are available which represent the bytecode
|
||||
* interpreter with and without subpixel hinting support,
|
||||
* respectively. The default is subpixel support if
|
||||
* TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
|
||||
* support otherwise (since it isn't available then).
|
||||
*
|
||||
* If subpixel hinting is on, many TrueType bytecode instructions
|
||||
* behave differently compared to B/W or grayscale rendering. The
|
||||
* main idea is to render at a much increased horizontal resolution,
|
||||
* then sampling down the created output to subpixel precision.
|
||||
* However, many older fonts are not suited to this and must be
|
||||
* specially taken care of by applying (hardcoded) font-specific
|
||||
* tweaks.
|
||||
*
|
||||
* Details on subpixel hinting and some of the necessary tweaks can be
|
||||
* found in Greg Hitchcock's whitepaper at
|
||||
* `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
|
||||
*
|
||||
* The following example code demonstrates how to activate subpixel
|
||||
* hinting (omitting the error handling).
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Face face;
|
||||
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "truetype",
|
||||
* "interpreter-version",
|
||||
* &interpreter_version );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* TT_INTERPRETER_VERSION_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of constants used for the @interpreter-version property to
|
||||
* select the hinting engine for Truetype fonts.
|
||||
*
|
||||
* The numeric value in the constant names represents the version
|
||||
* number as returned by the `GETINFO' bytecode instruction.
|
||||
*
|
||||
* @values:
|
||||
* TT_INTERPRETER_VERSION_35 ::
|
||||
* Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
|
||||
* Windows~98; only grayscale and B/W rasterizing is supported.
|
||||
*
|
||||
* TT_INTERPRETER_VERSION_38 ::
|
||||
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
|
||||
* equivalent to the hinting provided by DirectWrite ClearType (as
|
||||
* can be found, for example, in the Internet Explorer~9 running on
|
||||
* Windows~7).
|
||||
*
|
||||
* @note:
|
||||
* This property controls the behaviour of the bytecode interpreter
|
||||
* and thus how outlines get hinted. It does *not* control how glyph
|
||||
* get rasterized! In particular, it does not control subpixel color
|
||||
* filtering.
|
||||
*
|
||||
* If FreeType has not been compiled with configuration option
|
||||
* FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
|
||||
* `FT_Err_Unimplemented_Feature' error.
|
||||
*
|
||||
*/
|
||||
#define TT_INTERPRETER_VERSION_35 35
|
||||
#define TT_INTERPRETER_VERSION_38 38
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTTTDRV_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,833 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftoption.h (for development) */
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 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 __FTOPTION_H__
|
||||
#define __FTOPTION_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* USER-SELECTABLE CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* This file contains the default configuration macro definitions for */
|
||||
/* a standard build of the FreeType library. There are three ways to */
|
||||
/* use this file to build project-specific versions of the library: */
|
||||
/* */
|
||||
/* - You can modify this file by hand, but this is not recommended in */
|
||||
/* cases where you would like to build several versions of the */
|
||||
/* library from a single source directory. */
|
||||
/* */
|
||||
/* - You can put a copy of this file in your build directory, more */
|
||||
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
|
||||
/* is the name of a directory that is included _before_ the FreeType */
|
||||
/* include path during compilation. */
|
||||
/* */
|
||||
/* The default FreeType Makefiles and Jamfiles use the build */
|
||||
/* directory `builds/<system>' by default, but you can easily change */
|
||||
/* that for your own projects. */
|
||||
/* */
|
||||
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
|
||||
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
|
||||
/* locate this file during the build. For example, */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
|
||||
/* #include <freetype/config/ftheader.h> */
|
||||
/* */
|
||||
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
|
||||
/* definitions. */
|
||||
/* */
|
||||
/* Note also that you can similarly pre-define the macro */
|
||||
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
|
||||
/* that are statically linked to the library at compile time. By */
|
||||
/* default, this file is <freetype/config/ftmodule.h>. */
|
||||
/* */
|
||||
/* We highly recommend using the third method whenever possible. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Uncomment the line below if you want to activate sub-pixel rendering */
|
||||
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
|
||||
/* */
|
||||
/* Note that this feature is covered by several Microsoft patents */
|
||||
/* and should not be activated in any default build of the library. */
|
||||
/* */
|
||||
/* This macro has no impact on the FreeType API, only on its */
|
||||
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
|
||||
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
|
||||
/* the original size in case this macro isn't defined; however, each */
|
||||
/* triplet of subpixels has R=G=B. */
|
||||
/* */
|
||||
/* This is done to allow FreeType clients to run unmodified, forcing */
|
||||
/* them to display normal gray-level anti-aliased glyphs. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
|
||||
/* by FreeType to speed up some computations. However, this will create */
|
||||
/* some problems when compiling the library in strict ANSI mode. */
|
||||
/* */
|
||||
/* For this reason, the use of 64-bit integers is normally disabled when */
|
||||
/* the __STDC__ macro is defined. You can however disable this by */
|
||||
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
|
||||
/* */
|
||||
/* For most compilers, this will only create compilation warnings when */
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* ObNote: The compiler-specific 64-bit integers are detected in the */
|
||||
/* file `ftconfig.h' either statically or through the */
|
||||
/* `configure' script on supported platforms. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If this macro is defined, do not try to use an assembler version of */
|
||||
/* performance-critical functions (e.g. FT_MulFix). You should only do */
|
||||
/* that to verify that the assembler function works properly, or to */
|
||||
/* execute benchmark tests of the various implementations. */
|
||||
/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/* Note that if your compiler or CPU is not supported, this will default */
|
||||
/* to the standard and portable implementation found in `ftcalc.c'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_INLINE_MULFIX
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_LZW
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Gzip-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. See also */
|
||||
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_ZLIB
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* ZLib library selection */
|
||||
/* */
|
||||
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
|
||||
/* It allows FreeType's `ftgzip' component to link to the system's */
|
||||
/* installation of the ZLib library. This is useful on systems like */
|
||||
/* Unix or VMS where it generally is already available. */
|
||||
/* */
|
||||
/* If you let it undefined, the component will use its own copy */
|
||||
/* of the zlib sources instead. These have been modified to be */
|
||||
/* included directly within the component and *not* export external */
|
||||
/* function names. This allows you to link any program with FreeType */
|
||||
/* _and_ ZLib without linking conflicts. */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Bzip2-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `bzip2' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with XFree86. The implementation uses `libbz2' to */
|
||||
/* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
|
||||
/* Contrary to gzip, bzip2 currently is not included and need to use */
|
||||
/* the system available bzip2 implementation. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_BZIP2
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* PNG bitmap support. */
|
||||
/* */
|
||||
/* FreeType now handles loading color bitmap glyphs in the PNG format. */
|
||||
/* This requires help from the external libpng library. Uncompressed */
|
||||
/* color bitmaps do not need any external libraries and will be */
|
||||
/* supported regardless of this configuration. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_PNG
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define to disable the use of file stream functions and types, FILE, */
|
||||
/* fopen() etc. Enables the use of smaller system libraries on embedded */
|
||||
/* systems that have multiple system libraries, some with or without */
|
||||
/* file stream support, in the cases where file stream support is not */
|
||||
/* necessary such as memory loading of font files. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
/* */
|
||||
/* When compiling FreeType as a DLL, some systems/compilers need a */
|
||||
/* special keyword in front OR after the return type of function */
|
||||
/* declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
|
||||
/* */
|
||||
/* FT_EXPORT( return_type ) */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( return_type ) */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* */
|
||||
/* You can provide your own implementation of FT_EXPORT and */
|
||||
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
|
||||
/* will be later automatically defined as `extern return_type' to */
|
||||
/* allow normal compilation. */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_EXPORT(x) extern x */
|
||||
/* #define FT_EXPORT_DEF(x) x */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Glyph Postscript Names handling */
|
||||
/* */
|
||||
/* By default, FreeType 2 is compiled with the `psnames' module. This */
|
||||
/* module is in charge of converting a glyph name string into a */
|
||||
/* Unicode value, or return a Macintosh standard glyph name for the */
|
||||
/* use with the TrueType `post' table. */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want `psnames' compiled in your */
|
||||
/* build of FreeType. This has the following effects: */
|
||||
/* */
|
||||
/* - The TrueType driver will provide its own set of glyph names, */
|
||||
/* if you build it to support postscript names in the TrueType */
|
||||
/* `post' table. */
|
||||
/* */
|
||||
/* - The Type 1 driver will not be able to synthesize a Unicode */
|
||||
/* charmap out of the glyphs found in the fonts. */
|
||||
/* */
|
||||
/* You would normally undefine this configuration macro when building */
|
||||
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Postscript Names to Unicode Values support */
|
||||
/* */
|
||||
/* By default, FreeType 2 is built with the `PSNames' module compiled */
|
||||
/* in. Among other things, the module is used to convert a glyph name */
|
||||
/* into a Unicode value. This is especially useful in order to */
|
||||
/* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
|
||||
/* through a big table named the `Adobe Glyph List' (AGL). */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want the Adobe Glyph List */
|
||||
/* compiled in your `PSNames' module. The Type 1 driver will not be */
|
||||
/* able to synthesize a Unicode charmap out of the glyphs found in the */
|
||||
/* fonts. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Support for Mac fonts */
|
||||
/* */
|
||||
/* Define this macro if you want support for outline fonts in Mac */
|
||||
/* format (mac dfont, mac resource, macbinary containing a mac */
|
||||
/* resource) on non-Mac platforms. */
|
||||
/* */
|
||||
/* Note that the `FOND' resource isn't checked. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_MAC_FONTS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Guessing methods to access embedded resource forks */
|
||||
/* */
|
||||
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
|
||||
/* GNU/Linux). */
|
||||
/* */
|
||||
/* Resource forks which include fonts data are stored sometimes in */
|
||||
/* locations which users or developers don't expected. In some cases, */
|
||||
/* resource forks start with some offset from the head of a file. In */
|
||||
/* other cases, the actual resource fork is stored in file different */
|
||||
/* from what the user specifies. If this option is activated, */
|
||||
/* FreeType tries to guess whether such offsets or different file */
|
||||
/* names must be used. */
|
||||
/* */
|
||||
/* Note that normal, direct access of resource forks is controlled via */
|
||||
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Allow the use of FT_Incremental_Interface to load typefaces that */
|
||||
/* contain no glyph data, but supply it via a callback function. */
|
||||
/* This is required by clients supporting document formats which */
|
||||
/* supply font data incrementally as the document is parsed, such */
|
||||
/* as the Ghostscript interpreter for the PostScript language. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_INCREMENTAL
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The size in bytes of the render pool used by the scan-line converter */
|
||||
/* to do all of its work. */
|
||||
/* */
|
||||
/* This must be greater than 4KByte if you use FreeType to rasterize */
|
||||
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
|
||||
/* allocation of the render pool. */
|
||||
/* */
|
||||
#define FT_RENDER_POOL_SIZE 16384L
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_MODULES */
|
||||
/* */
|
||||
/* The maximum number of modules that can be registered in a single */
|
||||
/* FreeType library object. 32 is the default. */
|
||||
/* */
|
||||
#define FT_MAX_MODULES 32
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Debug level */
|
||||
/* */
|
||||
/* FreeType can be compiled in debug or trace mode. In debug mode, */
|
||||
/* errors are reported through the `ftdebug' component. In trace */
|
||||
/* mode, additional messages are sent to the standard output during */
|
||||
/* execution. */
|
||||
/* */
|
||||
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
|
||||
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
|
||||
/* */
|
||||
/* Don't define any of these macros to compile in `release' mode! */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
#define FT_DEBUG_LEVEL_ERROR
|
||||
#define FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Autofitter debugging */
|
||||
/* */
|
||||
/* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
|
||||
/* control the autofitter behaviour for debugging purposes with global */
|
||||
/* boolean variables (consequently, you should *never* enable this */
|
||||
/* while compiling in `release' mode): */
|
||||
/* */
|
||||
/* _af_debug_disable_horz_hints */
|
||||
/* _af_debug_disable_vert_hints */
|
||||
/* _af_debug_disable_blue_hints */
|
||||
/* */
|
||||
/* Additionally, the following functions provide dumps of various */
|
||||
/* internal autofit structures to stdout (using `printf'): */
|
||||
/* */
|
||||
/* af_glyph_hints_dump_points */
|
||||
/* af_glyph_hints_dump_segments */
|
||||
/* af_glyph_hints_dump_edges */
|
||||
/* */
|
||||
/* As an argument, they use another global variable: */
|
||||
/* */
|
||||
/* _af_debug_hints */
|
||||
/* */
|
||||
/* Please have a look at the `ftgrid' demo program to see how those */
|
||||
/* variables and macros should be used. */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
#define FT_DEBUG_AUTOFIT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Memory Debugging */
|
||||
/* */
|
||||
/* FreeType now comes with an integrated memory debugger that is */
|
||||
/* capable of detecting simple errors like memory leaks or double */
|
||||
/* deletes. To compile it within your build of the library, you */
|
||||
/* should define FT_DEBUG_MEMORY here. */
|
||||
/* */
|
||||
/* Note that the memory debugger is only activated at runtime when */
|
||||
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
/* */
|
||||
#define FT_DEBUG_MEMORY
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Module errors */
|
||||
/* */
|
||||
/* If this macro is set (which is _not_ the default), the higher byte */
|
||||
/* of an error code gives the module in which the error has occurred, */
|
||||
/* while the lower byte is the real error code. */
|
||||
/* */
|
||||
/* Setting this macro makes sense for debugging purposes only, since */
|
||||
/* it would break source compatibility of certain programs that use */
|
||||
/* FreeType 2. */
|
||||
/* */
|
||||
/* More details can be found in the files ftmoderr.h and fterrors.h. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Position Independent Code */
|
||||
/* */
|
||||
/* If this macro is set (which is _not_ the default), FreeType2 will */
|
||||
/* avoid creating constants that require address fixups. Instead the */
|
||||
/* constants will be moved into a struct and additional intialization */
|
||||
/* code will be used. */
|
||||
/* */
|
||||
/* Setting this macro is needed for systems that prohibit address */
|
||||
/* fixups, such as BREW. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
|
||||
/* embedded bitmaps in all formats using the SFNT module (namely */
|
||||
/* TrueType & OpenType). */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
|
||||
/* load and enumerate the glyph Postscript names in a TrueType or */
|
||||
/* OpenType file. */
|
||||
/* */
|
||||
/* Note that when you do not compile the `PSNames' module by undefining */
|
||||
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
|
||||
/* contain additional code used to read the PS Names table from a font. */
|
||||
/* */
|
||||
/* (By default, the module uses `PSNames' to extract glyph names.) */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
|
||||
/* access the internal name table in a SFNT-based format like TrueType */
|
||||
/* or OpenType. The name table contains various strings used to */
|
||||
/* describe the font, like family name, copyright, version, etc. It */
|
||||
/* does not contain any glyph name though. */
|
||||
/* */
|
||||
/* Accessing SFNT names is done through the functions declared in */
|
||||
/* `freetype/ftsnames.h'. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_SFNT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* TrueType CMap support */
|
||||
/* */
|
||||
/* Here you can fine-tune which TrueType CMap table format shall be */
|
||||
/* supported. */
|
||||
#define TT_CONFIG_CMAP_FORMAT_0
|
||||
#define TT_CONFIG_CMAP_FORMAT_2
|
||||
#define TT_CONFIG_CMAP_FORMAT_4
|
||||
#define TT_CONFIG_CMAP_FORMAT_6
|
||||
#define TT_CONFIG_CMAP_FORMAT_8
|
||||
#define TT_CONFIG_CMAP_FORMAT_10
|
||||
#define TT_CONFIG_CMAP_FORMAT_12
|
||||
#define TT_CONFIG_CMAP_FORMAT_13
|
||||
#define TT_CONFIG_CMAP_FORMAT_14
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
|
||||
/* a bytecode interpreter in the TrueType driver. */
|
||||
/* */
|
||||
/* By undefining this, you will only compile the code necessary to load */
|
||||
/* TrueType glyphs without hinting. */
|
||||
/* */
|
||||
/* Do not #undef this macro here, since the build system might */
|
||||
/* define it for certain configurations only. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
|
||||
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
|
||||
/* replaces the native TrueType hinting mechanism when anything but */
|
||||
/* FT_RENDER_MODE_MONO is requested. */
|
||||
/* */
|
||||
/* Enabling this causes the TrueType driver to ignore instructions under */
|
||||
/* certain conditions. This is done in accordance with the guide here, */
|
||||
/* with some minor differences: */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
|
||||
/* */
|
||||
/* By undefining this, you only compile the code necessary to hint */
|
||||
/* TrueType glyphs with native TT hinting. */
|
||||
/* */
|
||||
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
|
||||
/* defined. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
|
||||
/* of the TrueType bytecode interpreter is used that doesn't implement */
|
||||
/* any of the patented opcodes and algorithms. The patents related to */
|
||||
/* TrueType hinting have expired worldwide since May 2010; this option */
|
||||
/* is now deprecated. */
|
||||
/* */
|
||||
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
|
||||
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
|
||||
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
|
||||
/* */
|
||||
/* This macro is only useful for a small number of font files (mostly */
|
||||
/* for Asian scripts) that require bytecode interpretation to properly */
|
||||
/* load glyphs. For all other fonts, this produces unpleasant results, */
|
||||
/* thus the unpatented interpreter is never used to load glyphs from */
|
||||
/* TrueType fonts unless one of the following two options is used. */
|
||||
/* */
|
||||
/* - The unpatented interpreter is explicitly activated by the user */
|
||||
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
|
||||
/* when opening the FT_Face. */
|
||||
/* */
|
||||
/* - FreeType detects that the FT_Face corresponds to one of the */
|
||||
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
|
||||
/* contains a hard-coded list of font names and other matching */
|
||||
/* parameters (see function `tt_face_init' in file */
|
||||
/* `src/truetype/ttobjs.c'). */
|
||||
/* */
|
||||
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Parameter parameter; */
|
||||
/* FT_Open_Args open_args; */
|
||||
/* */
|
||||
/* */
|
||||
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
|
||||
/* */
|
||||
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
|
||||
/* open_args.pathname = my_font_pathname; */
|
||||
/* open_args.num_params = 1; */
|
||||
/* open_args.params = ¶meter; */
|
||||
/* */
|
||||
/* error = FT_Open_Face( library, &open_args, index, &face ); */
|
||||
/* ... */
|
||||
/* } */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
|
||||
/* bytecode interpreter with a huge switch statement, rather than a call */
|
||||
/* table. This results in smaller and faster code for a number of */
|
||||
/* architectures. */
|
||||
/* */
|
||||
/* Note however that on some compiler/processor combinations, undefining */
|
||||
/* this macro will generate faster, though larger, code. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
|
||||
/* TrueType glyph loader to use Apple's definition of how to handle */
|
||||
/* component offsets in composite glyphs. */
|
||||
/* */
|
||||
/* Apple and MS disagree on the default behavior of component offsets */
|
||||
/* in composites. Apple says that they should be scaled by the scaling */
|
||||
/* factors in the transformation matrix (roughly, it's more complex) */
|
||||
/* while MS says they should not. OpenType defines two bits in the */
|
||||
/* composite flags array which can be used to disambiguate, but old */
|
||||
/* fonts will not have them. */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/otspec/glyf.htm */
|
||||
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
|
||||
/* */
|
||||
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
|
||||
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
|
||||
/* and avar tables). This has many similarities to Type 1 Multiple */
|
||||
/* Masters support. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
|
||||
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_BDF
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
|
||||
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
|
||||
/* required. */
|
||||
/* */
|
||||
#define T1_MAX_DICT_DEPTH 5
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
|
||||
/* calls during glyph loading. */
|
||||
/* */
|
||||
#define T1_MAX_SUBRS_CALLS 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
|
||||
/* minimum of 16 is required. */
|
||||
/* */
|
||||
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
|
||||
/* */
|
||||
#define T1_MAX_CHARSTRINGS_OPERANDS 256
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
|
||||
/* files into an existing face. Note that if set, the T1 driver will be */
|
||||
/* unable to produce kerning distances. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_AFM
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of the Multiple Masters font support in the Type 1 */
|
||||
/* driver. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** C F F D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
|
||||
/* engine gets compiled into FreeType. If defined, it is possible to */
|
||||
/* switch between the two engines using the `hinting-engine' property of */
|
||||
/* the cff driver module. */
|
||||
/* */
|
||||
/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
|
||||
/* support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_CJK
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with Indic script support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_INDIC
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with warp hinting. The idea of the warping */
|
||||
/* code is to slightly scale and shift a glyph within a single dimension */
|
||||
/* so that as much of its segments are aligned (more or less) on the */
|
||||
/* grid. To find out the optimal scaling and shifting value, various */
|
||||
/* parameter combinations are tried and scored. */
|
||||
/* */
|
||||
/* This experimental option is only active if the render mode is */
|
||||
/* FT_RENDER_MODE_LIGHT. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_USE_WARPER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*
|
||||
* This macro is obsolete. Support has been removed in FreeType
|
||||
* version 2.5.
|
||||
*/
|
||||
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
* This macro is defined if either unpatented or native TrueType
|
||||
* hinting is requested by the definitions above.
|
||||
*/
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
#endif
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTOPTION_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,304 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afglobal.c */
|
||||
/* */
|
||||
/* Auto-fitter routines to compute global hinting values (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2013 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 "afglobal.h"
|
||||
#include "afdummy.h"
|
||||
#include "aflatin.h"
|
||||
#include "afcjk.h"
|
||||
#include "afindic.h"
|
||||
#include "afpic.h"
|
||||
|
||||
#include "aferrors.h"
|
||||
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
#include "aflatin2.h"
|
||||
#endif
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
/* when updating this table, don't forget to update */
|
||||
/* AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
|
||||
|
||||
/* populate this list when you add new scripts */
|
||||
static AF_ScriptClass const af_script_classes[] =
|
||||
{
|
||||
&af_dummy_script_class,
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
&af_latin2_script_class,
|
||||
#endif
|
||||
&af_latin_script_class,
|
||||
&af_cjk_script_class,
|
||||
&af_indic_script_class,
|
||||
NULL /* do not remove */
|
||||
};
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/* Compute the script index of each glyph within a given face. */
|
||||
|
||||
static FT_Error
|
||||
af_face_globals_compute_script_coverage( AF_FaceGlobals globals )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Face face = globals->face;
|
||||
FT_CharMap old_charmap = face->charmap;
|
||||
FT_Byte* gscripts = globals->glyph_scripts;
|
||||
FT_UInt ss;
|
||||
FT_UInt i;
|
||||
|
||||
|
||||
/* the value AF_SCRIPT_NONE means `uncovered glyph' */
|
||||
FT_MEM_SET( globals->glyph_scripts,
|
||||
AF_SCRIPT_NONE,
|
||||
globals->glyph_count );
|
||||
|
||||
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
|
||||
if ( error )
|
||||
{
|
||||
/*
|
||||
* Ignore this error; we simply use the fallback script.
|
||||
* XXX: Shouldn't we rather disable hinting?
|
||||
*/
|
||||
error = FT_Err_Ok;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* scan each script in a Unicode charmap */
|
||||
for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ )
|
||||
{
|
||||
AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[ss];
|
||||
AF_Script_UniRange range;
|
||||
|
||||
|
||||
if ( clazz->script_uni_ranges == NULL )
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Scan all Unicode points in the range and set the corresponding
|
||||
* glyph script index.
|
||||
*/
|
||||
for ( range = clazz->script_uni_ranges; range->first != 0; range++ )
|
||||
{
|
||||
FT_ULong charcode = range->first;
|
||||
FT_UInt gindex;
|
||||
|
||||
|
||||
gindex = FT_Get_Char_Index( face, charcode );
|
||||
|
||||
if ( gindex != 0 &&
|
||||
gindex < (FT_ULong)globals->glyph_count &&
|
||||
gscripts[gindex] == AF_SCRIPT_NONE )
|
||||
gscripts[gindex] = (FT_Byte)ss;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
charcode = FT_Get_Next_Char( face, charcode, &gindex );
|
||||
|
||||
if ( gindex == 0 || charcode > range->last )
|
||||
break;
|
||||
|
||||
if ( gindex < (FT_ULong)globals->glyph_count &&
|
||||
gscripts[gindex] == AF_SCRIPT_NONE )
|
||||
gscripts[gindex] = (FT_Byte)ss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* mark ASCII digits */
|
||||
for ( i = 0x30; i <= 0x39; i++ )
|
||||
{
|
||||
FT_UInt gindex = FT_Get_Char_Index( face, i );
|
||||
|
||||
|
||||
if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count )
|
||||
gscripts[gindex] |= AF_DIGIT;
|
||||
}
|
||||
|
||||
Exit:
|
||||
/*
|
||||
* By default, all uncovered glyphs are set to the fallback script.
|
||||
* XXX: Shouldn't we disable hinting or do something similar?
|
||||
*/
|
||||
if ( globals->module->fallback_script != AF_SCRIPT_NONE )
|
||||
{
|
||||
FT_Long nn;
|
||||
|
||||
|
||||
for ( nn = 0; nn < globals->glyph_count; nn++ )
|
||||
{
|
||||
if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_NONE )
|
||||
{
|
||||
gscripts[nn] &= ~AF_SCRIPT_NONE;
|
||||
gscripts[nn] |= globals->module->fallback_script;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FT_Set_Charmap( face, old_charmap );
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_face_globals_new( FT_Face face,
|
||||
AF_FaceGlobals *aglobals,
|
||||
AF_Module module )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Memory memory;
|
||||
AF_FaceGlobals globals = NULL;
|
||||
|
||||
|
||||
memory = face->memory;
|
||||
|
||||
if ( FT_ALLOC( globals, sizeof ( *globals ) +
|
||||
face->num_glyphs * sizeof ( FT_Byte ) ) )
|
||||
goto Exit;
|
||||
|
||||
globals->face = face;
|
||||
globals->glyph_count = face->num_glyphs;
|
||||
globals->glyph_scripts = (FT_Byte*)( globals + 1 );
|
||||
globals->module = module;
|
||||
|
||||
error = af_face_globals_compute_script_coverage( globals );
|
||||
if ( error )
|
||||
{
|
||||
af_face_globals_free( globals );
|
||||
globals = NULL;
|
||||
}
|
||||
|
||||
globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;
|
||||
|
||||
Exit:
|
||||
*aglobals = globals;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_face_globals_free( AF_FaceGlobals globals )
|
||||
{
|
||||
if ( globals )
|
||||
{
|
||||
FT_Memory memory = globals->face->memory;
|
||||
FT_UInt nn;
|
||||
|
||||
|
||||
for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ )
|
||||
{
|
||||
if ( globals->metrics[nn] )
|
||||
{
|
||||
AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[nn];
|
||||
|
||||
|
||||
FT_ASSERT( globals->metrics[nn]->clazz == clazz );
|
||||
|
||||
if ( clazz->script_metrics_done )
|
||||
clazz->script_metrics_done( globals->metrics[nn] );
|
||||
|
||||
FT_FREE( globals->metrics[nn] );
|
||||
}
|
||||
}
|
||||
|
||||
globals->glyph_count = 0;
|
||||
globals->glyph_scripts = NULL; /* no need to free this one! */
|
||||
globals->face = NULL;
|
||||
|
||||
FT_FREE( globals );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_ScriptMetrics *ametrics )
|
||||
{
|
||||
AF_ScriptMetrics metrics = NULL;
|
||||
FT_UInt gidx;
|
||||
AF_ScriptClass clazz;
|
||||
FT_UInt script = options & 15;
|
||||
const FT_Offset script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) /
|
||||
sizeof ( AF_SCRIPT_CLASSES_GET[0] );
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
if ( gindex >= (FT_ULong)globals->glyph_count )
|
||||
{
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
gidx = script;
|
||||
if ( gidx == 0 || gidx + 1 >= script_max )
|
||||
gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_NONE;
|
||||
|
||||
clazz = AF_SCRIPT_CLASSES_GET[gidx];
|
||||
if ( script == 0 )
|
||||
script = clazz->script;
|
||||
|
||||
metrics = globals->metrics[clazz->script];
|
||||
if ( metrics == NULL )
|
||||
{
|
||||
/* create the global metrics object if necessary */
|
||||
FT_Memory memory = globals->face->memory;
|
||||
|
||||
|
||||
if ( FT_ALLOC( metrics, clazz->script_metrics_size ) )
|
||||
goto Exit;
|
||||
|
||||
metrics->clazz = clazz;
|
||||
metrics->globals = globals;
|
||||
|
||||
if ( clazz->script_metrics_init )
|
||||
{
|
||||
error = clazz->script_metrics_init( metrics, globals->face );
|
||||
if ( error )
|
||||
{
|
||||
if ( clazz->script_metrics_done )
|
||||
clazz->script_metrics_done( metrics );
|
||||
|
||||
FT_FREE( metrics );
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
globals->metrics[clazz->script] = metrics;
|
||||
}
|
||||
|
||||
Exit:
|
||||
*ametrics = metrics;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( FT_Bool )
|
||||
af_face_globals_is_digit( AF_FaceGlobals globals,
|
||||
FT_UInt gindex )
|
||||
{
|
||||
if ( gindex < (FT_ULong)globals->glyph_count )
|
||||
return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT );
|
||||
|
||||
return (FT_Bool)0;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
@ -1,109 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afglobal.h */
|
||||
/* */
|
||||
/* Auto-fitter routines to compute global hinting values */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2003-2005, 2007, 2009, 2011-2012 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 __AFGLOBAL_H__
|
||||
#define __AFGLOBAL_H__
|
||||
|
||||
|
||||
#include "aftypes.h"
|
||||
#include "afmodule.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* Default values and flags for both autofitter globals (found in
|
||||
* AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
|
||||
*/
|
||||
|
||||
/* index of fallback script in `af_script_classes' */
|
||||
#define AF_SCRIPT_FALLBACK 2
|
||||
/* a bit mask indicating an uncovered glyph */
|
||||
#define AF_SCRIPT_NONE 0x7F
|
||||
/* if this flag is set, we have an ASCII digit */
|
||||
#define AF_DIGIT 0x80
|
||||
|
||||
/* `increase-x-height' property */
|
||||
#define AF_PROP_INCREASE_X_HEIGHT_MIN 6
|
||||
#define AF_PROP_INCREASE_X_HEIGHT_MAX 0
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
/***** F A C E G L O B A L S *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Note that glyph_scripts[] is used to map each glyph into
|
||||
* an index into the `af_script_classes' array.
|
||||
*
|
||||
*/
|
||||
typedef struct AF_FaceGlobalsRec_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_Long glyph_count; /* same as face->num_glyphs */
|
||||
FT_Byte* glyph_scripts;
|
||||
|
||||
/* per-face auto-hinter properties */
|
||||
FT_UInt increase_x_height;
|
||||
|
||||
AF_ScriptMetrics metrics[AF_SCRIPT_MAX];
|
||||
|
||||
AF_Module module; /* to access global properties */
|
||||
|
||||
} AF_FaceGlobalsRec;
|
||||
|
||||
|
||||
/*
|
||||
* model the global hints data for a given face, decomposed into
|
||||
* script-specific items
|
||||
*/
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
af_face_globals_new( FT_Face face,
|
||||
AF_FaceGlobals *aglobals,
|
||||
AF_Module module );
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
||||
FT_UInt gindex,
|
||||
FT_UInt options,
|
||||
AF_ScriptMetrics *ametrics );
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_face_globals_free( AF_FaceGlobals globals );
|
||||
|
||||
FT_LOCAL_DEF( FT_Bool )
|
||||
af_face_globals_is_digit( AF_FaceGlobals globals,
|
||||
FT_UInt gindex );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AFGLOBAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,561 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afloader.c */
|
||||
/* */
|
||||
/* Auto-fitter glyph loading routines (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2009, 2011-2013 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 "afglobal.h"
|
||||
#include "afloader.h"
|
||||
#include "afhints.h"
|
||||
#include "aferrors.h"
|
||||
#include "afmodule.h"
|
||||
|
||||
|
||||
/* Initialize glyph loader. */
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_loader_init( AF_Module module )
|
||||
{
|
||||
AF_Loader loader = module->loader;
|
||||
FT_Memory memory = module->root.library->memory;
|
||||
|
||||
|
||||
FT_ZERO( loader );
|
||||
|
||||
af_glyph_hints_init( &loader->hints, memory );
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
_af_debug_hints = &loader->hints;
|
||||
#endif
|
||||
return FT_GlyphLoader_New( memory, &loader->gloader );
|
||||
}
|
||||
|
||||
|
||||
/* Reset glyph loader and compute globals if necessary. */
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_loader_reset( AF_Module module,
|
||||
FT_Face face )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_Loader loader = module->loader;
|
||||
|
||||
|
||||
loader->face = face;
|
||||
loader->globals = (AF_FaceGlobals)face->autohint.data;
|
||||
|
||||
FT_GlyphLoader_Rewind( loader->gloader );
|
||||
|
||||
if ( loader->globals == NULL )
|
||||
{
|
||||
error = af_face_globals_new( face, &loader->globals, module );
|
||||
if ( !error )
|
||||
{
|
||||
face->autohint.data =
|
||||
(FT_Pointer)loader->globals;
|
||||
face->autohint.finalizer =
|
||||
(FT_Generic_Finalizer)af_face_globals_free;
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* Finalize glyph loader. */
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_loader_done( AF_Module module )
|
||||
{
|
||||
AF_Loader loader = module->loader;
|
||||
|
||||
|
||||
af_glyph_hints_done( &loader->hints );
|
||||
|
||||
loader->face = NULL;
|
||||
loader->globals = NULL;
|
||||
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
_af_debug_hints = NULL;
|
||||
#endif
|
||||
FT_GlyphLoader_Done( loader->gloader );
|
||||
loader->gloader = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Load a single glyph component. This routine calls itself */
|
||||
/* recursively, if necessary, and does the main work of */
|
||||
/* `af_loader_load_glyph.' */
|
||||
|
||||
static FT_Error
|
||||
af_loader_load_g( AF_Loader loader,
|
||||
AF_Scaler scaler,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags,
|
||||
FT_UInt depth )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Face face = loader->face;
|
||||
FT_GlyphLoader gloader = loader->gloader;
|
||||
AF_ScriptMetrics metrics = loader->metrics;
|
||||
AF_GlyphHints hints = &loader->hints;
|
||||
FT_GlyphSlot slot = face->glyph;
|
||||
FT_Slot_Internal internal = slot->internal;
|
||||
FT_Int32 flags;
|
||||
|
||||
|
||||
flags = load_flags | FT_LOAD_LINEAR_DESIGN;
|
||||
error = FT_Load_Glyph( face, glyph_index, flags );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
loader->transformed = internal->glyph_transformed;
|
||||
if ( loader->transformed )
|
||||
{
|
||||
FT_Matrix inverse;
|
||||
|
||||
|
||||
loader->trans_matrix = internal->glyph_matrix;
|
||||
loader->trans_delta = internal->glyph_delta;
|
||||
|
||||
inverse = loader->trans_matrix;
|
||||
FT_Matrix_Invert( &inverse );
|
||||
FT_Vector_Transform( &loader->trans_delta, &inverse );
|
||||
}
|
||||
|
||||
switch ( slot->format )
|
||||
{
|
||||
case FT_GLYPH_FORMAT_OUTLINE:
|
||||
/* translate the loaded glyph when an internal transform is needed */
|
||||
if ( loader->transformed )
|
||||
FT_Outline_Translate( &slot->outline,
|
||||
loader->trans_delta.x,
|
||||
loader->trans_delta.y );
|
||||
|
||||
/* copy the outline points in the loader's current */
|
||||
/* extra points which are used to keep original glyph coordinates */
|
||||
error = FT_GLYPHLOADER_CHECK_POINTS( gloader,
|
||||
slot->outline.n_points + 4,
|
||||
slot->outline.n_contours );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.outline.points,
|
||||
slot->outline.points,
|
||||
slot->outline.n_points );
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.outline.contours,
|
||||
slot->outline.contours,
|
||||
slot->outline.n_contours );
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.outline.tags,
|
||||
slot->outline.tags,
|
||||
slot->outline.n_points );
|
||||
|
||||
gloader->current.outline.n_points = slot->outline.n_points;
|
||||
gloader->current.outline.n_contours = slot->outline.n_contours;
|
||||
|
||||
/* compute original horizontal phantom points (and ignore */
|
||||
/* vertical ones) */
|
||||
loader->pp1.x = hints->x_delta;
|
||||
loader->pp1.y = hints->y_delta;
|
||||
loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance,
|
||||
hints->x_scale ) + hints->x_delta;
|
||||
loader->pp2.y = hints->y_delta;
|
||||
|
||||
/* be sure to check for spacing glyphs */
|
||||
if ( slot->outline.n_points == 0 )
|
||||
goto Hint_Metrics;
|
||||
|
||||
/* now load the slot image into the auto-outline and run the */
|
||||
/* automatic hinting process */
|
||||
if ( metrics->clazz->script_hints_apply )
|
||||
metrics->clazz->script_hints_apply( hints,
|
||||
&gloader->current.outline,
|
||||
metrics );
|
||||
|
||||
/* we now need to adjust the metrics according to the change in */
|
||||
/* width/positioning that occurred during the hinting process */
|
||||
if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )
|
||||
{
|
||||
FT_Pos old_rsb, old_lsb, new_lsb;
|
||||
FT_Pos pp1x_uh, pp2x_uh;
|
||||
AF_AxisHints axis = &hints->axis[AF_DIMENSION_HORZ];
|
||||
AF_Edge edge1 = axis->edges; /* leftmost edge */
|
||||
AF_Edge edge2 = edge1 +
|
||||
axis->num_edges - 1; /* rightmost edge */
|
||||
|
||||
|
||||
if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )
|
||||
{
|
||||
old_rsb = loader->pp2.x - edge2->opos;
|
||||
old_lsb = edge1->opos;
|
||||
new_lsb = edge1->pos;
|
||||
|
||||
/* remember unhinted values to later account */
|
||||
/* for rounding errors */
|
||||
|
||||
pp1x_uh = new_lsb - old_lsb;
|
||||
pp2x_uh = edge2->pos + old_rsb;
|
||||
|
||||
/* prefer too much space over too little space */
|
||||
/* for very small sizes */
|
||||
|
||||
if ( old_lsb < 24 )
|
||||
pp1x_uh -= 8;
|
||||
|
||||
if ( old_rsb < 24 )
|
||||
pp2x_uh += 8;
|
||||
|
||||
loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
|
||||
loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
|
||||
|
||||
if ( loader->pp1.x >= new_lsb && old_lsb > 0 )
|
||||
loader->pp1.x -= 64;
|
||||
|
||||
if ( loader->pp2.x <= edge2->pos && old_rsb > 0 )
|
||||
loader->pp2.x += 64;
|
||||
|
||||
slot->lsb_delta = loader->pp1.x - pp1x_uh;
|
||||
slot->rsb_delta = loader->pp2.x - pp2x_uh;
|
||||
}
|
||||
else
|
||||
{
|
||||
FT_Pos pp1x = loader->pp1.x;
|
||||
FT_Pos pp2x = loader->pp2.x;
|
||||
|
||||
|
||||
loader->pp1.x = FT_PIX_ROUND( pp1x );
|
||||
loader->pp2.x = FT_PIX_ROUND( pp2x );
|
||||
|
||||
slot->lsb_delta = loader->pp1.x - pp1x;
|
||||
slot->rsb_delta = loader->pp2.x - pp2x;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FT_Pos pp1x = loader->pp1.x;
|
||||
FT_Pos pp2x = loader->pp2.x;
|
||||
|
||||
|
||||
loader->pp1.x = FT_PIX_ROUND( pp1x + hints->xmin_delta );
|
||||
loader->pp2.x = FT_PIX_ROUND( pp2x + hints->xmax_delta );
|
||||
|
||||
slot->lsb_delta = loader->pp1.x - pp1x;
|
||||
slot->rsb_delta = loader->pp2.x - pp2x;
|
||||
}
|
||||
|
||||
/* good, we simply add the glyph to our loader's base */
|
||||
FT_GlyphLoader_Add( gloader );
|
||||
break;
|
||||
|
||||
case FT_GLYPH_FORMAT_COMPOSITE:
|
||||
{
|
||||
FT_UInt nn, num_subglyphs = slot->num_subglyphs;
|
||||
FT_UInt num_base_subgs, start_point;
|
||||
FT_SubGlyph subglyph;
|
||||
|
||||
|
||||
start_point = gloader->base.outline.n_points;
|
||||
|
||||
/* first of all, copy the subglyph descriptors in the glyph loader */
|
||||
error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.subglyphs,
|
||||
slot->subglyphs,
|
||||
num_subglyphs );
|
||||
|
||||
gloader->current.num_subglyphs = num_subglyphs;
|
||||
num_base_subgs = gloader->base.num_subglyphs;
|
||||
|
||||
/* now read each subglyph independently */
|
||||
for ( nn = 0; nn < num_subglyphs; nn++ )
|
||||
{
|
||||
FT_Vector pp1, pp2;
|
||||
FT_Pos x, y;
|
||||
FT_UInt num_points, num_new_points, num_base_points;
|
||||
|
||||
|
||||
/* gloader.current.subglyphs can change during glyph loading due */
|
||||
/* to re-allocation -- we must recompute the current subglyph on */
|
||||
/* each iteration */
|
||||
subglyph = gloader->base.subglyphs + num_base_subgs + nn;
|
||||
|
||||
pp1 = loader->pp1;
|
||||
pp2 = loader->pp2;
|
||||
|
||||
num_base_points = gloader->base.outline.n_points;
|
||||
|
||||
error = af_loader_load_g( loader, scaler, subglyph->index,
|
||||
load_flags, depth + 1 );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
/* recompute subglyph pointer */
|
||||
subglyph = gloader->base.subglyphs + num_base_subgs + nn;
|
||||
|
||||
if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS )
|
||||
{
|
||||
pp1 = loader->pp1;
|
||||
pp2 = loader->pp2;
|
||||
}
|
||||
else
|
||||
{
|
||||
loader->pp1 = pp1;
|
||||
loader->pp2 = pp2;
|
||||
}
|
||||
|
||||
num_points = gloader->base.outline.n_points;
|
||||
num_new_points = num_points - num_base_points;
|
||||
|
||||
/* now perform the transformation required for this subglyph */
|
||||
|
||||
if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE |
|
||||
FT_SUBGLYPH_FLAG_XY_SCALE |
|
||||
FT_SUBGLYPH_FLAG_2X2 ) )
|
||||
{
|
||||
FT_Vector* cur = gloader->base.outline.points +
|
||||
num_base_points;
|
||||
FT_Vector* limit = cur + num_new_points;
|
||||
|
||||
|
||||
for ( ; cur < limit; cur++ )
|
||||
FT_Vector_Transform( cur, &subglyph->transform );
|
||||
}
|
||||
|
||||
/* apply offset */
|
||||
|
||||
if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ) )
|
||||
{
|
||||
FT_Int k = subglyph->arg1;
|
||||
FT_UInt l = subglyph->arg2;
|
||||
FT_Vector* p1;
|
||||
FT_Vector* p2;
|
||||
|
||||
|
||||
if ( start_point + k >= num_base_points ||
|
||||
l >= (FT_UInt)num_new_points )
|
||||
{
|
||||
error = FT_THROW( Invalid_Composite );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
l += num_base_points;
|
||||
|
||||
/* for now, only use the current point coordinates; */
|
||||
/* we eventually may consider another approach */
|
||||
p1 = gloader->base.outline.points + start_point + k;
|
||||
p2 = gloader->base.outline.points + start_point + l;
|
||||
|
||||
x = p1->x - p2->x;
|
||||
y = p1->y - p2->y;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = FT_MulFix( subglyph->arg1, hints->x_scale ) + hints->x_delta;
|
||||
y = FT_MulFix( subglyph->arg2, hints->y_scale ) + hints->y_delta;
|
||||
|
||||
x = FT_PIX_ROUND( x );
|
||||
y = FT_PIX_ROUND( y );
|
||||
}
|
||||
|
||||
{
|
||||
FT_Outline dummy = gloader->base.outline;
|
||||
|
||||
|
||||
dummy.points += num_base_points;
|
||||
dummy.n_points = (short)num_new_points;
|
||||
|
||||
FT_Outline_Translate( &dummy, x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* we don't support other formats (yet?) */
|
||||
error = FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
Hint_Metrics:
|
||||
if ( depth == 0 )
|
||||
{
|
||||
FT_BBox bbox;
|
||||
FT_Vector vvector;
|
||||
|
||||
|
||||
vvector.x = slot->metrics.vertBearingX - slot->metrics.horiBearingX;
|
||||
vvector.y = slot->metrics.vertBearingY - slot->metrics.horiBearingY;
|
||||
vvector.x = FT_MulFix( vvector.x, metrics->scaler.x_scale );
|
||||
vvector.y = FT_MulFix( vvector.y, metrics->scaler.y_scale );
|
||||
|
||||
/* transform the hinted outline if needed */
|
||||
if ( loader->transformed )
|
||||
{
|
||||
FT_Outline_Transform( &gloader->base.outline, &loader->trans_matrix );
|
||||
FT_Vector_Transform( &vvector, &loader->trans_matrix );
|
||||
}
|
||||
#if 1
|
||||
/* we must translate our final outline by -pp1.x and compute */
|
||||
/* the new metrics */
|
||||
if ( loader->pp1.x )
|
||||
FT_Outline_Translate( &gloader->base.outline, -loader->pp1.x, 0 );
|
||||
#endif
|
||||
FT_Outline_Get_CBox( &gloader->base.outline, &bbox );
|
||||
|
||||
bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
|
||||
bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
|
||||
bbox.xMax = FT_PIX_CEIL( bbox.xMax );
|
||||
bbox.yMax = FT_PIX_CEIL( bbox.yMax );
|
||||
|
||||
slot->metrics.width = bbox.xMax - bbox.xMin;
|
||||
slot->metrics.height = bbox.yMax - bbox.yMin;
|
||||
slot->metrics.horiBearingX = bbox.xMin;
|
||||
slot->metrics.horiBearingY = bbox.yMax;
|
||||
|
||||
slot->metrics.vertBearingX = FT_PIX_FLOOR( bbox.xMin + vvector.x );
|
||||
slot->metrics.vertBearingY = FT_PIX_FLOOR( bbox.yMax + vvector.y );
|
||||
|
||||
/* for mono-width fonts (like Andale, Courier, etc.) we need */
|
||||
/* to keep the original rounded advance width; ditto for */
|
||||
/* digits if all have the same advance width */
|
||||
#if 0
|
||||
if ( !FT_IS_FIXED_WIDTH( slot->face ) )
|
||||
slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
|
||||
else
|
||||
slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
|
||||
x_scale );
|
||||
#else
|
||||
if ( scaler->render_mode != FT_RENDER_MODE_LIGHT &&
|
||||
( FT_IS_FIXED_WIDTH( slot->face ) ||
|
||||
( af_face_globals_is_digit( loader->globals, glyph_index ) &&
|
||||
metrics->digits_have_same_width ) ) )
|
||||
{
|
||||
slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
|
||||
metrics->scaler.x_scale );
|
||||
|
||||
/* Set delta values to 0. Otherwise code that uses them is */
|
||||
/* going to ruin the fixed advance width. */
|
||||
slot->lsb_delta = 0;
|
||||
slot->rsb_delta = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* non-spacing glyphs must stay as-is */
|
||||
if ( slot->metrics.horiAdvance )
|
||||
slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
|
||||
}
|
||||
#endif
|
||||
|
||||
slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
|
||||
metrics->scaler.y_scale );
|
||||
|
||||
slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
|
||||
slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
|
||||
|
||||
/* now copy outline into glyph slot */
|
||||
FT_GlyphLoader_Rewind( internal->loader );
|
||||
error = FT_GlyphLoader_CopyPoints( internal->loader, gloader );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
/* reassign all outline fields except flags to protect them */
|
||||
slot->outline.n_contours = internal->loader->base.outline.n_contours;
|
||||
slot->outline.n_points = internal->loader->base.outline.n_points;
|
||||
slot->outline.points = internal->loader->base.outline.points;
|
||||
slot->outline.tags = internal->loader->base.outline.tags;
|
||||
slot->outline.contours = internal->loader->base.outline.contours;
|
||||
|
||||
slot->format = FT_GLYPH_FORMAT_OUTLINE;
|
||||
}
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* Load a glyph. */
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
af_loader_load_glyph( AF_Module module,
|
||||
FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int32 load_flags )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Size size = face->size;
|
||||
AF_Loader loader = module->loader;
|
||||
AF_ScalerRec scaler;
|
||||
|
||||
|
||||
if ( !size )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
FT_ZERO( &scaler );
|
||||
|
||||
scaler.face = face;
|
||||
scaler.x_scale = size->metrics.x_scale;
|
||||
scaler.x_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */
|
||||
scaler.y_scale = size->metrics.y_scale;
|
||||
scaler.y_delta = 0; /* XXX: TODO: add support for sub-pixel hinting */
|
||||
|
||||
scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
|
||||
scaler.flags = 0; /* XXX: fix this */
|
||||
|
||||
error = af_loader_reset( module, face );
|
||||
if ( !error )
|
||||
{
|
||||
AF_ScriptMetrics metrics;
|
||||
FT_UInt options = 0;
|
||||
|
||||
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
/* XXX: undocumented hook to activate the latin2 hinter */
|
||||
if ( load_flags & ( 1UL << 20 ) )
|
||||
options = 2;
|
||||
#endif
|
||||
|
||||
error = af_face_globals_get_metrics( loader->globals, gindex,
|
||||
options, &metrics );
|
||||
if ( !error )
|
||||
{
|
||||
loader->metrics = metrics;
|
||||
|
||||
if ( metrics->clazz->script_metrics_scale )
|
||||
metrics->clazz->script_metrics_scale( metrics, &scaler );
|
||||
else
|
||||
metrics->scaler = scaler;
|
||||
|
||||
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
|
||||
load_flags &= ~FT_LOAD_RENDER;
|
||||
|
||||
if ( metrics->clazz->script_hints_init )
|
||||
{
|
||||
error = metrics->clazz->script_hints_init( &loader->hints,
|
||||
metrics );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );
|
||||
}
|
||||
}
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
@ -1,264 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afmodule.c */
|
||||
/* */
|
||||
/* Auto-fitter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2003-2006, 2009, 2011-2013 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 "afglobal.h"
|
||||
#include "afmodule.h"
|
||||
#include "afloader.h"
|
||||
#include "aferrors.h"
|
||||
#include "afpic.h"
|
||||
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
int _af_debug_disable_horz_hints;
|
||||
int _af_debug_disable_vert_hints;
|
||||
int _af_debug_disable_blue_hints;
|
||||
void* _af_debug_hints;
|
||||
#endif
|
||||
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
#include FT_AUTOHINTER_H
|
||||
#include FT_SERVICE_PROPERTIES_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
||||
/* messages during execution. */
|
||||
/* */
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_afmodule
|
||||
|
||||
|
||||
FT_Error
|
||||
af_property_get_face_globals( FT_Face face,
|
||||
AF_FaceGlobals* aglobals,
|
||||
AF_Module module )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_FaceGlobals globals;
|
||||
|
||||
|
||||
if ( !face )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
globals = (AF_FaceGlobals)face->autohint.data;
|
||||
if ( !globals )
|
||||
{
|
||||
/* trigger computation of the global script data */
|
||||
/* in case it hasn't been done yet */
|
||||
error = af_face_globals_new( face, &globals, module );
|
||||
if ( !error )
|
||||
{
|
||||
face->autohint.data =
|
||||
(FT_Pointer)globals;
|
||||
face->autohint.finalizer =
|
||||
(FT_Generic_Finalizer)af_face_globals_free;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !error )
|
||||
*aglobals = globals;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
af_property_set( FT_Module ft_module,
|
||||
const char* property_name,
|
||||
const void* value )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
|
||||
|
||||
if ( !ft_strcmp( property_name, "fallback-script" ) )
|
||||
{
|
||||
FT_UInt* fallback_script = (FT_UInt*)value;
|
||||
|
||||
|
||||
module->fallback_script = *fallback_script;
|
||||
|
||||
return error;
|
||||
}
|
||||
else if ( !ft_strcmp( property_name, "increase-x-height" ) )
|
||||
{
|
||||
FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value;
|
||||
AF_FaceGlobals globals;
|
||||
|
||||
|
||||
error = af_property_get_face_globals( prop->face, &globals, module );
|
||||
if ( !error )
|
||||
globals->increase_x_height = prop->limit;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
FT_TRACE0(( "af_property_set: missing property `%s'\n",
|
||||
property_name ));
|
||||
return FT_THROW( Missing_Property );
|
||||
}
|
||||
|
||||
|
||||
FT_Error
|
||||
af_property_get( FT_Module ft_module,
|
||||
const char* property_name,
|
||||
void* value )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
FT_UInt fallback_script = module->fallback_script;
|
||||
|
||||
|
||||
if ( !ft_strcmp( property_name, "glyph-to-script-map" ) )
|
||||
{
|
||||
FT_Prop_GlyphToScriptMap* prop = (FT_Prop_GlyphToScriptMap*)value;
|
||||
AF_FaceGlobals globals;
|
||||
|
||||
|
||||
error = af_property_get_face_globals( prop->face, &globals, module );
|
||||
if ( !error )
|
||||
prop->map = globals->glyph_scripts;
|
||||
|
||||
return error;
|
||||
}
|
||||
else if ( !ft_strcmp( property_name, "fallback-script" ) )
|
||||
{
|
||||
FT_UInt* val = (FT_UInt*)value;
|
||||
|
||||
|
||||
*val = fallback_script;
|
||||
|
||||
return error;
|
||||
}
|
||||
else if ( !ft_strcmp( property_name, "increase-x-height" ) )
|
||||
{
|
||||
FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value;
|
||||
AF_FaceGlobals globals;
|
||||
|
||||
|
||||
error = af_property_get_face_globals( prop->face, &globals, module );
|
||||
if ( !error )
|
||||
prop->limit = globals->increase_x_height;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_TRACE0(( "af_property_get: missing property `%s'\n",
|
||||
property_name ));
|
||||
return FT_THROW( Missing_Property );
|
||||
}
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE_PROPERTIESREC(
|
||||
af_service_properties,
|
||||
(FT_Properties_SetFunc)af_property_set,
|
||||
(FT_Properties_GetFunc)af_property_get )
|
||||
|
||||
|
||||
FT_DEFINE_SERVICEDESCREC1(
|
||||
af_services,
|
||||
FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Module_Interface )
|
||||
af_get_interface( FT_Module module,
|
||||
const char* module_interface )
|
||||
{
|
||||
/* AF_SERVICES_GET derefers `library' in PIC mode */
|
||||
#ifdef FT_CONFIG_OPTION_PIC
|
||||
FT_Library library;
|
||||
|
||||
|
||||
if ( !module )
|
||||
return NULL;
|
||||
library = module->library;
|
||||
if ( !library )
|
||||
return NULL;
|
||||
#else
|
||||
FT_UNUSED( module );
|
||||
#endif
|
||||
|
||||
return ft_service_list_lookup( AF_SERVICES_GET, module_interface );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
af_autofitter_init( FT_Module ft_module ) /* AF_Module */
|
||||
{
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
|
||||
|
||||
module->fallback_script = AF_SCRIPT_FALLBACK;
|
||||
|
||||
return af_loader_init( module );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
af_autofitter_done( FT_Module ft_module ) /* AF_Module */
|
||||
{
|
||||
AF_Module module = (AF_Module)ft_module;
|
||||
|
||||
|
||||
af_loader_done( module );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
af_autofitter_load_glyph( AF_Module module,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags )
|
||||
{
|
||||
FT_UNUSED( size );
|
||||
|
||||
return af_loader_load_glyph( module, slot->face,
|
||||
glyph_index, load_flags );
|
||||
}
|
||||
|
||||
|
||||
FT_DEFINE_AUTOHINTER_INTERFACE(
|
||||
af_autofitter_interface,
|
||||
NULL, /* reset_face */
|
||||
NULL, /* get_global_hints */
|
||||
NULL, /* done_global_hints */
|
||||
(FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph ) /* load_glyph */
|
||||
|
||||
|
||||
FT_DEFINE_MODULE(
|
||||
autofit_module_class,
|
||||
|
||||
FT_MODULE_HINTER,
|
||||
sizeof ( AF_ModuleRec ),
|
||||
|
||||
"autofitter",
|
||||
0x10000L, /* version 1.0 of the autofitter */
|
||||
0x20000L, /* requires FreeType 2.0 or above */
|
||||
|
||||
(const void*)&AF_INTERFACE_GET,
|
||||
|
||||
(FT_Module_Constructor)af_autofitter_init,
|
||||
(FT_Module_Destructor) af_autofitter_done,
|
||||
(FT_Module_Requester) af_get_interface )
|
||||
|
||||
|
||||
/* END */
|
@ -1,378 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* aftypes.h */
|
||||
/* */
|
||||
/* Auto-fitter types (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003-2009, 2011-2012 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
||||
* Its main feature is the ability to differentiate between different
|
||||
* scripts in order to apply language-specific rules.
|
||||
*
|
||||
* The code has also been compartmentized into several entities that
|
||||
* should make algorithmic experimentation easier than with the old
|
||||
* code.
|
||||
*
|
||||
* Finally, we get rid of the Catharon license, since this code is
|
||||
* released under the FreeType one.
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AFTYPES_H__
|
||||
#define __AFTYPES_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_OUTLINE_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** D E B U G G I N G *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
extern int _af_debug_disable_horz_hints;
|
||||
extern int _af_debug_disable_vert_hints;
|
||||
extern int _af_debug_disable_blue_hints;
|
||||
extern void* _af_debug_hints;
|
||||
|
||||
#endif /* FT_DEBUG_AUTOFIT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** U T I L I T Y S T U F F *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AF_WidthRec_
|
||||
{
|
||||
FT_Pos org; /* original position/width in font units */
|
||||
FT_Pos cur; /* current/scaled position/width in device sub-pixels */
|
||||
FT_Pos fit; /* current/fitted position/width in device sub-pixels */
|
||||
|
||||
} AF_WidthRec, *AF_Width;
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_sort_pos( FT_UInt count,
|
||||
FT_Pos* table );
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_sort_and_quantize_widths( FT_UInt* count,
|
||||
AF_Width widths,
|
||||
FT_Pos threshold );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** A N G L E T Y P E S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* The auto-fitter doesn't need a very high angular accuracy;
|
||||
* this allows us to speed up some computations considerably with a
|
||||
* light Cordic algorithm (see afangles.c).
|
||||
*/
|
||||
|
||||
typedef FT_Int AF_Angle;
|
||||
|
||||
|
||||
#define AF_ANGLE_PI 256
|
||||
#define AF_ANGLE_2PI ( AF_ANGLE_PI * 2 )
|
||||
#define AF_ANGLE_PI2 ( AF_ANGLE_PI / 2 )
|
||||
#define AF_ANGLE_PI4 ( AF_ANGLE_PI / 4 )
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* compute the angle of a given 2-D vector
|
||||
*/
|
||||
FT_LOCAL( AF_Angle )
|
||||
af_angle_atan( FT_Pos dx,
|
||||
FT_Pos dy );
|
||||
|
||||
|
||||
/*
|
||||
* compute `angle2 - angle1'; the result is always within
|
||||
* the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
|
||||
*/
|
||||
FT_LOCAL( AF_Angle )
|
||||
af_angle_diff( AF_Angle angle1,
|
||||
AF_Angle angle2 );
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#define AF_ANGLE_DIFF( result, angle1, angle2 ) \
|
||||
FT_BEGIN_STMNT \
|
||||
AF_Angle _delta = (angle2) - (angle1); \
|
||||
\
|
||||
\
|
||||
_delta %= AF_ANGLE_2PI; \
|
||||
if ( _delta < 0 ) \
|
||||
_delta += AF_ANGLE_2PI; \
|
||||
\
|
||||
if ( _delta > AF_ANGLE_PI ) \
|
||||
_delta -= AF_ANGLE_2PI; \
|
||||
\
|
||||
result = _delta; \
|
||||
FT_END_STMNT
|
||||
|
||||
|
||||
/* opaque handle to glyph-specific hints -- see `afhints.h' for more
|
||||
* details
|
||||
*/
|
||||
typedef struct AF_GlyphHintsRec_* AF_GlyphHints;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S C A L E R S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* A scaler models the target pixel device that will receive the
|
||||
* auto-hinted glyph image.
|
||||
*/
|
||||
|
||||
typedef enum AF_ScalerFlags_
|
||||
{
|
||||
AF_SCALER_FLAG_NO_HORIZONTAL = 1, /* disable horizontal hinting */
|
||||
AF_SCALER_FLAG_NO_VERTICAL = 2, /* disable vertical hinting */
|
||||
AF_SCALER_FLAG_NO_ADVANCE = 4 /* disable advance hinting */
|
||||
|
||||
} AF_ScalerFlags;
|
||||
|
||||
|
||||
typedef struct AF_ScalerRec_
|
||||
{
|
||||
FT_Face face; /* source font face */
|
||||
FT_Fixed x_scale; /* from font units to 1/64th device pixels */
|
||||
FT_Fixed y_scale; /* from font units to 1/64th device pixels */
|
||||
FT_Pos x_delta; /* in 1/64th device pixels */
|
||||
FT_Pos y_delta; /* in 1/64th device pixels */
|
||||
FT_Render_Mode render_mode; /* monochrome, anti-aliased, LCD, etc. */
|
||||
FT_UInt32 flags; /* additional control flags, see above */
|
||||
|
||||
} AF_ScalerRec, *AF_Scaler;
|
||||
|
||||
|
||||
#define AF_SCALER_EQUAL_SCALES( a, b ) \
|
||||
( (a)->x_scale == (b)->x_scale && \
|
||||
(a)->y_scale == (b)->y_scale && \
|
||||
(a)->x_delta == (b)->x_delta && \
|
||||
(a)->y_delta == (b)->y_delta )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S C R I P T S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* The list of known scripts. Each different script corresponds to the
|
||||
* following information:
|
||||
*
|
||||
* - A set of Unicode ranges to test whether the face supports the
|
||||
* script.
|
||||
*
|
||||
* - A specific global analyzer that will compute global metrics
|
||||
* specific to the script.
|
||||
*
|
||||
* - A specific glyph analyzer that will compute segments and
|
||||
* edges for each glyph covered by the script.
|
||||
*
|
||||
* - A specific grid-fitting algorithm that will distort the
|
||||
* scaled glyph outline according to the results of the glyph
|
||||
* analyzer.
|
||||
*
|
||||
* Note that a given analyzer and/or grid-fitting algorithm can be
|
||||
* used by more than one script.
|
||||
*/
|
||||
|
||||
typedef enum AF_Script_
|
||||
{
|
||||
AF_SCRIPT_DUMMY = 0,
|
||||
AF_SCRIPT_LATIN = 1,
|
||||
AF_SCRIPT_CJK = 2,
|
||||
AF_SCRIPT_INDIC = 3,
|
||||
#ifdef FT_OPTION_AUTOFIT2
|
||||
AF_SCRIPT_LATIN2 = 4,
|
||||
#endif
|
||||
|
||||
/* add new scripts here. Don't forget to update the list in */
|
||||
/* `afglobal.c'. */
|
||||
|
||||
AF_SCRIPT_MAX /* do not remove */
|
||||
|
||||
} AF_Script;
|
||||
|
||||
|
||||
typedef struct AF_ScriptClassRec_ const* AF_ScriptClass;
|
||||
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
|
||||
|
||||
typedef struct AF_ScriptMetricsRec_
|
||||
{
|
||||
AF_ScriptClass clazz;
|
||||
AF_ScalerRec scaler;
|
||||
FT_Bool digits_have_same_width;
|
||||
|
||||
AF_FaceGlobals globals; /* to access properties */
|
||||
|
||||
} AF_ScriptMetricsRec, *AF_ScriptMetrics;
|
||||
|
||||
|
||||
/* This function parses an FT_Face to compute global metrics for
|
||||
* a specific script.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*AF_Script_InitMetricsFunc)( AF_ScriptMetrics metrics,
|
||||
FT_Face face );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics metrics,
|
||||
AF_Scaler scaler );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics metrics );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*AF_Script_InitHintsFunc)( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics );
|
||||
|
||||
typedef void
|
||||
(*AF_Script_ApplyHintsFunc)( AF_GlyphHints hints,
|
||||
FT_Outline* outline,
|
||||
AF_ScriptMetrics metrics );
|
||||
|
||||
|
||||
typedef struct AF_Script_UniRangeRec_
|
||||
{
|
||||
FT_UInt32 first;
|
||||
FT_UInt32 last;
|
||||
|
||||
} AF_Script_UniRangeRec;
|
||||
|
||||
#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) }
|
||||
|
||||
typedef const AF_Script_UniRangeRec *AF_Script_UniRange;
|
||||
|
||||
|
||||
typedef struct AF_ScriptClassRec_
|
||||
{
|
||||
AF_Script script;
|
||||
AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
|
||||
FT_UInt32 standard_char; /* for default width and height */
|
||||
|
||||
FT_Offset script_metrics_size;
|
||||
AF_Script_InitMetricsFunc script_metrics_init;
|
||||
AF_Script_ScaleMetricsFunc script_metrics_scale;
|
||||
AF_Script_DoneMetricsFunc script_metrics_done;
|
||||
|
||||
AF_Script_InitHintsFunc script_hints_init;
|
||||
AF_Script_ApplyHintsFunc script_hints_apply;
|
||||
|
||||
} AF_ScriptClassRec;
|
||||
|
||||
|
||||
/* Declare and define vtables for classes */
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
|
||||
FT_CALLBACK_TABLE const AF_ScriptClassRec \
|
||||
script_class;
|
||||
|
||||
#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char, \
|
||||
m_size, \
|
||||
m_init, m_scale, m_done, h_init, h_apply ) \
|
||||
FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec script_class = \
|
||||
{ \
|
||||
script_, \
|
||||
ranges, \
|
||||
def_char, \
|
||||
\
|
||||
m_size, \
|
||||
\
|
||||
m_init, \
|
||||
m_scale, \
|
||||
m_done, \
|
||||
\
|
||||
h_init, \
|
||||
h_apply \
|
||||
};
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
|
||||
FT_LOCAL( void ) \
|
||||
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac );
|
||||
|
||||
#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char, \
|
||||
m_size, \
|
||||
m_init, m_scale, m_done, h_init, h_apply ) \
|
||||
FT_LOCAL_DEF( void ) \
|
||||
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
|
||||
{ \
|
||||
ac->script = script_; \
|
||||
ac->script_uni_ranges = ranges; \
|
||||
ac->default_char = def_char; \
|
||||
\
|
||||
ac->script_metrics_size = m_size; \
|
||||
\
|
||||
ac->script_metrics_init = m_init; \
|
||||
ac->script_metrics_scale = m_scale; \
|
||||
ac->script_metrics_done = m_done; \
|
||||
\
|
||||
ac->script_hints_init = h_init; \
|
||||
ac->script_hints_apply = h_apply; \
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AFTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,60 +0,0 @@
|
||||
# FreeType 2 src/base Jamfile
|
||||
#
|
||||
# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
SubDir FT2_TOP $(FT2_SRC_DIR) base ;
|
||||
|
||||
|
||||
{
|
||||
local _sources ;
|
||||
|
||||
if $(FT2_MULTI)
|
||||
{
|
||||
_sources = ftadvanc ftcalc ftdbgmem ftgloadr
|
||||
ftobjs ftoutln ftrfork ftsnames
|
||||
ftstream fttrigon ftutil
|
||||
basepic ftpic
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
_sources = ftbase ;
|
||||
}
|
||||
|
||||
Library $(FT2_LIB) : $(_sources).c ;
|
||||
}
|
||||
|
||||
# Add the optional/replaceable files.
|
||||
#
|
||||
{
|
||||
local _sources = bbox bdf bitmap debug gasp
|
||||
glyph gxval init lcdfil mm
|
||||
otval pfr stroke synth system
|
||||
type1 winfnt xf86 patent
|
||||
;
|
||||
|
||||
Library $(FT2_LIB) : ft$(_sources).c ;
|
||||
}
|
||||
|
||||
# Add Macintosh-specific file to the library when necessary.
|
||||
#
|
||||
if $(MAC)
|
||||
{
|
||||
Library $(FT2_LIB) : ftmac.c ;
|
||||
}
|
||||
else if $(OS) = MACOSX
|
||||
{
|
||||
if $(FT2_MULTI)
|
||||
{
|
||||
Library $(FT2_LIB) : ftmac.c ;
|
||||
}
|
||||
}
|
||||
|
||||
# end of src/base Jamfile
|
@ -1,974 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcalc.c */
|
||||
/* */
|
||||
/* Arithmetic computations (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2008, 2012-2013 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Support for 1-complement arithmetic has been totally dropped in this */
|
||||
/* release. You can still write your own code if you need it. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Implementing basic computation routines. */
|
||||
/* */
|
||||
/* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(), */
|
||||
/* and FT_FloorFix() are declared in freetype.h. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_GLYPH_H
|
||||
#include FT_TRIGONOMETRY_H
|
||||
#include FT_INTERNAL_CALC_H
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
#ifdef FT_MULFIX_INLINED
|
||||
#undef FT_MulFix
|
||||
#endif
|
||||
|
||||
/* we need to emulate a 64-bit data type if a real one isn't available */
|
||||
|
||||
#ifndef FT_LONG64
|
||||
|
||||
typedef struct FT_Int64_
|
||||
{
|
||||
FT_UInt32 lo;
|
||||
FT_UInt32 hi;
|
||||
|
||||
} FT_Int64;
|
||||
|
||||
#endif /* !FT_LONG64 */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
||||
/* messages during execution. */
|
||||
/* */
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_calc
|
||||
|
||||
|
||||
/* The following three functions are available regardless of whether */
|
||||
/* FT_LONG64 is defined. */
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_RoundFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL
|
||||
: -((-a + 0x8000L ) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_CeilFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL
|
||||
: -((-a + 0xFFFFL ) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Fixed )
|
||||
FT_FloorFix( FT_Fixed a )
|
||||
{
|
||||
return ( a >= 0 ) ? a & ~0xFFFFL
|
||||
: -((-a) & ~0xFFFFL );
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF ( FT_Int )
|
||||
FT_MSB( FT_UInt32 z )
|
||||
{
|
||||
FT_Int shift = 0;
|
||||
|
||||
/* determine msb bit index in `shift' */
|
||||
if ( z >= ( 1L << 16 ) )
|
||||
{
|
||||
z >>= 16;
|
||||
shift += 16;
|
||||
}
|
||||
if ( z >= ( 1L << 8 ) )
|
||||
{
|
||||
z >>= 8;
|
||||
shift += 8;
|
||||
}
|
||||
if ( z >= ( 1L << 4 ) )
|
||||
{
|
||||
z >>= 4;
|
||||
shift += 4;
|
||||
}
|
||||
if ( z >= ( 1L << 2 ) )
|
||||
{
|
||||
z >>= 2;
|
||||
shift += 2;
|
||||
}
|
||||
if ( z >= ( 1L << 1 ) )
|
||||
{
|
||||
z >>= 1;
|
||||
shift += 1;
|
||||
}
|
||||
|
||||
return shift;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( FT_Fixed )
|
||||
FT_Hypot( FT_Fixed x,
|
||||
FT_Fixed y )
|
||||
{
|
||||
FT_Vector v;
|
||||
|
||||
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
|
||||
return FT_Vector_Length( &v );
|
||||
}
|
||||
|
||||
|
||||
#ifdef FT_LONG64
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_MulDiv( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c )
|
||||
{
|
||||
FT_Int s;
|
||||
FT_Long d;
|
||||
|
||||
|
||||
s = 1;
|
||||
if ( a < 0 ) { a = -a; s = -1; }
|
||||
if ( b < 0 ) { b = -b; s = -s; }
|
||||
if ( c < 0 ) { c = -c; s = -s; }
|
||||
|
||||
d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
|
||||
: 0x7FFFFFFFL );
|
||||
|
||||
return ( s > 0 ) ? d : -d;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_MulDiv_No_Round( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c )
|
||||
{
|
||||
FT_Int s;
|
||||
FT_Long d;
|
||||
|
||||
|
||||
s = 1;
|
||||
if ( a < 0 ) { a = -a; s = -1; }
|
||||
if ( b < 0 ) { b = -b; s = -s; }
|
||||
if ( c < 0 ) { c = -c; s = -s; }
|
||||
|
||||
d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
|
||||
: 0x7FFFFFFFL );
|
||||
|
||||
return ( s > 0 ) ? d : -d;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_MulFix( FT_Long a,
|
||||
FT_Long b )
|
||||
{
|
||||
#ifdef FT_MULFIX_ASSEMBLER
|
||||
|
||||
return FT_MULFIX_ASSEMBLER( a, b );
|
||||
|
||||
#else
|
||||
|
||||
FT_Int s = 1;
|
||||
FT_Long c;
|
||||
|
||||
|
||||
if ( a < 0 )
|
||||
{
|
||||
a = -a;
|
||||
s = -1;
|
||||
}
|
||||
|
||||
if ( b < 0 )
|
||||
{
|
||||
b = -b;
|
||||
s = -s;
|
||||
}
|
||||
|
||||
c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
|
||||
|
||||
return ( s > 0 ) ? c : -c;
|
||||
|
||||
#endif /* FT_MULFIX_ASSEMBLER */
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_DivFix( FT_Long a,
|
||||
FT_Long b )
|
||||
{
|
||||
FT_Int32 s;
|
||||
FT_UInt32 q;
|
||||
|
||||
|
||||
s = 1;
|
||||
if ( a < 0 )
|
||||
{
|
||||
a = -a;
|
||||
s = -1;
|
||||
}
|
||||
if ( b < 0 )
|
||||
{
|
||||
b = -b;
|
||||
s = -s;
|
||||
}
|
||||
|
||||
if ( b == 0 )
|
||||
/* check for division by 0 */
|
||||
q = 0x7FFFFFFFL;
|
||||
else
|
||||
/* compute result directly */
|
||||
q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b );
|
||||
|
||||
return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
|
||||
}
|
||||
|
||||
|
||||
#else /* !FT_LONG64 */
|
||||
|
||||
|
||||
static void
|
||||
ft_multo64( FT_UInt32 x,
|
||||
FT_UInt32 y,
|
||||
FT_Int64 *z )
|
||||
{
|
||||
FT_UInt32 lo1, hi1, lo2, hi2, lo, hi, i1, i2;
|
||||
|
||||
|
||||
lo1 = x & 0x0000FFFFU; hi1 = x >> 16;
|
||||
lo2 = y & 0x0000FFFFU; hi2 = y >> 16;
|
||||
|
||||
lo = lo1 * lo2;
|
||||
i1 = lo1 * hi2;
|
||||
i2 = lo2 * hi1;
|
||||
hi = hi1 * hi2;
|
||||
|
||||
/* Check carry overflow of i1 + i2 */
|
||||
i1 += i2;
|
||||
hi += (FT_UInt32)( i1 < i2 ) << 16;
|
||||
|
||||
hi += i1 >> 16;
|
||||
i1 = i1 << 16;
|
||||
|
||||
/* Check carry overflow of i1 + lo */
|
||||
lo += i1;
|
||||
hi += ( lo < i1 );
|
||||
|
||||
z->lo = lo;
|
||||
z->hi = hi;
|
||||
}
|
||||
|
||||
|
||||
static FT_UInt32
|
||||
ft_div64by32( FT_UInt32 hi,
|
||||
FT_UInt32 lo,
|
||||
FT_UInt32 y )
|
||||
{
|
||||
FT_UInt32 r, q;
|
||||
FT_Int i;
|
||||
|
||||
|
||||
q = 0;
|
||||
r = hi;
|
||||
|
||||
if ( r >= y )
|
||||
return (FT_UInt32)0x7FFFFFFFL;
|
||||
|
||||
i = 32;
|
||||
do
|
||||
{
|
||||
r <<= 1;
|
||||
q <<= 1;
|
||||
r |= lo >> 31;
|
||||
|
||||
if ( r >= y )
|
||||
{
|
||||
r -= y;
|
||||
q |= 1;
|
||||
}
|
||||
lo <<= 1;
|
||||
} while ( --i );
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
FT_Add64( FT_Int64* x,
|
||||
FT_Int64* y,
|
||||
FT_Int64 *z )
|
||||
{
|
||||
register FT_UInt32 lo, hi;
|
||||
|
||||
|
||||
lo = x->lo + y->lo;
|
||||
hi = x->hi + y->hi + ( lo < x->lo );
|
||||
|
||||
z->lo = lo;
|
||||
z->hi = hi;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
/* The FT_MulDiv function has been optimized thanks to ideas from */
|
||||
/* Graham Asher. The trick is to optimize computation when everything */
|
||||
/* fits within 32-bits (a rather common case). */
|
||||
/* */
|
||||
/* we compute 'a*b+c/2', then divide it by 'c'. (positive values) */
|
||||
/* */
|
||||
/* 46340 is FLOOR(SQRT(2^31-1)). */
|
||||
/* */
|
||||
/* if ( a <= 46340 && b <= 46340 ) then ( a*b <= 0x7FFEA810 ) */
|
||||
/* */
|
||||
/* 0x7FFFFFFF - 0x7FFEA810 = 0x157F0 */
|
||||
/* */
|
||||
/* if ( c < 0x157F0*2 ) then ( a*b+c/2 <= 0x7FFFFFFF ) */
|
||||
/* */
|
||||
/* and 2*0x157F0 = 176096 */
|
||||
/* */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_MulDiv( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c )
|
||||
{
|
||||
long s;
|
||||
|
||||
|
||||
/* XXX: this function does not allow 64-bit arguments */
|
||||
if ( a == 0 || b == c )
|
||||
return a;
|
||||
|
||||
s = a; a = FT_ABS( a );
|
||||
s ^= b; b = FT_ABS( b );
|
||||
s ^= c; c = FT_ABS( c );
|
||||
|
||||
if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 )
|
||||
a = ( a * b + ( c >> 1 ) ) / c;
|
||||
|
||||
else if ( (FT_Int32)c > 0 )
|
||||
{
|
||||
FT_Int64 temp, temp2;
|
||||
|
||||
|
||||
ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp );
|
||||
|
||||
temp2.hi = 0;
|
||||
temp2.lo = (FT_UInt32)(c >> 1);
|
||||
FT_Add64( &temp, &temp2, &temp );
|
||||
a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c );
|
||||
}
|
||||
else
|
||||
a = 0x7FFFFFFFL;
|
||||
|
||||
return ( s < 0 ? -a : a );
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_MulDiv_No_Round( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c )
|
||||
{
|
||||
long s;
|
||||
|
||||
|
||||
if ( a == 0 || b == c )
|
||||
return a;
|
||||
|
||||
s = a; a = FT_ABS( a );
|
||||
s ^= b; b = FT_ABS( b );
|
||||
s ^= c; c = FT_ABS( c );
|
||||
|
||||
if ( a <= 46340L && b <= 46340L && c > 0 )
|
||||
a = a * b / c;
|
||||
|
||||
else if ( (FT_Int32)c > 0 )
|
||||
{
|
||||
FT_Int64 temp;
|
||||
|
||||
|
||||
ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp );
|
||||
a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c );
|
||||
}
|
||||
else
|
||||
a = 0x7FFFFFFFL;
|
||||
|
||||
return ( s < 0 ? -a : a );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_MulFix( FT_Long a,
|
||||
FT_Long b )
|
||||
{
|
||||
#ifdef FT_MULFIX_ASSEMBLER
|
||||
|
||||
return FT_MULFIX_ASSEMBLER( a, b );
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* This code is nonportable. See comment below.
|
||||
*
|
||||
* However, on a platform where right-shift of a signed quantity fills
|
||||
* the leftmost bits by copying the sign bit, it might be faster.
|
||||
*/
|
||||
|
||||
FT_Long sa, sb;
|
||||
FT_ULong ua, ub;
|
||||
|
||||
|
||||
if ( a == 0 || b == 0x10000L )
|
||||
return a;
|
||||
|
||||
/*
|
||||
* This is a clever way of converting a signed number `a' into its
|
||||
* absolute value (stored back into `a') and its sign. The sign is
|
||||
* stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
|
||||
* was negative. (Similarly for `b' and `sb').
|
||||
*
|
||||
* Unfortunately, it doesn't work (at least not portably).
|
||||
*
|
||||
* It makes the assumption that right-shift on a negative signed value
|
||||
* fills the leftmost bits by copying the sign bit. This is wrong.
|
||||
* According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
|
||||
* the result of right-shift of a negative signed value is
|
||||
* implementation-defined. At least one implementation fills the
|
||||
* leftmost bits with 0s (i.e., it is exactly the same as an unsigned
|
||||
* right shift). This means that when `a' is negative, `sa' ends up
|
||||
* with the value 1 rather than -1. After that, everything else goes
|
||||
* wrong.
|
||||
*/
|
||||
sa = ( a >> ( sizeof ( a ) * 8 - 1 ) );
|
||||
a = ( a ^ sa ) - sa;
|
||||
sb = ( b >> ( sizeof ( b ) * 8 - 1 ) );
|
||||
b = ( b ^ sb ) - sb;
|
||||
|
||||
ua = (FT_ULong)a;
|
||||
ub = (FT_ULong)b;
|
||||
|
||||
if ( ua <= 2048 && ub <= 1048576L )
|
||||
ua = ( ua * ub + 0x8000U ) >> 16;
|
||||
else
|
||||
{
|
||||
FT_ULong al = ua & 0xFFFFU;
|
||||
|
||||
|
||||
ua = ( ua >> 16 ) * ub + al * ( ub >> 16 ) +
|
||||
( ( al * ( ub & 0xFFFFU ) + 0x8000U ) >> 16 );
|
||||
}
|
||||
|
||||
sa ^= sb,
|
||||
ua = (FT_ULong)(( ua ^ sa ) - sa);
|
||||
|
||||
return (FT_Long)ua;
|
||||
|
||||
#else /* 0 */
|
||||
|
||||
FT_Long s;
|
||||
FT_ULong ua, ub;
|
||||
|
||||
|
||||
if ( a == 0 || b == 0x10000L )
|
||||
return a;
|
||||
|
||||
s = a; a = FT_ABS( a );
|
||||
s ^= b; b = FT_ABS( b );
|
||||
|
||||
ua = (FT_ULong)a;
|
||||
ub = (FT_ULong)b;
|
||||
|
||||
if ( ua <= 2048 && ub <= 1048576L )
|
||||
ua = ( ua * ub + 0x8000UL ) >> 16;
|
||||
else
|
||||
{
|
||||
FT_ULong al = ua & 0xFFFFUL;
|
||||
|
||||
|
||||
ua = ( ua >> 16 ) * ub + al * ( ub >> 16 ) +
|
||||
( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_DivFix( FT_Long a,
|
||||
FT_Long b )
|
||||
{
|
||||
FT_Int32 s;
|
||||
FT_UInt32 q;
|
||||
|
||||
|
||||
/* XXX: this function does not allow 64-bit arguments */
|
||||
s = (FT_Int32)a; a = FT_ABS( a );
|
||||
s ^= (FT_Int32)b; b = FT_ABS( b );
|
||||
|
||||
if ( (FT_UInt32)b == 0 )
|
||||
{
|
||||
/* check for division by 0 */
|
||||
q = (FT_UInt32)0x7FFFFFFFL;
|
||||
}
|
||||
else if ( ( a >> 16 ) == 0 )
|
||||
{
|
||||
/* compute result directly */
|
||||
q = (FT_UInt32)( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* we need more bits; we have to do it by hand */
|
||||
FT_Int64 temp, temp2;
|
||||
|
||||
|
||||
temp.hi = (FT_Int32)( a >> 16 );
|
||||
temp.lo = (FT_UInt32)a << 16;
|
||||
temp2.hi = 0;
|
||||
temp2.lo = (FT_UInt32)( b >> 1 );
|
||||
FT_Add64( &temp, &temp2, &temp );
|
||||
q = ft_div64by32( temp.hi, temp.lo, (FT_Int32)b );
|
||||
}
|
||||
|
||||
return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_MulTo64( FT_Int32 x,
|
||||
FT_Int32 y,
|
||||
FT_Int64 *z )
|
||||
{
|
||||
FT_Int32 s;
|
||||
|
||||
|
||||
s = x; x = FT_ABS( x );
|
||||
s ^= y; y = FT_ABS( y );
|
||||
|
||||
ft_multo64( x, y, z );
|
||||
|
||||
if ( s < 0 )
|
||||
{
|
||||
z->lo = (FT_UInt32)-(FT_Int32)z->lo;
|
||||
z->hi = ~z->hi + !( z->lo );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* apparently, the second version of this code is not compiled correctly */
|
||||
/* on Mac machines with the MPW C compiler.. tsk, tsk, tsk... */
|
||||
|
||||
#if 1
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 )
|
||||
FT_Div64by32( FT_Int64* x,
|
||||
FT_Int32 y )
|
||||
{
|
||||
FT_Int32 s;
|
||||
FT_UInt32 q, r, i, lo;
|
||||
|
||||
|
||||
s = x->hi;
|
||||
if ( s < 0 )
|
||||
{
|
||||
x->lo = (FT_UInt32)-(FT_Int32)x->lo;
|
||||
x->hi = ~x->hi + !x->lo;
|
||||
}
|
||||
s ^= y; y = FT_ABS( y );
|
||||
|
||||
/* Shortcut */
|
||||
if ( x->hi == 0 )
|
||||
{
|
||||
if ( y > 0 )
|
||||
q = x->lo / y;
|
||||
else
|
||||
q = 0x7FFFFFFFL;
|
||||
|
||||
return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
|
||||
}
|
||||
|
||||
r = x->hi;
|
||||
lo = x->lo;
|
||||
|
||||
if ( r >= (FT_UInt32)y ) /* we know y is to be treated as unsigned here */
|
||||
return ( s < 0 ? 0x80000001UL : 0x7FFFFFFFUL );
|
||||
/* Return Max/Min Int32 if division overflow. */
|
||||
/* This includes division by zero! */
|
||||
q = 0;
|
||||
for ( i = 0; i < 32; i++ )
|
||||
{
|
||||
r <<= 1;
|
||||
q <<= 1;
|
||||
r |= lo >> 31;
|
||||
|
||||
if ( r >= (FT_UInt32)y )
|
||||
{
|
||||
r -= y;
|
||||
q |= 1;
|
||||
}
|
||||
lo <<= 1;
|
||||
}
|
||||
|
||||
return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
|
||||
}
|
||||
|
||||
#else /* 0 */
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 )
|
||||
FT_Div64by32( FT_Int64* x,
|
||||
FT_Int32 y )
|
||||
{
|
||||
FT_Int32 s;
|
||||
FT_UInt32 q;
|
||||
|
||||
|
||||
s = x->hi;
|
||||
if ( s < 0 )
|
||||
{
|
||||
x->lo = (FT_UInt32)-(FT_Int32)x->lo;
|
||||
x->hi = ~x->hi + !x->lo;
|
||||
}
|
||||
s ^= y; y = FT_ABS( y );
|
||||
|
||||
/* Shortcut */
|
||||
if ( x->hi == 0 )
|
||||
{
|
||||
if ( y > 0 )
|
||||
q = ( x->lo + ( y >> 1 ) ) / y;
|
||||
else
|
||||
q = 0x7FFFFFFFL;
|
||||
|
||||
return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
|
||||
}
|
||||
|
||||
q = ft_div64by32( x->hi, x->lo, y );
|
||||
|
||||
return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#endif /* FT_LONG64 */
|
||||
|
||||
|
||||
/* documentation is in ftglyph.h */
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Matrix_Multiply( const FT_Matrix* a,
|
||||
FT_Matrix *b )
|
||||
{
|
||||
FT_Fixed xx, xy, yx, yy;
|
||||
|
||||
|
||||
if ( !a || !b )
|
||||
return;
|
||||
|
||||
xx = FT_MulFix( a->xx, b->xx ) + FT_MulFix( a->xy, b->yx );
|
||||
xy = FT_MulFix( a->xx, b->xy ) + FT_MulFix( a->xy, b->yy );
|
||||
yx = FT_MulFix( a->yx, b->xx ) + FT_MulFix( a->yy, b->yx );
|
||||
yy = FT_MulFix( a->yx, b->xy ) + FT_MulFix( a->yy, b->yy );
|
||||
|
||||
b->xx = xx; b->xy = xy;
|
||||
b->yx = yx; b->yy = yy;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftglyph.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_Matrix_Invert( FT_Matrix* matrix )
|
||||
{
|
||||
FT_Pos delta, xx, yy;
|
||||
|
||||
|
||||
if ( !matrix )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
/* compute discriminant */
|
||||
delta = FT_MulFix( matrix->xx, matrix->yy ) -
|
||||
FT_MulFix( matrix->xy, matrix->yx );
|
||||
|
||||
if ( !delta )
|
||||
return FT_THROW( Invalid_Argument ); /* matrix can't be inverted */
|
||||
|
||||
matrix->xy = - FT_DivFix( matrix->xy, delta );
|
||||
matrix->yx = - FT_DivFix( matrix->yx, delta );
|
||||
|
||||
xx = matrix->xx;
|
||||
yy = matrix->yy;
|
||||
|
||||
matrix->xx = FT_DivFix( yy, delta );
|
||||
matrix->yy = FT_DivFix( xx, delta );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
|
||||
FT_Matrix *b,
|
||||
FT_Long scaling )
|
||||
{
|
||||
FT_Fixed xx, xy, yx, yy;
|
||||
|
||||
FT_Long val = 0x10000L * scaling;
|
||||
|
||||
|
||||
if ( !a || !b )
|
||||
return;
|
||||
|
||||
xx = FT_MulDiv( a->xx, b->xx, val ) + FT_MulDiv( a->xy, b->yx, val );
|
||||
xy = FT_MulDiv( a->xx, b->xy, val ) + FT_MulDiv( a->xy, b->yy, val );
|
||||
yx = FT_MulDiv( a->yx, b->xx, val ) + FT_MulDiv( a->yy, b->yx, val );
|
||||
yy = FT_MulDiv( a->yx, b->xy, val ) + FT_MulDiv( a->yy, b->yy, val );
|
||||
|
||||
b->xx = xx; b->xy = xy;
|
||||
b->yx = yx; b->yy = yy;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Vector_Transform_Scaled( FT_Vector* vector,
|
||||
const FT_Matrix* matrix,
|
||||
FT_Long scaling )
|
||||
{
|
||||
FT_Pos xz, yz;
|
||||
|
||||
FT_Long val = 0x10000L * scaling;
|
||||
|
||||
|
||||
if ( !vector || !matrix )
|
||||
return;
|
||||
|
||||
xz = FT_MulDiv( vector->x, matrix->xx, val ) +
|
||||
FT_MulDiv( vector->y, matrix->xy, val );
|
||||
|
||||
yz = FT_MulDiv( vector->x, matrix->yx, val ) +
|
||||
FT_MulDiv( vector->y, matrix->yy, val );
|
||||
|
||||
vector->x = xz;
|
||||
vector->y = yz;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x )
|
||||
{
|
||||
FT_UInt32 root, rem_hi, rem_lo, test_div;
|
||||
FT_Int count;
|
||||
|
||||
|
||||
root = 0;
|
||||
|
||||
if ( x > 0 )
|
||||
{
|
||||
rem_hi = 0;
|
||||
rem_lo = x;
|
||||
count = 24;
|
||||
do
|
||||
{
|
||||
rem_hi = ( rem_hi << 2 ) | ( rem_lo >> 30 );
|
||||
rem_lo <<= 2;
|
||||
root <<= 1;
|
||||
test_div = ( root << 1 ) + 1;
|
||||
|
||||
if ( rem_hi >= test_div )
|
||||
{
|
||||
rem_hi -= test_div;
|
||||
root += 1;
|
||||
}
|
||||
} while ( --count );
|
||||
}
|
||||
|
||||
return (FT_Int32)root;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( FT_Int )
|
||||
ft_corner_orientation( FT_Pos in_x,
|
||||
FT_Pos in_y,
|
||||
FT_Pos out_x,
|
||||
FT_Pos out_y )
|
||||
{
|
||||
FT_Long result; /* avoid overflow on 16-bit system */
|
||||
|
||||
|
||||
/* deal with the trivial cases quickly */
|
||||
if ( in_y == 0 )
|
||||
{
|
||||
if ( in_x >= 0 )
|
||||
result = out_y;
|
||||
else
|
||||
result = -out_y;
|
||||
}
|
||||
else if ( in_x == 0 )
|
||||
{
|
||||
if ( in_y >= 0 )
|
||||
result = -out_x;
|
||||
else
|
||||
result = out_x;
|
||||
}
|
||||
else if ( out_y == 0 )
|
||||
{
|
||||
if ( out_x >= 0 )
|
||||
result = in_y;
|
||||
else
|
||||
result = -in_y;
|
||||
}
|
||||
else if ( out_x == 0 )
|
||||
{
|
||||
if ( out_y >= 0 )
|
||||
result = -in_x;
|
||||
else
|
||||
result = in_x;
|
||||
}
|
||||
else /* general case */
|
||||
{
|
||||
#ifdef FT_LONG64
|
||||
|
||||
FT_Int64 delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
|
||||
|
||||
|
||||
if ( delta == 0 )
|
||||
result = 0;
|
||||
else
|
||||
result = 1 - 2 * ( delta < 0 );
|
||||
|
||||
#else
|
||||
|
||||
FT_Int64 z1, z2;
|
||||
|
||||
|
||||
/* XXX: this function does not allow 64-bit arguments */
|
||||
ft_multo64( (FT_Int32)in_x, (FT_Int32)out_y, &z1 );
|
||||
ft_multo64( (FT_Int32)in_y, (FT_Int32)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;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* XXX: only the sign of return value, +1/0/-1 must be used */
|
||||
return (FT_Int)result;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_BASE_DEF( FT_Int )
|
||||
ft_corner_is_flat( FT_Pos in_x,
|
||||
FT_Pos in_y,
|
||||
FT_Pos out_x,
|
||||
FT_Pos out_y )
|
||||
{
|
||||
FT_Pos ax = in_x;
|
||||
FT_Pos ay = in_y;
|
||||
|
||||
FT_Pos d_in, d_out, d_corner;
|
||||
|
||||
|
||||
if ( ax < 0 )
|
||||
ax = -ax;
|
||||
if ( ay < 0 )
|
||||
ay = -ay;
|
||||
d_in = ax + ay;
|
||||
|
||||
ax = out_x;
|
||||
if ( ax < 0 )
|
||||
ax = -ax;
|
||||
ay = out_y;
|
||||
if ( ay < 0 )
|
||||
ay = -ay;
|
||||
d_out = ax + ay;
|
||||
|
||||
ax = out_x + in_x;
|
||||
if ( ax < 0 )
|
||||
ax = -ax;
|
||||
ay = out_y + in_y;
|
||||
if ( ay < 0 )
|
||||
ay = -ay;
|
||||
d_corner = ax + ay;
|
||||
|
||||
return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
@ -1,286 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftpatent.c */
|
||||
/* */
|
||||
/* FreeType API for checking patented TrueType bytecode instructions */
|
||||
/* (body). */
|
||||
/* */
|
||||
/* Copyright 2007, 2008, 2010 by David Turner. */
|
||||
/* */
|
||||
/* 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 <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_TRUETYPE_TAGS_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_STREAM_H
|
||||
#include FT_SERVICE_SFNT_H
|
||||
#include FT_SERVICE_TRUETYPE_GLYF_H
|
||||
|
||||
|
||||
static FT_Bool
|
||||
_tt_check_patents_in_range( FT_Stream stream,
|
||||
FT_ULong size )
|
||||
{
|
||||
FT_Bool result = FALSE;
|
||||
FT_Error error;
|
||||
FT_Bytes p, end;
|
||||
|
||||
|
||||
if ( FT_FRAME_ENTER( size ) )
|
||||
return 0;
|
||||
|
||||
p = stream->cursor;
|
||||
end = p + size;
|
||||
|
||||
while ( p < end )
|
||||
{
|
||||
switch (p[0])
|
||||
{
|
||||
case 0x06: /* SPvTL // */
|
||||
case 0x07: /* SPvTL + */
|
||||
case 0x08: /* SFvTL // */
|
||||
case 0x09: /* SFvTL + */
|
||||
case 0x0A: /* SPvFS */
|
||||
case 0x0B: /* SFvFS */
|
||||
result = TRUE;
|
||||
goto Exit;
|
||||
|
||||
case 0x40:
|
||||
if ( p + 1 >= end )
|
||||
goto Exit;
|
||||
|
||||
p += p[1] + 2;
|
||||
break;
|
||||
|
||||
case 0x41:
|
||||
if ( p + 1 >= end )
|
||||
goto Exit;
|
||||
|
||||
p += p[1] * 2 + 2;
|
||||
break;
|
||||
|
||||
case 0x71: /* DELTAP2 */
|
||||
case 0x72: /* DELTAP3 */
|
||||
case 0x73: /* DELTAC0 */
|
||||
case 0x74: /* DELTAC1 */
|
||||
case 0x75: /* DELTAC2 */
|
||||
result = TRUE;
|
||||
goto Exit;
|
||||
|
||||
case 0xB0:
|
||||
case 0xB1:
|
||||
case 0xB2:
|
||||
case 0xB3:
|
||||
case 0xB4:
|
||||
case 0xB5:
|
||||
case 0xB6:
|
||||
case 0xB7:
|
||||
p += ( p[0] - 0xB0 ) + 2;
|
||||
break;
|
||||
|
||||
case 0xB8:
|
||||
case 0xB9:
|
||||
case 0xBA:
|
||||
case 0xBB:
|
||||
case 0xBC:
|
||||
case 0xBD:
|
||||
case 0xBE:
|
||||
case 0xBF:
|
||||
p += ( p[0] - 0xB8 ) * 2 + 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
p += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Exit:
|
||||
FT_UNUSED( error );
|
||||
FT_FRAME_EXIT();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static FT_Bool
|
||||
_tt_check_patents_in_table( FT_Face face,
|
||||
FT_ULong tag )
|
||||
{
|
||||
FT_Stream stream = face->stream;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Service_SFNT_Table service;
|
||||
FT_Bool result = FALSE;
|
||||
|
||||
|
||||
FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
|
||||
|
||||
if ( service )
|
||||
{
|
||||
FT_UInt i = 0;
|
||||
FT_ULong tag_i = 0, offset_i = 0, length_i = 0;
|
||||
|
||||
|
||||
for ( i = 0; !error && tag_i != tag ; i++ )
|
||||
error = service->table_info( face, i,
|
||||
&tag_i, &offset_i, &length_i );
|
||||
|
||||
if ( error ||
|
||||
FT_STREAM_SEEK( offset_i ) )
|
||||
goto Exit;
|
||||
|
||||
result = _tt_check_patents_in_range( stream, length_i );
|
||||
}
|
||||
|
||||
Exit:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static FT_Bool
|
||||
_tt_face_check_patents( FT_Face face )
|
||||
{
|
||||
FT_Stream stream = face->stream;
|
||||
FT_UInt gindex;
|
||||
FT_Error error;
|
||||
FT_Bool result;
|
||||
|
||||
FT_Service_TTGlyf service;
|
||||
|
||||
|
||||
result = _tt_check_patents_in_table( face, TTAG_fpgm );
|
||||
if ( result )
|
||||
goto Exit;
|
||||
|
||||
result = _tt_check_patents_in_table( face, TTAG_prep );
|
||||
if ( result )
|
||||
goto Exit;
|
||||
|
||||
FT_FACE_FIND_SERVICE( face, service, TT_GLYF );
|
||||
if ( service == NULL )
|
||||
goto Exit;
|
||||
|
||||
for ( gindex = 0; gindex < (FT_UInt)face->num_glyphs; gindex++ )
|
||||
{
|
||||
FT_ULong offset, num_ins, size;
|
||||
FT_Int num_contours;
|
||||
|
||||
|
||||
offset = service->get_location( face, gindex, &size );
|
||||
if ( size == 0 )
|
||||
continue;
|
||||
|
||||
if ( FT_STREAM_SEEK( offset ) ||
|
||||
FT_READ_SHORT( num_contours ) )
|
||||
continue;
|
||||
|
||||
if ( num_contours >= 0 ) /* simple glyph */
|
||||
{
|
||||
if ( FT_STREAM_SKIP( 8 + num_contours * 2 ) )
|
||||
continue;
|
||||
}
|
||||
else /* compound glyph */
|
||||
{
|
||||
FT_Bool has_instr = 0;
|
||||
|
||||
|
||||
if ( FT_STREAM_SKIP( 8 ) )
|
||||
continue;
|
||||
|
||||
/* now read each component */
|
||||
for (;;)
|
||||
{
|
||||
FT_UInt flags, toskip;
|
||||
|
||||
|
||||
if( FT_READ_USHORT( flags ) )
|
||||
break;
|
||||
|
||||
toskip = 2 + 1 + 1;
|
||||
|
||||
if ( ( flags & ( 1 << 0 ) ) != 0 ) /* ARGS_ARE_WORDS */
|
||||
toskip += 2;
|
||||
|
||||
if ( ( flags & ( 1 << 3 ) ) != 0 ) /* WE_HAVE_A_SCALE */
|
||||
toskip += 2;
|
||||
else if ( ( flags & ( 1 << 6 ) ) != 0 ) /* WE_HAVE_X_Y_SCALE */
|
||||
toskip += 4;
|
||||
else if ( ( flags & ( 1 << 7 ) ) != 0 ) /* WE_HAVE_A_2x2 */
|
||||
toskip += 8;
|
||||
|
||||
if ( ( flags & ( 1 << 8 ) ) != 0 ) /* WE_HAVE_INSTRUCTIONS */
|
||||
has_instr = 1;
|
||||
|
||||
if ( FT_STREAM_SKIP( toskip ) )
|
||||
goto NextGlyph;
|
||||
|
||||
if ( ( flags & ( 1 << 5 ) ) == 0 ) /* MORE_COMPONENTS */
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !has_instr )
|
||||
goto NextGlyph;
|
||||
}
|
||||
|
||||
if ( FT_READ_USHORT( num_ins ) )
|
||||
continue;
|
||||
|
||||
result = _tt_check_patents_in_range( stream, num_ins );
|
||||
if ( result )
|
||||
goto Exit;
|
||||
|
||||
NextGlyph:
|
||||
;
|
||||
}
|
||||
|
||||
Exit:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Bool )
|
||||
FT_Face_CheckTrueTypePatents( FT_Face face )
|
||||
{
|
||||
FT_Bool result = FALSE;
|
||||
|
||||
|
||||
if ( face && FT_IS_SFNT( face ) )
|
||||
result = _tt_face_check_patents( face );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Bool )
|
||||
FT_Face_SetUnpatentedHinting( FT_Face face,
|
||||
FT_Bool value )
|
||||
{
|
||||
FT_Bool result = FALSE;
|
||||
|
||||
|
||||
#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
|
||||
!defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )
|
||||
if ( face && FT_IS_SFNT( face ) )
|
||||
{
|
||||
result = !face->internal->ignore_unpatented_hinter;
|
||||
face->internal->ignore_unpatented_hinter = !value;
|
||||
}
|
||||
#else
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( value );
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -27,16 +27,16 @@
|
||||
/* 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 `freetype/builds/<system>', and */
|
||||
/* contains system-specific files that are always included first when */
|
||||
/* building the library. */
|
||||
/* The build directory is usually `builds/<system>', and contains */
|
||||
/* system-specific files that are always included first when building */
|
||||
/* the library. */
|
||||
/* */
|
||||
/* This ANSI version should stay in `include/freetype/config'. */
|
||||
/* This ANSI version should stay in `include/config/'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef __FTCONFIG_H__
|
||||
#define __FTCONFIG_H__
|
||||
#ifndef FTCONFIG_H_
|
||||
#define FTCONFIG_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
@ -53,7 +53,7 @@ FT_BEGIN_HEADER
|
||||
/* These macros can be toggled to suit a specific system. The current */
|
||||
/* ones are defaults used to compile FreeType in an ANSI C environment */
|
||||
/* (16bit compilers are also supported). Copy this file to your own */
|
||||
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
|
||||
/* `builds/<system>' directory, and edit it to port the engine. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -266,6 +266,21 @@ FT_BEGIN_HEADER
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A 64-bit data type may create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */
|
||||
/* types if __STDC__ is defined. You can however ignore this rule */
|
||||
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
@ -300,178 +315,35 @@ FT_BEGIN_HEADER
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* __STDC_VERSION__ >= 199901L */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A 64-bit data type will create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
|
||||
/* is defined. You can however ignore this rule by defining the */
|
||||
/* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#ifdef __STDC__
|
||||
|
||||
/* undefine the 64-bit macros in strict ANSI compilation mode */
|
||||
#undef FT_LONG64
|
||||
#undef FT_INT64
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
|
||||
|
||||
#ifdef FT_LONG64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* miscellaneous */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||
/* Provide assembler fragments for performance-critical functions. */
|
||||
/* These must be defined `static __inline__' with GCC. */
|
||||
|
||||
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
|
||||
#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 )
|
||||
{
|
||||
register FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm
|
||||
{
|
||||
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
|
||||
mov a, t, asr #31 /* a = (hi >> 31) */
|
||||
add a, a, #0x8000 /* a += 0x8000 */
|
||||
adds t2, t2, a /* t2 += a */
|
||||
adc t, t, #0 /* t += carry */
|
||||
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( __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 )
|
||||
{
|
||||
register FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
|
||||
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
|
||||
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
"adds %1, %1, %0\n\t" /* %1 += %0 */
|
||||
"adc %2, %2, #0\n\t" /* %2 += carry */
|
||||
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
|
||||
"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
|
||||
: "=r"(a), "=&r"(t2), "=&r"(t)
|
||||
: "r"(a), "r"(b)
|
||||
: "cc" );
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
|
||||
|
||||
#if defined( __i386__ )
|
||||
#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 )
|
||||
{
|
||||
register FT_Int32 result;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"imul %%edx\n"
|
||||
"movl %%edx, %%ecx\n"
|
||||
"sarl $31, %%ecx\n"
|
||||
"addl $0x8000, %%ecx\n"
|
||||
"addl %%ecx, %%eax\n"
|
||||
"adcl $0, %%edx\n"
|
||||
"shrl $16, %%eax\n"
|
||||
"shll $16, %%edx\n"
|
||||
"addl %%edx, %%eax\n"
|
||||
: "=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 )
|
||||
{
|
||||
register FT_Int32 result;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a
|
||||
mov edx, b
|
||||
imul edx
|
||||
mov ecx, edx
|
||||
sar ecx, 31
|
||||
add ecx, 8000h
|
||||
add eax, ecx
|
||||
adc edx, 0
|
||||
shr eax, 16
|
||||
shl edx, 16
|
||||
add eax, edx
|
||||
mov result, eax
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* _M_IX86 */
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
|
||||
#ifdef FT_MULFIX_ASSEMBLER
|
||||
#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
|
||||
#endif
|
||||
/* typeof condition taken from gnulib's `intprops.h' header file */
|
||||
#if ( __GNUC__ >= 2 || \
|
||||
defined( __IBM__TYPEOF__ ) || \
|
||||
( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
|
||||
#define FT_TYPEOF( type ) (__typeof__ (type))
|
||||
#else
|
||||
#define FT_TYPEOF( type ) /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
@ -492,6 +364,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
#define FT_LOCAL_ARRAY( x ) extern const x
|
||||
#define FT_LOCAL_ARRAY_DEF( x ) const x
|
||||
|
||||
|
||||
#ifndef FT_BASE
|
||||
|
||||
@ -592,7 +467,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCONFIG_H__ */
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2008, 2010, 2012, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -15,8 +15,8 @@
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __FT_HEADER_H__
|
||||
#define __FT_HEADER_H__
|
||||
#ifndef FTHEADER_H_
|
||||
#define FTHEADER_H_
|
||||
|
||||
|
||||
/*@***********************************************************************/
|
||||
@ -710,14 +710,16 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_XFREE86_H
|
||||
* FT_FONT_FORMATS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which provides functions specific to the XFree86 and
|
||||
* X.Org X11 servers.
|
||||
* FreeType~2 API which provides functions specific to font formats.
|
||||
*/
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
|
||||
|
||||
/* deprecated */
|
||||
#define FT_XFREE86_H FT_FONT_FORMATS_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
@ -751,8 +753,7 @@
|
||||
* FT_UNPATENTED_HINTING_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
* Deprecated.
|
||||
*/
|
||||
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
|
||||
|
||||
@ -764,7 +765,7 @@
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
* FreeType~2 API which performs incremental glyph loading.
|
||||
*/
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
@ -817,7 +818,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Include internal headers definitions from <freetype/internal/...>
|
||||
* Include internal headers definitions from <internal/...>
|
||||
* only when building the library.
|
||||
*/
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
@ -826,7 +827,7 @@
|
||||
#endif /* FT2_BUILD_LIBRARY */
|
||||
|
||||
|
||||
#endif /* __FT2_BUILD_H__ */
|
||||
#endif /* FTHEADER_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOPTION_H__
|
||||
#define __FTOPTION_H__
|
||||
#ifndef FTOPTION_H_
|
||||
#define FTOPTION_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
|
||||
/* that are statically linked to the library at compile time. By */
|
||||
/* default, this file is <freetype/config/ftmodule.h>. */
|
||||
/* */
|
||||
/* We highly recommend using the third method whenever possible. */
|
||||
/* We highly recommend using the third method whenever possible. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -148,7 +148,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_LZW
|
||||
/* #define FT_CONFIG_OPTION_USE_LZW */ // -GODOT-
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -163,7 +163,7 @@ FT_BEGIN_HEADER
|
||||
/* Define this macro if you want to enable this `feature'. See also */
|
||||
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_ZLIB
|
||||
/* #define FT_CONFIG_OPTION_USE_ZLIB */ // -GODOT-
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -216,7 +216,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* PNG bitmap support. */
|
||||
/* PNG bitmap support. */
|
||||
/* */
|
||||
/* FreeType now handles loading color bitmap glyphs in the PNG format. */
|
||||
/* This requires help from the external libpng library. Uncompressed */
|
||||
@ -228,6 +228,19 @@ FT_BEGIN_HEADER
|
||||
/* #define FT_CONFIG_OPTION_USE_PNG */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* HarfBuzz support. */
|
||||
/* */
|
||||
/* FreeType uses the HarfBuzz library to improve auto-hinting of */
|
||||
/* OpenType fonts. If available, many glyphs not directly addressable */
|
||||
/* by a font's character map will be hinted also. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
@ -365,10 +378,6 @@ FT_BEGIN_HEADER
|
||||
/* The size in bytes of the render pool used by the scan-line converter */
|
||||
/* to do all of its work. */
|
||||
/* */
|
||||
/* This must be greater than 4KByte if you use FreeType to rasterize */
|
||||
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
|
||||
/* allocation of the render pool. */
|
||||
/* */
|
||||
#define FT_RENDER_POOL_SIZE 16384L
|
||||
|
||||
|
||||
@ -422,6 +431,8 @@ FT_BEGIN_HEADER
|
||||
/* af_glyph_hints_dump_points */
|
||||
/* af_glyph_hints_dump_segments */
|
||||
/* af_glyph_hints_dump_edges */
|
||||
/* af_glyph_hints_get_num_segments */
|
||||
/* af_glyph_hints_get_segment_offset */
|
||||
/* */
|
||||
/* As an argument, they use another global variable: */
|
||||
/* */
|
||||
@ -528,7 +539,7 @@ FT_BEGIN_HEADER
|
||||
/* does not contain any glyph name though. */
|
||||
/* */
|
||||
/* Accessing SFNT names is done through the functions declared in */
|
||||
/* `freetype/ftsnames.h'. */
|
||||
/* `ftsnames.h'. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_SFNT_NAMES
|
||||
|
||||
@ -575,86 +586,53 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
|
||||
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
|
||||
/* replaces the native TrueType hinting mechanism when anything but */
|
||||
/* FT_RENDER_MODE_MONO is requested. */
|
||||
/* subpixel hinting support into the TrueType driver. This modifies the */
|
||||
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
|
||||
/* requested. */
|
||||
/* */
|
||||
/* Enabling this causes the TrueType driver to ignore instructions under */
|
||||
/* certain conditions. This is done in accordance with the guide here, */
|
||||
/* with some minor differences: */
|
||||
/* In particular, it modifies the bytecode interpreter to interpret (or */
|
||||
/* not) instructions in a certain way so that all TrueType fonts look */
|
||||
/* like they do in a Windows ClearType (DirectWrite) environment. See */
|
||||
/* [1] for a technical overview on what this means. See `ttinterp.h' */
|
||||
/* for more details on the LEAN option. */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
|
||||
/* There are three options. */
|
||||
/* */
|
||||
/* By undefining this, you only compile the code necessary to hint */
|
||||
/* TrueType glyphs with native TT hinting. */
|
||||
/* 1. This option is associated with the `Infinality' moniker. */
|
||||
/* Contributed by an individual nicknamed Infinality with the goal of */
|
||||
/* making TrueType fonts render better than on Windows. A high */
|
||||
/* amount of configurability and flexibility, down to rules for */
|
||||
/* single glyphs in fonts, but also very slow. Its experimental and */
|
||||
/* slow nature and the original developer losing interest meant that */
|
||||
/* this option was never enabled in default builds. */
|
||||
/* */
|
||||
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
|
||||
/* defined. */
|
||||
/* 2. The new default mode for the TrueType driver. The Infinality code */
|
||||
/* base was stripped to the bare minimum and all configurability */
|
||||
/* removed in the name of speed and simplicity. The configurability */
|
||||
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
|
||||
/* Courier. Legacy fonts are fonts that modify vertical stems to */
|
||||
/* achieve clean black-and-white bitmaps. The new mode focuses on */
|
||||
/* applying a minimal set of rules to all fonts indiscriminately so */
|
||||
/* that modern and web fonts render well while legacy fonts render */
|
||||
/* okay. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* 3. Compile both. */
|
||||
/* */
|
||||
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
|
||||
/* of the TrueType bytecode interpreter is used that doesn't implement */
|
||||
/* any of the patented opcodes and algorithms. The patents related to */
|
||||
/* TrueType hinting have expired worldwide since May 2010; this option */
|
||||
/* is now deprecated. */
|
||||
/* By undefining these, you get rendering behavior like on Windows */
|
||||
/* without ClearType, i.e., Windows XP without ClearType enabled and */
|
||||
/* Win9x (interpreter version v35). Or not, depending on how much */
|
||||
/* hinting blood and testing tears the font designer put into a given */
|
||||
/* font. If you define one or both subpixel hinting options, you can */
|
||||
/* switch between between v35 and the ones you define. */
|
||||
/* */
|
||||
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
|
||||
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
|
||||
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
|
||||
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
|
||||
/* defined. */
|
||||
/* */
|
||||
/* This macro is only useful for a small number of font files (mostly */
|
||||
/* for Asian scripts) that require bytecode interpretation to properly */
|
||||
/* load glyphs. For all other fonts, this produces unpleasant results, */
|
||||
/* thus the unpatented interpreter is never used to load glyphs from */
|
||||
/* TrueType fonts unless one of the following two options is used. */
|
||||
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
|
||||
/* */
|
||||
/* - The unpatented interpreter is explicitly activated by the user */
|
||||
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
|
||||
/* when opening the FT_Face. */
|
||||
/* */
|
||||
/* - FreeType detects that the FT_Face corresponds to one of the */
|
||||
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
|
||||
/* contains a hard-coded list of font names and other matching */
|
||||
/* parameters (see function `tt_face_init' in file */
|
||||
/* `src/truetype/ttobjs.c'). */
|
||||
/* */
|
||||
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Parameter parameter; */
|
||||
/* FT_Open_Args open_args; */
|
||||
/* */
|
||||
/* */
|
||||
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
|
||||
/* */
|
||||
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
|
||||
/* open_args.pathname = my_font_pathname; */
|
||||
/* open_args.num_params = 1; */
|
||||
/* open_args.params = ¶meter; */
|
||||
/* */
|
||||
/* error = FT_Open_Face( library, &open_args, index, &face ); */
|
||||
/* ... */
|
||||
/* } */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
|
||||
/* bytecode interpreter with a huge switch statement, rather than a call */
|
||||
/* table. This results in smaller and faster code for a number of */
|
||||
/* architectures. */
|
||||
/* */
|
||||
/* Note however that on some compiler/processor combinations, undefining */
|
||||
/* this macro will generate faster, though larger, code. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
|
||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
|
||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
|
||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -671,7 +649,7 @@ FT_BEGIN_HEADER
|
||||
/* fonts will not have them. */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/otspec/glyf.htm */
|
||||
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
|
||||
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
|
||||
/* */
|
||||
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
|
||||
|
||||
@ -694,6 +672,24 @@ FT_BEGIN_HEADER
|
||||
#define TT_CONFIG_OPTION_BDF
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */
|
||||
/* number of bytecode instructions executed for a single run of the */
|
||||
/* bytecode interpreter, needed to prevent infinite loops. You don't */
|
||||
/* want to change this except for very special situations (e.g., making */
|
||||
/* a library fuzzer spend less time to handle broken fonts). */
|
||||
/* */
|
||||
/* It is not expected that this value is ever modified by a configuring */
|
||||
/* script; instead, it gets surrounded with #ifndef ... #endif so that */
|
||||
/* the value can be set as a preprocessor option on the compiler's */
|
||||
/* command line. */
|
||||
/* */
|
||||
#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES
|
||||
#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
@ -758,6 +754,30 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
|
||||
/* possible to set up the default values of the four control points that */
|
||||
/* define the stem darkening behaviour of the (new) CFF engine. For */
|
||||
/* more details please read the documentation of the */
|
||||
/* `darkening-parameters' property of the cff driver module (file */
|
||||
/* `ftcffdrv.h'), which allows the control at run-time. */
|
||||
/* */
|
||||
/* Do *not* undefine these macros! */
|
||||
/* */
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
|
||||
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
|
||||
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
|
||||
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
|
||||
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
|
||||
@ -765,7 +785,7 @@ FT_BEGIN_HEADER
|
||||
/* switch between the two engines using the `hinting-engine' property of */
|
||||
/* the cff driver module. */
|
||||
/* */
|
||||
#define CFF_CONFIG_OPTION_OLD_ENGINE
|
||||
/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -798,36 +818,72 @@ FT_BEGIN_HEADER
|
||||
/* grid. To find out the optimal scaling and shifting value, various */
|
||||
/* parameter combinations are tried and scored. */
|
||||
/* */
|
||||
/* This experimental option is only active if the render mode is */
|
||||
/* FT_RENDER_MODE_LIGHT. */
|
||||
/* This experimental option is active only if the rendering mode is */
|
||||
/* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
|
||||
/* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
|
||||
/* information; by default it is switched off). */
|
||||
/* */
|
||||
/* #define AF_CONFIG_OPTION_USE_WARPER */
|
||||
#define AF_CONFIG_OPTION_USE_WARPER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*
|
||||
* This macro is obsolete. Support has been removed in FreeType
|
||||
* version 2.5.
|
||||
* This macro is obsolete. Support has been removed in FreeType
|
||||
* version 2.5.
|
||||
*/
|
||||
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
* This macro is defined if either unpatented or native TrueType
|
||||
* hinting is requested by the definitions above.
|
||||
* This macro is defined if native TrueType hinting is requested by the
|
||||
* definitions above.
|
||||
*/
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
|
||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
|
||||
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
||||
#endif
|
||||
|
||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
|
||||
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Check CFF darkening parameters. The checks are the same as in function
|
||||
* `cff_property_set' in file `cffdrivr.c'.
|
||||
*/
|
||||
#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
|
||||
\
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
|
||||
\
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
|
||||
\
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
|
||||
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
|
||||
#error "Invalid CFF darkening parameters!"
|
||||
#endif
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTOPTION_H__ */
|
||||
#endif /* FTOPTION_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -5,7 +5,7 @@
|
||||
/* ANSI-specific library and header configuration file (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 2002-2007, 2009, 2011-2012 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -23,14 +23,13 @@
|
||||
/* FreeType normally requires. It also defines macros to rename the */
|
||||
/* standard functions within the FreeType source code. */
|
||||
/* */
|
||||
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
|
||||
/* it. */
|
||||
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSTDLIB_H__
|
||||
#define __FTSTDLIB_H__
|
||||
#ifndef FTSTDLIB_H_
|
||||
#define FTSTDLIB_H_
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
@ -64,6 +63,8 @@
|
||||
#define FT_INT_MAX INT_MAX
|
||||
#define FT_INT_MIN INT_MIN
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_LONG_MIN LONG_MIN
|
||||
#define FT_LONG_MAX LONG_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
|
||||
|
||||
@ -141,8 +142,7 @@
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_atol atol
|
||||
#define ft_labs labs
|
||||
#define ft_atol atol
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
@ -168,7 +168,7 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#endif /* __FTSTDLIB_H__ */
|
||||
#endif /* FTSTDLIB_H_ */
|
||||
|
||||
|
||||
/* END */
|
798
drivers/freetype/freetype/include/freetype/freetype.h → drivers/freetype/include/freetype/freetype.h
798
drivers/freetype/freetype/include/freetype/freetype.h → drivers/freetype/include/freetype/freetype.h
File diff suppressed because it is too large
Load Diff
21
drivers/freetype/freetype/include/freetype/ftadvanc.h → drivers/freetype/include/freetype/ftadvanc.h
21
drivers/freetype/freetype/include/freetype/ftadvanc.h → drivers/freetype/include/freetype/ftadvanc.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Quick computation of advance widths (specification only). */
|
||||
/* */
|
||||
/* Copyright 2008, 2013 by */
|
||||
/* Copyright 2008-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTADVANC_H__
|
||||
#define __FTADVANC_H__
|
||||
#ifndef FTADVANC_H_
|
||||
#define FTADVANC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -48,6 +48,11 @@ FT_BEGIN_HEADER
|
||||
* @description:
|
||||
* This section contains functions to quickly extract advance values
|
||||
* without handling glyph outlines, if possible.
|
||||
*
|
||||
* @order:
|
||||
* FT_Get_Advance
|
||||
* FT_Get_Advances
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -64,15 +69,15 @@ FT_BEGIN_HEADER
|
||||
/* corresponding hinting mode or font driver doesn't allow for very */
|
||||
/* quick advance computation. */
|
||||
/* */
|
||||
/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
|
||||
/* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
|
||||
/* or light-hinted can have their advance width computed very */
|
||||
/* quickly. */
|
||||
/* */
|
||||
/* Normal and bytecode hinted modes, which require loading, scaling, */
|
||||
/* Normal and bytecode hinted modes that require loading, scaling, */
|
||||
/* and hinting of the glyph outline, are extremely slow by */
|
||||
/* comparison. */
|
||||
/* */
|
||||
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
|
||||
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -171,12 +176,12 @@ FT_BEGIN_HEADER
|
||||
FT_Int32 load_flags,
|
||||
FT_Fixed *padvances );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTADVANC_H__ */
|
||||
#endif /* FTADVANC_H_ */
|
||||
|
||||
|
||||
/* END */
|
184
drivers/freetype/freetype/include/freetype/ftautoh.h → drivers/freetype/include/freetype/ftautoh.h
184
drivers/freetype/freetype/include/freetype/ftautoh.h → drivers/freetype/include/freetype/ftautoh.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for controlling the auto-hinter (specification only). */
|
||||
/* */
|
||||
/* Copyright 2012, 2013 by */
|
||||
/* Copyright 2012-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTAUTOH_H__
|
||||
#define __FTAUTOH_H__
|
||||
#ifndef FTAUTOH_H_
|
||||
#define FTAUTOH_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -79,7 +79,7 @@ FT_BEGIN_HEADER
|
||||
* sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
|
||||
* array with `num_glyphs' elements, as found in the font's @FT_Face
|
||||
* structure. The `glyph-to-script-map' property returns a pointer to
|
||||
* this array which can be modified as needed. Note that the
|
||||
* this array, which can be modified as needed. Note that the
|
||||
* modification should happen before the first glyph gets processed by
|
||||
* the auto-hinter so that the global analysis of the font shapes
|
||||
* actually uses the modified mapping.
|
||||
@ -219,8 +219,8 @@ FT_BEGIN_HEADER
|
||||
* U+0F00 - U+0FFF // Tibetan
|
||||
* U+1900 - U+194F // Limbu
|
||||
* U+1B80 - U+1BBF // Sundanese
|
||||
* U+1C80 - U+1CDF // Meetei Mayak
|
||||
* U+A800 - U+A82F // Syloti Nagri
|
||||
* U+ABC0 - U+ABFF // Meetei Mayek
|
||||
* U+11800 - U+118DF // Sharada
|
||||
* }
|
||||
*
|
||||
@ -245,12 +245,12 @@ FT_BEGIN_HEADER
|
||||
* The data exchange structure for the @glyph-to-script-map property.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Prop_GlyphToScriptMap_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_Byte* map;
|
||||
typedef struct FT_Prop_GlyphToScriptMap_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_UShort* map;
|
||||
|
||||
} FT_Prop_GlyphToScriptMap;
|
||||
} FT_Prop_GlyphToScriptMap;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
@ -282,12 +282,57 @@ FT_BEGIN_HEADER
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
* It's important to use the right timing for changing this value: The
|
||||
* creation of the glyph-to-script map which eventually uses the
|
||||
* creation of the glyph-to-script map that eventually uses the
|
||||
* fallback script value gets triggered either by setting or reading a
|
||||
* face-specific property like @glyph-to-script-map, or by auto-hinting
|
||||
* any glyph from that face. In particular, if you have already created
|
||||
* an @FT_Face structure but not loaded any glyph (using the
|
||||
* auto-hinter), a change of the fallback glyph will affect this face.
|
||||
* auto-hinter), a change of the fallback script will affect this face.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* default-script
|
||||
*
|
||||
* @description:
|
||||
* *Experimental* *only*
|
||||
*
|
||||
* If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
|
||||
* the HarfBuzz library access OpenType features for getting better
|
||||
* glyph coverages, this property sets the (auto-fitter) script to be
|
||||
* used for the default (OpenType) script data of a font's GSUB table.
|
||||
* Features for the default script are intended for all scripts not
|
||||
* explicitly handled in GSUB; an example is a `dlig' feature,
|
||||
* containing the combination of the characters `T', `E', and `L' to
|
||||
* form a `TEL' ligature.
|
||||
*
|
||||
* By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
|
||||
* `default-script' property, this default value can be changed.
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "autofitter",
|
||||
* "default-script", &default_script );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
* It's important to use the right timing for changing this value: The
|
||||
* creation of the glyph-to-script map that eventually uses the
|
||||
* default script value gets triggered either by setting or reading a
|
||||
* face-specific property like @glyph-to-script-map, or by auto-hinting
|
||||
* any glyph from that face. In particular, if you have already created
|
||||
* an @FT_Face structure but not loaded any glyph (using the
|
||||
* auto-hinter), a change of the default script will affect this face.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -339,19 +384,120 @@ FT_BEGIN_HEADER
|
||||
* The data exchange structure for the @increase-x-height property.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_Prop_IncreaseXHeight_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_UInt limit;
|
||||
typedef struct FT_Prop_IncreaseXHeight_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_UInt limit;
|
||||
|
||||
} FT_Prop_IncreaseXHeight;
|
||||
} FT_Prop_IncreaseXHeight;
|
||||
|
||||
|
||||
/* */
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* warping
|
||||
*
|
||||
* @description:
|
||||
* *Experimental* *only*
|
||||
*
|
||||
* If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to
|
||||
* activate the warp hinting code in the auto-hinter, this property
|
||||
* switches warping on and off.
|
||||
*
|
||||
* Warping only works in `light' auto-hinting mode. The idea of the
|
||||
* code is to slightly scale and shift a glyph along the non-hinted
|
||||
* dimension (which is usually the horizontal axis) so that as much of
|
||||
* its segments are aligned (more or less) to the grid. To find out a
|
||||
* glyph's optimal scaling and shifting value, various parameter
|
||||
* combinations are tried and scored.
|
||||
*
|
||||
* By default, warping is off. The example below shows how to switch on
|
||||
* warping (omitting the error handling).
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Bool warping = 1;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "autofitter",
|
||||
* "warping", &warping );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
* The warping code can also change advance widths. Have a look at the
|
||||
* `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
|
||||
* for details on improving inter-glyph distances while rendering.
|
||||
*
|
||||
* Since warping is a global property of the auto-hinter it is best to
|
||||
* change its value before rendering any face. Otherwise, you should
|
||||
* reload all faces that get auto-hinted in `light' hinting mode.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* no-stem-darkening[autofit]
|
||||
*
|
||||
* @description:
|
||||
* *Experimental* *only,* *requires* *linear* *alpha* *blending* *and*
|
||||
* *gamma* *correction*
|
||||
*
|
||||
* Stem darkening emboldens glyphs at smaller sizes to make them more
|
||||
* readable on common low-DPI screens when using linear alpha blending
|
||||
* and gamma correction, see @FT_Render_Glyph. When not using linear
|
||||
* alpha blending and gamma correction, glyphs will appear heavy and
|
||||
* fuzzy!
|
||||
*
|
||||
* Gamma correction essentially lightens fonts since shades of grey are
|
||||
* shifted to higher pixel values (=~higher brightness) to match the
|
||||
* original intention to the reality of our screens. The side-effect is
|
||||
* that glyphs `thin out'. Mac OS~X and Adobe's proprietary font
|
||||
* rendering library implement a counter-measure: stem darkening at
|
||||
* smaller sizes where shades of gray dominate. By emboldening a glyph
|
||||
* slightly in relation to its pixel size, individual pixels get higher
|
||||
* coverage of filled-in outlines and are therefore `blacker'. This
|
||||
* counteracts the `thinning out' of glyphs, making text remain readable
|
||||
* at smaller sizes. All glyphs that pass through the auto-hinter will
|
||||
* be emboldened unless this property is set to TRUE.
|
||||
*
|
||||
* See the description of the CFF driver for algorithmic details. Total
|
||||
* consistency with the CFF driver is currently not achieved because the
|
||||
* emboldening method differs and glyphs must be scaled down on the
|
||||
* Y-axis to keep outline points inside their precomputed blue zones.
|
||||
* The smaller the size (especially 9ppem and down), the higher the loss
|
||||
* of emboldening versus the CFF driver.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* darkening-parameters[autofit]
|
||||
*
|
||||
* @description:
|
||||
* *Experimental* *only*
|
||||
*
|
||||
* See the description of the CFF driver for details. This
|
||||
* implementation appropriates the
|
||||
* CFF_CONFIG_OPTION_DARKENING_PARAMETER_* #defines for consistency.
|
||||
* Note the differences described in @no-stem-darkening[autofit].
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTAUTOH_H__ */
|
||||
#endif /* FTAUTOH_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType exact bbox computation (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2007, 2011 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -27,8 +27,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBBOX_H__
|
||||
#define __FTBBOX_H__
|
||||
#ifndef FTBBOX_H_
|
||||
#define FTBBOX_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -60,7 +60,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Compute the exact bounding box of an outline. This is slower */
|
||||
/* than computing the control box. However, it uses an advanced */
|
||||
/* algorithm which returns _very_ quickly when the two boxes */
|
||||
/* algorithm that returns _very_ quickly when the two boxes */
|
||||
/* coincide. Otherwise, the outline Bézier arcs are traversed to */
|
||||
/* extract their extrema. */
|
||||
/* */
|
||||
@ -78,20 +78,19 @@ FT_BEGIN_HEADER
|
||||
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
|
||||
/* reasonable values for the BBox it is necessary to load the glyph */
|
||||
/* at a large ppem value (so that the hinting instructions can */
|
||||
/* properly shift and scale the subglyphs), then extracting the BBox */
|
||||
/* properly shift and scale the subglyphs), then extracting the BBox, */
|
||||
/* which can be eventually converted back to font units. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Get_BBox( FT_Outline* outline,
|
||||
FT_BBox *abbox );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBBOX_H__ */
|
||||
#endif /* FTBBOX_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing BDF-specific strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBDF_H__
|
||||
#define __FTBDF_H__
|
||||
#ifndef FTBDF_H_
|
||||
#define FTBDF_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -53,7 +53,7 @@ FT_BEGIN_HEADER
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_PropertyType
|
||||
* BDF_PropertyType
|
||||
*
|
||||
* @description:
|
||||
* A list of BDF property types.
|
||||
@ -106,7 +106,8 @@ FT_BEGIN_HEADER
|
||||
* The property type.
|
||||
*
|
||||
* u.atom ::
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
|
||||
* NULL, indicating an empty string.
|
||||
*
|
||||
* u.integer ::
|
||||
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
|
||||
@ -199,11 +200,11 @@ FT_BEGIN_HEADER
|
||||
const char* prop_name,
|
||||
BDF_PropertyRec *aproperty );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBDF_H__ */
|
||||
#endif /* FTBDF_H_ */
|
||||
|
||||
|
||||
/* END */
|
27
drivers/freetype/freetype/include/freetype/ftbitmap.h → drivers/freetype/include/freetype/ftbitmap.h
27
drivers/freetype/freetype/include/freetype/ftbitmap.h → drivers/freetype/include/freetype/ftbitmap.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType utility functions for bitmaps (specification). */
|
||||
/* */
|
||||
/* Copyright 2004-2006, 2008, 2013 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBITMAP_H__
|
||||
#define __FTBITMAP_H__
|
||||
#ifndef FTBITMAP_H_
|
||||
#define FTBITMAP_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -45,7 +45,9 @@ FT_BEGIN_HEADER
|
||||
/* Handling FT_Bitmap objects. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains functions for converting FT_Bitmap objects. */
|
||||
/* This section contains functions for handling @FT_Bitmap objects. */
|
||||
/* Note that none of the functions changes the bitmap's `flow' (as */
|
||||
/* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -53,7 +55,7 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_New */
|
||||
/* FT_Bitmap_Init */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initialize a pointer to an @FT_Bitmap structure. */
|
||||
@ -61,6 +63,14 @@ FT_BEGIN_HEADER
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the bitmap structure. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* A deprecated name for the same function is `FT_Bitmap_New'. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Bitmap_Init( FT_Bitmap *abitmap );
|
||||
|
||||
|
||||
/* deprecated */
|
||||
FT_EXPORT( void )
|
||||
FT_Bitmap_New( FT_Bitmap *abitmap );
|
||||
|
||||
@ -122,6 +132,9 @@ FT_BEGIN_HEADER
|
||||
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
||||
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
|
||||
/* */
|
||||
/* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
|
||||
/* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Embolden( FT_Library library,
|
||||
FT_Bitmap* bitmap,
|
||||
@ -197,7 +210,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Bitmap_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroy a bitmap object created with @FT_Bitmap_New. */
|
||||
/* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
@ -221,7 +234,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBITMAP_H__ */
|
||||
#endif /* FTBITMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
10
drivers/freetype/freetype/include/freetype/ftbzip2.h → drivers/freetype/include/freetype/ftbzip2.h
10
drivers/freetype/freetype/include/freetype/ftbzip2.h → drivers/freetype/include/freetype/ftbzip2.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Bzip2-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2010 by */
|
||||
/* Copyright 2010-2016 by */
|
||||
/* Joel Klinghed. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBZIP2_H__
|
||||
#define __FTBZIP2_H__
|
||||
#ifndef FTBZIP2_H_
|
||||
#define FTBZIP2_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -91,12 +91,12 @@ FT_BEGIN_HEADER
|
||||
FT_Stream_OpenBzip2( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBZIP2_H__ */
|
||||
#endif /* FTBZIP2_H_ */
|
||||
|
||||
|
||||
/* END */
|
28
drivers/freetype/freetype/include/freetype/ftcache.h → drivers/freetype/include/freetype/ftcache.h
28
drivers/freetype/freetype/include/freetype/ftcache.h → drivers/freetype/include/freetype/ftcache.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Cache subsystem (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2008, 2010, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCACHE_H__
|
||||
#define __FTCACHE_H__
|
||||
#ifndef FTCACHE_H_
|
||||
#define FTCACHE_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -156,7 +156,7 @@ FT_BEGIN_HEADER
|
||||
* @note:
|
||||
* Never use NULL as a valid @FTC_FaceID.
|
||||
*
|
||||
* Face IDs are passed by the client to the cache manager, which calls,
|
||||
* Face IDs are passed by the client to the cache manager that calls,
|
||||
* when needed, the @FTC_Face_Requester to translate them into new
|
||||
* @FT_Face objects.
|
||||
*
|
||||
@ -209,10 +209,10 @@ FT_BEGIN_HEADER
|
||||
typedef FT_Error
|
||||
(*FTC_Face_Requester)( FTC_FaceID face_id,
|
||||
FT_Library library,
|
||||
FT_Pointer request_data,
|
||||
FT_Pointer req_data,
|
||||
FT_Face* aface );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -667,8 +667,8 @@ FT_BEGIN_HEADER
|
||||
typedef struct FTC_ImageTypeRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_UInt width;
|
||||
FT_UInt height;
|
||||
FT_Int32 flags;
|
||||
|
||||
} FTC_ImageTypeRec;
|
||||
@ -749,7 +749,7 @@ FT_BEGIN_HEADER
|
||||
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
|
||||
/* failure. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* anode :: Used to return the address of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
@ -802,7 +802,7 @@ FT_BEGIN_HEADER
|
||||
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
|
||||
/* failure. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding */
|
||||
/* anode :: Used to return the address of the corresponding */
|
||||
/* cache node after incrementing its reference count */
|
||||
/* (see note below). */
|
||||
/* */
|
||||
@ -957,7 +957,7 @@ FT_BEGIN_HEADER
|
||||
/* <Output> */
|
||||
/* sbit :: A handle to a small bitmap descriptor. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* anode :: Used to return the address of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
@ -1012,7 +1012,7 @@ FT_BEGIN_HEADER
|
||||
/* <Output> */
|
||||
/* sbit :: A handle to a small bitmap descriptor. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding */
|
||||
/* anode :: Used to return the address of the corresponding */
|
||||
/* cache node after incrementing its reference count */
|
||||
/* (see note below). */
|
||||
/* */
|
||||
@ -1046,12 +1046,12 @@ FT_BEGIN_HEADER
|
||||
FTC_SBit *sbit,
|
||||
FTC_Node *anode );
|
||||
|
||||
/* */
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCACHE_H__ */
|
||||
#endif /* FTCACHE_H_ */
|
||||
|
||||
|
||||
/* END */
|
262
drivers/freetype/include/freetype/ftcffdrv.h
Normal file
262
drivers/freetype/include/freetype/ftcffdrv.h
Normal file
@ -0,0 +1,262 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcffdrv.h */
|
||||
/* */
|
||||
/* FreeType API for controlling the CFF driver (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013-2016 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 FTCFFDRV_H_
|
||||
#define FTCFFDRV_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* cff_driver
|
||||
*
|
||||
* @title:
|
||||
* The CFF driver
|
||||
*
|
||||
* @abstract:
|
||||
* Controlling the CFF driver module.
|
||||
*
|
||||
* @description:
|
||||
* While FreeType's CFF driver doesn't expose API functions by itself,
|
||||
* it is possible to control its behaviour with @FT_Property_Set and
|
||||
* @FT_Property_Get. The list below gives the available properties
|
||||
* together with the necessary macros and structures.
|
||||
*
|
||||
* The CFF driver's module name is `cff'.
|
||||
*
|
||||
* *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
|
||||
*
|
||||
* The rasterizer is positioning horizontal features (e.g., ascender
|
||||
* height & x-height, or crossbars) on the pixel grid and minimizing the
|
||||
* amount of antialiasing applied to them, while placing vertical
|
||||
* features (vertical stems) on the pixel grid without hinting, thus
|
||||
* representing the stem position and weight accurately. Sometimes the
|
||||
* vertical stems may be only partially black. In this context,
|
||||
* `antialiasing' means that stems are not positioned exactly on pixel
|
||||
* borders, causing a fuzzy appearance.
|
||||
*
|
||||
* There are two principles behind this approach.
|
||||
*
|
||||
* 1) No hinting in the horizontal direction: Unlike `superhinted'
|
||||
* TrueType, which changes glyph widths to accommodate regular
|
||||
* inter-glyph spacing, Adobe's approach is `faithful to the design' in
|
||||
* representing both the glyph width and the inter-glyph spacing
|
||||
* designed for the font. This makes the screen display as close as it
|
||||
* can be to the result one would get with infinite resolution, while
|
||||
* preserving what is considered the key characteristics of each glyph.
|
||||
* Note that the distances between unhinted and grid-fitted positions at
|
||||
* small sizes are comparable to kerning values and thus would be
|
||||
* noticeable (and distracting) while reading if hinting were applied.
|
||||
*
|
||||
* One of the reasons to not hint horizontally is antialiasing for LCD
|
||||
* screens: The pixel geometry of modern displays supplies three
|
||||
* vertical sub-pixels as the eye moves horizontally across each visible
|
||||
* pixel. On devices where we can be certain this characteristic is
|
||||
* present a rasterizer can take advantage of the sub-pixels to add
|
||||
* increments of weight. In Western writing systems this turns out to
|
||||
* be the more critical direction anyway; the weights and spacing of
|
||||
* vertical stems (see above) are central to Armenian, Cyrillic, Greek,
|
||||
* and Latin type designs. Even when the rasterizer uses greyscale
|
||||
* antialiasing instead of color (a necessary compromise when one
|
||||
* doesn't know the screen characteristics), the unhinted vertical
|
||||
* features preserve the design's weight and spacing much better than
|
||||
* aliased type would.
|
||||
*
|
||||
* 2) Alignment in the vertical direction: Weights and spacing along the
|
||||
* y~axis are less critical; what is much more important is the visual
|
||||
* alignment of related features (like cap-height and x-height). The
|
||||
* sense of alignment for these is enhanced by the sharpness of grid-fit
|
||||
* edges, while the cruder vertical resolution (full pixels instead of
|
||||
* 1/3 pixels) is less of a problem.
|
||||
*
|
||||
* On the technical side, horizontal alignment zones for ascender,
|
||||
* x-height, and other important height values (traditionally called
|
||||
* `blue zones') as defined in the font are positioned independently,
|
||||
* each being rounded to the nearest pixel edge, taking care of
|
||||
* overshoot suppression at small sizes, stem darkening, and scaling.
|
||||
*
|
||||
* Hstems (this is, hint values defined in the font to help align
|
||||
* horizontal features) that fall within a blue zone are said to be
|
||||
* `captured' and are aligned to that zone. Uncaptured stems are moved
|
||||
* in one of four ways, top edge up or down, bottom edge up or down.
|
||||
* Unless there are conflicting hstems, the smallest movement is taken
|
||||
* to minimize distortion.
|
||||
*
|
||||
* @order:
|
||||
* hinting-engine[cff]
|
||||
* no-stem-darkening[cff]
|
||||
* darkening-parameters[cff]
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* hinting-engine[cff]
|
||||
*
|
||||
* @description:
|
||||
* Thanks to Adobe, which contributed a new hinting (and parsing)
|
||||
* engine, an application can select between `freetype' and `adobe' if
|
||||
* compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
|
||||
* macro isn't defined, `hinting-engine' does nothing.
|
||||
*
|
||||
* The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
|
||||
* defined, and `adobe' otherwise.
|
||||
*
|
||||
* The following example code demonstrates how to select Adobe's hinting
|
||||
* engine (omitting the error handling).
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "cff",
|
||||
* "hinting-engine", &hinting_engine );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_CFF_HINTING_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of constants used for the @hinting-engine[cff] property to
|
||||
* select the hinting engine for CFF fonts.
|
||||
*
|
||||
* @values:
|
||||
* FT_CFF_HINTING_FREETYPE ::
|
||||
* Use the old FreeType hinting engine.
|
||||
*
|
||||
* FT_CFF_HINTING_ADOBE ::
|
||||
* Use the hinting engine contributed by Adobe.
|
||||
*
|
||||
*/
|
||||
#define FT_CFF_HINTING_FREETYPE 0
|
||||
#define FT_CFF_HINTING_ADOBE 1
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* no-stem-darkening[cff]
|
||||
*
|
||||
* @description:
|
||||
* By default, the Adobe CFF engine darkens stems at smaller sizes,
|
||||
* regardless of hinting, to enhance contrast. This feature requires
|
||||
* a rendering system with proper gamma correction. Setting this
|
||||
* property, stem darkening gets switched off.
|
||||
*
|
||||
* Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Bool no_stem_darkening = TRUE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "cff",
|
||||
* "no-stem-darkening", &no_stem_darkening );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* darkening-parameters[cff]
|
||||
*
|
||||
* @description:
|
||||
* By default, the Adobe CFF engine darkens stems as follows (if the
|
||||
* `no-stem-darkening' property isn't set):
|
||||
*
|
||||
* {
|
||||
* stem width <= 0.5px: darkening amount = 0.4px
|
||||
* stem width = 1px: darkening amount = 0.275px
|
||||
* stem width = 1.667px: darkening amount = 0.275px
|
||||
* stem width >= 2.333px: darkening amount = 0px
|
||||
* }
|
||||
*
|
||||
* and piecewise linear in-between. At configuration time, these four
|
||||
* control points can be set with the macro
|
||||
* `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'. At runtime, the control
|
||||
* points can be changed using the `darkening-parameters' property, as
|
||||
* the following example demonstrates.
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Int darken_params[8] = { 500, 300, // x1, y1
|
||||
* 1000, 200, // x2, y2
|
||||
* 1500, 100, // x3, y3
|
||||
* 2000, 0 }; // x4, y4
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "cff",
|
||||
* "darkening-parameters", darken_params );
|
||||
* }
|
||||
*
|
||||
* The x~values give the stem width, and the y~values the darkening
|
||||
* amount. The unit is 1000th of pixels. All coordinate values must be
|
||||
* positive; the x~values must be monotonically increasing; the
|
||||
* y~values must be monotonically decreasing and smaller than or
|
||||
* equal to 500 (corresponding to half a pixel); the slope of each
|
||||
* linear piece must be shallower than -1 (e.g., -.4).
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTCFFDRV_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,7 +1,7 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* This file defines the structure of the FreeType reference. */
|
||||
/* It is used by the python script which generates the HTML files. */
|
||||
/* It is used by the python script that generates the HTML files. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
/* General Remarks */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* header_inclusion */
|
||||
/* user_allocation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
@ -118,3 +119,17 @@
|
||||
/* lcd_filtering */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* error_codes */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Error Codes */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* error_enumerations */
|
||||
/* error_code_values */
|
||||
/* */
|
||||
/***************************************************************************/
|
@ -4,7 +4,8 @@
|
||||
/* */
|
||||
/* FreeType API for accessing CID font information (specification). */
|
||||
/* */
|
||||
/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
|
||||
/* Copyright 2007-2016 by */
|
||||
/* Dereg Clegg and Michael Toftdal. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
@ -15,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCID_H__
|
||||
#define __FTCID_H__
|
||||
#ifndef FTCID_H_
|
||||
#define FTCID_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -96,8 +97,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the type of the input face, CID keyed or not. In
|
||||
* constrast to the @FT_IS_CID_KEYED macro this function returns
|
||||
* successfully also for CID-keyed fonts in an SNFT wrapper.
|
||||
* contrast to the @FT_IS_CID_KEYED macro this function returns
|
||||
* successfully also for CID-keyed fonts in an SFNT wrapper.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
@ -156,11 +157,12 @@ FT_BEGIN_HEADER
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt *cid );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCID_H__ */
|
||||
#endif /* FTCID_H_ */
|
||||
|
||||
|
||||
/* END */
|
233
drivers/freetype/freetype/include/freetype/fterrdef.h → drivers/freetype/include/freetype/fterrdef.h
233
drivers/freetype/freetype/include/freetype/fterrdef.h → drivers/freetype/include/freetype/fterrdef.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004, 2006, 2007, 2010-2013 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,234 +16,261 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** LIST OF ERROR CODES/MESSAGES *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* error_code_values */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Error Code Values */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* All possible error codes returned by FreeType functions. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The list below is taken verbatim from the file `fterrdef.h' */
|
||||
/* (loaded automatically by including `FT_FREETYPE_H'). The first */
|
||||
/* argument of the `FT_ERROR_DEF_' macro is the error label; by */
|
||||
/* default, the prefix `FT_Err_' gets added so that you get error */
|
||||
/* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
|
||||
/* the error code, and the last argument an error string, which is not */
|
||||
/* used by FreeType. */
|
||||
/* */
|
||||
/* Within your application you should *only* use error names and */
|
||||
/* *never* its numeric values! The latter might (and actually do) */
|
||||
/* change in forthcoming FreeType versions. */
|
||||
/* */
|
||||
/* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
|
||||
/* See the `Error Enumerations' subsection how to automatically */
|
||||
/* generate a list of error strings. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
|
||||
/* including this file. */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* FT_Err_XXX */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/* generic errors */
|
||||
|
||||
FT_NOERRORDEF_( Ok, 0x00, \
|
||||
FT_NOERRORDEF_( Ok, 0x00,
|
||||
"no error" )
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
|
||||
FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
|
||||
"cannot open resource" )
|
||||
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
|
||||
FT_ERRORDEF_( Unknown_File_Format, 0x02,
|
||||
"unknown file format" )
|
||||
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
|
||||
FT_ERRORDEF_( Invalid_File_Format, 0x03,
|
||||
"broken file" )
|
||||
FT_ERRORDEF_( Invalid_Version, 0x04, \
|
||||
FT_ERRORDEF_( Invalid_Version, 0x04,
|
||||
"invalid FreeType version" )
|
||||
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
|
||||
FT_ERRORDEF_( Lower_Module_Version, 0x05,
|
||||
"module version is too low" )
|
||||
FT_ERRORDEF_( Invalid_Argument, 0x06, \
|
||||
FT_ERRORDEF_( Invalid_Argument, 0x06,
|
||||
"invalid argument" )
|
||||
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
|
||||
FT_ERRORDEF_( Unimplemented_Feature, 0x07,
|
||||
"unimplemented feature" )
|
||||
FT_ERRORDEF_( Invalid_Table, 0x08, \
|
||||
FT_ERRORDEF_( Invalid_Table, 0x08,
|
||||
"broken table" )
|
||||
FT_ERRORDEF_( Invalid_Offset, 0x09, \
|
||||
FT_ERRORDEF_( Invalid_Offset, 0x09,
|
||||
"broken offset within table" )
|
||||
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
|
||||
FT_ERRORDEF_( Array_Too_Large, 0x0A,
|
||||
"array allocation size too large" )
|
||||
FT_ERRORDEF_( Missing_Module, 0x0B, \
|
||||
FT_ERRORDEF_( Missing_Module, 0x0B,
|
||||
"missing module" )
|
||||
FT_ERRORDEF_( Missing_Property, 0x0C, \
|
||||
FT_ERRORDEF_( Missing_Property, 0x0C,
|
||||
"missing property" )
|
||||
|
||||
/* glyph/character errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
|
||||
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
|
||||
"invalid glyph index" )
|
||||
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
|
||||
FT_ERRORDEF_( Invalid_Character_Code, 0x11,
|
||||
"invalid character code" )
|
||||
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
|
||||
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
|
||||
"unsupported glyph image format" )
|
||||
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
|
||||
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
|
||||
"cannot render this glyph format" )
|
||||
FT_ERRORDEF_( Invalid_Outline, 0x14, \
|
||||
FT_ERRORDEF_( Invalid_Outline, 0x14,
|
||||
"invalid outline" )
|
||||
FT_ERRORDEF_( Invalid_Composite, 0x15, \
|
||||
FT_ERRORDEF_( Invalid_Composite, 0x15,
|
||||
"invalid composite glyph" )
|
||||
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
|
||||
FT_ERRORDEF_( Too_Many_Hints, 0x16,
|
||||
"too many hints" )
|
||||
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
|
||||
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
|
||||
"invalid pixel size" )
|
||||
|
||||
/* handle errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Handle, 0x20, \
|
||||
FT_ERRORDEF_( Invalid_Handle, 0x20,
|
||||
"invalid object handle" )
|
||||
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
|
||||
FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
|
||||
"invalid library handle" )
|
||||
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
|
||||
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
|
||||
"invalid module handle" )
|
||||
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
|
||||
FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
|
||||
"invalid face handle" )
|
||||
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
|
||||
FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
|
||||
"invalid size handle" )
|
||||
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
|
||||
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
|
||||
"invalid glyph slot handle" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
|
||||
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
|
||||
"invalid charmap handle" )
|
||||
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
|
||||
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
|
||||
"invalid cache manager handle" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
|
||||
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
|
||||
"invalid stream handle" )
|
||||
|
||||
/* driver errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
|
||||
FT_ERRORDEF_( Too_Many_Drivers, 0x30,
|
||||
"too many modules" )
|
||||
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
|
||||
FT_ERRORDEF_( Too_Many_Extensions, 0x31,
|
||||
"too many extensions" )
|
||||
|
||||
/* memory errors */
|
||||
|
||||
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
|
||||
FT_ERRORDEF_( Out_Of_Memory, 0x40,
|
||||
"out of memory" )
|
||||
FT_ERRORDEF_( Unlisted_Object, 0x41, \
|
||||
FT_ERRORDEF_( Unlisted_Object, 0x41,
|
||||
"unlisted object" )
|
||||
|
||||
/* stream errors */
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
|
||||
FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
|
||||
"cannot open stream" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
|
||||
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
|
||||
"invalid stream seek" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
|
||||
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
|
||||
"invalid stream skip" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
|
||||
FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
|
||||
"invalid stream read" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
|
||||
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
|
||||
"invalid stream operation" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
|
||||
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
|
||||
"invalid frame operation" )
|
||||
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
|
||||
FT_ERRORDEF_( Nested_Frame_Access, 0x57,
|
||||
"nested frame access" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
|
||||
FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
|
||||
"invalid frame read" )
|
||||
|
||||
/* raster errors */
|
||||
|
||||
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
|
||||
FT_ERRORDEF_( Raster_Uninitialized, 0x60,
|
||||
"raster uninitialized" )
|
||||
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
|
||||
FT_ERRORDEF_( Raster_Corrupted, 0x61,
|
||||
"raster corrupted" )
|
||||
FT_ERRORDEF_( Raster_Overflow, 0x62, \
|
||||
FT_ERRORDEF_( Raster_Overflow, 0x62,
|
||||
"raster overflow" )
|
||||
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
|
||||
FT_ERRORDEF_( Raster_Negative_Height, 0x63,
|
||||
"negative height while rastering" )
|
||||
|
||||
/* cache errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
|
||||
FT_ERRORDEF_( Too_Many_Caches, 0x70,
|
||||
"too many registered caches" )
|
||||
|
||||
/* TrueType and SFNT errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
|
||||
FT_ERRORDEF_( Invalid_Opcode, 0x80,
|
||||
"invalid opcode" )
|
||||
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
|
||||
FT_ERRORDEF_( Too_Few_Arguments, 0x81,
|
||||
"too few arguments" )
|
||||
FT_ERRORDEF_( Stack_Overflow, 0x82, \
|
||||
FT_ERRORDEF_( Stack_Overflow, 0x82,
|
||||
"stack overflow" )
|
||||
FT_ERRORDEF_( Code_Overflow, 0x83, \
|
||||
FT_ERRORDEF_( Code_Overflow, 0x83,
|
||||
"code overflow" )
|
||||
FT_ERRORDEF_( Bad_Argument, 0x84, \
|
||||
FT_ERRORDEF_( Bad_Argument, 0x84,
|
||||
"bad argument" )
|
||||
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
|
||||
FT_ERRORDEF_( Divide_By_Zero, 0x85,
|
||||
"division by zero" )
|
||||
FT_ERRORDEF_( Invalid_Reference, 0x86, \
|
||||
FT_ERRORDEF_( Invalid_Reference, 0x86,
|
||||
"invalid reference" )
|
||||
FT_ERRORDEF_( Debug_OpCode, 0x87, \
|
||||
FT_ERRORDEF_( Debug_OpCode, 0x87,
|
||||
"found debug opcode" )
|
||||
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
|
||||
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
|
||||
"found ENDF opcode in execution stream" )
|
||||
FT_ERRORDEF_( Nested_DEFS, 0x89, \
|
||||
FT_ERRORDEF_( Nested_DEFS, 0x89,
|
||||
"nested DEFS" )
|
||||
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
|
||||
FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
|
||||
"invalid code range" )
|
||||
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
|
||||
FT_ERRORDEF_( Execution_Too_Long, 0x8B,
|
||||
"execution context too long" )
|
||||
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
|
||||
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
|
||||
"too many function definitions" )
|
||||
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
|
||||
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
|
||||
"too many instruction definitions" )
|
||||
FT_ERRORDEF_( Table_Missing, 0x8E, \
|
||||
FT_ERRORDEF_( Table_Missing, 0x8E,
|
||||
"SFNT font table missing" )
|
||||
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
|
||||
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
|
||||
"horizontal header (hhea) table missing" )
|
||||
FT_ERRORDEF_( Locations_Missing, 0x90, \
|
||||
FT_ERRORDEF_( Locations_Missing, 0x90,
|
||||
"locations (loca) table missing" )
|
||||
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
|
||||
FT_ERRORDEF_( Name_Table_Missing, 0x91,
|
||||
"name table missing" )
|
||||
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
|
||||
FT_ERRORDEF_( CMap_Table_Missing, 0x92,
|
||||
"character map (cmap) table missing" )
|
||||
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
|
||||
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
|
||||
"horizontal metrics (hmtx) table missing" )
|
||||
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
|
||||
FT_ERRORDEF_( Post_Table_Missing, 0x94,
|
||||
"PostScript (post) table missing" )
|
||||
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
|
||||
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
|
||||
"invalid horizontal metrics" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
|
||||
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
|
||||
"invalid character map (cmap) format" )
|
||||
FT_ERRORDEF_( Invalid_PPem, 0x97, \
|
||||
FT_ERRORDEF_( Invalid_PPem, 0x97,
|
||||
"invalid ppem value" )
|
||||
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
|
||||
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
|
||||
"invalid vertical metrics" )
|
||||
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
|
||||
FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
|
||||
"could not find context" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
|
||||
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
|
||||
"invalid PostScript (post) table format" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
|
||||
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
|
||||
"invalid PostScript (post) table" )
|
||||
|
||||
/* CFF, CID, and Type 1 errors */
|
||||
|
||||
FT_ERRORDEF_( Syntax_Error, 0xA0, \
|
||||
FT_ERRORDEF_( Syntax_Error, 0xA0,
|
||||
"opcode syntax error" )
|
||||
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
|
||||
FT_ERRORDEF_( Stack_Underflow, 0xA1,
|
||||
"argument stack underflow" )
|
||||
FT_ERRORDEF_( Ignore, 0xA2, \
|
||||
FT_ERRORDEF_( Ignore, 0xA2,
|
||||
"ignore" )
|
||||
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
|
||||
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
|
||||
"no Unicode glyph name found" )
|
||||
FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \
|
||||
"glyph to big for hinting" )
|
||||
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
|
||||
"glyph too big for hinting" )
|
||||
|
||||
/* BDF errors */
|
||||
|
||||
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
|
||||
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
|
||||
"`STARTFONT' field missing" )
|
||||
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
|
||||
FT_ERRORDEF_( Missing_Font_Field, 0xB1,
|
||||
"`FONT' field missing" )
|
||||
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
|
||||
FT_ERRORDEF_( Missing_Size_Field, 0xB2,
|
||||
"`SIZE' field missing" )
|
||||
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
|
||||
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
|
||||
"`FONTBOUNDINGBOX' field missing" )
|
||||
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
|
||||
FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
|
||||
"`CHARS' field missing" )
|
||||
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
|
||||
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
|
||||
"`STARTCHAR' field missing" )
|
||||
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
|
||||
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
|
||||
"`ENCODING' field missing" )
|
||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
|
||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
|
||||
"`BBX' field missing" )
|
||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
|
||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
|
||||
"`BBX' too big" )
|
||||
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
|
||||
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
|
||||
"Font header corrupted or missing fields" )
|
||||
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
|
||||
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
|
||||
"Font glyphs corrupted or missing fields" )
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* END */
|
124
drivers/freetype/freetype/include/freetype/fterrors.h → drivers/freetype/include/freetype/fterrors.h
124
drivers/freetype/freetype/include/freetype/fterrors.h → drivers/freetype/include/freetype/fterrors.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType error code handling (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004, 2007, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -18,70 +18,98 @@
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This special header file is used to define the handling of FT2 */
|
||||
/* enumeration constants. It can also be used to generate error message */
|
||||
/* strings with a small macro trick explained below. */
|
||||
/* <Section> */
|
||||
/* error_enumerations */
|
||||
/* */
|
||||
/* I - Error Formats */
|
||||
/* ----------------- */
|
||||
/* <Title> */
|
||||
/* Error Enumerations */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How to handle errors and error strings. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The header file `fterrors.h' (which is automatically included by */
|
||||
/* `freetype.h' defines the handling of FreeType's enumeration */
|
||||
/* constants. It can also be used to generate error message strings */
|
||||
/* with a small macro trick explained below. */
|
||||
/* */
|
||||
/* *Error* *Formats* */
|
||||
/* */
|
||||
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
|
||||
/* defined in ftoption.h in order to make the higher byte indicate */
|
||||
/* defined in `ftoption.h' in order to make the higher byte indicate */
|
||||
/* the module where the error has happened (this is not compatible */
|
||||
/* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
|
||||
/* more details. */
|
||||
/* with standard builds of FreeType 2, however). See the file */
|
||||
/* `ftmoderr.h' for more details. */
|
||||
/* */
|
||||
/* *Error* *Message* *Strings* */
|
||||
/* */
|
||||
/* II - Error Message strings */
|
||||
/* -------------------------- */
|
||||
/* */
|
||||
/* The error definitions below are made through special macros that */
|
||||
/* allow client applications to build a table of error message strings */
|
||||
/* if they need it. The strings are not included in a normal build of */
|
||||
/* FreeType 2 to save space (most client applications do not use */
|
||||
/* them). */
|
||||
/* Error definitions are set up with special macros that allow client */
|
||||
/* applications to build a table of error message strings. The */
|
||||
/* strings are not included in a normal build of FreeType 2 to */
|
||||
/* save space (most client applications do not use them). */
|
||||
/* */
|
||||
/* To do so, you have to define the following macros before including */
|
||||
/* this file: */
|
||||
/* */
|
||||
/* FT_ERROR_START_LIST :: */
|
||||
/* This macro is called before anything else to define the start of */
|
||||
/* the error list. It is followed by several FT_ERROR_DEF calls */
|
||||
/* (see below). */
|
||||
/* */
|
||||
/* FT_ERROR_DEF( e, v, s ) :: */
|
||||
/* This macro is called to define one single error. */
|
||||
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
|
||||
/* `v' is the error numerical value. */
|
||||
/* `s' is the corresponding error string. */
|
||||
/* */
|
||||
/* FT_ERROR_END_LIST :: */
|
||||
/* This macro ends the list. */
|
||||
/* */
|
||||
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
|
||||
/* this file. */
|
||||
/* */
|
||||
/* Here is a simple example: */
|
||||
/* { */
|
||||
/* FT_ERROR_START_LIST */
|
||||
/* } */
|
||||
/* */
|
||||
/* This macro is called before anything else to define the start of */
|
||||
/* the error list. It is followed by several FT_ERROR_DEF calls. */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_ERROR_DEF( e, v, s ) */
|
||||
/* } */
|
||||
/* */
|
||||
/* This macro is called to define one single error. `e' is the error */
|
||||
/* code identifier (e.g., `Invalid_Argument'), `v' is the error's */
|
||||
/* numerical value, and `s' is the corresponding error string. */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_ERROR_END_LIST */
|
||||
/* } */
|
||||
/* */
|
||||
/* This macro ends the list. */
|
||||
/* */
|
||||
/* Additionally, you have to undefine `FTERRORS_H_' before #including */
|
||||
/* this file. */
|
||||
/* */
|
||||
/* Here is a simple example. */
|
||||
/* */
|
||||
/* { */
|
||||
/* #undef FTERRORS_H_ */
|
||||
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
|
||||
/* #define FT_ERROR_START_LIST { */
|
||||
/* #define FT_ERROR_END_LIST { 0, NULL } }; */
|
||||
/* */
|
||||
/* const struct */
|
||||
/* { */
|
||||
/* #undef __FTERRORS_H__ */
|
||||
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
|
||||
/* #define FT_ERROR_START_LIST { */
|
||||
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
|
||||
/* int err_code; */
|
||||
/* const char* err_msg; */
|
||||
/* } ft_errors[] = */
|
||||
/* */
|
||||
/* const struct */
|
||||
/* { */
|
||||
/* int err_code; */
|
||||
/* const char* err_msg; */
|
||||
/* } ft_errors[] = */
|
||||
/* #include FT_ERRORS_H */
|
||||
/* } */
|
||||
/* */
|
||||
/* #include FT_ERRORS_H */
|
||||
/* } */
|
||||
/* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */
|
||||
/* `FT_NOERRORDEF'; it is always zero. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/* */
|
||||
|
||||
#ifndef __FTERRORS_H__
|
||||
/* In previous FreeType versions we used `__FTERRORS_H__'. However, */
|
||||
/* using two successive underscores in a non-system symbol name */
|
||||
/* violates the C (and C++) standard, so it was changed to the */
|
||||
/* current form. In spite of this, we have to make */
|
||||
/* */
|
||||
/* #undefine __FTERRORS_H__ */
|
||||
/* */
|
||||
/* work for backwards compatibility. */
|
||||
/* */
|
||||
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
|
||||
#define FTERRORS_H_
|
||||
#define __FTERRORS_H__
|
||||
|
||||
|
||||
@ -192,7 +220,7 @@
|
||||
#undef FT_ERR_PREFIX
|
||||
#endif
|
||||
|
||||
#endif /* __FTERRORS_H__ */
|
||||
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
|
||||
|
||||
|
||||
/* END */
|
42
drivers/freetype/freetype/include/freetype/ftxf86.h → drivers/freetype/include/freetype/ftfntfmt.h
42
drivers/freetype/freetype/include/freetype/ftxf86.h → drivers/freetype/include/freetype/ftfntfmt.h
@ -1,10 +1,10 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftxf86.h */
|
||||
/* ftfntfmt.h */
|
||||
/* */
|
||||
/* Support functions for X11. */
|
||||
/* Support functions for font formats. */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006, 2007 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTXF86_H__
|
||||
#define __FTXF86_H__
|
||||
#ifndef FTFNTFMT_H_
|
||||
#define FTFNTFMT_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -49,22 +49,20 @@ FT_BEGIN_HEADER
|
||||
/* however, there are special cases (like in PDF devices) where it is */
|
||||
/* important to differentiate, in spite of FreeType's uniform API. */
|
||||
/* */
|
||||
/* This function is in the X11/xf86 namespace for historical reasons */
|
||||
/* and in no way depends on that windowing system. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_X11_Font_Format */
|
||||
/* FT_Get_Font_Format */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return a string describing the format of a given face, using values */
|
||||
/* which can be used as an X11 FONT_PROPERTY. Possible values are */
|
||||
/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
|
||||
/* `PFR', and `Windows~FNT'. */
|
||||
/* Return a string describing the format of a given face. Possible */
|
||||
/* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */
|
||||
/* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */
|
||||
/* */
|
||||
/* The return value is suitable to be used as an X11 FONT_PROPERTY. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: */
|
||||
@ -73,11 +71,25 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* Font format string. NULL in case of error. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* A deprecated name for the same function is */
|
||||
/* `FT_Get_X11_Font_Format'. */
|
||||
/* */
|
||||
FT_EXPORT( const char* )
|
||||
FT_Get_Font_Format( FT_Face face );
|
||||
|
||||
|
||||
/* deprecated */
|
||||
FT_EXPORT( const char* )
|
||||
FT_Get_X11_Font_Format( FT_Face face );
|
||||
|
||||
/* */
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTXF86_H__ */
|
||||
#endif /* FTFNTFMT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Access of TrueType's `gasp' table (specification). */
|
||||
/* */
|
||||
/* Copyright 2007, 2008, 2011 by */
|
||||
/* Copyright 2007-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef _FT_GASP_H_
|
||||
#define _FT_GASP_H_
|
||||
#ifndef FTGASP_H_
|
||||
#define FTGASP_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -120,9 +120,10 @@
|
||||
FT_Get_Gasp( FT_Face face,
|
||||
FT_UInt ppem );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
#endif /* _FT_GASP_H_ */
|
||||
|
||||
#endif /* FTGASP_H_ */
|
||||
|
||||
|
||||
/* END */
|
35
drivers/freetype/freetype/include/freetype/ftglyph.h → drivers/freetype/include/freetype/ftglyph.h
35
drivers/freetype/freetype/include/freetype/ftglyph.h → drivers/freetype/include/freetype/ftglyph.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType convenience functions to handle glyphs (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -29,8 +29,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGLYPH_H__
|
||||
#define __FTGLYPH_H__
|
||||
#ifndef FTGLYPH_H_
|
||||
#define FTGLYPH_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -325,22 +325,8 @@ FT_BEGIN_HEADER
|
||||
} FT_Glyph_BBox_Mode;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* ft_glyph_bbox_xxx */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* These constants are deprecated. Use the corresponding */
|
||||
/* @FT_Glyph_BBox_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
|
||||
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
|
||||
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
|
||||
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
|
||||
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
|
||||
/* */
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `FT_Glyph_BBox_Mode' values instead */
|
||||
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
|
||||
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
|
||||
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
|
||||
@ -358,17 +344,17 @@ FT_BEGIN_HEADER
|
||||
/* outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* that contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
/* and arcs in the outline. To get the latter, you can use the */
|
||||
/* `ftbbox' component which is dedicated to this single task. */
|
||||
/* `ftbbox' component, which is dedicated to this single task. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph :: A handle to the source glyph object. */
|
||||
/* */
|
||||
/* mode :: The mode which indicates how to interpret the returned */
|
||||
/* mode :: The mode that indicates how to interpret the returned */
|
||||
/* bounding box values. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
@ -388,7 +374,7 @@ FT_BEGIN_HEADER
|
||||
/* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
|
||||
/* reasonable values for the CBox it is necessary to load the glyph */
|
||||
/* at a large ppem value (so that the hinting instructions can */
|
||||
/* properly shift and scale the subglyphs), then extracting the CBox */
|
||||
/* properly shift and scale the subglyphs), then extracting the CBox, */
|
||||
/* which can be eventually converted back to font units. */
|
||||
/* */
|
||||
/* Note that the maximum coordinates are exclusive, which means that */
|
||||
@ -603,13 +589,12 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Matrix_Invert( FT_Matrix* matrix );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGLYPH_H__ */
|
||||
#endif /* FTGLYPH_H_ */
|
||||
|
||||
|
||||
/* END */
|
41
drivers/freetype/freetype/include/freetype/ftgxval.h → drivers/freetype/include/freetype/ftgxval.h
41
drivers/freetype/freetype/include/freetype/ftgxval.h → drivers/freetype/include/freetype/ftgxval.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* Masatake YAMATO, Redhat K.K, */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
@ -25,8 +25,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGXVAL_H__
|
||||
#define __FTGXVAL_H__
|
||||
#ifndef FTGXVAL_H_
|
||||
#define FTGXVAL_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -57,9 +57,19 @@ FT_BEGIN_HEADER
|
||||
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
|
||||
/* trak, prop, lcar). */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FT_TrueTypeGX_Validate */
|
||||
/* FT_TrueTypeGX_Free */
|
||||
/* */
|
||||
/* FT_ClassicKern_Validate */
|
||||
/* FT_ClassicKern_Free */
|
||||
/* */
|
||||
/* FT_VALIDATE_GX_LENGTH */
|
||||
/* FT_VALIDATE_GXXXX */
|
||||
/* FT_VALIDATE_CKERNXXX */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* */
|
||||
@ -171,8 +181,6 @@ FT_BEGIN_HEADER
|
||||
FT_VALIDATE_lcar )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
@ -180,7 +188,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Validate various TrueTypeGX tables to assure that all offsets and
|
||||
* indices are valid. The idea is that a higher-level library which
|
||||
* indices are valid. The idea is that a higher-level library that
|
||||
* actually does the text layout can access those tables without
|
||||
* error checking (which can be quite time consuming).
|
||||
*
|
||||
@ -189,7 +197,7 @@ FT_BEGIN_HEADER
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* A bit field that specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_GXXXX for possible values.
|
||||
*
|
||||
* table_length ::
|
||||
@ -221,8 +229,6 @@ FT_BEGIN_HEADER
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
@ -248,8 +254,6 @@ FT_BEGIN_HEADER
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
@ -277,8 +281,6 @@ FT_BEGIN_HEADER
|
||||
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
@ -286,7 +288,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Validate classic (16-bit format) kern table to assure that the offsets
|
||||
* and indices are valid. The idea is that a higher-level library which
|
||||
* and indices are valid. The idea is that a higher-level library that
|
||||
* actually does the text layout can access those tables without error
|
||||
* checking (which can be quite time consuming).
|
||||
*
|
||||
@ -299,7 +301,7 @@ FT_BEGIN_HEADER
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the dialect to be validated. See
|
||||
* A bit field that specifies the dialect to be validated. See
|
||||
* @FT_VALIDATE_CKERNXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
@ -320,8 +322,6 @@ FT_BEGIN_HEADER
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
@ -346,13 +346,12 @@ FT_BEGIN_HEADER
|
||||
FT_ClassicKern_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGXVAL_H__ */
|
||||
#endif /* FTGXVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Gzip-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGZIP_H__
|
||||
#define __FTGZIP_H__
|
||||
#ifndef FTGZIP_H_
|
||||
#define FTGZIP_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -91,12 +91,58 @@ FT_BEGIN_HEADER
|
||||
FT_Stream_OpenGzip( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Gzip_Uncompress
|
||||
*
|
||||
* @description:
|
||||
* Decompress a zipped input buffer into an output buffer. This function
|
||||
* is modeled after zlib's `uncompress' function.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* A FreeType memory handle.
|
||||
*
|
||||
* input ::
|
||||
* The input buffer.
|
||||
*
|
||||
* input_len ::
|
||||
* The length of the input buffer.
|
||||
*
|
||||
* @output:
|
||||
* output::
|
||||
* The output buffer.
|
||||
*
|
||||
* @inout:
|
||||
* output_len ::
|
||||
* Before calling the function, this is the total size of the output
|
||||
* buffer, which must be large enough to hold the entire uncompressed
|
||||
* data (so the size of the uncompressed data must be known in
|
||||
* advance). After calling the function, `output_len' is the size of
|
||||
* the used data in `output'.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function may return `FT_Err_Unimplemented_Feature' if your build
|
||||
* of FreeType was not compiled with zlib support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Gzip_Uncompress( FT_Memory memory,
|
||||
FT_Byte* output,
|
||||
FT_ULong* output_len,
|
||||
const FT_Byte* input,
|
||||
FT_ULong input_len );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGZIP_H__ */
|
||||
#endif /* FTGZIP_H_ */
|
||||
|
||||
|
||||
/* END */
|
252
drivers/freetype/freetype/include/freetype/ftimage.h → drivers/freetype/include/freetype/ftimage.h
252
drivers/freetype/freetype/include/freetype/ftimage.h → drivers/freetype/include/freetype/ftimage.h
@ -5,7 +5,7 @@
|
||||
/* FreeType glyph image formats and default raster interface */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2010, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -24,12 +24,12 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTIMAGE_H__
|
||||
#define __FTIMAGE_H__
|
||||
#ifndef FTIMAGE_H_
|
||||
#define FTIMAGE_H_
|
||||
|
||||
|
||||
/* _STANDALONE_ is from ftgrays.c */
|
||||
#ifndef _STANDALONE_
|
||||
/* STANDALONE_ is from ftgrays.c */
|
||||
#ifndef STANDALONE_
|
||||
#include <ft2build.h>
|
||||
#endif
|
||||
|
||||
@ -193,67 +193,14 @@ FT_BEGIN_HEADER
|
||||
} FT_Pixel_Mode;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* ft_pixel_mode_xxx */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A list of deprecated constants. Use the corresponding */
|
||||
/* @FT_Pixel_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
|
||||
/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
|
||||
/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
|
||||
/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
|
||||
/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
|
||||
/* */
|
||||
/* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */
|
||||
/* values instead. */
|
||||
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
|
||||
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
|
||||
#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
|
||||
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
|
||||
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
|
||||
|
||||
/* */
|
||||
|
||||
#if 0
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* FT_Palette_Mode */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
|
||||
/* */
|
||||
/* An enumeration type to describe the format of a bitmap palette, */
|
||||
/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */
|
||||
/* records. */
|
||||
/* */
|
||||
/* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */
|
||||
/* records. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
|
||||
/* FreeType, these types are not handled by the library itself. */
|
||||
/* */
|
||||
typedef enum FT_Palette_Mode_
|
||||
{
|
||||
ft_palette_mode_rgb = 0,
|
||||
ft_palette_mode_rgba,
|
||||
|
||||
ft_palette_mode_max /* do not remove */
|
||||
|
||||
} FT_Palette_Mode;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -311,20 +258,15 @@ FT_BEGIN_HEADER
|
||||
/* field is intended for paletted pixel modes. Not */
|
||||
/* used currently. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* For now, the only pixel modes supported by FreeType are mono and */
|
||||
/* grays. However, drivers might be added in the future to support */
|
||||
/* more `colorful' options. */
|
||||
/* */
|
||||
typedef struct FT_Bitmap_
|
||||
{
|
||||
int rows;
|
||||
int width;
|
||||
unsigned int rows;
|
||||
unsigned int width;
|
||||
int pitch;
|
||||
unsigned char* buffer;
|
||||
short num_grays;
|
||||
char pixel_mode;
|
||||
char palette_mode;
|
||||
unsigned short num_grays;
|
||||
unsigned char pixel_mode;
|
||||
unsigned char palette_mode;
|
||||
void* palette;
|
||||
|
||||
} FT_Bitmap;
|
||||
@ -381,7 +323,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* flags :: A set of bit flags used to characterize the outline */
|
||||
/* and give hints to the scan-converter and hinter on */
|
||||
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
|
||||
/* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The B/W rasterizer only checks bit~2 in the `tags' array for the */
|
||||
@ -402,6 +344,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
} FT_Outline;
|
||||
|
||||
/* */
|
||||
|
||||
/* Following limits must be consistent with */
|
||||
/* FT_Outline.{n_contours,n_points} */
|
||||
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
|
||||
@ -411,7 +355,7 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* FT_OUTLINE_FLAGS */
|
||||
/* FT_OUTLINE_XXX */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A list of bit-field constants use for the flags in an outline's */
|
||||
@ -492,24 +436,8 @@ FT_BEGIN_HEADER
|
||||
#define FT_OUTLINE_SINGLE_PASS 0x200
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* ft_outline_flags
|
||||
*
|
||||
* @description:
|
||||
* These constants are deprecated. Please use the corresponding
|
||||
* @FT_OUTLINE_FLAGS values.
|
||||
*
|
||||
* @values:
|
||||
* ft_outline_none :: See @FT_OUTLINE_NONE.
|
||||
* ft_outline_owner :: See @FT_OUTLINE_OWNER.
|
||||
* ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
|
||||
* ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
|
||||
* ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
|
||||
* ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
|
||||
* ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
|
||||
*/
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `FT_OUTLINE_XXX' values instead */
|
||||
#define ft_outline_none FT_OUTLINE_NONE
|
||||
#define ft_outline_owner FT_OUTLINE_OWNER
|
||||
#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
|
||||
@ -555,7 +483,7 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* to :: A pointer to the target point of the `move to'. */
|
||||
/* */
|
||||
/* user :: A typeless pointer which is passed from the caller of the */
|
||||
/* user :: A typeless pointer, which is passed from the caller of the */
|
||||
/* decomposition function. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -582,7 +510,7 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* to :: A pointer to the target point of the `line to'. */
|
||||
/* */
|
||||
/* user :: A typeless pointer which is passed from the caller of the */
|
||||
/* user :: A typeless pointer, which is passed from the caller of the */
|
||||
/* decomposition function. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -613,7 +541,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* to :: A pointer to the target end point of the conic arc. */
|
||||
/* */
|
||||
/* user :: A typeless pointer which is passed from the caller of */
|
||||
/* user :: A typeless pointer, which is passed from the caller of */
|
||||
/* the decomposition function. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -645,7 +573,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* to :: A pointer to the target end point. */
|
||||
/* */
|
||||
/* user :: A typeless pointer which is passed from the caller of */
|
||||
/* user :: A typeless pointer, which is passed from the caller of */
|
||||
/* the decomposition function. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -796,22 +724,8 @@ FT_BEGIN_HEADER
|
||||
} FT_Glyph_Format;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* ft_glyph_format_xxx */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A list of deprecated constants. Use the corresponding */
|
||||
/* @FT_Glyph_Format values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
|
||||
/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
|
||||
/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
|
||||
/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
|
||||
/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
|
||||
/* */
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `FT_Glyph_Format' values instead. */
|
||||
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
|
||||
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
|
||||
#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
|
||||
@ -833,11 +747,11 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A raster is a scan converter, in charge of rendering an outline into */
|
||||
/* a a bitmap. This section contains the public API for rasters. */
|
||||
/* a bitmap. This section contains the public API for rasters. */
|
||||
/* */
|
||||
/* Note that in FreeType 2, all rasters are now encapsulated within */
|
||||
/* specific modules called `renderers'. See `freetype/ftrender.h' for */
|
||||
/* more details on renderers. */
|
||||
/* specific modules called `renderers'. See `ftrender.h' for more */
|
||||
/* details on renderers. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -856,6 +770,21 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* This section contains technical definitions. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FT_Raster */
|
||||
/* FT_Span */
|
||||
/* FT_SpanFunc */
|
||||
/* */
|
||||
/* FT_Raster_Params */
|
||||
/* FT_RASTER_FLAG_XXX */
|
||||
/* */
|
||||
/* FT_Raster_NewFunc */
|
||||
/* FT_Raster_DoneFunc */
|
||||
/* FT_Raster_ResetFunc */
|
||||
/* FT_Raster_SetModeFunc */
|
||||
/* FT_Raster_RenderFunc */
|
||||
/* FT_Raster_Funcs */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@ -865,8 +794,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_Raster */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle (pointer) to a raster object. Each object can be used */
|
||||
/* independently to convert an outline into a bitmap or pixmap. */
|
||||
/* An opaque handle (pointer) to a raster object. Each object can be */
|
||||
/* used independently to convert an outline into a bitmap or pixmap. */
|
||||
/* */
|
||||
typedef struct FT_RasterRec_* FT_Raster;
|
||||
|
||||
@ -877,8 +806,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_Span */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a single span of gray (or black) pixels */
|
||||
/* when rendering a monochrome or anti-aliased bitmap. */
|
||||
/* A structure used to model a single span of gray pixels when */
|
||||
/* rendering an anti-aliased bitmap. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* x :: The span's horizontal start position. */
|
||||
@ -886,13 +815,12 @@ FT_BEGIN_HEADER
|
||||
/* len :: The span's length in pixels. */
|
||||
/* */
|
||||
/* coverage :: The span color/coverage, ranging from 0 (background) */
|
||||
/* to 255 (foreground). Only used for anti-aliased */
|
||||
/* rendering. */
|
||||
/* to 255 (foreground). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This structure is used by the span drawing callback type named */
|
||||
/* @FT_SpanFunc which takes the y~coordinate of the span as a */
|
||||
/* a parameter. */
|
||||
/* @FT_SpanFunc that takes the y~coordinate of the span as a */
|
||||
/* parameter. */
|
||||
/* */
|
||||
/* The coverage value is always between 0 and 255. If you want less */
|
||||
/* gray values, the callback function has to reduce them. */
|
||||
@ -957,22 +885,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Raster_BitTest_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
|
||||
/* */
|
||||
/* A function used as a call-back by the monochrome scan-converter */
|
||||
/* to test whether a given target pixel is already set to the drawing */
|
||||
/* `color'. These tests are crucial to implement drop-out control */
|
||||
/* per-se the TrueType spec. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* y :: The pixel's y~coordinate. */
|
||||
/* */
|
||||
/* x :: The pixel's x~coordinate. */
|
||||
/* */
|
||||
/* user :: User-supplied data that is passed to the callback. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* 1~if the pixel is `set', 0~otherwise. */
|
||||
/* Deprecated, unimplemented. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Raster_BitTest_Func)( int y,
|
||||
@ -986,21 +899,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Raster_BitSet_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
|
||||
/* */
|
||||
/* A function used as a call-back by the monochrome scan-converter */
|
||||
/* to set an individual target pixel. This is crucial to implement */
|
||||
/* drop-out control according to the TrueType specification. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* y :: The pixel's y~coordinate. */
|
||||
/* */
|
||||
/* x :: The pixel's x~coordinate. */
|
||||
/* */
|
||||
/* user :: User-supplied data that is passed to the callback. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* 1~if the pixel is `set', 0~otherwise. */
|
||||
/* Deprecated, unimplemented. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_Raster_BitSet_Func)( int y,
|
||||
@ -1034,8 +933,8 @@ FT_BEGIN_HEADER
|
||||
/* pixmap's buffer _must_ be zeroed before */
|
||||
/* rendering. */
|
||||
/* */
|
||||
/* Note that for now, direct rendering is */
|
||||
/* only possible with anti-aliased glyphs. */
|
||||
/* Direct rendering is only possible with */
|
||||
/* anti-aliased glyphs. */
|
||||
/* */
|
||||
/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
|
||||
/* rendering mode. If set, the output will */
|
||||
@ -1053,7 +952,8 @@ FT_BEGIN_HEADER
|
||||
#define FT_RASTER_FLAG_DIRECT 0x2
|
||||
#define FT_RASTER_FLAG_CLIP 0x4
|
||||
|
||||
/* deprecated */
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `FT_RASTER_FLAG_XXX' values instead */
|
||||
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
|
||||
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
|
||||
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
|
||||
@ -1079,11 +979,11 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* gray_spans :: The gray span drawing callback. */
|
||||
/* */
|
||||
/* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
|
||||
/* black_spans :: Unused. */
|
||||
/* */
|
||||
/* bit_test :: The bit test callback. UNIMPLEMENTED! */
|
||||
/* bit_test :: Unused. */
|
||||
/* */
|
||||
/* bit_set :: The bit set callback. UNIMPLEMENTED! */
|
||||
/* bit_set :: Unused. */
|
||||
/* */
|
||||
/* user :: User-supplied data that is passed to each drawing */
|
||||
/* callback. */
|
||||
@ -1100,15 +1000,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* raster will call the `gray_spans' callback to draw gray pixel */
|
||||
/* spans, in the case of an aa glyph bitmap, it will call */
|
||||
/* `black_spans', and `bit_test' and `bit_set' in the case of a */
|
||||
/* monochrome bitmap. This allows direct composition over a */
|
||||
/* pre-existing bitmap through user-provided callbacks to perform the */
|
||||
/* span drawing/composition. */
|
||||
/* */
|
||||
/* Note that the `bit_test' and `bit_set' callbacks are required when */
|
||||
/* rendering a monochrome bitmap, as they are crucial to implement */
|
||||
/* correct drop-out control as defined in the TrueType specification. */
|
||||
/* spans. This allows direct composition over a pre-existing bitmap */
|
||||
/* through user-provided callbacks to perform the span drawing and */
|
||||
/* composition. Not supported by the monochrome rasterizer. */
|
||||
/* */
|
||||
typedef struct FT_Raster_Params_
|
||||
{
|
||||
@ -1116,9 +1010,9 @@ FT_BEGIN_HEADER
|
||||
const void* source;
|
||||
int flags;
|
||||
FT_SpanFunc gray_spans;
|
||||
FT_SpanFunc black_spans; /* doesn't work! */
|
||||
FT_Raster_BitTest_Func bit_test; /* doesn't work! */
|
||||
FT_Raster_BitSet_Func bit_set; /* doesn't work! */
|
||||
FT_SpanFunc black_spans; /* unused */
|
||||
FT_Raster_BitTest_Func bit_test; /* unused */
|
||||
FT_Raster_BitSet_Func bit_set; /* unused */
|
||||
void* user;
|
||||
FT_BBox clip_box;
|
||||
|
||||
@ -1179,10 +1073,10 @@ FT_BEGIN_HEADER
|
||||
/* FT_Raster_ResetFunc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* FreeType provides an area of memory called the `render pool', */
|
||||
/* available to all registered rasters. This pool can be freely used */
|
||||
/* during a given scan-conversion but is shared by all rasters. Its */
|
||||
/* content is thus transient. */
|
||||
/* FreeType used to provide an area of memory called the `render */
|
||||
/* pool' available to all registered rasters. This was not thread */
|
||||
/* safe however and now FreeType never allocates this pool. NULL */
|
||||
/* is always passed in as pool_base. */
|
||||
/* */
|
||||
/* This function is called each time the render pool changes, or just */
|
||||
/* after a new raster object is created. */
|
||||
@ -1195,10 +1089,9 @@ FT_BEGIN_HEADER
|
||||
/* pool_size :: The size in bytes of the render pool. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Rasters can ignore the render pool and rely on dynamic memory */
|
||||
/* Rasters should ignore the render pool and rely on dynamic or stack */
|
||||
/* allocation if they want to (a handle to the memory allocator is */
|
||||
/* passed to the raster constructor). However, this is not */
|
||||
/* recommended for efficiency purposes. */
|
||||
/* passed to the raster constructor). */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_Raster_ResetFunc)( FT_Raster raster,
|
||||
@ -1265,7 +1158,7 @@ FT_BEGIN_HEADER
|
||||
/* XXX: For now, the standard raster doesn't support direct */
|
||||
/* composition but this should change for the final release (see */
|
||||
/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
|
||||
/* for examples of distinct implementations which support direct */
|
||||
/* for examples of distinct implementations that support direct */
|
||||
/* composition). */
|
||||
/* */
|
||||
typedef int
|
||||
@ -1305,13 +1198,12 @@ FT_BEGIN_HEADER
|
||||
|
||||
} FT_Raster_Funcs;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTIMAGE_H__ */
|
||||
#endif /* FTIMAGE_H_ */
|
||||
|
||||
|
||||
/* END */
|
11
drivers/freetype/freetype/include/freetype/ftincrem.h → drivers/freetype/include/freetype/ftincrem.h
11
drivers/freetype/freetype/include/freetype/ftincrem.h → drivers/freetype/include/freetype/ftincrem.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType incremental loading (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTINCREM_H__
|
||||
#define __FTINCREM_H__
|
||||
#ifndef FTINCREM_H_
|
||||
#define FTINCREM_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
|
||||
* @description:
|
||||
* This section contains various functions used to perform so-called
|
||||
* `incremental' glyph loading. This is a mode where all glyphs loaded
|
||||
* from a given @FT_Face are provided by the client application,
|
||||
* from a given @FT_Face are provided by the client application.
|
||||
*
|
||||
* Apart from that, all other tables are loaded normally from the font
|
||||
* file. This mode is useful when FreeType is used within another
|
||||
@ -345,9 +345,10 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTINCREM_H__ */
|
||||
#endif /* FTINCREM_H_ */
|
||||
|
||||
|
||||
/* END */
|
171
drivers/freetype/freetype/include/freetype/ftlcdfil.h → drivers/freetype/include/freetype/ftlcdfil.h
171
drivers/freetype/freetype/include/freetype/ftlcdfil.h → drivers/freetype/include/freetype/ftlcdfil.h
@ -5,7 +5,7 @@
|
||||
/* FreeType API for color filtering of subpixel bitmap glyphs */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2006, 2007, 2008, 2010 by */
|
||||
/* Copyright 2006-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,8 +17,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FT_LCD_FILTER_H__
|
||||
#define __FT_LCD_FILTER_H__
|
||||
#ifndef FTLCDFIL_H_
|
||||
#define FTLCDFIL_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -41,56 +41,91 @@ FT_BEGIN_HEADER
|
||||
* LCD Filtering
|
||||
*
|
||||
* @abstract:
|
||||
* Reduce color fringes of LCD-optimized bitmaps.
|
||||
* Reduce color fringes of subpixel-rendered bitmaps.
|
||||
*
|
||||
* @description:
|
||||
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass
|
||||
* filter which is then applied to LCD-optimized bitmaps generated
|
||||
* through @FT_Render_Glyph. This is useful to reduce color fringes
|
||||
* which would occur with unfiltered rendering.
|
||||
* Subpixel rendering exploits the color-striped structure of LCD
|
||||
* pixels, increasing the available resolution in the direction of the
|
||||
* stripe (usually horizontal RGB) by a factor of~3. Since these
|
||||
* subpixels are color pixels, using them unfiltered creates severe
|
||||
* color fringes. Use the @FT_Library_SetLcdFilter API to specify a
|
||||
* low-pass filter, which is then applied to subpixel-rendered bitmaps
|
||||
* generated through @FT_Render_Glyph. The filter sacrifices some of
|
||||
* the higher resolution to reduce color fringes, making the glyph image
|
||||
* slightly blurrier. Positional improvements will remain.
|
||||
*
|
||||
* Note that no filter is active by default, and that this function is
|
||||
* *not* implemented in default builds of the library. You need to
|
||||
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
|
||||
* in order to activate it.
|
||||
* in order to activate it and explicitly call @FT_Library_SetLcdFilter
|
||||
* to enable it.
|
||||
*
|
||||
* FreeType generates alpha coverage maps, which are linear by nature.
|
||||
* For instance, the value 0x80 in bitmap representation means that
|
||||
* (within numerical precision) 0x80/0xff fraction of that pixel is
|
||||
* covered by the glyph's outline. The blending function for placing
|
||||
* text over a background is
|
||||
* A filter should have two properties:
|
||||
*
|
||||
* {
|
||||
* dst = alpha * src + (1 - alpha) * dst ,
|
||||
* }
|
||||
* 1) It should be normalized, meaning the sum of the 5~components
|
||||
* should be 256 (0x100). It is possible to go above or under this
|
||||
* target sum, however: going under means tossing out contrast, going
|
||||
* over means invoking clamping and thereby non-linearities that
|
||||
* increase contrast somewhat at the expense of greater distortion
|
||||
* and color-fringing. Contrast is better enhanced through stem
|
||||
* darkening.
|
||||
*
|
||||
* which is known as OVER. However, when calculating the output of the
|
||||
* OVER operator, the source colors should first be transformed to a
|
||||
* linear color space, then alpha blended in that space, and transformed
|
||||
* back to the output color space.
|
||||
* 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}'
|
||||
* where a~+ b~=~c. It distributes the computed coverage for one
|
||||
* subpixel to all subpixels equally, sacrificing some won resolution
|
||||
* but drastically reducing color-fringing. Positioning improvements
|
||||
* remain! Note that color-fringing can only really be minimized
|
||||
* when using a color-balanced filter and alpha-blending the glyph
|
||||
* onto a surface in linear space; see @FT_Render_Glyph.
|
||||
*
|
||||
* When linear light blending is used, the default FIR5 filtering
|
||||
* weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
|
||||
* they have been designed for black on white rendering while lacking
|
||||
* gamma correction. To preserve color neutrality, weights for a FIR5
|
||||
* filter should be chosen according to two free parameters `a' and `c',
|
||||
* and the FIR weights should be
|
||||
* Regarding the form, a filter can be a `boxy' filter or a `beveled'
|
||||
* filter. Boxy filters are sharper but are less forgiving of non-ideal
|
||||
* gamma curves of a screen (viewing angles!), beveled filters are
|
||||
* fuzzier but more tolerant.
|
||||
*
|
||||
* {
|
||||
* [a - c, a + c, 2 * a, a + c, a - c] .
|
||||
* }
|
||||
* Examples:
|
||||
*
|
||||
* This formula generates equal weights for all the color primaries
|
||||
* across the filter kernel, which makes it colorless. One suggested
|
||||
* set of weights is
|
||||
* - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
|
||||
* normalized.
|
||||
*
|
||||
* {
|
||||
* [0x10, 0x50, 0x60, 0x50, 0x10] ,
|
||||
* }
|
||||
* - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
|
||||
* normalized.
|
||||
*
|
||||
* where `a' has value 0x30 and `b' value 0x20. The weights in filter
|
||||
* may have a sum larger than 0x100, which increases coloration slightly
|
||||
* but also improves contrast.
|
||||
* - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not
|
||||
* balanced.
|
||||
*
|
||||
* - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not
|
||||
* balanced.
|
||||
*
|
||||
* - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost
|
||||
* balanced.
|
||||
*
|
||||
* - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost
|
||||
* balanced.
|
||||
*
|
||||
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
|
||||
* @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output
|
||||
* of @FT_Outline_Render and @FT_Outline_Get_Bitmap.
|
||||
*
|
||||
* If this feature is activated, the dimensions of LCD glyph bitmaps are
|
||||
* either wider or taller than the dimensions of the corresponding
|
||||
* outline with regard to the pixel grid. For example, for
|
||||
* @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and
|
||||
* 3~subpixels to the right. The bitmap offset values are adjusted
|
||||
* accordingly, so clients shouldn't need to modify their layout and
|
||||
* glyph positioning code when enabling the filter.
|
||||
*
|
||||
* It is important to understand that linear alpha blending and gamma
|
||||
* correction is critical for correctly rendering glyphs onto surfaces
|
||||
* without artifacts and even more critical when subpixel rendering is
|
||||
* involved.
|
||||
*
|
||||
* Each of the 3~alpha values (subpixels) is independently used to blend
|
||||
* one color channel. That is, red alpha blends the red channel of the
|
||||
* text color with the red channel of the background pixel. The
|
||||
* distribution of density values by the color-balanced filter assumes
|
||||
* alpha blending is done in linear space; only then color artifacts
|
||||
* cancel out.
|
||||
*/
|
||||
|
||||
|
||||
@ -111,10 +146,23 @@ FT_BEGIN_HEADER
|
||||
* The default filter reduces color fringes considerably, at the cost
|
||||
* of a slight blurriness in the output.
|
||||
*
|
||||
* It is a beveled, normalized, and color-balanced five-tap filter
|
||||
* that is more forgiving to screens with non-ideal gamma curves and
|
||||
* viewing angles. Note that while color-fringing is reduced, it can
|
||||
* only be minimized by using linear alpha blending and gamma
|
||||
* correction to render glyphs onto surfaces. The default filter
|
||||
* weights are [0x08 0x4D 0x56 0x4D 0x08].
|
||||
*
|
||||
* FT_LCD_FILTER_LIGHT ::
|
||||
* The light filter is a variant that produces less blurriness at the
|
||||
* cost of slightly more color fringes than the default one. It might
|
||||
* be better, depending on taste, your monitor, or your personal vision.
|
||||
* The light filter is a variant that is sharper at the cost of
|
||||
* slightly more color fringes than the default one.
|
||||
*
|
||||
* It is a boxy, normalized, and color-balanced three-tap filter that
|
||||
* is less forgiving to screens with non-ideal gamma curves and
|
||||
* viewing angles. This filter works best when the rendering system
|
||||
* uses linear alpha blending and gamma correction to render glyphs
|
||||
* onto surfaces. The light filter weights are
|
||||
* [0x00 0x55 0x56 0x55 0x00].
|
||||
*
|
||||
* FT_LCD_FILTER_LEGACY ::
|
||||
* This filter corresponds to the original libXft color filter. It
|
||||
@ -126,14 +174,23 @@ FT_BEGIN_HEADER
|
||||
* This filter is only provided for comparison purposes, and might be
|
||||
* disabled or stay unsupported in the future.
|
||||
*
|
||||
* FT_LCD_FILTER_LEGACY1 ::
|
||||
* For historical reasons, the FontConfig library returns a different
|
||||
* enumeration value for legacy LCD filtering. To make code work that
|
||||
* (incorrectly) forwards FontConfig's enumeration value to
|
||||
* @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
|
||||
* to have another enumeration value, which is completely equal to
|
||||
* `FT_LCD_FILTER_LEGACY'.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0
|
||||
* 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
|
||||
*/
|
||||
typedef enum FT_LcdFilter_
|
||||
{
|
||||
FT_LCD_FILTER_NONE = 0,
|
||||
FT_LCD_FILTER_DEFAULT = 1,
|
||||
FT_LCD_FILTER_LIGHT = 2,
|
||||
FT_LCD_FILTER_LEGACY1 = 3,
|
||||
FT_LCD_FILTER_LEGACY = 16,
|
||||
|
||||
FT_LCD_FILTER_MAX /* do not remove */
|
||||
@ -176,22 +233,6 @@ FT_BEGIN_HEADER
|
||||
* defined in your build of the library, which should correspond to all
|
||||
* default builds of FreeType.
|
||||
*
|
||||
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
|
||||
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
|
||||
*
|
||||
* It does _not_ affect the output of @FT_Outline_Render and
|
||||
* @FT_Outline_Get_Bitmap.
|
||||
*
|
||||
* If this feature is activated, the dimensions of LCD glyph bitmaps are
|
||||
* either larger or taller than the dimensions of the corresponding
|
||||
* outline with regards to the pixel grid. For example, for
|
||||
* @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
|
||||
* up to 3~pixels to the right.
|
||||
*
|
||||
* The bitmap offset values are adjusted correctly, so clients shouldn't
|
||||
* need to modify their layout and glyph positioning code when enabling
|
||||
* the filter.
|
||||
*
|
||||
* @since:
|
||||
* 2.3.0
|
||||
*/
|
||||
@ -206,11 +247,8 @@ FT_BEGIN_HEADER
|
||||
* FT_Library_SetLcdFilterWeights
|
||||
*
|
||||
* @description:
|
||||
* Use this function to override the filter weights selected by
|
||||
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
|
||||
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
|
||||
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
|
||||
* FT_LCD_FILTER_LEGACY.
|
||||
* This function can be used to enable LCD filter with custom weights,
|
||||
* instead of using presets in @FT_Library_SetLcdFilter.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
@ -230,9 +268,6 @@ FT_BEGIN_HEADER
|
||||
* defined in your build of the library, which should correspond to all
|
||||
* default builds of FreeType.
|
||||
*
|
||||
* This function must be called after @FT_Library_SetLcdFilter to have
|
||||
* any effect.
|
||||
*
|
||||
* @since:
|
||||
* 2.4.0
|
||||
*/
|
||||
@ -245,7 +280,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_LCD_FILTER_H__ */
|
||||
#endif /* FTLCDFIL_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Generic list support for FreeType (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2007, 2010 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -24,8 +24,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTLIST_H__
|
||||
#define __FTLIST_H__
|
||||
#ifndef FTLIST_H_
|
||||
#define FTLIST_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -173,7 +173,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_List_Iterator */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list parse */
|
||||
/* An FT_List iterator function that is called during a list parse */
|
||||
/* by @FT_List_Iterate. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -200,7 +200,7 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* list :: A handle to the list. */
|
||||
/* iterator :: An iterator function, called on each node of the list. */
|
||||
/* user :: A user-supplied field which is passed as the second */
|
||||
/* user :: A user-supplied field that is passed as the second */
|
||||
/* argument to the iterator. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -218,7 +218,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_List_Destructor */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An @FT_List iterator function which is called during a list */
|
||||
/* An @FT_List iterator function that is called during a list */
|
||||
/* finalization by @FT_List_Finalize to destroy all elements in a */
|
||||
/* given list. */
|
||||
/* */
|
||||
@ -248,11 +248,11 @@ FT_BEGIN_HEADER
|
||||
/* list :: A handle to the list. */
|
||||
/* */
|
||||
/* destroy :: A list destructor that will be applied to each element */
|
||||
/* of the list. */
|
||||
/* of the list. Set this to NULL if not needed. */
|
||||
/* */
|
||||
/* memory :: The current memory object which handles deallocation. */
|
||||
/* memory :: The current memory object that handles deallocation. */
|
||||
/* */
|
||||
/* user :: A user-supplied field which is passed as the last */
|
||||
/* user :: A user-supplied field that is passed as the last */
|
||||
/* argument to the destructor. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
@ -265,13 +265,12 @@ FT_BEGIN_HEADER
|
||||
FT_Memory memory,
|
||||
void* user );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTLIST_H__ */
|
||||
#endif /* FTLIST_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* LZW-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTLZW_H__
|
||||
#define __FTLZW_H__
|
||||
#ifndef FTLZW_H_
|
||||
#define FTLZW_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -88,12 +88,12 @@ FT_BEGIN_HEADER
|
||||
FT_Stream_OpenLZW( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTLZW_H__ */
|
||||
#endif /* FTLZW_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Additional Mac-specific API. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004, 2006, 2007 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -18,15 +18,15 @@
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* NOTE: Include this file after <freetype/freetype.h> and after any */
|
||||
/* NOTE: Include this file after FT_FREETYPE_H and after any */
|
||||
/* Mac-specific headers (because this header uses Mac types such as */
|
||||
/* Handle, FSSpec, FSRef, etc.) */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMAC_H__
|
||||
#define __FTMAC_H__
|
||||
#ifndef FTMAC_H_
|
||||
#define FTMAC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -168,7 +168,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return a pathname of the disk file and face index for given font */
|
||||
/* name which is handled by ATS framework. */
|
||||
/* name that is handled by ATS framework. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fontName :: Mac OS name of the font in ATS framework. */
|
||||
@ -268,7 +268,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTMAC_H__ */
|
||||
#endif /* FTMAC_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Multiple Master font interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMM_H__
|
||||
#define __FTMM_H__
|
||||
#ifndef FTMM_H_
|
||||
#define FTMM_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -95,8 +95,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* num_designs :: 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. */
|
||||
/* allows for intermediate designs to be present. */
|
||||
/* This number cannot exceed~16. */
|
||||
/* */
|
||||
/* axis :: A table of axis descriptors. */
|
||||
/* */
|
||||
@ -196,16 +196,20 @@ FT_BEGIN_HEADER
|
||||
/* number of designs). */
|
||||
/* */
|
||||
/* num_namedstyles :: The number of named styles; only meaningful for */
|
||||
/* GX which allows certain design coordinates to */
|
||||
/* GX that allows certain design coordinates to */
|
||||
/* have a string ID (in the `name' table) */
|
||||
/* associated with them. The font can tell the */
|
||||
/* user that, for example, Weight=1.5 is `Bold'. */
|
||||
/* */
|
||||
/* axis :: A table of axis descriptors. */
|
||||
/* axis :: An axis descriptor table. */
|
||||
/* GX fonts contain slightly more data than MM. */
|
||||
/* Memory management of this pointer is done */
|
||||
/* internally by FreeType. */
|
||||
/* */
|
||||
/* namedstyles :: A table of named styles. */
|
||||
/* namedstyle :: A named style table. */
|
||||
/* Only meaningful with GX. */
|
||||
/* Memory management of this pointer is done */
|
||||
/* internally by FreeType. */
|
||||
/* */
|
||||
typedef struct FT_MM_Var_
|
||||
{
|
||||
@ -218,9 +222,6 @@ FT_BEGIN_HEADER
|
||||
} FT_MM_Var;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
@ -258,8 +259,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* amaster :: The Multiple Masters/GX var descriptor. */
|
||||
/* Allocates a data structure, which the user must free */
|
||||
/* (a single call to FT_FREE will do it). */
|
||||
/* Allocates a data structure, which the user must */
|
||||
/* deallocate with `free' after use. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
@ -284,8 +285,10 @@ FT_BEGIN_HEADER
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* num_coords :: The number of design coordinates (must be equal to */
|
||||
/* the number of axes in the font). */
|
||||
/* num_coords :: The number of available design coordinates. If it */
|
||||
/* is larger than the number of axes, ignore the excess */
|
||||
/* values. If it is smaller than the number of axes, */
|
||||
/* use default values for the remaining axes. */
|
||||
/* */
|
||||
/* coords :: An array of design coordinates. */
|
||||
/* */
|
||||
@ -311,8 +314,10 @@ FT_BEGIN_HEADER
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* num_coords :: The number of design coordinates (must be equal to */
|
||||
/* the number of axes in the font). */
|
||||
/* num_coords :: The number of available design coordinates. If it */
|
||||
/* is larger than the number of axes, ignore the excess */
|
||||
/* values. If it is smaller than the number of axes, */
|
||||
/* use default values for the remaining axes. */
|
||||
/* */
|
||||
/* coords :: An array of design coordinates. */
|
||||
/* */
|
||||
@ -338,8 +343,10 @@ FT_BEGIN_HEADER
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* num_coords :: The number of design coordinates (must be equal to */
|
||||
/* the number of axes in the font). */
|
||||
/* num_coords :: The number of available design coordinates. If it */
|
||||
/* is larger than the number of axes, ignore the excess */
|
||||
/* values. If it is smaller than the number of axes, */
|
||||
/* use default values for the remaining axes. */
|
||||
/* */
|
||||
/* coords :: The design coordinates array (each element must be */
|
||||
/* between 0 and 1.0). */
|
||||
@ -366,13 +373,12 @@ FT_BEGIN_HEADER
|
||||
FT_UInt num_coords,
|
||||
FT_Fixed* coords );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTMM_H__ */
|
||||
#endif /* FTMM_H_ */
|
||||
|
||||
|
||||
/* END */
|
72
drivers/freetype/freetype/include/freetype/ftmodapi.h → drivers/freetype/include/freetype/ftmodapi.h
72
drivers/freetype/freetype/include/freetype/ftmodapi.h → drivers/freetype/include/freetype/ftmodapi.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMODAPI_H__
|
||||
#define __FTMODAPI_H__
|
||||
#ifndef FTMODAPI_H_
|
||||
#define FTMODAPI_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -63,7 +63,7 @@ FT_BEGIN_HEADER
|
||||
/* psaux */
|
||||
/* pshinter */
|
||||
/* psnames */
|
||||
/* raster1, raster5 */
|
||||
/* raster1 */
|
||||
/* sfnt */
|
||||
/* smooth, smooth-lcd, smooth-lcdv */
|
||||
/* truetype */
|
||||
@ -75,6 +75,33 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* Note that the FreeType Cache sub-system is not a FreeType module. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FT_Module */
|
||||
/* FT_Module_Constructor */
|
||||
/* FT_Module_Destructor */
|
||||
/* FT_Module_Requester */
|
||||
/* FT_Module_Class */
|
||||
/* */
|
||||
/* FT_Add_Module */
|
||||
/* FT_Get_Module */
|
||||
/* FT_Remove_Module */
|
||||
/* FT_Add_Default_Modules */
|
||||
/* */
|
||||
/* FT_Property_Set */
|
||||
/* FT_Property_Get */
|
||||
/* */
|
||||
/* FT_New_Library */
|
||||
/* FT_Done_Library */
|
||||
/* FT_Reference_Library */
|
||||
/* */
|
||||
/* FT_Renderer */
|
||||
/* FT_Renderer_Class */
|
||||
/* */
|
||||
/* FT_Get_Renderer */
|
||||
/* FT_Set_Renderer */
|
||||
/* */
|
||||
/* FT_Set_Debug_Hook */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@ -84,12 +111,14 @@ FT_BEGIN_HEADER
|
||||
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
|
||||
#define FT_MODULE_STYLER 8 /* this module is a styler */
|
||||
|
||||
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
|
||||
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
|
||||
/* scalable fonts */
|
||||
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
|
||||
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
|
||||
/* support vector outlines */
|
||||
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
|
||||
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
|
||||
/* own hinter */
|
||||
#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */
|
||||
/* produces LIGHT hints */
|
||||
|
||||
|
||||
/* deprecated values */
|
||||
@ -98,9 +127,10 @@ FT_BEGIN_HEADER
|
||||
#define ft_module_hinter FT_MODULE_HINTER
|
||||
#define ft_module_styler FT_MODULE_STYLER
|
||||
|
||||
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
|
||||
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
|
||||
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
|
||||
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
|
||||
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
|
||||
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
|
||||
#define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY
|
||||
|
||||
|
||||
typedef FT_Pointer FT_Module_Interface;
|
||||
@ -298,7 +328,7 @@ FT_BEGIN_HEADER
|
||||
* Note that only a few modules have properties.
|
||||
*
|
||||
* value ::
|
||||
* A generic pointer to a variable or structure which gives the new
|
||||
* A generic pointer to a variable or structure that gives the new
|
||||
* value of the property. The exact definition of `value' is
|
||||
* dependent on the property; see the `Synopsis' subsection of the
|
||||
* module's documentation.
|
||||
@ -364,7 +394,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @inout:
|
||||
* value ::
|
||||
* A generic pointer to a variable or structure which gives the
|
||||
* A generic pointer to a variable or structure that gives the
|
||||
* value of the property. The exact definition of `value' is
|
||||
* dependent on the property; see the `Synopsis' subsection of the
|
||||
* module's documentation.
|
||||
@ -418,7 +448,7 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Done_Library then only destroys a library if the counter is~1, */
|
||||
/* otherwise it simply decrements the counter. */
|
||||
/* */
|
||||
/* This function helps in managing life-cycles of structures which */
|
||||
/* This function helps in managing life-cycles of structures that */
|
||||
/* reference @FT_Library objects. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -442,7 +472,9 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* This function is used to create a new FreeType library instance */
|
||||
/* from a given memory object. It is thus possible to use libraries */
|
||||
/* with distinct memory allocators within the same program. */
|
||||
/* with distinct memory allocators within the same program. Note, */
|
||||
/* however, that the used @FT_Memory structure is expected to remain */
|
||||
/* valid for the life of the @FT_Library object. */
|
||||
/* */
|
||||
/* Normally, you would call this function (followed by a call to */
|
||||
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
|
||||
@ -491,7 +523,7 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Done_Library( FT_Library library );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
typedef void
|
||||
(*FT_DebugHook_Func)( void* arg );
|
||||
@ -581,12 +613,7 @@ FT_BEGIN_HEADER
|
||||
* The library doesn't implement any kind of bytecode interpreter.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
|
||||
* The library implements a bytecode interpreter that doesn't
|
||||
* support the patented operations of the TrueType virtual machine.
|
||||
*
|
||||
* Its main use is to load certain Asian fonts which position and
|
||||
* scale glyph components with bytecode instructions. It produces
|
||||
* bad output for most other fonts.
|
||||
* Deprecated and removed.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
|
||||
* The library implements a bytecode interpreter that covers
|
||||
@ -629,13 +656,12 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_TrueTypeEngineType )
|
||||
FT_Get_TrueType_Engine_Type( FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTMODAPI_H__ */
|
||||
#endif /* FTMODAPI_H_ */
|
||||
|
||||
|
||||
/* END */
|
10
drivers/freetype/freetype/include/freetype/ftmoderr.h → drivers/freetype/include/freetype/ftmoderr.h
10
drivers/freetype/freetype/include/freetype/ftmoderr.h → drivers/freetype/include/freetype/ftmoderr.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType module error offsets (specification). */
|
||||
/* */
|
||||
/* Copyright 2001-2005, 2010, 2013 by */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -74,7 +74,7 @@
|
||||
/* with something like */
|
||||
/* */
|
||||
/* { */
|
||||
/* #undef __FTMODERR_H__ */
|
||||
/* #undef FTMODERR_H_ */
|
||||
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
|
||||
/* #define FT_MODERR_START_LIST { */
|
||||
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
|
||||
@ -91,8 +91,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMODERR_H__
|
||||
#define __FTMODERR_H__
|
||||
#ifndef FTMODERR_H_
|
||||
#define FTMODERR_H_
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
@ -188,7 +188,7 @@
|
||||
#undef FT_NEED_EXTERN_C
|
||||
|
||||
|
||||
#endif /* __FTMODERR_H__ */
|
||||
#endif /* FTMODERR_H_ */
|
||||
|
||||
|
||||
/* END */
|
37
drivers/freetype/freetype/include/freetype/ftotval.h → drivers/freetype/include/freetype/ftotval.h
37
drivers/freetype/freetype/include/freetype/ftotval.h → drivers/freetype/include/freetype/ftotval.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for validating OpenType tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006, 2007 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -27,8 +27,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOTVAL_H__
|
||||
#define __FTOTVAL_H__
|
||||
#ifndef FTOTVAL_H_
|
||||
#define FTOTVAL_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -58,6 +58,12 @@ FT_BEGIN_HEADER
|
||||
/* This section contains the declaration of functions to validate */
|
||||
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FT_OpenType_Validate */
|
||||
/* FT_OpenType_Free */
|
||||
/* */
|
||||
/* FT_VALIDATE_OTXXX */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@ -100,14 +106,12 @@ FT_BEGIN_HEADER
|
||||
#define FT_VALIDATE_JSTF 0x1000
|
||||
#define FT_VALIDATE_MATH 0x2000
|
||||
|
||||
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
|
||||
FT_VALIDATE_GDEF | \
|
||||
FT_VALIDATE_GPOS | \
|
||||
FT_VALIDATE_GSUB | \
|
||||
FT_VALIDATE_JSTF | \
|
||||
FT_VALIDATE_MATH
|
||||
|
||||
/* */
|
||||
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
|
||||
FT_VALIDATE_GDEF | \
|
||||
FT_VALIDATE_GPOS | \
|
||||
FT_VALIDATE_GSUB | \
|
||||
FT_VALIDATE_JSTF | \
|
||||
FT_VALIDATE_MATH )
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
@ -116,7 +120,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Validate various OpenType tables to assure that all offsets and
|
||||
* indices are valid. The idea is that a higher-level library which
|
||||
* indices are valid. The idea is that a higher-level library that
|
||||
* actually does the text layout can access those tables without
|
||||
* error checking (which can be quite time consuming).
|
||||
*
|
||||
@ -125,7 +129,7 @@ FT_BEGIN_HEADER
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* A bit field that specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_OTXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
@ -165,8 +169,6 @@ FT_BEGIN_HEADER
|
||||
FT_Bytes *GSUB_table,
|
||||
FT_Bytes *JSTF_table );
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
@ -191,13 +193,12 @@ FT_BEGIN_HEADER
|
||||
FT_OpenType_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTOTVAL_H__ */
|
||||
#endif /* FTOTVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
52
drivers/freetype/freetype/include/freetype/ftoutln.h → drivers/freetype/include/freetype/ftoutln.h
52
drivers/freetype/freetype/include/freetype/ftoutln.h → drivers/freetype/include/freetype/ftoutln.h
@ -5,7 +5,7 @@
|
||||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2005-2012 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,8 +17,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOUTLN_H__
|
||||
#define __FTOUTLN_H__
|
||||
#ifndef FTOUTLN_H_
|
||||
#define FTOUTLN_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -52,7 +52,6 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FT_Outline */
|
||||
/* FT_OUTLINE_FLAGS */
|
||||
/* FT_Outline_New */
|
||||
/* FT_Outline_Done */
|
||||
/* FT_Outline_Copy */
|
||||
@ -68,13 +67,17 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* FT_Outline_Get_Bitmap */
|
||||
/* FT_Outline_Render */
|
||||
/* */
|
||||
/* FT_Outline_Decompose */
|
||||
/* FT_Outline_Funcs */
|
||||
/* FT_Outline_MoveTo_Func */
|
||||
/* FT_Outline_LineTo_Func */
|
||||
/* FT_Outline_ConicTo_Func */
|
||||
/* FT_Outline_CubicTo_Func */
|
||||
/* FT_Outline_MoveToFunc */
|
||||
/* FT_Outline_LineToFunc */
|
||||
/* FT_Outline_ConicToFunc */
|
||||
/* FT_Outline_CubicToFunc */
|
||||
/* */
|
||||
/* FT_Orientation */
|
||||
/* FT_Outline_Get_Orientation */
|
||||
/* */
|
||||
/* FT_OUTLINE_XXX */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -97,7 +100,7 @@ FT_BEGIN_HEADER
|
||||
/* operations. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* user :: A typeless pointer which is passed to each */
|
||||
/* user :: A typeless pointer that is passed to each */
|
||||
/* emitter during the decomposition. It can be */
|
||||
/* used to store the state during the */
|
||||
/* decomposition. */
|
||||
@ -105,6 +108,13 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* A contour that contains a single point only is represented by a */
|
||||
/* `move to' operation followed by `line to' to the same point. In */
|
||||
/* most cases, it is best to filter this out before using the */
|
||||
/* outline for stroking purposes (otherwise it would result in a */
|
||||
/* visible dot when round caps are used). */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Decompose( FT_Outline* outline,
|
||||
const FT_Outline_Funcs* func_interface,
|
||||
@ -217,12 +227,12 @@ FT_BEGIN_HEADER
|
||||
/* the outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* that contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
/* and arcs in the outline. To get the latter, you can use the */
|
||||
/* `ftbbox' component which is dedicated to this single task. */
|
||||
/* `ftbbox' component, which is dedicated to this single task. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
@ -344,10 +354,13 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
|
||||
/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
|
||||
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
|
||||
/* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) */
|
||||
/* FT_Outline_Embolden( &face->glyph->outline, strength ); */
|
||||
/* } */
|
||||
/* */
|
||||
/* To get meaningful results, font scaling values must be set with */
|
||||
/* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Embolden( FT_Outline* outline,
|
||||
FT_Pos strength );
|
||||
@ -525,9 +538,11 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* This function analyzes a glyph outline and tries to compute its
|
||||
* fill orientation (see @FT_Orientation). This is done by computing
|
||||
* the direction of each global horizontal and/or vertical extrema
|
||||
* within the outline.
|
||||
* fill orientation (see @FT_Orientation). This is done by integrating
|
||||
* the total area covered by the outline. The positive integral
|
||||
* corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
|
||||
* is returned. The negative integral corresponds to the counter-clockwise
|
||||
* orientation and @FT_ORIENTATION_TRUETYPE is returned.
|
||||
*
|
||||
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
|
||||
* outlines.
|
||||
@ -543,13 +558,12 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Orientation )
|
||||
FT_Outline_Get_Orientation( FT_Outline* outline );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTOUTLN_H__ */
|
||||
#endif /* FTOUTLN_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing PFR-specific data (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTPFR_H__
|
||||
#define __FTPFR_H__
|
||||
#ifndef FTPFR_H_
|
||||
#define FTPFR_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -161,12 +161,12 @@ FT_BEGIN_HEADER
|
||||
FT_UInt gindex,
|
||||
FT_Pos *aadvance );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTPFR_H__ */
|
||||
#endif /* FTPFR_H_ */
|
||||
|
||||
|
||||
/* END */
|
18
drivers/freetype/freetype/include/freetype/ftrender.h → drivers/freetype/include/freetype/ftrender.h
18
drivers/freetype/freetype/include/freetype/ftrender.h → drivers/freetype/include/freetype/ftrender.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType renderer modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2005, 2006, 2010 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTRENDER_H__
|
||||
#define __FTRENDER_H__
|
||||
#ifndef FTRENDER_H_
|
||||
#define FTRENDER_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -212,13 +212,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* This doesn't change the current renderer for other formats. */
|
||||
/* */
|
||||
/* Currently, only the B/W renderer, if compiled with */
|
||||
/* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
|
||||
/* anti-aliasing mode; this option must be set directly in */
|
||||
/* `ftraster.c' and is undefined by default) accepts a single tag */
|
||||
/* `pal5' to set its gray palette as a character string with */
|
||||
/* 5~elements. Consequently, the third and fourth argument are zero */
|
||||
/* normally. */
|
||||
/* Currently, no FreeType renderer module uses `parameters'; you */
|
||||
/* should thus always pass NULL as the value. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Set_Renderer( FT_Library library,
|
||||
@ -226,13 +221,12 @@ FT_BEGIN_HEADER
|
||||
FT_UInt num_params,
|
||||
FT_Parameter* parameters );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTRENDER_H__ */
|
||||
#endif /* FTRENDER_H_ */
|
||||
|
||||
|
||||
/* END */
|
10
drivers/freetype/freetype/include/freetype/ftsizes.h → drivers/freetype/include/freetype/ftsizes.h
10
drivers/freetype/freetype/include/freetype/ftsizes.h → drivers/freetype/include/freetype/ftsizes.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType size objects management (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -25,8 +25,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSIZES_H__
|
||||
#define __FTSIZES_H__
|
||||
#ifndef FTSIZES_H_
|
||||
#define FTSIZES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -129,7 +129,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Even though it is possible to create several size objects for a */
|
||||
/* given face (see @FT_New_Size for details), functions like */
|
||||
/* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
|
||||
/* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
|
||||
/* activated last to determine the `current character pixel size'. */
|
||||
/* */
|
||||
/* This function can be used to `activate' a previously created size */
|
||||
@ -153,7 +153,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSIZES_H__ */
|
||||
#endif /* FTSIZES_H_ */
|
||||
|
||||
|
||||
/* END */
|
12
drivers/freetype/freetype/include/freetype/ftsnames.h → drivers/freetype/include/freetype/ftsnames.h
12
drivers/freetype/freetype/include/freetype/ftsnames.h → drivers/freetype/include/freetype/ftsnames.h
@ -7,7 +7,7 @@
|
||||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,8 +19,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FT_SFNT_NAMES_H__
|
||||
#define __FT_SFNT_NAMES_H__
|
||||
#ifndef FTSNAMES_H_
|
||||
#define FTSNAMES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -169,7 +169,7 @@ FT_BEGIN_HEADER
|
||||
* A constant used as the tag of @FT_Parameter structures to make
|
||||
* FT_Open_Face() ignore preferred family subfamily names in `name'
|
||||
* table since OpenType version 1.4. For backwards compatibility with
|
||||
* legacy systems which has 4-face-per-family restriction.
|
||||
* legacy systems that have a 4-face-per-family restriction.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
|
||||
@ -184,7 +184,7 @@ FT_BEGIN_HEADER
|
||||
* A constant used as the tag of @FT_Parameter structures to make
|
||||
* FT_Open_Face() ignore preferred subfamily names in `name' table since
|
||||
* OpenType version 1.4. For backwards compatibility with legacy
|
||||
* systems which has 4-face-per-family restriction.
|
||||
* systems that have a 4-face-per-family restriction.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
|
||||
@ -194,7 +194,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SFNT_NAMES_H__ */
|
||||
#endif /* FTSNAMES_H_ */
|
||||
|
||||
|
||||
/* END */
|
50
drivers/freetype/freetype/include/freetype/ftstroke.h → drivers/freetype/include/freetype/ftstroke.h
50
drivers/freetype/freetype/include/freetype/ftstroke.h → drivers/freetype/include/freetype/ftstroke.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType path stroker (specification). */
|
||||
/* */
|
||||
/* Copyright 2002-2006, 2008, 2009, 2011-2012 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FT_STROKE_H__
|
||||
#define __FT_STROKE_H__
|
||||
#ifndef FTSTROKE_H_
|
||||
#define FTSTROKE_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_OUTLINE_H
|
||||
@ -46,6 +46,38 @@ FT_BEGIN_HEADER
|
||||
* This can be useful to generate `bordered' glyph, i.e., glyphs
|
||||
* displayed with a coloured (and anti-aliased) border around their
|
||||
* shape.
|
||||
*
|
||||
* @order:
|
||||
* FT_Stroker
|
||||
*
|
||||
* FT_Stroker_LineJoin
|
||||
* FT_Stroker_LineCap
|
||||
* FT_StrokerBorder
|
||||
*
|
||||
* FT_Outline_GetInsideBorder
|
||||
* FT_Outline_GetOutsideBorder
|
||||
*
|
||||
* FT_Glyph_Stroke
|
||||
* FT_Glyph_StrokeBorder
|
||||
*
|
||||
* FT_Stroker_New
|
||||
* FT_Stroker_Set
|
||||
* FT_Stroker_Rewind
|
||||
* FT_Stroker_ParseOutline
|
||||
* FT_Stroker_Done
|
||||
*
|
||||
* FT_Stroker_BeginSubPath
|
||||
* FT_Stroker_EndSubPath
|
||||
*
|
||||
* FT_Stroker_LineTo
|
||||
* FT_Stroker_ConicTo
|
||||
* FT_Stroker_CubicTo
|
||||
*
|
||||
* FT_Stroker_GetBorderCounts
|
||||
* FT_Stroker_ExportBorder
|
||||
* FT_Stroker_GetCounts
|
||||
* FT_Stroker_Export
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -55,7 +87,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker
|
||||
*
|
||||
* @description:
|
||||
* Opaque handler to a path stroker object.
|
||||
* Opaque handle to a path stroker object.
|
||||
*/
|
||||
typedef struct FT_StrokerRec_* FT_Stroker;
|
||||
|
||||
@ -276,6 +308,8 @@ FT_BEGIN_HEADER
|
||||
* @note:
|
||||
* The radius is expressed in the same units as the outline
|
||||
* coordinates.
|
||||
*
|
||||
* This function calls @FT_Stroker_Rewind automatically.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Set( FT_Stroker stroker,
|
||||
@ -570,10 +604,10 @@ FT_BEGIN_HEADER
|
||||
* receive all new data.
|
||||
*
|
||||
* When an outline, or a sub-path, is `closed', the stroker generates
|
||||
* two independent `border' outlines, named `left' and `right'
|
||||
* two independent `border' outlines, named `left' and `right'.
|
||||
*
|
||||
* When the outline, or a sub-path, is `opened', the stroker merges
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* points, while the `right' border becomes empty.
|
||||
*
|
||||
* Use the function @FT_Stroker_Export instead if you want to
|
||||
@ -736,11 +770,11 @@ FT_BEGIN_HEADER
|
||||
FT_Bool inside,
|
||||
FT_Bool destroy );
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_STROKE_H__ */
|
||||
#endif /* FTSTROKE_H_ */
|
||||
|
||||
|
||||
/* END */
|
17
drivers/freetype/freetype/include/freetype/ftsynth.h → drivers/freetype/include/freetype/ftsynth.h
17
drivers/freetype/freetype/include/freetype/ftsynth.h → drivers/freetype/include/freetype/ftsynth.h
@ -5,7 +5,7 @@
|
||||
/* FreeType synthesizing code for emboldening and slanting */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003, 2006, 2008, 2012 by */
|
||||
/* Copyright 2000-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -37,12 +37,12 @@
|
||||
/* Main reason for not lifting the functions in this module to a */
|
||||
/* `standard' API is that the used parameters for emboldening and */
|
||||
/* slanting are not configurable. Consider the functions as a */
|
||||
/* code resource which should be copied into the application and */
|
||||
/* code resource that should be copied into the application and */
|
||||
/* adapted to the particular needs. */
|
||||
|
||||
|
||||
#ifndef __FTSYNTH_H__
|
||||
#define __FTSYNTH_H__
|
||||
#ifndef FTSYNTH_H_
|
||||
#define FTSYNTH_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -62,8 +62,10 @@ FT_BEGIN_HEADER
|
||||
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
|
||||
/* */
|
||||
/* For emboldened outlines the height, width, and advance metrics are */
|
||||
/* increased by the strength of the emboldening. You can also call */
|
||||
/* @FT_Outline_Get_CBox to get precise values. */
|
||||
/* increased by the strength of the emboldening -- this even affects */
|
||||
/* mono-width fonts! */
|
||||
/* */
|
||||
/* You can also call @FT_Outline_Get_CBox to get precise values. */
|
||||
FT_EXPORT( void )
|
||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
||||
|
||||
@ -73,9 +75,10 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSYNTH_H__ */
|
||||
#endif /* FTSYNTH_H_ */
|
||||
|
||||
|
||||
/* END */
|
18
drivers/freetype/freetype/include/freetype/ftsystem.h → drivers/freetype/include/freetype/ftsystem.h
18
drivers/freetype/freetype/include/freetype/ftsystem.h → drivers/freetype/include/freetype/ftsystem.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType low-level system interface definition (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2005, 2010 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSYSTEM_H__
|
||||
#define __FTSYSTEM_H__
|
||||
#ifndef FTSYSTEM_H_
|
||||
#define FTSYSTEM_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -192,6 +192,10 @@ FT_BEGIN_HEADER
|
||||
* @description:
|
||||
* A handle to an input stream.
|
||||
*
|
||||
* @also:
|
||||
* See @FT_StreamRec for the publicly accessible fields of a given
|
||||
* stream object.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
@ -285,6 +289,11 @@ FT_BEGIN_HEADER
|
||||
* size ::
|
||||
* The stream size in bytes.
|
||||
*
|
||||
* In case of compressed streams where the size is unknown before
|
||||
* actually doing the decompression, the value is set to 0x7FFFFFFF.
|
||||
* (Note that this size value can occur for normal streams also; it is
|
||||
* thus just a hint.)
|
||||
*
|
||||
* pos ::
|
||||
* The current position within the stream.
|
||||
*
|
||||
@ -335,13 +344,12 @@ FT_BEGIN_HEADER
|
||||
|
||||
} FT_StreamRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSYSTEM_H__ */
|
||||
#endif /* FTSYSTEM_H_ */
|
||||
|
||||
|
||||
/* END */
|
16
drivers/freetype/freetype/include/freetype/fttrigon.h → drivers/freetype/include/freetype/fttrigon.h
16
drivers/freetype/freetype/include/freetype/fttrigon.h → drivers/freetype/include/freetype/fttrigon.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType trigonometric functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2001, 2003, 2005, 2007, 2013 by */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTTRIGON_H__
|
||||
#define __FTTRIGON_H__
|
||||
#ifndef FTTRIGON_H_
|
||||
#define FTTRIGON_H_
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
@ -225,8 +225,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Return the unit vector corresponding to a given angle. After the
|
||||
* call, the value of `vec.x' will be `sin(angle)', and the value of
|
||||
* `vec.y' will be `cos(angle)'.
|
||||
* call, the value of `vec.x' will be `cos(angle)', and the value of
|
||||
* `vec.y' will be `sin(angle)'.
|
||||
*
|
||||
* This function is useful to retrieve both the sinus and cosinus of a
|
||||
* given angle quickly.
|
||||
@ -237,7 +237,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
* The input angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
@ -259,7 +259,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
* The input angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
@ -344,7 +344,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTTRIGON_H__ */
|
||||
#endif /* FTTRIGON_H_ */
|
||||
|
||||
|
||||
/* END */
|
327
drivers/freetype/include/freetype/ftttdrv.h
Normal file
327
drivers/freetype/include/freetype/ftttdrv.h
Normal file
@ -0,0 +1,327 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftttdrv.h */
|
||||
/* */
|
||||
/* FreeType API for controlling the TrueType driver */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 2013-2016 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 FTTTDRV_H_
|
||||
#define FTTTDRV_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* tt_driver
|
||||
*
|
||||
* @title:
|
||||
* The TrueType driver
|
||||
*
|
||||
* @abstract:
|
||||
* Controlling the TrueType driver module.
|
||||
*
|
||||
* @description:
|
||||
* While FreeType's TrueType driver doesn't expose API functions by
|
||||
* itself, it is possible to control its behaviour with @FT_Property_Set
|
||||
* and @FT_Property_Get. The following lists the available properties
|
||||
* together with the necessary macros and structures.
|
||||
*
|
||||
* The TrueType driver's module name is `truetype'.
|
||||
*
|
||||
* We start with a list of definitions, kindly provided by Greg
|
||||
* Hitchcock.
|
||||
*
|
||||
* _Bi-Level_ _Rendering_
|
||||
*
|
||||
* Monochromatic rendering, exclusively used in the early days of
|
||||
* TrueType by both Apple and Microsoft. Microsoft's GDI interface
|
||||
* supported hinting of the right-side bearing point, such that the
|
||||
* advance width could be non-linear. Most often this was done to
|
||||
* achieve some level of glyph symmetry. To enable reasonable
|
||||
* performance (e.g., not having to run hinting on all glyphs just to
|
||||
* get the widths) there was a bit in the head table indicating if the
|
||||
* side bearing was hinted, and additional tables, `hdmx' and `LTSH', to
|
||||
* cache hinting widths across multiple sizes and device aspect ratios.
|
||||
*
|
||||
* _Font_ _Smoothing_
|
||||
*
|
||||
* Microsoft's GDI implementation of anti-aliasing. Not traditional
|
||||
* anti-aliasing as the outlines were hinted before the sampling. The
|
||||
* widths matched the bi-level rendering.
|
||||
*
|
||||
* _ClearType_ _Rendering_
|
||||
*
|
||||
* Technique that uses physical subpixels to improve rendering on LCD
|
||||
* (and other) displays. Because of the higher resolution, many methods
|
||||
* of improving symmetry in glyphs through hinting the right-side
|
||||
* bearing were no longer necessary. This lead to what GDI calls
|
||||
* `natural widths' ClearType, see
|
||||
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec21. Since hinting
|
||||
* has extra resolution, most non-linearity went away, but it is still
|
||||
* possible for hints to change the advance widths in this mode.
|
||||
*
|
||||
* _ClearType_ _Compatible_ _Widths_
|
||||
*
|
||||
* One of the earliest challenges with ClearType was allowing the
|
||||
* implementation in GDI to be selected without requiring all UI and
|
||||
* documents to reflow. To address this, a compatible method of
|
||||
* rendering ClearType was added where the font hints are executed once
|
||||
* to determine the width in bi-level rendering, and then re-run in
|
||||
* ClearType, with the difference in widths being absorbed in the font
|
||||
* hints for ClearType (mostly in the white space of hints); see
|
||||
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec20. Somewhat by
|
||||
* definition, compatible width ClearType allows for non-linear widths,
|
||||
* but only when the bi-level version has non-linear widths.
|
||||
*
|
||||
* _ClearType_ _Subpixel_ _Positioning_
|
||||
*
|
||||
* One of the nice benefits of ClearType is the ability to more crisply
|
||||
* display fractional widths; unfortunately, the GDI model of integer
|
||||
* bitmaps did not support this. However, the WPF and Direct Write
|
||||
* frameworks do support fractional widths. DWrite calls this `natural
|
||||
* mode', not to be confused with GDI's `natural widths'. Subpixel
|
||||
* positioning, in the current implementation of Direct Write,
|
||||
* unfortunately does not support hinted advance widths, see
|
||||
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec22. Note that the
|
||||
* TrueType interpreter fully allows the advance width to be adjusted in
|
||||
* this mode, just the DWrite client will ignore those changes.
|
||||
*
|
||||
* _ClearType_ _Backwards_ _Compatibility_
|
||||
*
|
||||
* This is a set of exceptions made in the TrueType interpreter to
|
||||
* minimize hinting techniques that were problematic with the extra
|
||||
* resolution of ClearType; see
|
||||
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
|
||||
* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
|
||||
* This technique is not to be confused with ClearType compatible
|
||||
* widths. ClearType backwards compatibility has no direct impact on
|
||||
* changing advance widths, but there might be an indirect impact on
|
||||
* disabling some deltas. This could be worked around in backwards
|
||||
* compatibility mode.
|
||||
*
|
||||
* _Native_ _ClearType_ _Mode_
|
||||
*
|
||||
* (Not to be confused with `natural widths'.) This mode removes all
|
||||
* the exceptions in the TrueType interpreter when running with
|
||||
* ClearType. Any issues on widths would still apply, though.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* interpreter-version
|
||||
*
|
||||
* @description:
|
||||
|
||||
* Currently, three versions are available, two representing the
|
||||
* bytecode interpreter with subpixel hinting support (old `Infinality'
|
||||
* code and new stripped-down and higher performance `minimal' code) and
|
||||
* one without, respectively. The default is subpixel support if
|
||||
* TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support
|
||||
* otherwise (since it isn't available then).
|
||||
*
|
||||
* If subpixel hinting is on, many TrueType bytecode instructions behave
|
||||
* differently compared to B/W or grayscale rendering (except if `native
|
||||
* ClearType' is selected by the font). Microsoft's main idea is to
|
||||
* render at a much increased horizontal resolution, then sampling down
|
||||
* the created output to subpixel precision. However, many older fonts
|
||||
* are not suited to this and must be specially taken care of by
|
||||
* applying (hardcoded) tweaks in Microsoft's interpreter.
|
||||
*
|
||||
* Details on subpixel hinting and some of the necessary tweaks can be
|
||||
* found in Greg Hitchcock's whitepaper at
|
||||
* `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
|
||||
* 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
|
||||
* to arrive at very similar results.
|
||||
*
|
||||
* The following example code demonstrates how to deactivate subpixel
|
||||
* hinting (omitting the error handling).
|
||||
*
|
||||
* {
|
||||
* FT_Library library;
|
||||
* FT_Face face;
|
||||
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "truetype",
|
||||
* "interpreter-version",
|
||||
* &interpreter_version );
|
||||
* }
|
||||
*
|
||||
* @note:
|
||||
* This property can be used with @FT_Property_Get also.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* TT_INTERPRETER_VERSION_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of constants used for the @interpreter-version property to
|
||||
* select the hinting engine for Truetype fonts.
|
||||
*
|
||||
* The numeric value in the constant names represents the version
|
||||
* number as returned by the `GETINFO' bytecode instruction.
|
||||
*
|
||||
* @values:
|
||||
* TT_INTERPRETER_VERSION_35 ::
|
||||
* Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
|
||||
* Windows~98; only grayscale and B/W rasterizing is supported.
|
||||
*
|
||||
* TT_INTERPRETER_VERSION_38 ::
|
||||
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
|
||||
* equivalent to the hinting provided by DirectWrite ClearType (as can
|
||||
* be found, for example, in the Internet Explorer~9 running on
|
||||
* Windows~7). It is used in FreeType to select the `Infinality'
|
||||
* subpixel hinting code. The code may be removed in a future
|
||||
* version.
|
||||
*
|
||||
* TT_INTERPRETER_VERSION_40 ::
|
||||
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
|
||||
* equivalent to the hinting provided by DirectWrite ClearType (as can
|
||||
* be found, for example, in Microsoft's Edge Browser on Windows~10).
|
||||
* It is used in FreeType to select the `minimal' subpixel hinting
|
||||
* code, a stripped-down and higher performance version of the
|
||||
* `Infinality' code.
|
||||
*
|
||||
* @note:
|
||||
* This property controls the behaviour of the bytecode interpreter
|
||||
* and thus how outlines get hinted. It does *not* control how glyph
|
||||
* get rasterized! In particular, it does not control subpixel color
|
||||
* filtering.
|
||||
*
|
||||
* If FreeType has not been compiled with the configuration option
|
||||
* FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
|
||||
* an `FT_Err_Unimplemented_Feature' error.
|
||||
*
|
||||
* Depending on the graphics framework, Microsoft uses different
|
||||
* bytecode and rendering engines. As a consequence, the version
|
||||
* numbers returned by a call to the `GETINFO' bytecode instruction are
|
||||
* more convoluted than desired.
|
||||
*
|
||||
* Here are two tables that try to shed some light on the possible
|
||||
* values for the MS rasterizer engine, together with the additional
|
||||
* features introduced by it.
|
||||
*
|
||||
* {
|
||||
* GETINFO framework version feature
|
||||
* -------------------------------------------------------------------
|
||||
* 3 GDI (Win 3.1), v1.0 16-bit, first version
|
||||
* TrueImage
|
||||
* 33 GDI (Win NT 3.1), v1.5 32-bit
|
||||
* HP Laserjet
|
||||
* 34 GDI (Win 95) v1.6 font smoothing,
|
||||
* new SCANTYPE opcode
|
||||
* 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET
|
||||
* bits in composite glyphs
|
||||
* 36 MGDI (Win CE 2) v1.6+ classic ClearType
|
||||
* 37 GDI (XP and later), v1.8 ClearType
|
||||
* GDI+ old (before Vista)
|
||||
* 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType,
|
||||
* WPF Y-direction ClearType,
|
||||
* additional error checking
|
||||
* 39 DWrite (before Win 8) v2.0 subpixel ClearType flags
|
||||
* in GETINFO opcode,
|
||||
* bug fixes
|
||||
* 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag
|
||||
* DWrite (Win 8) in GETINFO opcode,
|
||||
* Gray ClearType
|
||||
* }
|
||||
*
|
||||
* The `version' field gives a rough orientation only, since some
|
||||
* applications provided certain features much earlier (as an example,
|
||||
* Microsoft Reader used subpixel and Y-direction ClearType already in
|
||||
* Windows 2000). Similarly, updates to a given framework might include
|
||||
* improved hinting support.
|
||||
*
|
||||
* {
|
||||
* version sampling rendering comment
|
||||
* x y x y
|
||||
* --------------------------------------------------------------
|
||||
* v1.0 normal normal B/W B/W bi-level
|
||||
* v1.6 high high gray gray grayscale
|
||||
* v1.8 high normal color-filter B/W (GDI) ClearType
|
||||
* v1.9 high high color-filter gray Color ClearType
|
||||
* v2.1 high normal gray B/W Gray ClearType
|
||||
* v2.1 high high gray gray Gray ClearType
|
||||
* }
|
||||
*
|
||||
* Color and Gray ClearType are the two available variants of
|
||||
* `Y-direction ClearType', meaning grayscale rasterization along the
|
||||
* Y-direction; the name used in the TrueType specification for this
|
||||
* feature is `symmetric smoothing'. `Classic ClearType' is the
|
||||
* original algorithm used before introducing a modified version in
|
||||
* Win~XP. Another name for v1.6's grayscale rendering is `font
|
||||
* smoothing', and `Color ClearType' is sometimes also called `DWrite
|
||||
* ClearType'. To differentiate between today's Color ClearType and the
|
||||
* earlier ClearType variant with B/W rendering along the vertical axis,
|
||||
* the latter is sometimes called `GDI ClearType'.
|
||||
*
|
||||
* `Normal' and `high' sampling describe the (virtual) resolution to
|
||||
* access the rasterized outline after the hinting process. `Normal'
|
||||
* means 1 sample per grid line (i.e., B/W). In the current Microsoft
|
||||
* implementation, `high' means an extra virtual resolution of 16x16 (or
|
||||
* 16x1) grid lines per pixel for bytecode instructions like `MIRP'.
|
||||
* After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
|
||||
* lines for color filtering if Color ClearType is activated.
|
||||
*
|
||||
* Note that `Gray ClearType' is essentially the same as v1.6's
|
||||
* grayscale rendering. However, the GETINFO instruction handles it
|
||||
* differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1
|
||||
* returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing),
|
||||
* and~19 (Gray ClearType). Also, this mode respects bits 2 and~3 for
|
||||
* the version~1 gasp table exclusively (like Color ClearType), while
|
||||
* v1.6 only respects the values of version~0 (bits 0 and~1).
|
||||
*
|
||||
* Keep in mind that the features of the above interpreter versions
|
||||
* might not map exactly to FreeType features or behavior because it is
|
||||
* a fundamentally different library with different internals.
|
||||
*
|
||||
*/
|
||||
#define TT_INTERPRETER_VERSION_35 35
|
||||
#define TT_INTERPRETER_VERSION_38 38
|
||||
#define TT_INTERPRETER_VERSION_40 40
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTTTDRV_H_ */
|
||||
|
||||
|
||||
/* END */
|
20
drivers/freetype/freetype/include/freetype/fttypes.h → drivers/freetype/include/freetype/fttypes.h
20
drivers/freetype/freetype/include/freetype/fttypes.h → drivers/freetype/include/freetype/fttypes.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType simple types definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTTYPES_H__
|
||||
#define __FTTYPES_H__
|
||||
#ifndef FTTYPES_H_
|
||||
#define FTTYPES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -57,6 +57,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_UInt16 */
|
||||
/* FT_Int32 */
|
||||
/* FT_UInt32 */
|
||||
/* FT_Int64 */
|
||||
/* FT_UInt64 */
|
||||
/* FT_Short */
|
||||
/* FT_UShort */
|
||||
/* FT_Long */
|
||||
@ -78,7 +80,9 @@ FT_BEGIN_HEADER
|
||||
/* FT_F2Dot14 */
|
||||
/* FT_UnitVector */
|
||||
/* FT_F26Dot6 */
|
||||
/* FT_Data */
|
||||
/* */
|
||||
/* FT_MAKE_TAG */
|
||||
/* */
|
||||
/* FT_Generic */
|
||||
/* FT_Generic_Finalizer */
|
||||
@ -418,7 +422,7 @@ FT_BEGIN_HEADER
|
||||
/* details of usage. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* The address of the FreeType object which is under finalization. */
|
||||
/* The address of the FreeType object that is under finalization. */
|
||||
/* Its client data is accessed through its `generic' field. */
|
||||
/* */
|
||||
typedef void (*FT_Generic_Finalizer)(void* object);
|
||||
@ -466,8 +470,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_MAKE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four-letter tags which are used to label */
|
||||
/* TrueType tables into an unsigned long to be used within FreeType. */
|
||||
/* This macro converts four-letter tags that are used to label */
|
||||
/* TrueType tables into an unsigned long, to be used within FreeType. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The produced values *must* be 32-bit integers. Don't redefine */
|
||||
@ -567,9 +571,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
} FT_ListRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
|
||||
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
|
||||
|
||||
@ -592,7 +596,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTTYPES_H__ */
|
||||
#endif /* FTTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
19
drivers/freetype/freetype/include/freetype/ftwinfnt.h → drivers/freetype/include/freetype/ftwinfnt.h
19
drivers/freetype/freetype/include/freetype/ftwinfnt.h → drivers/freetype/include/freetype/ftwinfnt.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing Windows fnt-specific data. */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2008 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTWINFNT_H__
|
||||
#define __FTWINFNT_H__
|
||||
#ifndef FTWINFNT_H_
|
||||
#define FTWINFNT_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@ -58,9 +58,10 @@ FT_BEGIN_HEADER
|
||||
* @description:
|
||||
* A list of valid values for the `charset' byte in
|
||||
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
|
||||
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org
|
||||
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
|
||||
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
|
||||
* encodings (except for cp1361) can be found at
|
||||
* ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
|
||||
* subdirectory. cp1361 is roughly a superset of
|
||||
* MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
|
||||
*
|
||||
* @values:
|
||||
* FT_WinFNT_ID_DEFAULT ::
|
||||
@ -94,7 +95,7 @@ FT_BEGIN_HEADER
|
||||
* second default codepage that most international versions of
|
||||
* Windows have. It is one of the OEM codepages from
|
||||
*
|
||||
* http://www.microsoft.com/globaldev/reference/cphome.mspx,
|
||||
* https://msdn.microsoft.com/en-us/goglobal/bb964655,
|
||||
*
|
||||
* and is used for the `DOS boxes', to support legacy applications.
|
||||
* A German Windows version for example usually uses ANSI codepage
|
||||
@ -258,12 +259,12 @@ FT_BEGIN_HEADER
|
||||
FT_Get_WinFNT_Header( FT_Face face,
|
||||
FT_WinFNT_HeaderRec *aheader );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTWINFNT_H__ */
|
||||
#endif /* FTWINFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* High-level `autohint' module-specific interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2007, 2009, 2012 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -24,8 +24,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AUTOHINT_H__
|
||||
#define __AUTOHINT_H__
|
||||
#ifndef AUTOHINT_H_
|
||||
#define AUTOHINT_H_
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -238,7 +238,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AUTOHINT_H__ */
|
||||
#endif /* AUTOHINT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2008, 2009, 2012-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCALC_H__
|
||||
#define __FTCALC_H__
|
||||
#ifndef FTCALC_H_
|
||||
#define FTCALC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -27,33 +27,224 @@
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_FixedSqrt */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 16.16 fixed-point value. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The value to compute the root for. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `sqrt(x)'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is not very fast. */
|
||||
/* */
|
||||
FT_BASE( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
|
||||
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
__asm
|
||||
{
|
||||
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
|
||||
mov a, t, asr #31 /* a = (hi >> 31) */
|
||||
add a, a, #0x8000 /* a += 0x8000 */
|
||||
adds t2, t2, a /* t2 += a */
|
||||
adc t, t, #0 /* t += carry */
|
||||
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;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
|
||||
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
|
||||
#if defined( __clang__ ) && defined( __thumb2__ )
|
||||
"add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
#else
|
||||
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
#endif
|
||||
"adds %1, %1, %0\n\t" /* %1 += %0 */
|
||||
"adc %2, %2, #0\n\t" /* %2 += carry */
|
||||
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
|
||||
"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
|
||||
: "=r"(a), "=&r"(t2), "=&r"(t)
|
||||
: "r"(a), "r"(b)
|
||||
: "cc" );
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __arm__ && */
|
||||
/* ( __thumb2__ || !__thumb__ ) && */
|
||||
/* !( __CC_ARM || __ARMCC__ ) */
|
||||
|
||||
|
||||
#if defined( __i386__ )
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"imul %%edx\n"
|
||||
"movl %%edx, %%ecx\n"
|
||||
"sarl $31, %%ecx\n"
|
||||
"addl $0x8000, %%ecx\n"
|
||||
"addl %%ecx, %%eax\n"
|
||||
"adcl $0, %%edx\n"
|
||||
"shrl $16, %%eax\n"
|
||||
"shll $16, %%edx\n"
|
||||
"addl %%edx, %%eax\n"
|
||||
: "=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;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a
|
||||
mov edx, b
|
||||
imul edx
|
||||
mov ecx, edx
|
||||
sar ecx, 31
|
||||
add ecx, 8000h
|
||||
add eax, ecx
|
||||
adc edx, 0
|
||||
shr eax, 16
|
||||
shl edx, 16
|
||||
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
|
||||
}
|
||||
|
||||
#endif /* __GNUC__ && __x86_64__ */
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
#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
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -108,6 +299,18 @@ FT_BEGIN_HEADER
|
||||
FT_Long scaling );
|
||||
|
||||
|
||||
/*
|
||||
* This function normalizes a vector and returns its original length.
|
||||
* The normalized vector is a 16.16 fixed-point unit vector with length
|
||||
* close to 0x10000. The accuracy of the returned length is limited to
|
||||
* 16 bits also. The function utilizes quick inverse square root
|
||||
* approximation without divisions and square roots relying on Newton's
|
||||
* iterations instead.
|
||||
*/
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_Vector_NormLen( FT_Vector* vector );
|
||||
|
||||
|
||||
/*
|
||||
* Return -1, 0, or +1, depending on the orientation of a given corner.
|
||||
* We use the Cartesian coordinate system, with positive vertical values
|
||||
@ -120,10 +323,11 @@ FT_BEGIN_HEADER
|
||||
FT_Pos out_x,
|
||||
FT_Pos out_y );
|
||||
|
||||
|
||||
/*
|
||||
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
|
||||
* saying that the angle difference between the `in' and `out' vectors is
|
||||
* very small.
|
||||
* saying that the corner point is close to its neighbors, or inside an
|
||||
* ellipse defined by the neighbor focal points to be more precise.
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
ft_corner_is_flat( FT_Pos in_x,
|
||||
@ -135,9 +339,31 @@ FT_BEGIN_HEADER
|
||||
/*
|
||||
* Return the most significant bit index.
|
||||
*/
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||
#if defined( __GNUC__ ) && \
|
||||
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
#define FT_MSB( x ) ( 31 - __builtin_clz( x ) )
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
#ifndef FT_MSB
|
||||
|
||||
FT_BASE( FT_Int )
|
||||
FT_MSB( FT_UInt32 z );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
|
||||
@ -148,6 +374,31 @@ FT_BEGIN_HEADER
|
||||
FT_Fixed y );
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_SqrtFixed */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 16.16 fixed-point value. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The value to compute the root for. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `sqrt(x)'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is not very fast. */
|
||||
/* */
|
||||
FT_BASE( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
||||
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
|
||||
@ -161,7 +412,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCALC_H__ */
|
||||
#endif /* FTCALC_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004, 2006-2009, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -21,8 +21,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTDEBUG_H__
|
||||
#define __FTDEBUG_H__
|
||||
#ifndef FTDEBUG_H_
|
||||
#define FTDEBUG_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -140,7 +140,7 @@ FT_BEGIN_HEADER
|
||||
/* This function may be useful if you want to control FreeType 2's */
|
||||
/* debug level in your application. */
|
||||
/* */
|
||||
FT_BASE( const char * )
|
||||
FT_BASE( const char* )
|
||||
FT_Trace_Get_Name( FT_Int idx );
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDEBUG_H__ */
|
||||
#endif /* FTDEBUG_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2006, 2008, 2011-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTDRIVER_H__
|
||||
#define __FTDRIVER_H__
|
||||
#ifndef FTDRIVER_H_
|
||||
#define FTDRIVER_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -213,7 +213,7 @@ FT_BEGIN_HEADER
|
||||
/* And when it is no longer needed a `destroy' function needs to be */
|
||||
/* called to release that allocation. */
|
||||
/* */
|
||||
/* `fcinit.c' (ft_create_default_module_classes) already contains a */
|
||||
/* `ftinit.c' (ft_create_default_module_classes) already contains a */
|
||||
/* mechanism to call these functions for the default modules */
|
||||
/* described in `ftmodule.h'. */
|
||||
/* */
|
||||
@ -403,7 +403,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDRIVER_H__ */
|
||||
#endif /* FTDRIVER_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType glyph loader (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2005, 2006 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGLOADR_H__
|
||||
#define __FTGLOADR_H__
|
||||
#ifndef FTGLOADR_H_
|
||||
#define FTGLOADR_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -36,24 +36,6 @@ FT_BEGIN_HEADER
|
||||
/* The glyph loader is an internal object used to load several glyphs */
|
||||
/* together (for example, in the case of composites). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The glyph loader implementation is not part of the high-level API, */
|
||||
/* hence the forward structure declaration. */
|
||||
/* */
|
||||
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
|
||||
|
||||
|
||||
#if 0 /* moved to freetype.h in version 2.2 */
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
|
||||
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
|
||||
#define FT_SUBGLYPH_FLAG_SCALE 8
|
||||
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
||||
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
||||
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct FT_SubGlyphRec_
|
||||
{
|
||||
FT_Int index;
|
||||
@ -89,7 +71,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
void* other; /* for possible future extension? */
|
||||
|
||||
} FT_GlyphLoaderRec;
|
||||
} FT_GlyphLoaderRec, *FT_GlyphLoader;
|
||||
|
||||
|
||||
/* create new empty glyph loader */
|
||||
@ -121,21 +103,25 @@ FT_BEGIN_HEADER
|
||||
FT_UInt n_contours );
|
||||
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
||||
( (_count) == 0 || ((_loader)->base.outline.n_points + \
|
||||
(_loader)->current.outline.n_points + \
|
||||
(unsigned long)(_count)) <= (_loader)->max_points )
|
||||
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
||||
( (_count) == 0 || \
|
||||
( (FT_UInt)(_loader)->base.outline.n_points + \
|
||||
(FT_UInt)(_loader)->current.outline.n_points + \
|
||||
(FT_UInt)(_count) ) <= (_loader)->max_points )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
||||
( (_count) == 0 || ((_loader)->base.outline.n_contours + \
|
||||
(_loader)->current.outline.n_contours + \
|
||||
(unsigned long)(_count)) <= (_loader)->max_contours )
|
||||
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
||||
( (_count) == 0 || \
|
||||
( (FT_UInt)(_loader)->base.outline.n_contours + \
|
||||
(FT_UInt)(_loader)->current.outline.n_contours + \
|
||||
(FT_UInt)(_count) ) <= (_loader)->max_contours )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
|
||||
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
||||
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
||||
? 0 \
|
||||
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
|
||||
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \
|
||||
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
||||
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
||||
? 0 \
|
||||
: FT_GlyphLoader_CheckPoints( (_loader), \
|
||||
(FT_UInt)(_points), \
|
||||
(FT_UInt)(_contours) ) )
|
||||
|
||||
|
||||
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
||||
@ -162,7 +148,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGLOADR_H__ */
|
||||
#endif /* FTGLOADR_H_ */
|
||||
|
||||
|
||||
/* END */
|
136
drivers/freetype/include/freetype/internal/fthash.h
Normal file
136
drivers/freetype/include/freetype/internal/fthash.h
Normal file
@ -0,0 +1,136 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* fthash.h */
|
||||
/* */
|
||||
/* Hashing functions (specification). */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
* Copyright 2001-2015
|
||||
* 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 COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY 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.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
|
||||
/* */
|
||||
/* taken from Mark Leisher's xmbdfed package */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTHASH_H_
|
||||
#define FTHASH_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef union FT_Hashkey_
|
||||
{
|
||||
FT_Int num;
|
||||
const char* str;
|
||||
|
||||
} FT_Hashkey;
|
||||
|
||||
|
||||
typedef struct FT_HashnodeRec_
|
||||
{
|
||||
FT_Hashkey key;
|
||||
size_t data;
|
||||
|
||||
} FT_HashnodeRec;
|
||||
|
||||
typedef struct FT_HashnodeRec_ *FT_Hashnode;
|
||||
|
||||
|
||||
typedef FT_ULong
|
||||
(*FT_Hash_LookupFunc)( FT_Hashkey* key );
|
||||
|
||||
typedef FT_Bool
|
||||
(*FT_Hash_CompareFunc)( FT_Hashkey* a,
|
||||
FT_Hashkey* b );
|
||||
|
||||
|
||||
typedef struct FT_HashRec_
|
||||
{
|
||||
FT_UInt limit;
|
||||
FT_UInt size;
|
||||
FT_UInt used;
|
||||
|
||||
FT_Hash_LookupFunc lookup;
|
||||
FT_Hash_CompareFunc compare;
|
||||
|
||||
FT_Hashnode* table;
|
||||
|
||||
} FT_HashRec;
|
||||
|
||||
typedef struct FT_HashRec_ *FT_Hash;
|
||||
|
||||
|
||||
FT_Error
|
||||
ft_hash_str_init( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_Error
|
||||
ft_hash_num_init( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
void
|
||||
ft_hash_str_free( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
#define ft_hash_num_free ft_hash_str_free
|
||||
|
||||
FT_Error
|
||||
ft_hash_str_insert( const char* key,
|
||||
size_t data,
|
||||
FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_Error
|
||||
ft_hash_num_insert( FT_Int num,
|
||||
size_t data,
|
||||
FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
size_t*
|
||||
ft_hash_str_lookup( const char* key,
|
||||
FT_Hash hash );
|
||||
|
||||
size_t*
|
||||
ft_hash_num_lookup( FT_Int num,
|
||||
FT_Hash hash );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTHASH_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004-2007, 2010, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMEMORY_H__
|
||||
#define __FTMEMORY_H__
|
||||
#ifndef FTMEMORY_H_
|
||||
#define FTMEMORY_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -65,13 +65,15 @@ FT_BEGIN_HEADER
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C++"
|
||||
extern "C++"
|
||||
{
|
||||
template <typename T> inline T*
|
||||
cplusplus_typeof( T*,
|
||||
void *v )
|
||||
{
|
||||
return static_cast <T*> ( v );
|
||||
}
|
||||
}
|
||||
|
||||
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
|
||||
|
||||
@ -215,11 +217,14 @@ FT_BEGIN_HEADER
|
||||
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
|
||||
|
||||
|
||||
#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
|
||||
#define FT_MEM_SET( dest, byte, count ) \
|
||||
ft_memset( dest, byte, (FT_Offset)(count) )
|
||||
|
||||
#define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count )
|
||||
#define FT_MEM_COPY( dest, source, count ) \
|
||||
ft_memcpy( dest, source, (FT_Offset)(count) )
|
||||
|
||||
#define FT_MEM_MOVE( dest, source, count ) ft_memmove( dest, source, count )
|
||||
#define FT_MEM_MOVE( dest, source, count ) \
|
||||
ft_memmove( dest, source, (FT_Offset)(count) )
|
||||
|
||||
|
||||
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
|
||||
@ -227,14 +232,19 @@ FT_BEGIN_HEADER
|
||||
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
|
||||
|
||||
|
||||
#define FT_ARRAY_ZERO( dest, count ) \
|
||||
FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
|
||||
#define FT_ARRAY_ZERO( dest, count ) \
|
||||
FT_MEM_ZERO( dest, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
#define FT_ARRAY_COPY( dest, source, count ) \
|
||||
FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )
|
||||
#define FT_ARRAY_COPY( dest, source, count ) \
|
||||
FT_MEM_COPY( dest, \
|
||||
source, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
#define FT_ARRAY_MOVE( dest, source, count ) \
|
||||
FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )
|
||||
#define FT_ARRAY_MOVE( dest, source, count ) \
|
||||
FT_MEM_MOVE( dest, \
|
||||
source, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
|
||||
/*
|
||||
@ -372,7 +382,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTMEMORY_H__ */
|
||||
#endif /* FTMEMORY_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2008, 2010, 2012-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -23,8 +23,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOBJS_H__
|
||||
#define __FTOBJS_H__
|
||||
#ifndef FTOBJS_H_
|
||||
#define FTOBJS_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_RENDER_H
|
||||
@ -72,24 +72,27 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
||||
|
||||
/*
|
||||
* Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'
|
||||
* algorithm. We use alpha = 1, beta = 3/8, giving us results with a
|
||||
* largest error less than 7% compared to the exact value.
|
||||
*/
|
||||
#define FT_HYPOT( x, y ) \
|
||||
( x = FT_ABS( x ), \
|
||||
y = FT_ABS( y ), \
|
||||
x > y ? x + ( 3 * y >> 3 ) \
|
||||
: y + ( 3 * x >> 3 ) )
|
||||
|
||||
#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
|
||||
/* we use FT_TYPEOF to suppress signedness compilation warnings */
|
||||
#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n)-1 ) )
|
||||
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
|
||||
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
|
||||
|
||||
#define FT_PIX_FLOOR( x ) ( (x) & ~63 )
|
||||
#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
|
||||
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
|
||||
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
|
||||
|
||||
|
||||
/*
|
||||
* Return the highest power of 2 that is <= value; this correspond to
|
||||
* the highest bit in a given 32-bit value.
|
||||
*/
|
||||
FT_BASE( FT_UInt32 )
|
||||
ft_highpow2( FT_UInt32 value );
|
||||
|
||||
|
||||
/*
|
||||
* character classification functions -- since these are used to parse
|
||||
* font files, we must not use those in <ctypes.h> which are
|
||||
@ -338,12 +341,6 @@ FT_BEGIN_HEADER
|
||||
/* this data when first opened. This field exists only if */
|
||||
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
|
||||
/* */
|
||||
/* ignore_unpatented_hinter :: */
|
||||
/* This boolean flag instructs the glyph loader to ignore the */
|
||||
/* native font hinter, if one is found. This is exclusively used */
|
||||
/* in the case when the unpatented hinter is compiled within the */
|
||||
/* library. */
|
||||
/* */
|
||||
/* refcount :: */
|
||||
/* A counter initialized to~1 at the time an @FT_Face structure is */
|
||||
/* created. @FT_Reference_Face increments this counter, and */
|
||||
@ -362,7 +359,6 @@ FT_BEGIN_HEADER
|
||||
FT_Incremental_InterfaceRec* incremental_interface;
|
||||
#endif
|
||||
|
||||
FT_Bool ignore_unpatented_hinter;
|
||||
FT_Int refcount;
|
||||
|
||||
} FT_Face_InternalRec;
|
||||
@ -402,7 +398,7 @@ FT_BEGIN_HEADER
|
||||
/* glyph_hints :: Format-specific glyph hints management. */
|
||||
/* */
|
||||
|
||||
#define FT_GLYPH_OWN_BITMAP 0x1
|
||||
#define FT_GLYPH_OWN_BITMAP 0x1U
|
||||
|
||||
typedef struct FT_Slot_InternalRec_
|
||||
{
|
||||
@ -503,6 +499,9 @@ FT_BEGIN_HEADER
|
||||
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
FT_MODULE_DRIVER_HAS_HINTER )
|
||||
|
||||
#define FT_DRIVER_HINTS_LIGHTLY( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
FT_MODULE_DRIVER_HINTS_LIGHTLY )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -611,12 +610,12 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_REQUEST_WIDTH( req ) \
|
||||
( (req)->horiResolution \
|
||||
? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
|
||||
? ( (req)->width * (FT_Pos)(req)->horiResolution + 36 ) / 72 \
|
||||
: (req)->width )
|
||||
|
||||
#define FT_REQUEST_HEIGHT( req ) \
|
||||
( (req)->vertResolution \
|
||||
? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
|
||||
? ( (req)->height * (FT_Pos)(req)->vertResolution + 36 ) / 72 \
|
||||
: (req)->height )
|
||||
|
||||
|
||||
@ -738,9 +737,8 @@ FT_BEGIN_HEADER
|
||||
/* faces_list :: The list of faces currently opened by this */
|
||||
/* driver. */
|
||||
/* */
|
||||
/* glyph_loader :: The glyph loader for all faces managed by this */
|
||||
/* driver. This object isn't defined for unscalable */
|
||||
/* formats. */
|
||||
/* glyph_loader :: Unused. Used to be glyph loader for all faces */
|
||||
/* managed by this driver. */
|
||||
/* */
|
||||
typedef struct FT_DriverRec_
|
||||
{
|
||||
@ -770,13 +768,6 @@ FT_BEGIN_HEADER
|
||||
#define FT_DEBUG_HOOK_TRUETYPE 0
|
||||
|
||||
|
||||
/* Set this debug hook to a non-null pointer to force unpatented hinting */
|
||||
/* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
|
||||
/* during debugging. */
|
||||
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
|
||||
|
||||
|
||||
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
|
||||
FT_Render_Mode render_mode,
|
||||
FT_Library library );
|
||||
@ -842,7 +833,7 @@ FT_BEGIN_HEADER
|
||||
/* filtering callback function. */
|
||||
/* */
|
||||
/* pic_container :: Contains global structs and tables, instead */
|
||||
/* of defining them globallly. */
|
||||
/* of defining them globally. */
|
||||
/* */
|
||||
/* refcount :: A counter initialized to~1 at the time an */
|
||||
/* @FT_Library structure is created. */
|
||||
@ -980,8 +971,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Used to initialize an instance of FT_Outline_Funcs struct. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
|
||||
/* be called with a pre-allocated structure to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
|
||||
/* to be called with a pre-allocated structure to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
|
||||
/* allocated in the global scope (or the scope where the macro */
|
||||
/* is used). */
|
||||
@ -1039,8 +1030,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Used to initialize an instance of FT_Raster_Funcs struct. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
|
||||
/* be called with a pre-allocated structure to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
|
||||
/* to be called with a pre-allocated structure to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
|
||||
/* allocated in the global scope (or the scope where the macro */
|
||||
/* is used). */
|
||||
@ -1099,8 +1090,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Used to initialize an instance of FT_Glyph_Class struct. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
|
||||
/* be called with a pre-allocated stcture to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
|
||||
/* to be called with a pre-allocated structure to be filled. */
|
||||
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
|
||||
/* allocated in the global scope (or the scope where the macro */
|
||||
/* is used). */
|
||||
@ -1173,11 +1164,11 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Used to initialize an instance of FT_Renderer_Class struct. */
|
||||
/* */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
|
||||
/* to be called with a pointer where the allocated structure is */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined a `create' function will */
|
||||
/* need to be called with a pointer where the allocated structure is */
|
||||
/* returned. And when it is no longer needed a `destroy' function */
|
||||
/* needs to be called to release that allocation. */
|
||||
/* `fcinit.c' (ft_create_default_module_classes) already contains */
|
||||
/* `ftinit.c' (ft_create_default_module_classes) already contains */
|
||||
/* a mechanism to call these functions for the default modules */
|
||||
/* described in `ftmodule.h'. */
|
||||
/* */
|
||||
@ -1377,11 +1368,11 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Used to initialize an instance of an FT_Module_Class struct. */
|
||||
/* */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
|
||||
/* be called with a pointer where the allocated structure is */
|
||||
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs */
|
||||
/* to be called with a pointer where the allocated structure is */
|
||||
/* returned. And when it is no longer needed a `destroy' function */
|
||||
/* needs to be called to release that allocation. */
|
||||
/* `fcinit.c' (ft_create_default_module_classes) already contains */
|
||||
/* `ftinit.c' (ft_create_default_module_classes) already contains */
|
||||
/* a mechanism to call these functions for the default modules */
|
||||
/* described in `ftmodule.h'. */
|
||||
/* */
|
||||
@ -1563,7 +1554,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTOBJS_H__ */
|
||||
#endif /* FTOBJS_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType position independent code services (declaration). */
|
||||
/* */
|
||||
/* Copyright 2009, 2012 by */
|
||||
/* Copyright 2009-2016 by */
|
||||
/* Oran Agra and Mickey Gabel. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -23,8 +23,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTPIC_H__
|
||||
#define __FTPIC_H__
|
||||
#ifndef FTPIC_H_
|
||||
#define FTPIC_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
@ -65,7 +65,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTPIC_H__ */
|
||||
#endif /* FTPIC_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Embedded resource forks accessor (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2006, 2007, 2012 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -21,8 +21,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTRFORK_H__
|
||||
#define __FTRFORK_H__
|
||||
#ifndef FTRFORK_H_
|
||||
#define FTRFORK_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -44,7 +44,7 @@ FT_BEGIN_HEADER
|
||||
typedef struct FT_RFork_Ref_
|
||||
{
|
||||
FT_UShort res_id;
|
||||
FT_ULong offset;
|
||||
FT_Long offset;
|
||||
|
||||
} FT_RFork_Ref;
|
||||
|
||||
@ -83,7 +83,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* this array is a storage in non-PIC mode, so ; is needed in END */
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
|
||||
const type name[] = {
|
||||
static const type name[] = {
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
|
||||
{ raccess_guess_ ## func_suffix, \
|
||||
FT_RFork_Rule_ ## type_suffix },
|
||||
@ -94,7 +94,7 @@ FT_BEGIN_HEADER
|
||||
/* this array is a function in PIC mode, so no ; is needed in END */
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
|
||||
void \
|
||||
FT_Init_ ## name( type* storage ) \
|
||||
FT_Init_Table_ ## name( type* storage ) \
|
||||
{ \
|
||||
type* local = storage; \
|
||||
\
|
||||
@ -224,6 +224,13 @@ FT_BEGIN_HEADER
|
||||
/* tag :: */
|
||||
/* The resource tag. */
|
||||
/* */
|
||||
/* sort_by_res_id :: */
|
||||
/* A Boolean to sort the fragmented resource by their ids. */
|
||||
/* The fragmented resources for `POST' resource should be sorted */
|
||||
/* to restore Type1 font properly. For `sfnt' resources, sorting */
|
||||
/* may induce a different order of the faces in comparison to that */
|
||||
/* by QuickDraw API. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* offsets :: */
|
||||
/* The stream offsets for the resource data specified by `tag'. */
|
||||
@ -246,13 +253,14 @@ FT_BEGIN_HEADER
|
||||
FT_Long map_offset,
|
||||
FT_Long rdata_pos,
|
||||
FT_Long tag,
|
||||
FT_Bool sort_by_res_id,
|
||||
FT_Long **offsets,
|
||||
FT_Long *count );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTRFORK_H__ */
|
||||
#endif /* FTRFORK_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType services (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003-2007, 2009, 2012, 2013 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -28,8 +28,8 @@
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSERV_H__
|
||||
#define __FTSERV_H__
|
||||
#ifndef FTSERV_H_
|
||||
#define FTSERV_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
@ -750,14 +750,14 @@ FT_BEGIN_HEADER
|
||||
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
|
||||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
|
||||
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
|
||||
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSERV_H__ */
|
||||
#endif /* FTSERV_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Stream handling (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004-2006, 2011, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSTREAM_H__
|
||||
#define __FTSTREAM_H__
|
||||
#ifndef FTSTREAM_H_
|
||||
#define FTSTREAM_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -361,7 +361,7 @@ FT_BEGIN_HEADER
|
||||
FT_Long distance );
|
||||
|
||||
/* return current stream position */
|
||||
FT_BASE( FT_Long )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_Pos( FT_Stream stream );
|
||||
|
||||
/* read bytes from a stream into a user-allocated buffer, returns an */
|
||||
@ -530,7 +530,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSTREAM_H__ */
|
||||
#endif /* FTSTREAM_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tracing handling (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004-2007, 2009, 2011-2013 by */
|
||||
/* Copyright 2002-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -148,5 +148,7 @@ FT_TRACE_DEF( afcjk )
|
||||
FT_TRACE_DEF( aflatin )
|
||||
FT_TRACE_DEF( aflatin2 )
|
||||
FT_TRACE_DEF( afwarp )
|
||||
FT_TRACE_DEF( afshaper )
|
||||
FT_TRACE_DEF( afglobal )
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType validation support (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2013 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTVALID_H__
|
||||
#define __FTVALID_H__
|
||||
#ifndef FTVALID_H_
|
||||
#define FTVALID_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
|
||||
@ -87,13 +87,13 @@ FT_BEGIN_HEADER
|
||||
/* validator structure */
|
||||
typedef struct FT_ValidatorRec_
|
||||
{
|
||||
ft_jmp_buf jump_buffer; /* used for exception handling */
|
||||
|
||||
const FT_Byte* base; /* address of table in memory */
|
||||
const FT_Byte* limit; /* `base' + sizeof(table) in memory */
|
||||
FT_ValidationLevel level; /* validation level */
|
||||
FT_Error error; /* error returned. 0 means success */
|
||||
|
||||
ft_jmp_buf jump_buffer; /* used for exception handling */
|
||||
|
||||
} FT_ValidatorRec;
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
@ -126,36 +126,34 @@ FT_BEGIN_HEADER
|
||||
/* Calls ft_validate_error. Assumes that the `valid' local variable */
|
||||
/* holds a pointer to the current validator object. */
|
||||
/* */
|
||||
/* Use preprocessor prescan to pass FT_ERR_PREFIX. */
|
||||
/* */
|
||||
#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error )
|
||||
#define FT_INVALID_( _prefix, _error ) \
|
||||
ft_validator_error( valid, _prefix ## _error )
|
||||
#define FT_INVALID( _error ) FT_INVALID_( _error )
|
||||
#define FT_INVALID_( _error ) \
|
||||
ft_validator_error( valid, FT_THROW( _error ) )
|
||||
|
||||
/* called when a broken table is detected */
|
||||
#define FT_INVALID_TOO_SHORT \
|
||||
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
/* called when an invalid offset is detected */
|
||||
#define FT_INVALID_OFFSET \
|
||||
FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )
|
||||
FT_INVALID( Invalid_Offset )
|
||||
|
||||
/* called when an invalid format/value is detected */
|
||||
#define FT_INVALID_FORMAT \
|
||||
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
/* called when an invalid glyph index is detected */
|
||||
#define FT_INVALID_GLYPH_ID \
|
||||
FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )
|
||||
FT_INVALID( Invalid_Glyph_Index )
|
||||
|
||||
/* called when an invalid field value is detected */
|
||||
#define FT_INVALID_DATA \
|
||||
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTVALID_H__ */
|
||||
#endif /* FTVALID_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Internal header files (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -30,6 +30,7 @@
|
||||
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
|
||||
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
|
||||
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
|
||||
#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h>
|
||||
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
|
||||
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
|
||||
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
|
||||
@ -43,7 +44,6 @@
|
||||
|
||||
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
|
||||
|
||||
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Auxiliary functions and data structures related to PostScript fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006, 2008, 2009, 2012 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,13 +17,14 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PSAUX_H__
|
||||
#define __PSAUX_H__
|
||||
#ifndef PSAUX_H_
|
||||
#define PSAUX_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_TYPE1_TYPES_H
|
||||
#include FT_INTERNAL_HASH_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
|
||||
|
||||
@ -71,10 +72,10 @@ FT_BEGIN_HEADER
|
||||
(*done)( PS_Table table );
|
||||
|
||||
FT_Error
|
||||
(*add)( PS_Table table,
|
||||
FT_Int idx,
|
||||
void* object,
|
||||
FT_PtrDist length );
|
||||
(*add)( PS_Table table,
|
||||
FT_Int idx,
|
||||
void* object,
|
||||
FT_UInt length );
|
||||
|
||||
void
|
||||
(*release)( PS_Table table );
|
||||
@ -122,12 +123,12 @@ FT_BEGIN_HEADER
|
||||
FT_Byte* block; /* current memory block */
|
||||
FT_Offset cursor; /* current cursor in memory block */
|
||||
FT_Offset capacity; /* current size of memory block */
|
||||
FT_Long init;
|
||||
FT_ULong init;
|
||||
|
||||
FT_Int max_elems;
|
||||
FT_Int num_elems;
|
||||
FT_Byte** elements; /* addresses of table elements */
|
||||
FT_PtrDist* lengths; /* lengths of table elements */
|
||||
FT_UInt* lengths; /* lengths of table elements */
|
||||
|
||||
FT_Memory memory;
|
||||
PS_Table_FuncsRec funcs;
|
||||
@ -365,7 +366,7 @@ FT_BEGIN_HEADER
|
||||
(*to_bytes)( PS_Parser parser,
|
||||
FT_Byte* bytes,
|
||||
FT_Offset max_bytes,
|
||||
FT_Long* pnum_bytes,
|
||||
FT_ULong* pnum_bytes,
|
||||
FT_Bool delimiters );
|
||||
|
||||
FT_Int
|
||||
@ -675,9 +676,10 @@ FT_BEGIN_HEADER
|
||||
FT_Byte** glyph_names;
|
||||
|
||||
FT_Int lenIV; /* internal for sub routine calls */
|
||||
FT_UInt num_subrs;
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** subrs;
|
||||
FT_PtrDist* subrs_len; /* array of subrs length (optional) */
|
||||
FT_UInt* subrs_len; /* array of subrs length (optional) */
|
||||
FT_Hash subrs_hash; /* used if `num_subrs' was massaged */
|
||||
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
@ -871,7 +873,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSAUX_H__ */
|
||||
#endif /* PSAUX_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -6,7 +6,7 @@
|
||||
/* recorders (specification only). These are used to support native */
|
||||
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
|
||||
/* */
|
||||
/* Copyright 2001-2003, 2005-2007, 2009, 2012 by */
|
||||
/* Copyright 2001-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -18,8 +18,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PSHINTS_H__
|
||||
#define __PSHINTS_H__
|
||||
#ifndef PSHINTS_H_
|
||||
#define PSHINTS_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
|
||||
T1_Private* private_dict,
|
||||
PSH_Globals* aglobals );
|
||||
|
||||
typedef FT_Error
|
||||
typedef void
|
||||
(*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
@ -465,7 +465,7 @@ FT_BEGIN_HEADER
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_UInt count,
|
||||
FT_Int count,
|
||||
FT_Fixed* coordinates );
|
||||
|
||||
|
||||
@ -716,7 +716,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSHINTS_H__ */
|
||||
#endif /* PSHINTS_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType BDF services (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVBDF_H__
|
||||
#define __SVBDF_H__
|
||||
#ifndef SVBDF_H_
|
||||
#define SVBDF_H_
|
||||
|
||||
#include FT_BDF_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
@ -76,7 +76,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVBDF_H__ */
|
||||
#endif /* SVBDF_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,8 @@
|
||||
/* */
|
||||
/* The FreeType CID font services (specification). */
|
||||
/* */
|
||||
/* Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal. */
|
||||
/* Copyright 2007-2016 by */
|
||||
/* Derek Clegg and Michael Toftdal. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
@ -15,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVCID_H__
|
||||
#define __SVCID_H__
|
||||
#ifndef SVCID_H_
|
||||
#define SVCID_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
@ -83,7 +84,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVCID_H__ */
|
||||
#endif /* SVCID_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,10 +1,10 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svxf86nm.h */
|
||||
/* svfntfmt.h */
|
||||
/* */
|
||||
/* The FreeType XFree86 services (specification only). */
|
||||
/* The FreeType font format service (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVXF86NM_H__
|
||||
#define __SVXF86NM_H__
|
||||
#ifndef SVFNTFMT_H_
|
||||
#define SVFNTFMT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
@ -31,17 +31,17 @@ FT_BEGIN_HEADER
|
||||
* is a simple constant string pointer.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_XF86_NAME "xf86-driver-name"
|
||||
#define FT_SERVICE_ID_FONT_FORMAT "font-format"
|
||||
|
||||
#define FT_XF86_FORMAT_TRUETYPE "TrueType"
|
||||
#define FT_XF86_FORMAT_TYPE_1 "Type 1"
|
||||
#define FT_XF86_FORMAT_BDF "BDF"
|
||||
#define FT_XF86_FORMAT_PCF "PCF"
|
||||
#define FT_XF86_FORMAT_TYPE_42 "Type 42"
|
||||
#define FT_XF86_FORMAT_CID "CID Type 1"
|
||||
#define FT_XF86_FORMAT_CFF "CFF"
|
||||
#define FT_XF86_FORMAT_PFR "PFR"
|
||||
#define FT_XF86_FORMAT_WINFNT "Windows FNT"
|
||||
#define FT_FONT_FORMAT_TRUETYPE "TrueType"
|
||||
#define FT_FONT_FORMAT_TYPE_1 "Type 1"
|
||||
#define FT_FONT_FORMAT_BDF "BDF"
|
||||
#define FT_FONT_FORMAT_PCF "PCF"
|
||||
#define FT_FONT_FORMAT_TYPE_42 "Type 42"
|
||||
#define FT_FONT_FORMAT_CID "CID Type 1"
|
||||
#define FT_FONT_FORMAT_CFF "CFF"
|
||||
#define FT_FONT_FORMAT_PFR "PFR"
|
||||
#define FT_FONT_FORMAT_WINFNT "Windows FNT"
|
||||
|
||||
/* */
|
||||
|
||||
@ -49,7 +49,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVXF86NM_H__ */
|
||||
#endif /* SVFNTFMT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType glyph dictionary services (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVGLDICT_H__
|
||||
#define __SVGLDICT_H__
|
||||
#ifndef SVGLDICT_H_
|
||||
#define SVGLDICT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
@ -85,4 +85,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVGLDICT_H__ */
|
||||
#endif /* SVGLDICT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* Masatake YAMATO, Red Hat K.K., */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
@ -25,8 +25,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVGXVAL_H__
|
||||
#define __SVGXVAL_H__
|
||||
#ifndef SVGXVAL_H_
|
||||
#define SVGXVAL_H_
|
||||
|
||||
#include FT_GX_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
@ -66,7 +66,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVGXVAL_H__ */
|
||||
#endif /* SVGXVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType Kerning service (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 by */
|
||||
/* Copyright 2006-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVKERN_H__
|
||||
#define __SVKERN_H__
|
||||
#ifndef SVKERN_H_
|
||||
#define SVKERN_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVKERN_H__ */
|
||||
#endif /* SVKERN_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType Multiple Masters and GX var services (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVMM_H__
|
||||
#define __SVMM_H__
|
||||
#ifndef SVMM_H_
|
||||
#define SVMM_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
@ -107,7 +107,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SVMM_H__ */
|
||||
#endif /* SVMM_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType OpenType validation service (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* Copyright 2004-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVOTVAL_H__
|
||||
#define __SVOTVAL_H__
|
||||
#ifndef SVOTVAL_H_
|
||||
#define SVOTVAL_H_
|
||||
|
||||
#include FT_OPENTYPE_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
@ -49,7 +49,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVOTVAL_H__ */
|
||||
#endif /* SVOTVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Internal PFR service functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVPFR_H__
|
||||
#define __SVPFR_H__
|
||||
#ifndef SVPFR_H_
|
||||
#define SVPFR_H_
|
||||
|
||||
#include FT_PFR_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
@ -60,7 +60,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SVPFR_H__ */
|
||||
#endif /* SVPFR_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType PostScript name services (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2007, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVPOSTNM_H__
|
||||
#define __SVPOSTNM_H__
|
||||
#ifndef SVPOSTNM_H_
|
||||
#define SVPOSTNM_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
@ -75,7 +75,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVPOSTNM_H__ */
|
||||
#endif /* SVPOSTNM_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType property service (specification). */
|
||||
/* */
|
||||
/* Copyright 2012 by */
|
||||
/* Copyright 2012-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVPROP_H__
|
||||
#define __SVPROP_H__
|
||||
#ifndef SVPROP_H_
|
||||
#define SVPROP_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
@ -75,7 +75,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVPROP_H__ */
|
||||
#endif /* SVPROP_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType PostScript charmap service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2006, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVPSCMAP_H__
|
||||
#define __SVPSCMAP_H__
|
||||
#ifndef SVPSCMAP_H_
|
||||
#define SVPSCMAP_H_
|
||||
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
@ -171,7 +171,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVPSCMAP_H__ */
|
||||
#endif /* SVPSCMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType PostScript info service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2009, 2011, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVPSINFO_H__
|
||||
#define __SVPSINFO_H__
|
||||
#ifndef SVPSINFO_H_
|
||||
#define SVPSINFO_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_INTERNAL_TYPE1_TYPES_H
|
||||
@ -105,7 +105,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVPSINFO_H__ */
|
||||
#endif /* SVPSINFO_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType SFNT table loading service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVSFNT_H__
|
||||
#define __SVSFNT_H__
|
||||
#ifndef SVSFNT_H_
|
||||
#define SVSFNT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
@ -97,7 +97,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVSFNT_H__ */
|
||||
#endif /* SVSFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,10 +4,8 @@
|
||||
/* */
|
||||
/* The FreeType TrueType/sfnt cmap extra information service. */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Masatake YAMATO, Redhat K.K. */
|
||||
/* */
|
||||
/* Copyright 2003, 2008, 2009, 2012 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* Masatake YAMATO, Redhat K.K., */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -21,8 +19,8 @@
|
||||
/* Development of this service is support of
|
||||
Information-technology Promotion Agency, Japan. */
|
||||
|
||||
#ifndef __SVTTCMAP_H__
|
||||
#define __SVTTCMAP_H__
|
||||
#ifndef SVTTCMAP_H_
|
||||
#define SVTTCMAP_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
@ -47,14 +45,15 @@ FT_BEGIN_HEADER
|
||||
/* <Fields> */
|
||||
/* language :: */
|
||||
/* The language ID used in Mac fonts. Definitions of values are in */
|
||||
/* freetype/ttnameid.h. */
|
||||
/* `ttnameid.h'. */
|
||||
/* */
|
||||
/* format :: */
|
||||
/* The cmap format. OpenType 1.5 defines the formats 0 (byte */
|
||||
/* The cmap format. OpenType 1.6 defines the formats 0 (byte */
|
||||
/* encoding table), 2~(high-byte mapping through table), 4~(segment */
|
||||
/* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
|
||||
/* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
|
||||
/* coverage), and 14 (Unicode Variation Sequences). */
|
||||
/* coverage), 13~(last resort font), and 14 (Unicode Variation */
|
||||
/* Sequences). */
|
||||
/* */
|
||||
typedef struct TT_CMapInfo_
|
||||
{
|
||||
@ -101,7 +100,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SVTTCMAP_H__ */
|
||||
#endif /* SVTTCMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType TrueType engine query service (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 by */
|
||||
/* Copyright 2006-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVTTENG_H__
|
||||
#define __SVTTENG_H__
|
||||
#ifndef SVTTENG_H_
|
||||
#define SVTTENG_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_MODULE_H
|
||||
@ -47,7 +47,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVTTENG_H__ */
|
||||
#endif /* SVTTENG_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,8 @@
|
||||
/* */
|
||||
/* The FreeType TrueType glyph service. */
|
||||
/* */
|
||||
/* Copyright 2007, 2009, 2012 by David Turner. */
|
||||
/* Copyright 2007-2016 by */
|
||||
/* David Turner. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
@ -14,8 +15,8 @@
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __SVTTGLYF_H__
|
||||
#define __SVTTGLYF_H__
|
||||
#ifndef SVTTGLYF_H_
|
||||
#define SVTTGLYF_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
@ -62,7 +63,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SVTTGLYF_H__ */
|
||||
#endif /* SVTTGLYF_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType Windows FNT/FONT service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVWINFNT_H__
|
||||
#define __SVWINFNT_H__
|
||||
#ifndef SVWINFNT_H_
|
||||
#define SVWINFNT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_WINFONTS_H
|
||||
@ -44,7 +44,7 @@ FT_BEGIN_HEADER
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVWINFNT_H__ */
|
||||
#endif /* SVWINFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2009, 2012-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SFNT_H__
|
||||
#define __SFNT_H__
|
||||
#ifndef SFNT_H_
|
||||
#define SFNT_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -44,7 +44,9 @@ FT_BEGIN_HEADER
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* collection, in bits 0-15. The numbered instance */
|
||||
/* index~+~1 of a GX (sub)font, if applicable, in bits */
|
||||
/* 16-30. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
@ -87,7 +89,9 @@ FT_BEGIN_HEADER
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* collection, in bits 0-15. The numbered instance */
|
||||
/* index~+~1 of a GX (sub)font, if applicable, in bits */
|
||||
/* 16-30. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
@ -405,14 +409,18 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* gindex :: The glyph index. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
/* <Output> */
|
||||
/* abearing :: The horizontal (or vertical) bearing. Set to zero in */
|
||||
/* case of error. */
|
||||
/* */
|
||||
/* aadvance :: The horizontal (or vertical) advance. Set to zero in */
|
||||
/* case of error. */
|
||||
/* */
|
||||
typedef void
|
||||
(*TT_Get_Metrics_Func)( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
FT_UInt gindex,
|
||||
@ -420,6 +428,33 @@ FT_BEGIN_HEADER
|
||||
FT_UShort* aadvance );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Get_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* From the `name' table, return a given ENGLISH name record in */
|
||||
/* ASCII. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face object. */
|
||||
/* */
|
||||
/* nameid :: The name id of the name record to return. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* name :: The address of an allocated string pointer. NULL if */
|
||||
/* no name is present. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Get_Name_Func)( TT_Face face,
|
||||
FT_UShort nameid,
|
||||
FT_String** name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
@ -552,6 +587,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
TT_Get_Metrics_Func get_metrics;
|
||||
|
||||
TT_Get_Name_Func get_name;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
@ -590,7 +627,8 @@ FT_BEGIN_HEADER
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
get_metrics_, \
|
||||
get_name_ ) \
|
||||
static const SFNT_Interface class_ = \
|
||||
{ \
|
||||
goto_table_, \
|
||||
@ -622,6 +660,7 @@ FT_BEGIN_HEADER
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_, \
|
||||
get_name_, \
|
||||
};
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
@ -659,7 +698,8 @@ FT_BEGIN_HEADER
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
get_metrics_, \
|
||||
get_name_ ) \
|
||||
void \
|
||||
FT_Init_Class_ ## class_( FT_Library library, \
|
||||
SFNT_Interface* clazz ) \
|
||||
@ -695,13 +735,14 @@ FT_BEGIN_HEADER
|
||||
clazz->set_sbit_strike = set_sbit_strike_; \
|
||||
clazz->load_strike_metrics = load_strike_metrics_; \
|
||||
clazz->get_metrics = get_metrics_; \
|
||||
clazz->get_name = get_name_; \
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SFNT_H__ */
|
||||
#endif /* SFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -5,7 +5,7 @@
|
||||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,14 +17,15 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __T1TYPES_H__
|
||||
#define __T1TYPES_H__
|
||||
#ifndef T1TYPES_H_
|
||||
#define T1TYPES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_TYPE1_TABLES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_INTERNAL_HASH_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
|
||||
|
||||
@ -106,12 +107,13 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** subrs;
|
||||
FT_PtrDist* subrs_len;
|
||||
FT_UInt* subrs_len;
|
||||
FT_Hash subrs_hash;
|
||||
|
||||
FT_Int num_glyphs;
|
||||
FT_String** glyph_names; /* array of glyph names */
|
||||
FT_Byte** charstrings; /* array of glyph charstrings */
|
||||
FT_PtrDist* charstrings_len;
|
||||
FT_UInt* charstrings_len;
|
||||
|
||||
FT_Byte paint_type;
|
||||
FT_Byte font_type;
|
||||
@ -127,7 +129,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct CID_SubrsRec_
|
||||
{
|
||||
FT_UInt num_subrs;
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** code;
|
||||
|
||||
} CID_SubrsRec, *CID_Subrs;
|
||||
@ -157,10 +159,10 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct AFM_KernPairRec_
|
||||
{
|
||||
FT_Int index1;
|
||||
FT_Int index2;
|
||||
FT_Int x;
|
||||
FT_Int y;
|
||||
FT_UInt index1;
|
||||
FT_UInt index2;
|
||||
FT_Int x;
|
||||
FT_Int y;
|
||||
|
||||
} AFM_KernPairRec, *AFM_KernPair;
|
||||
|
||||
@ -171,9 +173,9 @@ FT_BEGIN_HEADER
|
||||
FT_Fixed Ascender;
|
||||
FT_Fixed Descender;
|
||||
AFM_TrackKern TrackKerns; /* free if non-NULL */
|
||||
FT_Int NumTrackKern;
|
||||
FT_UInt NumTrackKern;
|
||||
AFM_KernPair KernPairs; /* free if non-NULL */
|
||||
FT_Int NumKernPair;
|
||||
FT_UInt NumKernPair;
|
||||
|
||||
} AFM_FontInfoRec, *AFM_FontInfo;
|
||||
|
||||
@ -249,7 +251,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __T1TYPES_H__ */
|
||||
#endif /* T1TYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2004-2008, 2012-2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,8 +17,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __TTTYPES_H__
|
||||
#define __TTTYPES_H__
|
||||
#ifndef TTTYPES_H_
|
||||
#define TTTYPES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -137,6 +137,75 @@ FT_BEGIN_HEADER
|
||||
} TT_TableRec, *TT_Table;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* WOFF_HeaderRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* WOFF file format header. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* See */
|
||||
/* */
|
||||
/* http://www.w3.org/TR/WOFF/#WOFFHeader */
|
||||
/* */
|
||||
typedef struct WOFF_HeaderRec_
|
||||
{
|
||||
FT_ULong signature;
|
||||
FT_ULong flavor;
|
||||
FT_ULong length;
|
||||
FT_UShort num_tables;
|
||||
FT_UShort reserved;
|
||||
FT_ULong totalSfntSize;
|
||||
FT_UShort majorVersion;
|
||||
FT_UShort minorVersion;
|
||||
FT_ULong metaOffset;
|
||||
FT_ULong metaLength;
|
||||
FT_ULong metaOrigLength;
|
||||
FT_ULong privOffset;
|
||||
FT_ULong privLength;
|
||||
|
||||
} WOFF_HeaderRec, *WOFF_Header;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* WOFF_TableRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure describes a given table of a WOFF font. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* Tag :: A four-bytes tag describing the table. */
|
||||
/* */
|
||||
/* Offset :: The offset of the table from the start of the WOFF */
|
||||
/* font in its resource. */
|
||||
/* */
|
||||
/* CompLength :: Compressed table length (in bytes). */
|
||||
/* */
|
||||
/* OrigLength :: Uncompressed table length (in bytes). */
|
||||
/* */
|
||||
/* CheckSum :: The table checksum. This value can be ignored. */
|
||||
/* */
|
||||
/* OrigOffset :: The uncompressed table file offset. This value gets */
|
||||
/* computed while constructing the (uncompressed) SFNT */
|
||||
/* header. It is not contained in the WOFF file. */
|
||||
/* */
|
||||
typedef struct WOFF_TableRec_
|
||||
{
|
||||
FT_ULong Tag; /* table ID */
|
||||
FT_ULong Offset; /* table file offset */
|
||||
FT_ULong CompLength; /* compressed table length */
|
||||
FT_ULong OrigLength; /* uncompressed table length */
|
||||
FT_ULong CheckSum; /* uncompressed checksum */
|
||||
|
||||
FT_ULong OrigOffset; /* uncompressed table file offset */
|
||||
/* (not in the WOFF file) */
|
||||
} WOFF_TableRec, *WOFF_Table;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
@ -353,16 +422,16 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
typedef struct TT_SBit_MetricsRec_
|
||||
{
|
||||
FT_Byte height;
|
||||
FT_Byte width;
|
||||
FT_UShort height;
|
||||
FT_UShort width;
|
||||
|
||||
FT_Char horiBearingX;
|
||||
FT_Char horiBearingY;
|
||||
FT_Byte horiAdvance;
|
||||
FT_Short horiBearingX;
|
||||
FT_Short horiBearingY;
|
||||
FT_UShort horiAdvance;
|
||||
|
||||
FT_Char vertBearingX;
|
||||
FT_Char vertBearingY;
|
||||
FT_Byte vertAdvance;
|
||||
FT_Short vertBearingX;
|
||||
FT_Short vertBearingY;
|
||||
FT_UShort vertAdvance;
|
||||
|
||||
} TT_SBit_MetricsRec, *TT_SBit_Metrics;
|
||||
|
||||
@ -545,8 +614,7 @@ FT_BEGIN_HEADER
|
||||
/* in use by other platforms (e.g. Newton). */
|
||||
/* For details, please see */
|
||||
/* */
|
||||
/* http://fonts.apple.com/ */
|
||||
/* TTRefMan/RM06/Chap6bloc.html */
|
||||
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html */
|
||||
/* */
|
||||
/* hori :: The line metrics for horizontal layouts. */
|
||||
/* */
|
||||
@ -566,8 +634,7 @@ FT_BEGIN_HEADER
|
||||
/* flags :: Is this a vertical or horizontal strike? For */
|
||||
/* details, please see */
|
||||
/* */
|
||||
/* http://fonts.apple.com/ */
|
||||
/* TTRefMan/RM06/Chap6bloc.html */
|
||||
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html */
|
||||
/* */
|
||||
typedef struct TT_SBit_StrikeRec_
|
||||
{
|
||||
@ -979,6 +1046,20 @@ FT_BEGIN_HEADER
|
||||
(*TT_Loader_EndGlyphFunc)( TT_Loader loader );
|
||||
|
||||
|
||||
typedef enum TT_SbitTableType_
|
||||
{
|
||||
TT_SBIT_TABLE_TYPE_NONE = 0,
|
||||
TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */
|
||||
/* `bloc' (Apple) */
|
||||
TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google) */
|
||||
TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple) */
|
||||
|
||||
/* do not remove */
|
||||
TT_SBIT_TABLE_TYPE_MAX
|
||||
|
||||
} TT_SbitTableType;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* TrueType Face Type */
|
||||
@ -1030,7 +1111,7 @@ FT_BEGIN_HEADER
|
||||
/* This field also contains the associated */
|
||||
/* vertical metrics table (`vmtx'), if found. */
|
||||
/* IMPORTANT: The contents of this field is */
|
||||
/* undefined if the `verticalInfo' field is */
|
||||
/* undefined if the `vertical_info' field is */
|
||||
/* unset. */
|
||||
/* */
|
||||
/* num_names :: The number of name records within this */
|
||||
@ -1090,13 +1171,6 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* pclt :: The `pclt' SFNT table. */
|
||||
/* */
|
||||
/* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */
|
||||
/* sizes, embedded in this font. */
|
||||
/* */
|
||||
/* sbit_strikes :: An array of sbit strikes embedded in this */
|
||||
/* font. This table is optional in a */
|
||||
/* TrueType/OpenType font. */
|
||||
/* */
|
||||
/* num_sbit_scales :: The number of sbit scales for this font. */
|
||||
/* */
|
||||
/* sbit_scales :: Array of sbit scales embedded in this */
|
||||
@ -1159,9 +1233,6 @@ FT_BEGIN_HEADER
|
||||
/* interpreters field is also used to hook */
|
||||
/* the debugger in `ttdebug'. */
|
||||
/* */
|
||||
/* unpatented_hinting :: If true, use only unpatented methods in */
|
||||
/* the bytecode interpreter. */
|
||||
/* */
|
||||
/* doblend :: A boolean which is set if the font should */
|
||||
/* be blended (this is for GX var). */
|
||||
/* */
|
||||
@ -1260,10 +1331,6 @@ FT_BEGIN_HEADER
|
||||
/* used to hook the debugger for the `ttdebug' utility. */
|
||||
TT_Interpreter interpreter;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
/* Use unpatented hinting only. */
|
||||
FT_Bool unpatented_hinting;
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
@ -1302,6 +1369,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_Byte* sbit_table;
|
||||
FT_ULong sbit_table_size;
|
||||
TT_SbitTableType sbit_table_type;
|
||||
FT_UInt sbit_num_strikes;
|
||||
|
||||
FT_Byte* kern_table;
|
||||
@ -1318,12 +1386,12 @@ FT_BEGIN_HEADER
|
||||
FT_ULong horz_metrics_offset;
|
||||
FT_ULong vert_metrics_offset;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
||||
/* since 2.4.12 */
|
||||
FT_ULong sph_found_func_flags; /* special functions found */
|
||||
/* for this face */
|
||||
FT_Bool sph_compatibility_mode;
|
||||
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
|
||||
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
||||
|
||||
} TT_FaceRec;
|
||||
|
||||
@ -1363,7 +1431,7 @@ FT_BEGIN_HEADER
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_UShort max_points;
|
||||
FT_UShort max_contours;
|
||||
FT_Short max_contours;
|
||||
FT_UShort n_points; /* number of points in zone */
|
||||
FT_Short n_contours; /* number of contours */
|
||||
|
||||
@ -1382,11 +1450,23 @@ FT_BEGIN_HEADER
|
||||
/* handle to execution context */
|
||||
typedef struct TT_ExecContextRec_* TT_ExecContext;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* TT_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a TrueType size object. */
|
||||
/* */
|
||||
typedef struct TT_SizeRec_* TT_Size;
|
||||
|
||||
|
||||
/* glyph loader structure */
|
||||
typedef struct TT_LoaderRec_
|
||||
{
|
||||
FT_Face face;
|
||||
FT_Size size;
|
||||
TT_Face face;
|
||||
TT_Size size;
|
||||
FT_GlyphSlot glyph;
|
||||
FT_GlyphLoader gloader;
|
||||
|
||||
@ -1402,7 +1482,6 @@ FT_BEGIN_HEADER
|
||||
FT_Int advance;
|
||||
FT_Int linear;
|
||||
FT_Bool linear_def;
|
||||
FT_Bool preserve_pps;
|
||||
FT_Vector pp1;
|
||||
FT_Vector pp2;
|
||||
|
||||
@ -1429,12 +1508,15 @@ FT_BEGIN_HEADER
|
||||
FT_Byte* cursor;
|
||||
FT_Byte* limit;
|
||||
|
||||
/* since version 2.6.2 */
|
||||
FT_ListRec composites;
|
||||
|
||||
} TT_LoaderRec;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __TTTYPES_H__ */
|
||||
#endif /* TTTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
131
drivers/freetype/freetype/include/freetype/t1tables.h → drivers/freetype/include/freetype/t1tables.h
131
drivers/freetype/freetype/include/freetype/t1tables.h → drivers/freetype/include/freetype/t1tables.h
@ -5,7 +5,7 @@
|
||||
/* Basic Type 1/Type 2 tables definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,8 +17,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __T1TABLES_H__
|
||||
#define __T1TABLES_H__
|
||||
#ifndef T1TABLES_H_
|
||||
#define T1TABLES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -49,6 +49,26 @@ FT_BEGIN_HEADER
|
||||
/* This section contains the definition of Type 1-specific tables, */
|
||||
/* including structures related to other PostScript font formats. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* PS_FontInfoRec */
|
||||
/* PS_FontInfo */
|
||||
/* PS_PrivateRec */
|
||||
/* PS_Private */
|
||||
/* */
|
||||
/* CID_FaceDictRec */
|
||||
/* CID_FaceDict */
|
||||
/* CID_FaceInfoRec */
|
||||
/* CID_FaceInfo */
|
||||
/* */
|
||||
/* FT_Has_PS_Glyph_Names */
|
||||
/* FT_Get_PS_Font_Info */
|
||||
/* FT_Get_PS_Font_Private */
|
||||
/* FT_Get_PS_Font_Value */
|
||||
/* */
|
||||
/* T1_Blend_Flags */
|
||||
/* T1_EncodingType */
|
||||
/* PS_Dict_Keys */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@ -190,14 +210,30 @@ FT_BEGIN_HEADER
|
||||
/* given blend dictionary (font info or private). Used to support */
|
||||
/* Multiple Masters fonts. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* T1_BLEND_UNDERLINE_POSITION :: */
|
||||
/* T1_BLEND_UNDERLINE_THICKNESS :: */
|
||||
/* T1_BLEND_ITALIC_ANGLE :: */
|
||||
/* T1_BLEND_BLUE_VALUES :: */
|
||||
/* T1_BLEND_OTHER_BLUES :: */
|
||||
/* T1_BLEND_STANDARD_WIDTH :: */
|
||||
/* T1_BLEND_STANDARD_HEIGHT :: */
|
||||
/* T1_BLEND_STEM_SNAP_WIDTHS :: */
|
||||
/* T1_BLEND_STEM_SNAP_HEIGHTS :: */
|
||||
/* T1_BLEND_BLUE_SCALE :: */
|
||||
/* T1_BLEND_BLUE_SHIFT :: */
|
||||
/* T1_BLEND_FAMILY_BLUES :: */
|
||||
/* T1_BLEND_FAMILY_OTHER_BLUES :: */
|
||||
/* T1_BLEND_FORCE_BOLD :: */
|
||||
/* */
|
||||
typedef enum T1_Blend_Flags_
|
||||
{
|
||||
/*# required fields in a FontInfo blend dictionary */
|
||||
/* required fields in a FontInfo blend dictionary */
|
||||
T1_BLEND_UNDERLINE_POSITION = 0,
|
||||
T1_BLEND_UNDERLINE_THICKNESS,
|
||||
T1_BLEND_ITALIC_ANGLE,
|
||||
|
||||
/*# required fields in a Private blend dictionary */
|
||||
/* required fields in a Private blend dictionary */
|
||||
T1_BLEND_BLUE_VALUES,
|
||||
T1_BLEND_OTHER_BLUES,
|
||||
T1_BLEND_STANDARD_WIDTH,
|
||||
@ -210,15 +246,13 @@ FT_BEGIN_HEADER
|
||||
T1_BLEND_FAMILY_OTHER_BLUES,
|
||||
T1_BLEND_FORCE_BOLD,
|
||||
|
||||
/*# never remove */
|
||||
T1_BLEND_MAX
|
||||
T1_BLEND_MAX /* do not remove */
|
||||
|
||||
} T1_Blend_Flags;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*# backwards compatible definitions */
|
||||
/* these constants are deprecated; use the corresponding */
|
||||
/* `T1_Blend_Flags' values instead */
|
||||
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
|
||||
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
|
||||
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
|
||||
@ -235,6 +269,8 @@ FT_BEGIN_HEADER
|
||||
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
|
||||
#define t1_blend_max T1_BLEND_MAX
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* maximum number of Multiple Masters designs, as defined in the spec */
|
||||
#define T1_MAX_MM_DESIGNS 16
|
||||
@ -333,10 +369,17 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
typedef struct CID_FaceDictRec_* CID_FaceDict;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* backwards-compatible definition */
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* CID_FontDict */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
|
||||
/* kept to maintain source compatibility between various versions of */
|
||||
/* FreeType. */
|
||||
/* */
|
||||
typedef CID_FaceDictRec CID_FontDict;
|
||||
|
||||
|
||||
@ -449,8 +492,9 @@ FT_BEGIN_HEADER
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The string pointers within the font info structure are owned by
|
||||
* the face and don't need to be freed by the caller.
|
||||
* String pointers within the @PS_FontInfoRec structure are owned by
|
||||
* the face and don't need to be freed by the caller. Missing entries
|
||||
* in the font's FontInfo dictionary are represented by NULL pointers.
|
||||
*
|
||||
* If the font's format is not PostScript-based, this function will
|
||||
* return the `FT_Err_Invalid_Argument' error code.
|
||||
@ -503,6 +547,13 @@ FT_BEGIN_HEADER
|
||||
/* An enumeration describing the `Encoding' entry in a Type 1 */
|
||||
/* dictionary. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* T1_ENCODING_TYPE_NONE :: */
|
||||
/* T1_ENCODING_TYPE_ARRAY :: */
|
||||
/* T1_ENCODING_TYPE_STANDARD :: */
|
||||
/* T1_ENCODING_TYPE_ISOLATIN1 :: */
|
||||
/* T1_ENCODING_TYPE_EXPERT :: */
|
||||
/* */
|
||||
typedef enum T1_EncodingType_
|
||||
{
|
||||
T1_ENCODING_TYPE_NONE = 0,
|
||||
@ -523,6 +574,54 @@ FT_BEGIN_HEADER
|
||||
/* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
|
||||
/* the Type~1 dictionary entry to retrieve. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* PS_DICT_FONT_TYPE :: */
|
||||
/* PS_DICT_FONT_MATRIX :: */
|
||||
/* PS_DICT_FONT_BBOX :: */
|
||||
/* PS_DICT_PAINT_TYPE :: */
|
||||
/* PS_DICT_FONT_NAME :: */
|
||||
/* PS_DICT_UNIQUE_ID :: */
|
||||
/* PS_DICT_NUM_CHAR_STRINGS :: */
|
||||
/* PS_DICT_CHAR_STRING_KEY :: */
|
||||
/* PS_DICT_CHAR_STRING :: */
|
||||
/* PS_DICT_ENCODING_TYPE :: */
|
||||
/* PS_DICT_ENCODING_ENTRY :: */
|
||||
/* PS_DICT_NUM_SUBRS :: */
|
||||
/* PS_DICT_SUBR :: */
|
||||
/* PS_DICT_STD_HW :: */
|
||||
/* PS_DICT_STD_VW :: */
|
||||
/* PS_DICT_NUM_BLUE_VALUES :: */
|
||||
/* PS_DICT_BLUE_VALUE :: */
|
||||
/* PS_DICT_BLUE_FUZZ :: */
|
||||
/* PS_DICT_NUM_OTHER_BLUES :: */
|
||||
/* PS_DICT_OTHER_BLUE :: */
|
||||
/* PS_DICT_NUM_FAMILY_BLUES :: */
|
||||
/* PS_DICT_FAMILY_BLUE :: */
|
||||
/* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
|
||||
/* PS_DICT_FAMILY_OTHER_BLUE :: */
|
||||
/* PS_DICT_BLUE_SCALE :: */
|
||||
/* PS_DICT_BLUE_SHIFT :: */
|
||||
/* PS_DICT_NUM_STEM_SNAP_H :: */
|
||||
/* PS_DICT_STEM_SNAP_H :: */
|
||||
/* PS_DICT_NUM_STEM_SNAP_V :: */
|
||||
/* PS_DICT_STEM_SNAP_V :: */
|
||||
/* PS_DICT_FORCE_BOLD :: */
|
||||
/* PS_DICT_RND_STEM_UP :: */
|
||||
/* PS_DICT_MIN_FEATURE :: */
|
||||
/* PS_DICT_LEN_IV :: */
|
||||
/* PS_DICT_PASSWORD :: */
|
||||
/* PS_DICT_LANGUAGE_GROUP :: */
|
||||
/* PS_DICT_VERSION :: */
|
||||
/* PS_DICT_NOTICE :: */
|
||||
/* PS_DICT_FULL_NAME :: */
|
||||
/* PS_DICT_FAMILY_NAME :: */
|
||||
/* PS_DICT_WEIGHT :: */
|
||||
/* PS_DICT_IS_FIXED_PITCH :: */
|
||||
/* PS_DICT_UNDERLINE_POSITION :: */
|
||||
/* PS_DICT_UNDERLINE_THICKNESS :: */
|
||||
/* PS_DICT_FS_TYPE :: */
|
||||
/* PS_DICT_ITALIC_ANGLE :: */
|
||||
/* */
|
||||
typedef enum PS_Dict_Keys_
|
||||
{
|
||||
/* conventionally in the font dictionary */
|
||||
@ -656,7 +755,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __T1TABLES_H__ */
|
||||
#endif /* T1TABLES_H_ */
|
||||
|
||||
|
||||
/* END */
|
240
drivers/freetype/freetype/include/freetype/ttnameid.h → drivers/freetype/include/freetype/ttnameid.h
240
drivers/freetype/freetype/include/freetype/ttnameid.h → drivers/freetype/include/freetype/ttnameid.h
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* TrueType name ID definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006-2008, 2012 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __TTNAMEID_H__
|
||||
#define __TTNAMEID_H__
|
||||
#ifndef TTNAMEID_H_
|
||||
#define TTNAMEID_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -321,7 +321,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* The canonical source for the Apple assigned Language ID's is at */
|
||||
/* */
|
||||
/* https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html */
|
||||
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html */
|
||||
/* */
|
||||
#define TT_MAC_LANGID_ENGLISH 0
|
||||
#define TT_MAC_LANGID_FRENCH 1
|
||||
@ -470,26 +470,26 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
|
||||
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
|
||||
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
|
||||
#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
|
||||
#define TT_MS_LANGID_ARABIC_EGYPT 0x0C01
|
||||
#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
|
||||
#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
|
||||
#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
|
||||
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
|
||||
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01
|
||||
#define TT_MS_LANGID_ARABIC_OMAN 0x2001
|
||||
#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
|
||||
#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
|
||||
#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
|
||||
#define TT_MS_LANGID_ARABIC_JORDAN 0x2C01
|
||||
#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
|
||||
#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
|
||||
#define TT_MS_LANGID_ARABIC_UAE 0x3801
|
||||
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
|
||||
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01
|
||||
#define TT_MS_LANGID_ARABIC_QATAR 0x4001
|
||||
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
|
||||
#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
|
||||
#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
|
||||
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
|
||||
#define TT_MS_LANGID_CHINESE_PRC 0x0804
|
||||
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
|
||||
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04
|
||||
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
|
||||
|
||||
#if 1 /* this looks like the correct value */
|
||||
@ -507,7 +507,7 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_DANISH_DENMARK 0x0406
|
||||
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
|
||||
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
|
||||
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
|
||||
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07
|
||||
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
|
||||
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
|
||||
#define TT_MS_LANGID_GREEK_GREECE 0x0408
|
||||
@ -520,69 +520,69 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
|
||||
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
|
||||
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
|
||||
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
|
||||
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09
|
||||
#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
|
||||
#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
|
||||
#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
|
||||
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
|
||||
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09
|
||||
#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
|
||||
#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
|
||||
#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
|
||||
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
|
||||
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09
|
||||
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
|
||||
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
|
||||
#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
|
||||
#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09
|
||||
#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
|
||||
#define TT_MS_LANGID_ENGLISH_INDIA 0x4009
|
||||
#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
|
||||
#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
|
||||
#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
|
||||
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
|
||||
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
|
||||
#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
|
||||
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
|
||||
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
|
||||
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
|
||||
#define TT_MS_LANGID_SPANISH_PERU 0x280a
|
||||
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
|
||||
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
|
||||
#define TT_MS_LANGID_SPANISH_CHILE 0x340a
|
||||
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
|
||||
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
|
||||
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
|
||||
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
|
||||
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
|
||||
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
|
||||
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
|
||||
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A
|
||||
#define TT_MS_LANGID_SPANISH_MEXICO 0x080A
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0C0A
|
||||
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A
|
||||
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A
|
||||
#define TT_MS_LANGID_SPANISH_PANAMA 0x180A
|
||||
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A
|
||||
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A
|
||||
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A
|
||||
#define TT_MS_LANGID_SPANISH_PERU 0x280A
|
||||
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A
|
||||
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300A
|
||||
#define TT_MS_LANGID_SPANISH_CHILE 0x340A
|
||||
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380A
|
||||
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A
|
||||
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A
|
||||
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A
|
||||
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480A
|
||||
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A
|
||||
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A
|
||||
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A
|
||||
/* The following ID blatantly violate MS specs by using a */
|
||||
/* sublanguage > 0x1F. */
|
||||
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU
|
||||
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
|
||||
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
|
||||
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
|
||||
#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
|
||||
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
|
||||
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
|
||||
#define TT_MS_LANGID_FRENCH_MONACO 0x180c
|
||||
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c
|
||||
#define TT_MS_LANGID_FRENCH_REUNION 0x200c
|
||||
#define TT_MS_LANGID_FRENCH_CONGO 0x240c
|
||||
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
|
||||
#define TT_MS_LANGID_FINNISH_FINLAND 0x040B
|
||||
#define TT_MS_LANGID_FRENCH_FRANCE 0x040C
|
||||
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080C
|
||||
#define TT_MS_LANGID_FRENCH_CANADA 0x0C0C
|
||||
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C
|
||||
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C
|
||||
#define TT_MS_LANGID_FRENCH_MONACO 0x180C
|
||||
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
|
||||
#define TT_MS_LANGID_FRENCH_REUNION 0x200C
|
||||
#define TT_MS_LANGID_FRENCH_CONGO 0x240C
|
||||
/* which was formerly: */
|
||||
#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
|
||||
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c
|
||||
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c
|
||||
#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c
|
||||
#define TT_MS_LANGID_FRENCH_MALI 0x340c
|
||||
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c
|
||||
#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c
|
||||
/* and another violation of the spec (see 0xE40aU) */
|
||||
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU
|
||||
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
|
||||
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
|
||||
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
|
||||
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
|
||||
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
|
||||
#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
|
||||
#define TT_MS_LANGID_FRENCH_MALI 0x340C
|
||||
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
|
||||
#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
|
||||
/* and another violation of the spec (see 0xE40AU) */
|
||||
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
|
||||
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040D
|
||||
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E
|
||||
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F
|
||||
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
|
||||
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
|
||||
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
|
||||
@ -600,27 +600,27 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
|
||||
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
|
||||
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
|
||||
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
|
||||
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041A
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A
|
||||
|
||||
#if 0 /* this used to be this value, but it looks like we were wrong */
|
||||
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a
|
||||
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101A
|
||||
#else /* current sources say */
|
||||
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a
|
||||
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a
|
||||
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
|
||||
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A
|
||||
/* and XPsp2 Platform SDK added (2004-07-26) */
|
||||
/* Names are shortened to be significant within 40 chars. */
|
||||
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a
|
||||
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a
|
||||
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A
|
||||
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181A
|
||||
#endif
|
||||
|
||||
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
|
||||
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
|
||||
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
|
||||
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
|
||||
#define TT_MS_LANGID_THAI_THAILAND 0x041e
|
||||
#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
|
||||
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B
|
||||
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C
|
||||
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D
|
||||
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081D
|
||||
#define TT_MS_LANGID_THAI_THAILAND 0x041E
|
||||
#define TT_MS_LANGID_TURKISH_TURKEY 0x041F
|
||||
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
|
||||
#define TT_MS_LANGID_URDU_INDIA 0x0820
|
||||
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
|
||||
@ -633,13 +633,13 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
|
||||
#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
|
||||
#define TT_MS_LANGID_FARSI_IRAN 0x0429
|
||||
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
|
||||
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
|
||||
#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
|
||||
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
|
||||
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
|
||||
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A
|
||||
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C
|
||||
#define TT_MS_LANGID_BASQUE_SPAIN 0x042D
|
||||
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042E
|
||||
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F
|
||||
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
|
||||
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
|
||||
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
|
||||
@ -650,32 +650,32 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
|
||||
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
|
||||
#define TT_MS_LANGID_HINDI_INDIA 0x0439
|
||||
#define TT_MS_LANGID_MALTESE_MALTA 0x043a
|
||||
#define TT_MS_LANGID_MALTESE_MALTA 0x043A
|
||||
/* Added by XPsp2 Platform SDK (2004-07-26) */
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b
|
||||
#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b
|
||||
#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b
|
||||
#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b
|
||||
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b
|
||||
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b
|
||||
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B
|
||||
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B
|
||||
#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B
|
||||
#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B
|
||||
#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B
|
||||
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B
|
||||
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B
|
||||
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B
|
||||
/* ... and we also keep our old identifier... */
|
||||
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
|
||||
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
|
||||
|
||||
#if 0 /* this seems to be a previous inversion */
|
||||
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
|
||||
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
|
||||
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
|
||||
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
|
||||
#else
|
||||
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
|
||||
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
|
||||
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
|
||||
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
|
||||
#endif
|
||||
|
||||
#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d
|
||||
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
|
||||
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
|
||||
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
|
||||
#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
|
||||
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
|
||||
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
|
||||
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043F
|
||||
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
|
||||
/* alias declared in Windows 2000 */
|
||||
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
|
||||
@ -693,12 +693,12 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
|
||||
#define TT_MS_LANGID_ORIYA_INDIA 0x0448
|
||||
#define TT_MS_LANGID_TAMIL_INDIA 0x0449
|
||||
#define TT_MS_LANGID_TELUGU_INDIA 0x044a
|
||||
#define TT_MS_LANGID_KANNADA_INDIA 0x044b
|
||||
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
|
||||
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
|
||||
#define TT_MS_LANGID_MARATHI_INDIA 0x044e
|
||||
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
|
||||
#define TT_MS_LANGID_TELUGU_INDIA 0x044A
|
||||
#define TT_MS_LANGID_KANNADA_INDIA 0x044B
|
||||
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044C
|
||||
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044D
|
||||
#define TT_MS_LANGID_MARATHI_INDIA 0x044E
|
||||
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044F
|
||||
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
|
||||
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
|
||||
#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
|
||||
@ -732,13 +732,13 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
|
||||
#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
|
||||
/* Missing a LCID for Sindhi in Devanagari script */
|
||||
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a
|
||||
#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b
|
||||
#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c
|
||||
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d
|
||||
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e
|
||||
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f
|
||||
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f
|
||||
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A
|
||||
#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045B
|
||||
#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
|
||||
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D
|
||||
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E
|
||||
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
|
||||
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085F
|
||||
/* Missing a LCID for Tifinagh script */
|
||||
#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
|
||||
/* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
|
||||
@ -758,15 +758,15 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
|
||||
#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
|
||||
#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
|
||||
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a
|
||||
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b
|
||||
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b
|
||||
#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b
|
||||
#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c
|
||||
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A
|
||||
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B
|
||||
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B
|
||||
#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B
|
||||
#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046C
|
||||
/* Also spelled by XPsp2 Platform SDK (2004-07-26) */
|
||||
#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
|
||||
TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
|
||||
/* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
|
||||
/* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */
|
||||
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
|
||||
#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
|
||||
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
|
||||
@ -783,12 +783,12 @@ FT_BEGIN_HEADER
|
||||
/* studying). */
|
||||
#define TT_MS_LANGID_YI_CHINA 0x0478
|
||||
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
|
||||
/* language codes from 0x047a to 0x047f are (still) unknown. */
|
||||
/* language codes from 0x047A to 0x047F are (still) unknown. */
|
||||
#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
|
||||
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
|
||||
|
||||
#if 0 /* not deemed useful for fonts */
|
||||
#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff
|
||||
#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04FF
|
||||
#endif
|
||||
|
||||
|
||||
@ -1208,7 +1208,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* Here some alias #defines in order to be clearer. */
|
||||
/* */
|
||||
/* These are not always #defined to stay within the 31~character limit */
|
||||
/* These are not always #defined to stay within the 31~character limit, */
|
||||
/* which some compilers have. */
|
||||
/* */
|
||||
/* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
|
||||
@ -1231,7 +1231,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __TTNAMEID_H__ */
|
||||
#endif /* TTNAMEID_H_ */
|
||||
|
||||
|
||||
/* END */
|
108
drivers/freetype/freetype/include/freetype/tttables.h → drivers/freetype/include/freetype/tttables.h
108
drivers/freetype/freetype/include/freetype/tttables.h → drivers/freetype/include/freetype/tttables.h
@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType tables definitions and interface */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2005, 2008-2012 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -17,8 +17,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __TTTABLES_H__
|
||||
#define __TTTABLES_H__
|
||||
#ifndef TTTABLES_H_
|
||||
#define TTTABLES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -48,6 +48,25 @@ FT_BEGIN_HEADER
|
||||
/* This section contains the definition of TrueType-specific tables */
|
||||
/* as well as some routines used to access and process them. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* TT_Header */
|
||||
/* TT_HoriHeader */
|
||||
/* TT_VertHeader */
|
||||
/* TT_OS2 */
|
||||
/* TT_Postscript */
|
||||
/* TT_PCLT */
|
||||
/* TT_MaxProfile */
|
||||
/* */
|
||||
/* FT_Sfnt_Tag */
|
||||
/* FT_Get_Sfnt_Table */
|
||||
/* FT_Load_Sfnt_Table */
|
||||
/* FT_Sfnt_Table_Info */
|
||||
/* */
|
||||
/* FT_Get_CMap_Language_ID */
|
||||
/* FT_Get_CMap_Format */
|
||||
/* */
|
||||
/* FT_PARAM_TAG_UNPATENTED_HINTING */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@ -170,8 +189,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
|
||||
/* be identical except for the names of their fields which */
|
||||
/* are different. */
|
||||
/* be identical except for the names of their fields, */
|
||||
/* which are different. */
|
||||
/* */
|
||||
/* This ensures that a single function in the `ttload' */
|
||||
/* module is able to read both the horizontal and vertical */
|
||||
@ -296,8 +315,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
|
||||
/* be identical except for the names of their fields which */
|
||||
/* are different. */
|
||||
/* be identical except for the names of their fields, */
|
||||
/* which are different. */
|
||||
/* */
|
||||
/* This ensures that a single function in the `ttload' */
|
||||
/* module is able to read both the horizontal and vertical */
|
||||
@ -340,12 +359,11 @@ FT_BEGIN_HEADER
|
||||
/* TT_OS2 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType OS/2 table. This is the long */
|
||||
/* table version. All fields comply to the TrueType specification. */
|
||||
/* A structure used to model a TrueType OS/2 table. All fields */
|
||||
/* comply to the OpenType specification. */
|
||||
/* */
|
||||
/* Note that we now support old Mac fonts which do not include an */
|
||||
/* OS/2 table. In this case, the `version' field is always set to */
|
||||
/* 0xFFFF. */
|
||||
/* Note that we now support old Mac fonts that do not include an OS/2 */
|
||||
/* table. In this case, the `version' field is always set to 0xFFFF. */
|
||||
/* */
|
||||
typedef struct TT_OS2_
|
||||
{
|
||||
@ -353,7 +371,7 @@ FT_BEGIN_HEADER
|
||||
FT_Short xAvgCharWidth;
|
||||
FT_UShort usWeightClass;
|
||||
FT_UShort usWidthClass;
|
||||
FT_Short fsType;
|
||||
FT_UShort fsType;
|
||||
FT_Short ySubscriptXSize;
|
||||
FT_Short ySubscriptYSize;
|
||||
FT_Short ySubscriptXOffset;
|
||||
@ -384,12 +402,12 @@ FT_BEGIN_HEADER
|
||||
FT_UShort usWinAscent;
|
||||
FT_UShort usWinDescent;
|
||||
|
||||
/* only version 1 tables: */
|
||||
/* only version 1 and higher: */
|
||||
|
||||
FT_ULong ulCodePageRange1; /* Bits 0-31 */
|
||||
FT_ULong ulCodePageRange2; /* Bits 32-63 */
|
||||
|
||||
/* only version 2 tables: */
|
||||
/* only version 2 and higher: */
|
||||
|
||||
FT_Short sxHeight;
|
||||
FT_Short sCapHeight;
|
||||
@ -397,6 +415,11 @@ FT_BEGIN_HEADER
|
||||
FT_UShort usBreakChar;
|
||||
FT_UShort usMaxContext;
|
||||
|
||||
/* only version 5 and higher: */
|
||||
|
||||
FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
|
||||
FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
|
||||
|
||||
} TT_OS2;
|
||||
|
||||
|
||||
@ -465,7 +488,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_MaxProfile */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The maximum profile is a table containing many max values which */
|
||||
/* The maximum profile is a table containing many max values, which */
|
||||
/* can be used to pre-allocate arrays. This ensures that no memory */
|
||||
/* allocation occurs during a glyph load. */
|
||||
/* */
|
||||
@ -555,21 +578,44 @@ FT_BEGIN_HEADER
|
||||
/* An enumeration used to specify the index of an SFNT table. */
|
||||
/* Used in the @FT_Get_Sfnt_Table API function. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
|
||||
/* */
|
||||
/* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */
|
||||
/* */
|
||||
/* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */
|
||||
/* */
|
||||
/* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
|
||||
/* */
|
||||
/* FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure. */
|
||||
/* */
|
||||
/* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
|
||||
/* */
|
||||
/* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */
|
||||
/* */
|
||||
typedef enum FT_Sfnt_Tag_
|
||||
{
|
||||
ft_sfnt_head = 0, /* TT_Header */
|
||||
ft_sfnt_maxp = 1, /* TT_MaxProfile */
|
||||
ft_sfnt_os2 = 2, /* TT_OS2 */
|
||||
ft_sfnt_hhea = 3, /* TT_HoriHeader */
|
||||
ft_sfnt_vhea = 4, /* TT_VertHeader */
|
||||
ft_sfnt_post = 5, /* TT_Postscript */
|
||||
ft_sfnt_pclt = 6, /* TT_PCLT */
|
||||
FT_SFNT_HEAD,
|
||||
FT_SFNT_MAXP,
|
||||
FT_SFNT_OS2,
|
||||
FT_SFNT_HHEA,
|
||||
FT_SFNT_VHEA,
|
||||
FT_SFNT_POST,
|
||||
FT_SFNT_PCLT,
|
||||
|
||||
sfnt_max /* internal end mark */
|
||||
FT_SFNT_MAX
|
||||
|
||||
} FT_Sfnt_Tag;
|
||||
|
||||
/* */
|
||||
/* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
|
||||
/* values instead */
|
||||
#define ft_sfnt_head FT_SFNT_HEAD
|
||||
#define ft_sfnt_maxp FT_SFNT_MAXP
|
||||
#define ft_sfnt_os2 FT_SFNT_OS2
|
||||
#define ft_sfnt_hhea FT_SFNT_HHEA
|
||||
#define ft_sfnt_vhea FT_SFNT_VHEA
|
||||
#define ft_sfnt_post FT_SFNT_POST
|
||||
#define ft_sfnt_pclt FT_SFNT_PCLT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -607,7 +653,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* */
|
||||
/* vert_header = */
|
||||
/* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */
|
||||
/* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */
|
||||
/* } */
|
||||
/* */
|
||||
FT_EXPORT( void* )
|
||||
@ -672,6 +718,12 @@ FT_BEGIN_HEADER
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
|
||||
* if ( error ) { ... could not load table ... }
|
||||
* }
|
||||
*
|
||||
* Note that structures like @TT_Header or @TT_OS2 can't be used with
|
||||
* this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
|
||||
* those structures depend on the processor architecture, with varying
|
||||
* size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Load_Sfnt_Table( FT_Face face,
|
||||
@ -730,7 +782,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return TrueType/sfnt specific cmap language ID. Definitions of */
|
||||
/* language ID values are in `freetype/ttnameid.h'. */
|
||||
/* language ID values are in `ttnameid.h'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: */
|
||||
@ -771,7 +823,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __TTTABLES_H__ */
|
||||
#endif /* TTTABLES_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tags for TrueType and OpenType tables (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by */
|
||||
/* Copyright 1996-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,8 +16,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __TTAGS_H__
|
||||
#define __TTAGS_H__
|
||||
#ifndef TTAGS_H_
|
||||
#define TTAGS_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -88,6 +88,7 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
|
||||
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
|
||||
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
|
||||
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
|
||||
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
|
||||
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
|
||||
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
|
||||
@ -99,11 +100,12 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
|
||||
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
|
||||
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
|
||||
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __TTAGS_H__ */
|
||||
#endif /* TTAGS_H_ */
|
||||
|
||||
|
||||
/* END */
|
22
drivers/freetype/freetype/include/freetype/ttunpat.h → drivers/freetype/include/freetype/ttunpat.h
22
drivers/freetype/freetype/include/freetype/ttunpat.h → drivers/freetype/include/freetype/ttunpat.h
@ -2,9 +2,10 @@
|
||||
/* */
|
||||
/* ttunpat.h */
|
||||
/* */
|
||||
/* Definitions for the unpatented TrueType hinting system */
|
||||
/* Definitions for the unpatented TrueType hinting system. */
|
||||
/* Obsolete, retained for backwards compatibility. */
|
||||
/* */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* Copyright 2003-2016 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* Written by Graham Asher <graham.asher@btinternet.com> */
|
||||
@ -18,8 +19,8 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __TTUNPAT_H__
|
||||
#define __TTUNPAT_H__
|
||||
#ifndef TTUNPAT_H_
|
||||
#define TTUNPAT_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
@ -41,19 +42,22 @@ FT_BEGIN_HEADER
|
||||
* FT_PARAM_TAG_UNPATENTED_HINTING
|
||||
*
|
||||
* @description:
|
||||
* A constant used as the tag of an @FT_Parameter structure to indicate
|
||||
* that unpatented methods only should be used by the TrueType bytecode
|
||||
* interpreter for a typeface opened by @FT_Open_Face.
|
||||
* Deprecated.
|
||||
*
|
||||
* Previously: A constant used as the tag of an @FT_Parameter structure to
|
||||
* indicate that unpatented methods only should be used by the TrueType
|
||||
* bytecode interpreter for a typeface opened by @FT_Open_Face.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
|
||||
|
||||
/* */
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __TTUNPAT_H__ */
|
||||
#endif /* TTUNPAT_H_ */
|
||||
|
||||
|
||||
/* END */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user