summaryrefslogtreecommitdiff
path: root/third_party/freetype/include/freetype
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/freetype/include/freetype')
-rw-r--r--third_party/freetype/include/freetype/config/ftconfig.h35
-rw-r--r--third_party/freetype/include/freetype/config/ftheader.h13
-rw-r--r--third_party/freetype/include/freetype/config/ftmodule.h17
-rw-r--r--third_party/freetype/include/freetype/config/ftoption.h212
-rw-r--r--third_party/freetype/include/freetype/config/ftstdlib.h15
-rw-r--r--third_party/freetype/include/freetype/freetype.h887
-rw-r--r--third_party/freetype/include/freetype/ftadvanc.h8
-rw-r--r--third_party/freetype/include/freetype/ftbitmap.h8
-rw-r--r--third_party/freetype/include/freetype/ftcffdrv.h39
-rw-r--r--third_party/freetype/include/freetype/fterrdef.h4
-rw-r--r--third_party/freetype/include/freetype/fterrors.h22
-rw-r--r--third_party/freetype/include/freetype/ftfntfmt.h11
-rw-r--r--third_party/freetype/include/freetype/ftglyph.h8
-rw-r--r--third_party/freetype/include/freetype/ftgzip.h18
-rw-r--r--third_party/freetype/include/freetype/ftimage.h25
-rw-r--r--third_party/freetype/include/freetype/ftincrem.h8
-rw-r--r--third_party/freetype/include/freetype/ftlcdfil.h187
-rw-r--r--third_party/freetype/include/freetype/ftlist.h8
-rw-r--r--third_party/freetype/include/freetype/ftmm.h212
-rw-r--r--third_party/freetype/include/freetype/ftmodapi.h30
-rw-r--r--third_party/freetype/include/freetype/ftmoderr.h10
-rw-r--r--third_party/freetype/include/freetype/ftotval.h20
-rw-r--r--third_party/freetype/include/freetype/ftoutln.h16
-rw-r--r--third_party/freetype/include/freetype/ftrender.h9
-rw-r--r--third_party/freetype/include/freetype/ftsizes.h8
-rw-r--r--third_party/freetype/include/freetype/ftsnames.h12
-rw-r--r--third_party/freetype/include/freetype/ftsynth.h8
-rw-r--r--third_party/freetype/include/freetype/ftsystem.h10
-rw-r--r--third_party/freetype/include/freetype/fttrigon.h8
-rw-r--r--third_party/freetype/include/freetype/ftttdrv.h71
-rw-r--r--third_party/freetype/include/freetype/fttypes.h8
-rw-r--r--third_party/freetype/include/freetype/internal/autohint.h8
-rw-r--r--third_party/freetype/include/freetype/internal/ftcalc.h16
-rw-r--r--third_party/freetype/include/freetype/internal/ftdebug.h8
-rw-r--r--third_party/freetype/include/freetype/internal/ftdriver.h19
-rw-r--r--third_party/freetype/include/freetype/internal/ftgloadr.h28
-rw-r--r--third_party/freetype/include/freetype/internal/fthash.h136
-rw-r--r--third_party/freetype/include/freetype/internal/ftmemory.h21
-rw-r--r--third_party/freetype/include/freetype/internal/ftobjs.h65
-rw-r--r--third_party/freetype/include/freetype/internal/ftpic.h8
-rw-r--r--third_party/freetype/include/freetype/internal/ftrfork.h15
-rw-r--r--third_party/freetype/include/freetype/internal/ftserv.h123
-rw-r--r--third_party/freetype/include/freetype/internal/ftstream.h8
-rw-r--r--third_party/freetype/include/freetype/internal/ftvalid.h8
-rw-r--r--third_party/freetype/include/freetype/internal/internal.h4
-rw-r--r--third_party/freetype/include/freetype/internal/psaux.h10
-rw-r--r--third_party/freetype/include/freetype/internal/pshints.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svcid.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svfntfmt.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svgldict.h11
-rw-r--r--third_party/freetype/include/freetype/internal/services/svkern.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svmetric.h153
-rw-r--r--third_party/freetype/include/freetype/internal/services/svmm.h99
-rw-r--r--third_party/freetype/include/freetype/internal/services/svpostnm.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svprop.h11
-rw-r--r--third_party/freetype/include/freetype/internal/services/svpscmap.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svpsinfo.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svsfnt.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svttcmap.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svtteng.h8
-rw-r--r--third_party/freetype/include/freetype/internal/services/svttglyf.h8
-rw-r--r--third_party/freetype/include/freetype/internal/sfnt.h8
-rw-r--r--third_party/freetype/include/freetype/internal/t1types.h10
-rw-r--r--third_party/freetype/include/freetype/internal/tttypes.h200
-rw-r--r--third_party/freetype/include/freetype/t1tables.h8
-rw-r--r--third_party/freetype/include/freetype/ttnameid.h8
-rw-r--r--third_party/freetype/include/freetype/tttables.h61
-rw-r--r--third_party/freetype/include/freetype/tttags.h12
68 files changed, 2027 insertions, 1066 deletions
diff --git a/third_party/freetype/include/freetype/config/ftconfig.h b/third_party/freetype/include/freetype/config/ftconfig.h
index d4d79936df..9d7f8839b0 100644
--- a/third_party/freetype/include/freetype/config/ftconfig.h
+++ b/third_party/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -35,8 +35,8 @@
/* */
/*************************************************************************/
-#ifndef __FTCONFIG_H__
-#define __FTCONFIG_H__
+#ifndef FTCONFIG_H_
+#define FTCONFIG_H_
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H
@@ -143,6 +143,14 @@ FT_BEGIN_HEADER
#endif
+ /* Fix compiler warning with sgi compiler */
+#if defined( __sgi ) && !defined( __GNUC__ )
+#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
+#pragma set woff 3505
+#endif
+#endif
+
+
/*************************************************************************/
/* */
/* <Section> */
@@ -275,7 +283,13 @@ FT_BEGIN_HEADER
/* */
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
-#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
+#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 */
#define FT_LONG64
@@ -309,7 +323,7 @@ FT_BEGIN_HEADER
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
-#endif /* _MSC_VER */
+#endif /* __STDC_VERSION__ >= 199901L */
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
@@ -332,10 +346,11 @@ FT_BEGIN_HEADER
/* 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))
+#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
+ ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
+ defined( __IBM__TYPEOF__ ) ) || \
+ ( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
+#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
@@ -461,7 +476,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTCONFIG_H__ */
+#endif /* FTCONFIG_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/config/ftheader.h b/third_party/freetype/include/freetype/config/ftheader.h
index 55f833db0f..950d36c91f 100644
--- a/third_party/freetype/include/freetype/config/ftheader.h
+++ b/third_party/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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_
/*@***********************************************************************/
@@ -753,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>
@@ -766,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>
@@ -828,7 +827,7 @@
#endif /* FT2_BUILD_LIBRARY */
-#endif /* __FT2_BUILD_H__ */
+#endif /* FTHEADER_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/config/ftmodule.h b/third_party/freetype/include/freetype/config/ftmodule.h
index fb255743a7..0d31ce6932 100644
--- a/third_party/freetype/include/freetype/config/ftmodule.h
+++ b/third_party/freetype/include/freetype/config/ftmodule.h
@@ -1,20 +1,3 @@
-/***************************************************************************/
-/* */
-/* ftmodule.h */
-/* */
-/* FreeType modules public interface (specification). */
-/* */
-/* Copyright 1996-2001, 2002, 2003 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
/*
* This file registers the FreeType modules compiled into the library.
*
diff --git a/third_party/freetype/include/freetype/config/ftoption.h b/third_party/freetype/include/freetype/config/ftoption.h
index 886e64e9bf..802beb5036 100644
--- a/third_party/freetype/include/freetype/config/ftoption.h
+++ b/third_party/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -77,6 +77,36 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* If you enable this configuration option, FreeType recognizes an */
+ /* environment variable called `FREETYPE_PROPERTIES', which can be used */
+ /* to control the various font drivers and modules. The controllable */
+ /* properties are listed in the section `Controlling FreeType Modules' */
+ /* in the reference's table of contents; currently there are properties */
+ /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
+ /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
+ /* */
+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
+ /* multiple lines for better readability). */
+ /* */
+ /* <optional whitespace> */
+ /* <module-name1> ':' */
+ /* <property-name1> '=' <property-value1> */
+ /* <whitespace> */
+ /* <module-name2> ':' */
+ /* <property-name2> '=' <property-value2> */
+ /* ... */
+ /* */
+ /* Example: */
+ /* */
+ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
+ /* cff:no-stem-darkening=1 \ */
+ /* autofitter:warping=1 */
+ /* */
+#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+
+
+ /*************************************************************************/
+ /* */
/* 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. */
/* */
@@ -163,7 +193,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
+#undef FT_CONFIG_OPTION_USE_ZLIB
/*************************************************************************/
@@ -492,7 +522,21 @@ FT_BEGIN_HEADER
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
- /* fixups, such as BREW. */
+ /* fixups, such as BREW. [Note that standard compilers like gcc or */
+ /* clang handle PIC generation automatically; you don't have to set */
+ /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
+ /* compilers.] */
+ /* */
+ /* Note that FT_CONFIG_OPTION_PIC support is not available for all */
+ /* modules (see `modules.cfg' for a complete list). For building with */
+ /* FT_CONFIG_OPTION_PIC support, do the following. */
+ /* */
+ /* 0. Clone the repository. */
+ /* 1. Define FT_CONFIG_OPTION_PIC. */
+ /* 2. Remove all subdirectories in `src' that don't have */
+ /* FT_CONFIG_OPTION_PIC support. */
+ /* 3. Comment out the corresponding modules in `modules.cfg'. */
+ /* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
@@ -586,73 +630,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. */
- /* */
- /* 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. */
+ /* subpixel hinting support into the TrueType driver. This modifies the */
+ /* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
+ /* requested. */
/* */
- /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
- /* defined. */
+ /* 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. */
/* */
-/* #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. */
+ /* There are three options. */
/* */
- /* - The unpatented interpreter is explicitly activated by the user */
- /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
- /* when opening the FT_Face. */
+ /* 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. */
/* */
- /* - 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'). */
+ /* 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. */
/* */
- /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
+ /* 3. Compile both. */
/* */
- /* { */
- /* FT_Parameter parameter; */
- /* FT_Open_Args open_args; */
+ /* 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. */
/* */
+ /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
+ /* defined. */
/* */
- /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
+ /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
- /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
- /* open_args.pathname = my_font_pathname; */
- /* open_args.num_params = 1; */
- /* open_args.params = &parameter; */
- /* */
- /* error = FT_Open_Face( library, &open_args, index, &face ); */
- /* ... */
- /* } */
- /* */
-/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
/*************************************************************************/
@@ -693,6 +717,24 @@ FT_BEGIN_HEADER
/*************************************************************************/
+ /* */
+ /* 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
+
+
+ /*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
@@ -793,6 +835,33 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/**** ****/
+ /**** P C F D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* There are many PCF fonts just called `Fixed' which look completely */
+ /* different, and which have nothing to do with each other. When */
+ /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
+ /* random, the style changes often if one changes the size and one */
+ /* cannot select some fonts at all. This option makes the PCF module */
+ /* prepend the foundry name (plus a space) to the family name. */
+ /* */
+ /* We also check whether we have `wide' characters; all put together, we */
+ /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
+ /* */
+ /* If this option is activated, it can be controlled with the */
+ /* `no-long-family-names' property of the pcf driver module. */
+ /* */
+/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
/**** 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 ****/
/**** ****/
/*************************************************************************/
@@ -838,14 +907,19 @@ FT_BEGIN_HEADER
/*
- * 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
@@ -880,7 +954,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTOPTION_H__ */
+#endif /* FTOPTION_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/config/ftstdlib.h b/third_party/freetype/include/freetype/config/ftstdlib.h
index 4b471d4d15..05a4845fd5 100644
--- a/third_party/freetype/include/freetype/config/ftstdlib.h
+++ b/third_party/freetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 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,7 @@
#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
@@ -142,7 +142,8 @@
/**********************************************************************/
-#define ft_atol atol
+#define ft_strtol strtol
+#define ft_getenv getenv
/**********************************************************************/
@@ -168,7 +169,7 @@
#include <stdarg.h>
-#endif /* __FTSTDLIB_H__ */
+#endif /* FTSTDLIB_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/freetype.h b/third_party/freetype/include/freetype/freetype.h
index b6247f510f..b6c6032528 100644
--- a/third_party/freetype/include/freetype/freetype.h
+++ b/third_party/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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 __FREETYPE_H__
-#define __FREETYPE_H__
+#ifndef FREETYPE_H_
+#define FREETYPE_H_
#ifndef FT_FREETYPE_H
@@ -141,7 +141,6 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_HINTER */
- /* FT_FACE_FLAG_TRICKY */
/* */
/* FT_HAS_HORIZONTAL */
/* FT_HAS_VERTICAL */
@@ -266,8 +265,8 @@ FT_BEGIN_HEADER
/* FT_Glyph_Metrics */
/* */
/* <Description> */
- /* A structure used to model the metrics of a single glyph. The */
- /* values are expressed in 26.6 fractional pixel format; if the flag */
+ /* A structure to model the metrics of a single glyph. The values */
+ /* are expressed in 26.6 fractional pixel format; if the flag */
/* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
/* are expressed in font units instead. */
/* */
@@ -350,10 +349,10 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* Windows FNT: */
- /* The nominal size given in a FNT font is not reliable. Thus when */
- /* the driver finds it incorrect, it sets `size' to some calculated */
- /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
- /* height given in the font, respectively. */
+ /* The nominal size given in a FNT font is not reliable. If the */
+ /* driver finds it incorrect, it sets `size' to some calculated */
+ /* values, and `x_ppem' and `y_ppem' to the pixel width and height */
+ /* given in the font, respectively. */
/* */
/* TrueType embedded bitmaps: */
/* `size', `width', and `height' values are not contained in the */
@@ -422,9 +421,9 @@ FT_BEGIN_HEADER
/* FT_Module */
/* */
/* <Description> */
- /* A handle to a given FreeType module object. Each module can be a */
+ /* A handle to a given FreeType module object. A module can be a */
/* font driver, a renderer, or anything else that provides services */
- /* to the formers. */
+ /* to the former. */
/* */
typedef struct FT_ModuleRec_* FT_Module;
@@ -435,8 +434,8 @@ FT_BEGIN_HEADER
/* FT_Driver */
/* */
/* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is a special module capable of creating faces from font files. */
+ /* A handle to a given FreeType font driver object. A font driver */
+ /* is a module capable of creating faces from font files. */
/* */
typedef struct FT_DriverRec_* FT_Driver;
@@ -447,10 +446,10 @@ FT_BEGIN_HEADER
/* FT_Renderer */
/* */
/* <Description> */
- /* A handle to a given FreeType renderer. A renderer is a special */
- /* module in charge of converting a glyph image to a bitmap, when */
- /* necessary. Each renderer supports a given glyph image format, and */
- /* one or more target surface depths. */
+ /* A handle to a given FreeType renderer. A renderer is a module in */
+ /* charge of converting a glyph's outline image to a bitmap. It */
+ /* supports a single glyph image format, and one or more target */
+ /* surface depths. */
/* */
typedef struct FT_RendererRec_* FT_Renderer;
@@ -468,15 +467,15 @@ FT_BEGIN_HEADER
/* FT_Face */
/* */
/* <Description> */
- /* A handle to a given typographic face object. A face object models */
- /* a given typeface, in a given style. */
+ /* A handle to a typographic face object. A face object models a */
+ /* given typeface, in a given style. */
/* */
/* <Note> */
- /* Each face object also owns a single @FT_GlyphSlot object, as well */
+ /* A face object also owns a single @FT_GlyphSlot object, as well */
/* as one or more @FT_Size objects. */
/* */
/* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
- /* a given filepathname or a custom input stream. */
+ /* a given filepath or a custom input stream. */
/* */
/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
/* */
@@ -501,11 +500,11 @@ FT_BEGIN_HEADER
/* FT_Size */
/* */
/* <Description> */
- /* A handle to an object used to model a face scaled to a given */
+ /* A handle to an object that models a face scaled to a given */
/* character size. */
/* */
/* <Note> */
- /* Each @FT_Face has an _active_ @FT_Size object that is used by */
+ /* An @FT_Face has one _active_ @FT_Size object that is used by */
/* functions like @FT_Load_Glyph to determine the scaling */
/* transformation that in turn is used to load and hint glyphs and */
/* metrics. */
@@ -532,9 +531,8 @@ FT_BEGIN_HEADER
/* FT_GlyphSlot */
/* */
/* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained in its parent */
- /* face. */
+ /* A handle to a given `glyph slot'. A slot is a container that can */
+ /* hold any of the glyphs contained in its parent face. */
/* */
/* In other words, each time you call @FT_Load_Glyph or */
/* @FT_Load_Char, the slot's content is erased by the new glyph data, */
@@ -553,13 +551,14 @@ FT_BEGIN_HEADER
/* FT_CharMap */
/* */
/* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
+ /* A handle to a character map (usually abbreviated to `charmap'). A */
+ /* charmap is used to translate character codes in a given encoding */
+ /* into glyph indexes for its parent's face. Some font formats may */
+ /* provide several charmaps per font. */
/* */
/* Each face object owns zero or more charmaps, but only one of them */
- /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
+ /* can be `active', providing the data used by @FT_Get_Char_Index or */
+ /* @FT_Load_Char. */
/* */
/* The list of available charmaps in a face is available through the */
/* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
@@ -616,8 +615,8 @@ FT_BEGIN_HEADER
/* FT_Encoding */
/* */
/* <Description> */
- /* An enumeration used to specify character sets supported by */
- /* charmaps. Used in the @FT_Select_Charmap API function. */
+ /* An enumeration to specify character sets supported by charmaps. */
+ /* Used in the @FT_Select_Charmap API function. */
/* */
/* <Note> */
/* Despite the name, this enumeration lists specific character */
@@ -631,18 +630,17 @@ FT_BEGIN_HEADER
/* The encoding value~0 is reserved. */
/* */
/* FT_ENCODING_UNICODE :: */
- /* Corresponds to the Unicode character set. This value covers */
- /* all versions of the Unicode repertoire, including ASCII and */
- /* Latin-1. Most fonts include a Unicode charmap, but not all */
- /* of them. */
+ /* The Unicode character set. This value covers all versions of */
+ /* the Unicode repertoire, including ASCII and Latin-1. Most fonts */
+ /* include a Unicode charmap, but not all of them. */
/* */
/* For example, if you want to access Unicode value U+1F028 (and */
/* the font contains it), use value 0x1F028 as the input value for */
/* @FT_Get_Char_Index. */
/* */
/* FT_ENCODING_MS_SYMBOL :: */
- /* Corresponds to the Microsoft Symbol encoding, used to encode */
- /* mathematical symbols and wingdings. For more information, see */
+ /* Microsoft Symbol encoding, used to encode mathematical symbols */
+ /* and wingdings. For more information, see */
/* `http://www.microsoft.com/typography/otspec/recom.htm', */
/* `http://www.kostis.net/charsets/symbol.htm', and */
/* `http://www.kostis.net/charsets/wingding.htm'. */
@@ -651,12 +649,12 @@ FT_BEGIN_HEADER
/* Area) in the range U+F020-U+F0FF. */
/* */
/* FT_ENCODING_SJIS :: */
- /* Corresponds to Japanese SJIS encoding. More info at */
- /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */
- /* See note on multi-byte encodings below. */
+ /* Shift JIS encoding for Japanese. More info at */
+ /* `http://en.wikipedia.org/wiki/Shift_JIS'. See note on */
+ /* multi-byte encodings below. */
/* */
/* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as used */
+ /* Corresponds to an encoding system for Simplified Chinese as */
/* used in mainland China. */
/* */
/* FT_ENCODING_BIG5 :: */
@@ -664,9 +662,10 @@ FT_BEGIN_HEADER
/* used in Taiwan and Hong Kong. */
/* */
/* FT_ENCODING_WANSUNG :: */
- /* Corresponds to the Korean encoding system known as Wansung. */
+ /* Corresponds to the Korean encoding system known as Extended */
+ /* Wansung (MS Windows code page 949). */
/* For more information see */
- /* `https://msdn.microsoft.com/en-US/goglobal/cc305154'. */
+ /* `http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt'. */
/* */
/* FT_ENCODING_JOHAB :: */
/* The Korean standard character set (KS~C 5601-1992), which */
@@ -678,26 +677,24 @@ FT_BEGIN_HEADER
/* PostScript font. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_STANDARD :: */
- /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
+ /* Adobe Standard encoding, as found in Type~1, CFF, and */
+ /* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_EXPERT :: */
- /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
+ /* Adobe Expert encoding, as found in Type~1, CFF, and OpenType/CFF */
+ /* fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_CUSTOM :: */
/* Corresponds to a custom encoding, as found in Type~1, CFF, and */
/* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_APPLE_ROMAN :: */
- /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
- /* and OpenType fonts contain a charmap for this encoding, since */
- /* older versions of Mac OS are able to use it. */
+ /* Apple roman encoding. Many TrueType and OpenType fonts contain */
+ /* a charmap for this 8-bit encoding, since older versions of Mac */
+ /* OS are able to use it. */
/* */
/* FT_ENCODING_OLD_LATIN_2 :: */
- /* This value is deprecated and was never used nor reported by */
+ /* This value is deprecated and was neither used nor reported by */
/* FreeType. Don't use or test for it. */
/* */
/* FT_ENCODING_MS_SJIS :: */
@@ -717,7 +714,7 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph names dictionaries. */
+ /* for PostScript fonts, using their glyph name dictionaries. */
/* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */
/* values as well. */
@@ -821,11 +818,11 @@ FT_BEGIN_HEADER
/* */
/* platform_id :: An ID number describing the platform for the */
/* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
+ /* the TrueType specification gets emulated */
/* for other formats. */
/* */
/* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
+ /* comes from the TrueType specification and gets */
/* emulated similarly. */
/* */
typedef struct FT_CharMapRec_
@@ -853,8 +850,8 @@ FT_BEGIN_HEADER
/* FT_Face_Internal */
/* */
/* <Description> */
- /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
- /* model private data of a given @FT_Face object. */
+ /* An opaque handle to an `FT_Face_InternalRec' structure that models */
+ /* the private data of a given @FT_Face object. */
/* */
/* This structure might change between releases of FreeType~2 and is */
/* not generally available to client applications. */
@@ -874,7 +871,7 @@ FT_BEGIN_HEADER
/* <Fields> */
/* num_faces :: The number of faces in the font file. Some */
/* font formats can have multiple faces in */
- /* a font file. */
+ /* a single font file. */
/* */
/* face_index :: This field holds two different values. */
/* Bits 0-15 are the index of the face in the */
@@ -882,14 +879,15 @@ FT_BEGIN_HEADER
/* are set to~0 if there is only one face in */
/* the font file. */
/* */
- /* Bits 16-30 are relevant to GX variation */
- /* fonts only, holding the named instance */
- /* index for the current face index (starting */
- /* with value~1; value~0 indicates font access */
- /* without GX variation data). For non-GX */
- /* fonts, bits 16-30 are ignored. If we have */
- /* the third named instance of face~4, say, */
- /* `face_index' is set to 0x00030004. */
+ /* Bits 16-30 are relevant to GX and OpenType */
+ /* variation fonts only, holding the named */
+ /* instance index for the current face index */
+ /* (starting with value~1; value~0 indicates */
+ /* font access without variation data). For */
+ /* non-variation fonts, bits 16-30 are */
+ /* ignored. If we have the third named */
+ /* instance of face~4, say, `face_index' is */
+ /* set to 0x00030004. */
/* */
/* Bit 31 is always zero (this is, */
/* `face_index' is always a positive value). */
@@ -903,17 +901,18 @@ FT_BEGIN_HEADER
/* @FT_STYLE_FLAG_XXX for the details. Bits */
/* 16-30 hold the number of named instances */
/* available for the current face if we have a */
- /* GX variation (sub)font. Bit 31 is always */
- /* zero (this is, `style_flags' is always a */
- /* positive value). */
+ /* GX or OpenType variation (sub)font. Bit 31 */
+ /* is always zero (this is, `style_flags' is */
+ /* always a positive value). */
/* */
/* num_glyphs :: The number of glyphs in the face. If the */
/* face is scalable and has sbits (see */
/* `num_fixed_sizes'), it is set to the number */
/* of outline glyphs. */
/* */
- /* For CID-keyed fonts, this value gives the */
- /* highest CID used in the font. */
+ /* For CID-keyed fonts (not in an SFNT */
+ /* wrapper) this value gives the highest CID */
+ /* used in the font. */
/* */
/* family_name :: The face's family name. This is an ASCII */
/* string, usually in English, that describes */
@@ -952,6 +951,10 @@ FT_BEGIN_HEADER
/* strikes in the face. It is set to NULL if */
/* there is no bitmap strike. */
/* */
+ /* Note that FreeType tries to sanitize the */
+ /* strike data since they are sometimes sloppy */
+ /* or incorrect, but this can easily fail. */
+ /* */
/* num_charmaps :: The number of charmaps in the face. */
/* */
/* charmaps :: An array of the charmaps of the face. */
@@ -987,8 +990,8 @@ FT_BEGIN_HEADER
/* expressed in font units. For font formats */
/* not having this information, it is set to */
/* `bbox.yMin'. Note that this field is */
- /* usually negative. Only relevant for */
- /* scalable formats. */
+ /* negative for values below the baseline. */
+ /* Only relevant for scalable formats. */
/* */
/* height :: This value is the vertical distance */
/* between two consecutive baselines, */
@@ -1031,6 +1034,12 @@ FT_BEGIN_HEADER
/* Fields may be changed after a call to @FT_Attach_File or */
/* @FT_Attach_Stream. */
/* */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `ascender', */
+ /* `descender', `height', `underline_position', and */
+ /* `underline_thickness'. */
+ /* */
typedef struct FT_FaceRec_
{
FT_Long num_faces;
@@ -1102,49 +1111,51 @@ FT_BEGIN_HEADER
/* */
/* <Values> */
/* FT_FACE_FLAG_SCALABLE :: */
- /* Indicates that the face contains outline glyphs. This doesn't */
- /* prevent bitmap strikes, i.e., a face can have both this and */
- /* and @FT_FACE_FLAG_FIXED_SIZES set. */
+ /* The face contains outline glyphs. Note that a face can contain */
+ /* bitmap strikes also, i.e., a face can have both this flag and */
+ /* @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
- /* Indicates that the face contains bitmap strikes. See also the */
+ /* The face contains bitmap strikes. See also the */
/* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
/* */
/* FT_FACE_FLAG_FIXED_WIDTH :: */
- /* Indicates that the face contains fixed-width characters (like */
- /* Courier, Lucido, MonoType, etc.). */
+ /* The face contains fixed-width characters (like Courier, Lucido, */
+ /* MonoType, etc.). */
/* */
/* FT_FACE_FLAG_SFNT :: */
- /* Indicates that the face uses the `sfnt' storage scheme. For */
- /* now, this means TrueType and OpenType. */
+ /* The face uses the SFNT storage scheme. For now, this means */
+ /* TrueType and OpenType. */
/* */
/* FT_FACE_FLAG_HORIZONTAL :: */
- /* Indicates that the face contains horizontal glyph metrics. This */
- /* should be set for all common formats. */
+ /* The face contains horizontal glyph metrics. This should be set */
+ /* for all common formats. */
/* */
/* FT_FACE_FLAG_VERTICAL :: */
- /* Indicates that the face contains vertical glyph metrics. This */
- /* is only available in some formats, not all of them. */
+ /* The face contains vertical glyph metrics. This is only */
+ /* available in some formats, not all of them. */
/* */
/* FT_FACE_FLAG_KERNING :: */
- /* Indicates that the face contains kerning information. If set, */
- /* the kerning distance can be retrieved through the function */
- /* @FT_Get_Kerning. Otherwise the function always return the */
- /* vector (0,0). Note that FreeType doesn't handle kerning data */
- /* from the `GPOS' table (as present in some OpenType fonts). */
+ /* The face contains kerning information. If set, the kerning */
+ /* distance can be retrieved using the function @FT_Get_Kerning. */
+ /* Otherwise the function always return the vector (0,0). Note */
+ /* that FreeType doesn't handle kerning data from the SFNT `GPOS' */
+ /* table (as present in many OpenType fonts). */
/* */
/* FT_FACE_FLAG_FAST_GLYPHS :: */
/* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
/* */
/* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
- /* Indicates that the font contains multiple masters and is capable */
- /* of interpolating between them. See the multiple-masters */
- /* specific API for details. */
+ /* The face contains multiple masters and is capable of */
+ /* interpolating between them. Supported formats are Adobe MM, */
+ /* TrueType GX, and OpenType variation fonts. */
+ /* */
+ /* See the multiple-masters specific API for details. */
/* */
/* FT_FACE_FLAG_GLYPH_NAMES :: */
- /* Indicates that the font contains glyph names that can be */
- /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
- /* fonts contain broken glyph name tables. Use the function */
+ /* The face contains glyph names, which can be retrieved using */
+ /* @FT_Get_Glyph_Name. Note that some TrueType fonts contain */
+ /* broken glyph name tables. Use the function */
/* @FT_Has_PS_Glyph_Names when needed. */
/* */
/* FT_FACE_FLAG_EXTERNAL_STREAM :: */
@@ -1153,31 +1164,31 @@ FT_BEGIN_HEADER
/* when @FT_Done_Face is called. Don't read or test this flag. */
/* */
/* FT_FACE_FLAG_HINTER :: */
- /* Set if the font driver has a hinting machine of its own. For */
- /* example, with TrueType fonts, it makes sense to use data from */
- /* the SFNT `gasp' table only if the native TrueType hinting engine */
- /* (with the bytecode interpreter) is available and active. */
+ /* The font driver has a hinting machine of its own. For example, */
+ /* with TrueType fonts, it makes sense to use data from the SFNT */
+ /* `gasp' table only if the native TrueType hinting engine (with */
+ /* the bytecode interpreter) is available and active. */
/* */
/* FT_FACE_FLAG_CID_KEYED :: */
- /* Set if the font is CID-keyed. In that case, the font is not */
- /* accessed by glyph indices but by CID values. For subsetted */
- /* CID-keyed fonts this has the consequence that not all index */
- /* values are a valid argument to FT_Load_Glyph. Only the CID */
- /* values for which corresponding glyphs in the subsetted font */
- /* exist make FT_Load_Glyph return successfully; in all other cases */
- /* you get an `FT_Err_Invalid_Argument' error. */
- /* */
- /* Note that CID-keyed fonts that are in an SFNT wrapper don't */
- /* have this flag set since the glyphs are accessed in the normal */
- /* way (using contiguous indices); the `CID-ness' isn't visible to */
- /* the application. */
+ /* The face is CID-keyed. In that case, the face is not accessed */
+ /* by glyph indices but by CID values. For subsetted CID-keyed */
+ /* fonts this has the consequence that not all index values are a */
+ /* valid argument to @FT_Load_Glyph. Only the CID values for which */
+ /* corresponding glyphs in the subsetted font exist make */
+ /* `FT_Load_Glyph' return successfully; in all other cases you get */
+ /* an `FT_Err_Invalid_Argument' error. */
+ /* */
+ /* Note that CID-keyed fonts that are in an SFNT wrapper (this is, */
+ /* all OpenType/CFF fonts) don't have this flag set since the */
+ /* glyphs are accessed in the normal way (using contiguous */
+ /* indices); the `CID-ness' isn't visible to the application. */
/* */
/* FT_FACE_FLAG_TRICKY :: */
- /* Set if the font is `tricky', this is, it always needs the */
- /* font format's native hinting engine to get a reasonable result. */
- /* A typical example is the Chinese font `mingli.ttf' that uses */
- /* TrueType bytecode instructions to move and scale all of its */
- /* subglyphs. */
+ /* The face is `tricky', this is, it always needs the font format's */
+ /* native hinting engine to get a reasonable result. A typical */
+ /* example is the old Chinese font `mingli.ttf' (but not */
+ /* `mingliu.ttc') that uses TrueType bytecode instructions to move */
+ /* and scale all of its subglyphs. */
/* */
/* It is not possible to auto-hint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
@@ -1189,8 +1200,8 @@ FT_BEGIN_HEADER
/* tricky fonts; they are hard-coded in file `ttobjs.c'. */
/* */
/* FT_FACE_FLAG_COLOR :: */
- /* Set if the font has color glyph tables. To access color glyphs */
- /* use @FT_LOAD_COLOR. */
+ /* The face has color glyph tables. To access color glyphs use */
+ /* @FT_LOAD_COLOR. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1223,7 +1234,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_HORIZONTAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+ ( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL )
/*************************************************************************
@@ -1237,7 +1248,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_VERTICAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+ ( (face)->face_flags & FT_FACE_FLAG_VERTICAL )
/*************************************************************************
@@ -1251,7 +1262,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_KERNING( face ) \
- ( face->face_flags & FT_FACE_FLAG_KERNING )
+ ( (face)->face_flags & FT_FACE_FLAG_KERNING )
/*************************************************************************
@@ -1262,11 +1273,11 @@ FT_BEGIN_HEADER
* @description:
* A macro that returns true whenever a face object contains a scalable
* font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
- * and PFR font formats.
+ * and PFR font formats).
*
*/
#define FT_IS_SCALABLE( face ) \
- ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+ ( (face)->face_flags & FT_FACE_FLAG_SCALABLE )
/*************************************************************************
@@ -1285,7 +1296,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SFNT( face ) \
- ( face->face_flags & FT_FACE_FLAG_SFNT )
+ ( (face)->face_flags & FT_FACE_FLAG_SFNT )
/*************************************************************************
@@ -1300,7 +1311,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_FIXED_WIDTH( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+ ( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
/*************************************************************************
@@ -1315,7 +1326,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_FIXED_SIZES( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+ ( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES )
/*************************************************************************
@@ -1341,7 +1352,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_GLYPH_NAMES( face ) \
- ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+ ( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
/*************************************************************************
@@ -1356,7 +1367,21 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_MULTIPLE_MASTERS( face ) \
- ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+ ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_NAMED_INSTANCE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object is a named instance
+ * of a GX or OpenType variation font.
+ *
+ */
+#define FT_IS_NAMED_INSTANCE( face ) \
+ ( (face)->face_index & 0x7FFF0000L )
/*************************************************************************
@@ -1374,7 +1399,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_CID_KEYED( face ) \
- ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+ ( (face)->face_flags & FT_FACE_FLAG_CID_KEYED )
/*************************************************************************
@@ -1388,7 +1413,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_TRICKY( face ) \
- ( face->face_flags & FT_FACE_FLAG_TRICKY )
+ ( (face)->face_flags & FT_FACE_FLAG_TRICKY )
/*************************************************************************
@@ -1402,7 +1427,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_COLOR( face ) \
- ( face->face_flags & FT_FACE_FLAG_COLOR )
+ ( (face)->face_flags & FT_FACE_FLAG_COLOR )
/*************************************************************************/
@@ -1411,15 +1436,15 @@ FT_BEGIN_HEADER
/* FT_STYLE_FLAG_XXX */
/* */
/* <Description> */
- /* A list of bit flags used to indicate the style of a given face. */
- /* These are used in the `style_flags' field of @FT_FaceRec. */
+ /* A list of bit flags to indicate the style of a given face. These */
+ /* are used in the `style_flags' field of @FT_FaceRec. */
/* */
/* <Values> */
/* FT_STYLE_FLAG_ITALIC :: */
- /* Indicates that a given face style is italic or oblique. */
+ /* The face style is italic or oblique. */
/* */
/* FT_STYLE_FLAG_BOLD :: */
- /* Indicates that a given face is bold. */
+ /* The face is bold. */
/* */
/* <Note> */
/* The style information as provided by FreeType is very basic. More */
@@ -1460,12 +1485,12 @@ FT_BEGIN_HEADER
/* hence the term `ppem' (pixels per EM). It is also */
/* referred to as `nominal height'. */
/* */
- /* x_scale :: A 16.16 fractional scaling value used to convert */
+ /* x_scale :: A 16.16 fractional scaling value to convert */
/* horizontal metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
/* */
- /* y_scale :: A 16.16 fractional scaling value used to convert */
+ /* y_scale :: A 16.16 fractional scaling value to convert */
/* vertical metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
@@ -1496,7 +1521,7 @@ FT_BEGIN_HEADER
/* glyphs. As this would be a definite performance hit, it is up to */
/* client applications to perform such computations. */
/* */
- /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
+ /* The `FT_Size_Metrics' structure is valid for bitmap fonts also. */
/* */
typedef struct FT_Size_Metrics_
{
@@ -1636,8 +1661,8 @@ FT_BEGIN_HEADER
/* contained in the glyph slot. Typically */
/* @FT_GLYPH_FORMAT_BITMAP, */
/* @FT_GLYPH_FORMAT_OUTLINE, or */
- /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
- /* possible. */
+ /* @FT_GLYPH_FORMAT_COMPOSITE, but other values */
+ /* are possible. */
/* */
/* bitmap :: This field is used as a bitmap descriptor */
/* when the slot format is */
@@ -1652,10 +1677,9 @@ FT_BEGIN_HEADER
/* glyph slot contains a bitmap. */
/* */
/* bitmap_top :: The bitmap's top bearing expressed in integer */
- /* pixels. Remember that this is the distance */
- /* from the baseline to the top-most glyph */
- /* scanline, upwards y~coordinates being */
- /* *positive*. */
+ /* pixels. This is the distance from the */
+ /* baseline to the top-most glyph scanline, */
+ /* upwards y~coordinates being *positive*. */
/* */
/* outline :: The outline descriptor for the current glyph */
/* image if its format is */
@@ -1677,15 +1701,13 @@ FT_BEGIN_HEADER
/* control_data :: Certain font drivers can also return the */
/* control data for a given glyph image (e.g. */
/* TrueType bytecode, Type~1 charstrings, etc.). */
- /* This field is a pointer to such data. */
+ /* This field is a pointer to such data; it is */
+ /* currently internal to FreeType. */
/* */
/* control_len :: This is the length in bytes of the control */
- /* data. */
+ /* data. Currently internal to FreeType. */
/* */
- /* other :: Really wicked formats can use this pointer to */
- /* present their own glyph image to client */
- /* applications. Note that the application */
- /* needs to know about the image format. */
+ /* other :: Reserved. */
/* */
/* lsb_delta :: The difference between hinted and unhinted */
/* left side bearing while auto-hinting is */
@@ -1702,7 +1724,7 @@ FT_BEGIN_HEADER
/* formats). */
/* */
/* This image can later be converted into a bitmap by calling */
- /* @FT_Render_Glyph. This function finds the current renderer for */
+ /* @FT_Render_Glyph. This function searches the current renderer for */
/* the native image's format, then invokes it. */
/* */
/* The renderer is in charge of transforming the native image through */
@@ -1714,7 +1736,6 @@ FT_BEGIN_HEADER
/* position (e.g., coordinates (0,0) on the baseline). Of course, */
/* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
/* */
- /* <Note> */
/* Here is a small pseudo code fragment that shows how to use */
/* `lsb_delta' and `rsb_delta': */
/* */
@@ -1724,8 +1745,8 @@ FT_BEGIN_HEADER
/* */
/* */
/* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
+ /* <compute kern between current and previous glyph */
+ /* and add it to `origin_x'> */
/* */
/* <load glyph with `FT_Load_Glyph'> */
/* */
@@ -1742,6 +1763,12 @@ FT_BEGIN_HEADER
/* endfor */
/* } */
/* */
+ /* If you use strong auto-hinting, you *must* apply these delta */
+ /* values! Otherwise you will experience far too large inter-glyph */
+ /* spacing at small rendering sizes in most cases. Note that it */
+ /* doesn't harm to use the above code for other hinting modes also, */
+ /* since the delta values are zero then. */
+ /* */
typedef struct FT_GlyphSlotRec_
{
FT_Library library;
@@ -1884,7 +1911,7 @@ FT_BEGIN_HEADER
/* FT_Parameter */
/* */
/* <Description> */
- /* A simple structure used to pass more or less generic parameters to */
+ /* A simple structure to pass more or less generic parameters to */
/* @FT_Open_Face. */
/* */
/* <Fields> */
@@ -1910,9 +1937,9 @@ FT_BEGIN_HEADER
/* FT_Open_Args */
/* */
/* <Description> */
- /* A structure used to indicate how to open a new font file or */
- /* stream. A pointer to such a structure can be used as a parameter */
- /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
+ /* A structure to indicate how to open a new font file or stream. A */
+ /* pointer to such a structure can be used as a parameter for the */
+ /* functions @FT_Open_Face and @FT_Attach_Stream. */
/* */
/* <Fields> */
/* flags :: A set of bit flags indicating how to use the */
@@ -1927,9 +1954,10 @@ FT_BEGIN_HEADER
/* stream :: A handle to a source stream object. */
/* */
/* driver :: This field is exclusively used by @FT_Open_Face; */
- /* it simply specifies the font driver to use to open */
- /* the face. If set to~0, FreeType tries to load the */
- /* face with each one of the drivers in its list. */
+ /* it simply specifies the font driver to use for */
+ /* opening the face. If set to NULL, FreeType tries */
+ /* to load the face with each one of the drivers in */
+ /* its list. */
/* */
/* num_params :: The number of extra parameters. */
/* */
@@ -1942,7 +1970,7 @@ FT_BEGIN_HEADER
/* */
/* If the @FT_OPEN_MEMORY bit is set, assume that this is a */
/* memory file of `memory_size' bytes, located at `memory_address'. */
- /* The data are are not copied, and the client is responsible for */
+ /* The data are not copied, and the client is responsible for */
/* releasing and destroying them _after_ the corresponding call to */
/* @FT_Done_Face. */
/* */
@@ -1982,7 +2010,7 @@ FT_BEGIN_HEADER
/* FT_New_Face */
/* */
/* <Description> */
- /* This function calls @FT_Open_Face to open a font by its pathname. */
+ /* Call @FT_Open_Face to open a font by its pathname. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
@@ -2017,8 +2045,8 @@ FT_BEGIN_HEADER
/* FT_New_Memory_Face */
/* */
/* <Description> */
- /* This function calls @FT_Open_Face to open a font that has been */
- /* loaded into memory. */
+ /* Call @FT_Open_Face to open a font that has been loaded into */
+ /* memory. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
@@ -2070,20 +2098,21 @@ FT_BEGIN_HEADER
/* with value~0). Set it to~0 if there is only one */
/* face in the font file. */
/* */
- /* Bits 16-30 are relevant to GX variation fonts only, */
- /* specifying the named instance index for the current */
- /* face index (starting with value~1; value~0 makes */
- /* FreeType ignore named instances). For non-GX fonts, */
- /* bits 16-30 are ignored. Assuming that you want to */
- /* access the third named instance in face~4, */
- /* `face_index' should be set to 0x00030004. If you */
- /* want to access face~4 without GX variation handling, */
- /* simply set `face_index' to value~4. */
- /* */
- /* FT_Open_Face and its siblings can be used to quickly */
- /* check whether the font format of a given font */
- /* resource is supported by FreeType. In general, if */
- /* the `face_index' argument is negative, the */
+ /* Bits 16-30 are relevant to GX and OpenType variation */
+ /* fonts only, specifying the named instance index for */
+ /* the current face index (starting with value~1; */
+ /* value~0 makes FreeType ignore named instances). For */
+ /* non-variation fonts, bits 16-30 are ignored. */
+ /* Assuming that you want to access the third named */
+ /* instance in face~4, `face_index' should be set to */
+ /* 0x00030004. If you want to access face~4 without */
+ /* variation handling, simply set `face_index' to */
+ /* value~4. */
+ /* */
+ /* `FT_Open_Face' and its siblings can be used to */
+ /* quickly check whether the font format of a given */
+ /* font resource is supported by FreeType. In general, */
+ /* if the `face_index' argument is negative, the */
/* function's return value is~0 if the font format is */
/* recognized, or non-zero otherwise. The function */
/* allocates a more or less empty face handle in */
@@ -2092,10 +2121,10 @@ FT_BEGIN_HEADER
/* `face->num_faces' and `face->style_flags'. For any */
/* negative value of `face_index', `face->num_faces' */
/* gives the number of faces within the font file. For */
- /* the negative value `-(N+1)' (with `N' a 16-bit */
- /* value), bits 16-30 in `face->style_flags' give the */
- /* number of named instances in face `N' if we have a */
- /* GX variation font (or zero otherwise). After */
+ /* the negative value `-(N+1)' (with `N' a non-negative */
+ /* 16-bit value), bits 16-30 in `face->style_flags' */
+ /* give the number of named instances in face `N' if we */
+ /* have a variation font (or zero otherwise). After */
/* examination, the returned @FT_Face structure should */
/* be deallocated with a call to @FT_Done_Face. */
/* */
@@ -2202,7 +2231,7 @@ FT_BEGIN_HEADER
/* FT_Attach_File */
/* */
/* <Description> */
- /* This function calls @FT_Attach_Stream to attach a file. */
+ /* Call @FT_Attach_Stream to attach a file. */
/* */
/* <InOut> */
/* face :: The target face object. */
@@ -2246,7 +2275,7 @@ FT_BEGIN_HEADER
/* */
/* Client applications are expected to know what they are doing */
/* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
+ /* file or stream attachments. */
/* */
FT_EXPORT( FT_Error )
FT_Attach_Stream( FT_Face face,
@@ -2309,7 +2338,10 @@ FT_BEGIN_HEADER
/* FT_Select_Size */
/* */
/* <Description> */
- /* Select a bitmap strike. */
+ /* Select a bitmap strike. To be more precise, this function sets */
+ /* the scaling factors of the active @FT_Size object in a face so */
+ /* that bitmaps from this particular strike are taken by */
+ /* @FT_Load_Glyph and friends. */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
@@ -2321,6 +2353,20 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* For bitmaps embedded in outline fonts it is common that only a */
+ /* subset of the available glyphs at a given ppem value is available. */
+ /* FreeType silently uses outlines if there is no bitmap for a given */
+ /* glyph index. */
+ /* */
+ /* For GX and OpenType variation fonts, a bitmap strike makes sense */
+ /* only if the default instance is active (this is, no glyph */
+ /* variation takes place); otherwise, FreeType simply ignores bitmap */
+ /* strikes. The same is true for all named instances that are */
+ /* different from the default instance. */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
FT_EXPORT( FT_Error )
FT_Select_Size( FT_Face face,
FT_Int strike_index );
@@ -2332,17 +2378,26 @@ FT_BEGIN_HEADER
/* FT_Size_Request_Type */
/* */
/* <Description> */
- /* An enumeration type that lists the supported size request types. */
+ /* An enumeration type that lists the supported size request types, */
+ /* i.e., what input size (in font units) maps to the requested output */
+ /* size (in pixels, as computed from the arguments of */
+ /* @FT_Size_Request). */
/* */
/* <Values> */
/* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
/* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
/* used to determine both scaling values. */
/* */
+ /* This is the standard scaling found in most applications. In */
+ /* particular, use this size request type for TrueType fonts if */
+ /* they provide optical scaling or something similar. Note, */
+ /* however, that `units_per_EM' is a rather abstract value which */
+ /* bears no relation to the actual size of the glyphs in a font. */
+ /* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `ascender' and (minus */
- /* of) the `descender' fields of @FT_FaceRec are used to determine */
- /* both scaling values. */
+ /* The real dimension. The sum of the `ascender' and (minus of) */
+ /* the `descender' fields of @FT_FaceRec is used to determine both */
+ /* scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
/* The font bounding box. The width and height of the `bbox' field */
@@ -2387,27 +2442,36 @@ FT_BEGIN_HEADER
/* FT_Size_RequestRec */
/* */
/* <Description> */
- /* A structure used to model a size request. */
+ /* A structure to model a size request. */
/* */
/* <Fields> */
/* type :: See @FT_Size_Request_Type. */
/* */
- /* width :: The desired width. */
+ /* width :: The desired width, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* height :: The desired height. */
+ /* height :: The desired height, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* horiResolution :: The horizontal resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `width' is treated as a */
+ /* 26.6 fractional *pixel* value, which gets */
+ /* internally rounded to an integer. */
/* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* vertResolution :: The vertical resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `height' is treated as a */
+ /* 26.6 fractional *pixel* value, which gets */
+ /* internally rounded to an integer. */
/* */
/* <Note> */
- /* If `width' is zero, then the horizontal scaling value is set equal */
+ /* If `width' is zero, the horizontal scaling value is set equal */
/* to the vertical scaling value, and vice versa. */
/* */
+ /* If `type' is FT_SIZE_REQUEST_TYPE_SCALES, `width' and `height' are */
+ /* interpreted directly as 16.16 fractional scaling values, without */
+ /* any further modification, and both `horiResolution' and */
+ /* `vertResolution' are ignored. */
+ /* */
typedef struct FT_Size_RequestRec_
{
FT_Size_Request_Type type;
@@ -2457,7 +2521,7 @@ FT_BEGIN_HEADER
/* size is dependent entirely on how the size is defined in the */
/* source face. The font designer chooses the final size of each */
/* glyph relative to this size. For more information refer to */
- /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
+ /* `https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'. */
/* */
/* Don't use this function if you are using the FreeType cache API. */
/* */
@@ -2472,8 +2536,7 @@ FT_BEGIN_HEADER
/* FT_Set_Char_Size */
/* */
/* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in points). */
+ /* Call @FT_Request_Size to request the nominal size (in points). */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
@@ -2491,6 +2554,10 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
+ /* While this function allows fractional points as input values, the */
+ /* resulting ppem value for the given resolution is always rounded to */
+ /* the nearest integer. */
+ /* */
/* If either the character width or height is zero, it is set equal */
/* to the other value. */
/* */
@@ -2516,8 +2583,7 @@ FT_BEGIN_HEADER
/* FT_Set_Pixel_Sizes */
/* */
/* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in pixels). */
+ /* Call @FT_Request_Size to request the nominal size (in pixels). */
/* */
/* <InOut> */
/* face :: A handle to the target face object. */
@@ -2531,8 +2597,8 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
- /* You should not rely on the resulting glyphs matching, or being */
- /* constrained, to this pixel size. Refer to @FT_Request_Size to */
+ /* You should not rely on the resulting glyphs matching or being */
+ /* constrained to this pixel size. Refer to @FT_Request_Size to */
/* understand how requested sizes relate to actual sizes. */
/* */
/* Don't use this function if you are using the FreeType cache API. */
@@ -2549,8 +2615,7 @@ FT_BEGIN_HEADER
/* FT_Load_Glyph */
/* */
/* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object. */
+ /* Load a glyph into the glyph slot of a face object. */
/* */
/* <InOut> */
/* face :: A handle to the target face object where the glyph */
@@ -2579,6 +2644,10 @@ FT_BEGIN_HEADER
/* don't have a corresponding glyph in the font). See the discussion */
/* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
/* */
+ /* If you receive `FT_Err_Glyph_Too_Big', try getting the glyph */
+ /* outline at EM size, then scale it manually and fill it as a */
+ /* graphics operation. */
+ /* */
FT_EXPORT( FT_Error )
FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
@@ -2591,8 +2660,8 @@ FT_BEGIN_HEADER
/* FT_Load_Char */
/* */
/* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object, according to its character code. */
+ /* Load a glyph into the glyph slot of a face object, accessed by its */
+ /* character code. */
/* */
/* <InOut> */
/* face :: A handle to a target face object where the glyph */
@@ -2614,6 +2683,10 @@ FT_BEGIN_HEADER
/* <Note> */
/* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
/* */
+ /* Many fonts contain glyphs that can't be loaded by this function */
+ /* since its glyph indices are not listed in any of the font's */
+ /* charmaps. */
+ /* */
FT_EXPORT( FT_Error )
FT_Load_Char( FT_Face face,
FT_ULong char_code,
@@ -2626,8 +2699,8 @@ FT_BEGIN_HEADER
* FT_LOAD_XXX
*
* @description:
- * A list of bit field constants used with @FT_Load_Glyph to indicate
- * what kind of operations to perform during glyph loading.
+ * A list of bit field constants for @FT_Load_Glyph to indicate what
+ * kind of operations to perform during glyph loading.
*
* @values:
* FT_LOAD_DEFAULT ::
@@ -2639,13 +2712,13 @@ FT_BEGIN_HEADER
* The bitmap data can be accessed from the glyph slot (see note
* below).
*
- * 2. If no embedded bitmap is searched or found, FreeType looks for a
- * scalable outline. If one is found, it is loaded from the font
- * file, scaled to device pixels, then `hinted' to the pixel grid
- * in order to optimize it. The outline data can be accessed from
- * the glyph slot (see note below).
+ * 2. If no embedded bitmap is searched for or found, FreeType looks
+ * for a scalable outline. If one is found, it is loaded from
+ * the font file, scaled to device pixels, then `hinted' to the
+ * pixel grid in order to optimize it. The outline data can be
+ * accessed from the glyph slot (see note below).
*
- * Note that by default, the glyph loader doesn't render outlines into
+ * Note that by default the glyph loader doesn't render outlines into
* bitmaps. The following flags are used to modify this default
* behaviour to more specific and useful cases.
*
@@ -2692,13 +2765,13 @@ FT_BEGIN_HEADER
* various font formats.
*
* FT_LOAD_FORCE_AUTOHINT ::
- * Indicates that the auto-hinter is preferred over the font's native
- * hinter. See also the note below.
+ * Prefer the auto-hinter over the font's native hinter. See also
+ * the note below.
*
* FT_LOAD_PEDANTIC ::
- * Indicates that the font driver should perform pedantic verifications
- * during glyph loading. This is mostly used to detect broken glyphs
- * in fonts. By default, FreeType tries to handle broken fonts also.
+ * Make the font driver perform pedantic verifications during glyph
+ * loading. This is mostly used to detect broken glyphs in fonts.
+ * By default, FreeType tries to handle broken fonts also.
*
* In particular, errors from the TrueType bytecode engine are not
* passed to the application if this flag is not set; this might
@@ -2706,17 +2779,16 @@ FT_BEGIN_HEADER
* bytecode is buggy.
*
* FT_LOAD_NO_RECURSE ::
- * Indicate that the font driver should not load composite glyphs
- * recursively. Instead, it should set the `num_subglyph' and
- * `subglyphs' values of the glyph slot accordingly, and set
- * `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE. The description of
- * subglyphs can then be accessed with @FT_Get_SubGlyph_Info.
+ * Don't load composite glyphs recursively. Instead, the font
+ * driver should set the `num_subglyph' and `subglyphs' values of
+ * the glyph slot accordingly, and set `glyph->format' to
+ * @FT_GLYPH_FORMAT_COMPOSITE. The description of subglyphs can
+ * then be accessed with @FT_Get_SubGlyph_Info.
*
* This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
*
* FT_LOAD_IGNORE_TRANSFORM ::
- * Indicates that the transform matrix set by @FT_Set_Transform should
- * be ignored.
+ * Ignore the transform matrix set by @FT_Set_Transform.
*
* FT_LOAD_MONOCHROME ::
* This flag is used with @FT_LOAD_RENDER to indicate that you want to
@@ -2728,31 +2800,37 @@ FT_BEGIN_HEADER
* monochrome-optimized hinting algorithm is used.
*
* FT_LOAD_LINEAR_DESIGN ::
- * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
- * fields of @FT_GlyphSlotRec should be kept in font units. See
- * @FT_GlyphSlotRec for details.
+ * Keep `linearHoriAdvance' and `linearVertAdvance' fields of
+ * @FT_GlyphSlotRec in font units. See @FT_GlyphSlotRec for
+ * details.
*
* FT_LOAD_NO_AUTOHINT ::
- * Disable auto-hinter. See also the note below.
+ * Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
- * This flag is used to request loading of color embedded-bitmap
- * images. The resulting color bitmaps, if available, will have the
- * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
- * bitmaps are found, they will be converted to 256-level gray
- * bitmaps transparently. Those bitmaps will be in the
+ * Load embedded color bitmap images. The resulting color bitmaps,
+ * if available, will have the @FT_PIXEL_MODE_BGRA format. If the
+ * flag is not set and color bitmaps are found, they are converted
+ * to 256-level gray bitmaps transparently, using the
* @FT_PIXEL_MODE_GRAY format.
*
* FT_LOAD_COMPUTE_METRICS ::
- * This flag sets computing glyph metrics without the use of bundled
- * metrics tables (for example, the `hdmx' table in TrueType fonts).
- * Well-behaving fonts have optimized bundled metrics and these should
- * be used. This flag is mainly used by font validating or font
+ * Compute glyph metrics from the glyph data, without the use of
+ * bundled metrics tables (for example, the `hdmx' table in TrueType
+ * fonts). This flag is mainly used by font validating or font
* editing applications, which need to ignore, verify, or edit those
* tables.
*
* Currently, this flag is only implemented for TrueType fonts.
*
+ * FT_LOAD_BITMAP_METRICS_ONLY ::
+ * Request loading of the metrics and bitmap image information of a
+ * (possibly embedded) bitmap glyph without allocating or copying
+ * the bitmap image data itself. No effect if the target glyph is
+ * not a bitmap image.
+ *
+ * This flag unsets @FT_LOAD_RENDER.
+ *
* FT_LOAD_CROP_BITMAP ::
* Ignored. Deprecated.
*
@@ -2796,13 +2874,14 @@ FT_BEGIN_HEADER
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
- /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+ /* Bits 16-19 are used by `FT_LOAD_TARGET_' */
#define FT_LOAD_COLOR ( 1L << 20 )
#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
+#define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 )
/* */
- /* used internally only by certain font drivers! */
+ /* used internally only by certain font drivers */
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
@@ -2813,29 +2892,30 @@ FT_BEGIN_HEADER
* FT_LOAD_TARGET_XXX
*
* @description:
- * A list of values that are used to select a specific hinting algorithm
- * to use by the hinter. You should OR one of these values to your
- * `load_flags' when calling @FT_Load_Glyph.
+ * A list of values to select a specific hinting algorithm for the
+ * hinter. You should OR one of these values to your `load_flags'
+ * when calling @FT_Load_Glyph.
*
- * Note that font's native hinters may ignore the hinting algorithm you
- * have specified (e.g., the TrueType bytecode interpreter). You can set
- * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
- *
- * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
- * always implies @FT_LOAD_FORCE_AUTOHINT.
+ * Note that a font's native hinters may ignore the hinting algorithm
+ * you have specified (e.g., the TrueType bytecode interpreter). You
+ * can set @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is
+ * used.
*
* @values:
* FT_LOAD_TARGET_NORMAL ::
- * This corresponds to the default hinting algorithm, optimized for
- * standard gray-level rendering. For monochrome output, use
- * @FT_LOAD_TARGET_MONO instead.
+ * The default hinting algorithm, optimized for standard gray-level
+ * rendering. For monochrome output, use @FT_LOAD_TARGET_MONO
+ * instead.
*
* FT_LOAD_TARGET_LIGHT ::
- * A lighter hinting algorithm for non-monochrome modes. Many
- * generated glyphs are more fuzzy but better resemble its original
- * shape. A bit like rendering on Mac OS~X.
- *
- * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
+ * A lighter hinting algorithm for gray-level modes. Many generated
+ * glyphs are fuzzier but better resemble their original shape. This
+ * is achieved by snapping glyphs to the pixel grid only vertically
+ * (Y-axis), as is done by Microsoft's ClearType and Adobe's
+ * proprietary font renderer. This preserves inter-glyph spacing in
+ * horizontal text. The snapping is done either by the native font
+ * driver, if the driver itself and the font support it, or by the
+ * auto-hinter.
*
* FT_LOAD_TARGET_MONO ::
* Strong hinting algorithm that should only be used for monochrome
@@ -2856,7 +2936,7 @@ FT_BEGIN_HEADER
*
* If @FT_LOAD_RENDER is also set, the glyph is rendered in the
* corresponding mode (i.e., the mode that matches the used algorithm
- * best). An exeption is FT_LOAD_TARGET_MONO since it implies
+ * best). An exception is FT_LOAD_TARGET_MONO since it implies
* @FT_LOAD_MONOCHROME.
*
* You can use a hinting algorithm that doesn't correspond to the same
@@ -2900,18 +2980,17 @@ FT_BEGIN_HEADER
/* FT_Set_Transform */
/* */
/* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images when they are loaded into a glyph slot through */
- /* @FT_Load_Glyph. */
+ /* Set the transformation that is applied to glyph images when they */
+ /* are loaded into a glyph slot through @FT_Load_Glyph. */
/* */
/* <InOut> */
/* face :: A handle to the source face object. */
/* */
/* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use~0 for the null */
- /* vector. */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use NULL */
+ /* for the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use NULL for the */
+ /* null vector. */
/* */
/* <Note> */
/* The transformation is only applied to scalable image formats after */
@@ -2934,20 +3013,22 @@ FT_BEGIN_HEADER
/* FT_Render_Mode */
/* */
/* <Description> */
- /* An enumeration type that lists the render modes supported by */
- /* FreeType~2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline. */
+ /* Render modes supported by FreeType~2. Each mode corresponds to a */
+ /* specific type of scanline conversion performed on the outline. */
/* */
/* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
/* field in the @FT_GlyphSlotRec structure gives the format of the */
/* returned bitmap. */
/* */
- /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
+ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity, */
+ /* indicating pixel coverage. Use linear alpha blending and gamma */
+ /* correction to correctly render non-monochrome glyph bitmaps onto a */
+ /* surface; see @FT_Render_Glyph. */
/* */
/* <Values> */
/* FT_RENDER_MODE_NORMAL :: */
- /* This is the default render mode; it corresponds to 8-bit */
- /* anti-aliased bitmaps. */
+ /* Default render mode; it corresponds to 8-bit anti-aliased */
+ /* bitmaps. */
/* */
/* FT_RENDER_MODE_LIGHT :: */
/* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
@@ -2972,11 +3053,11 @@ FT_BEGIN_HEADER
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
/* */
/* <Note> */
- /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
- /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
- /* (not active in the default builds). It is up to the caller to */
- /* either call @FT_Library_SetLcdFilter (if available) or do the */
- /* filtering itself. */
+ /* The LCD-optimized glyph bitmaps produced by `FT_Render_Glyph' can */
+ /* be filtered to reduce color-fringes by using */
+ /* @FT_Library_SetLcdFilter (not active in the default builds). It */
+ /* is up to the caller to either call `FT_Library_SetLcdFilter' (if */
+ /* available) or do the filtering itself. */
/* */
/* The selected render mode only affects vector glyphs of a font. */
/* Embedded bitmaps often have a different pixel mode like */
@@ -3017,16 +3098,93 @@ FT_BEGIN_HEADER
/* convert. */
/* */
/* <Input> */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See @FT_Render_Mode for a */
- /* list of possible values. */
+ /* render_mode :: The render mode used to render the glyph image into */
+ /* a bitmap. See @FT_Render_Mode for a list of */
+ /* possible values. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* To get meaningful results, font scaling values must be set with */
- /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
+ /* functions like @FT_Set_Char_Size before calling `FT_Render_Glyph'. */
+ /* */
+ /* When FreeType outputs a bitmap of a glyph, it really outputs an */
+ /* alpha coverage map. If a pixel is completely covered by a */
+ /* filled-in outline, the bitmap contains 0xFF at that pixel, meaning */
+ /* that 0xFF/0xFF fraction of that pixel is covered, meaning the */
+ /* pixel is 100% black (or 0% bright). If a pixel is only 50% */
+ /* covered (value 0x80), the pixel is made 50% black (50% bright or a */
+ /* middle shade of grey). 0% covered means 0% black (100% bright or */
+ /* white). */
+ /* */
+ /* On high-DPI screens like on smartphones and tablets, the pixels */
+ /* are so small that their chance of being completely covered and */
+ /* therefore completely black are fairly good. On the low-DPI */
+ /* screens, however, the situation is different. The pixels are too */
+ /* large for most of the details of a glyph and shades of gray are */
+ /* the norm rather than the exception. */
+ /* */
+ /* This is relevant because all our screens have a second problem: */
+ /* they are not linear. 1~+~1 is not~2. Twice the value does not */
+ /* result in twice the brightness. When a pixel is only 50% covered, */
+ /* the coverage map says 50% black, and this translates to a pixel */
+ /* value of 128 when you use 8~bits per channel (0-255). However, */
+ /* this does not translate to 50% brightness for that pixel on our */
+ /* sRGB and gamma~2.2 screens. Due to their non-linearity, they */
+ /* dwell longer in the darks and only a pixel value of about 186 */
+ /* results in 50% brightness – 128 ends up too dark on both bright */
+ /* and dark backgrounds. The net result is that dark text looks */
+ /* burnt-out, pixely and blotchy on bright background, bright text */
+ /* too frail on dark backgrounds, and colored text on colored */
+ /* background (for example, red on green) seems to have dark halos or */
+ /* `dirt' around it. The situation is especially ugly for diagonal */
+ /* stems like in `w' glyph shapes where the quality of FreeType's */
+ /* anti-aliasing depends on the correct display of grays. On */
+ /* high-DPI screens where smaller, fully black pixels reign supreme, */
+ /* this doesn't matter, but on our low-DPI screens with all the gray */
+ /* shades, it does. 0% and 100% brightness are the same things in */
+ /* linear and non-linear space, just all the shades in-between */
+ /* aren't. */
+ /* */
+ /* The blending function for placing text over a background is */
+ /* */
+ /* { */
+ /* dst = alpha * src + (1 - alpha) * dst , */
+ /* } */
+ /* */
+ /* which is known as the OVER operator. */
+ /* */
+ /* To correctly composite an antialiased pixel of a glyph onto a */
+ /* surface, */
+ /* */
+ /* 1. take the foreground and background colors (e.g., in sRGB space) */
+ /* and apply gamma to get them in a linear space, */
+ /* */
+ /* 2. use OVER to blend the two linear colors using the glyph pixel */
+ /* as the alpha value (remember, the glyph bitmap is an alpha */
+ /* coverage bitmap), and */
+ /* */
+ /* 3. apply inverse gamma to the blended pixel and write it back to */
+ /* the image. */
+ /* */
+ /* Internal testing at Adobe found that a target inverse gamma of~1.8 */
+ /* for step~3 gives good results across a wide range of displays with */
+ /* an sRGB gamma curve or a similar one. */
+ /* */
+ /* This process can cost performance. There is an approximation that */
+ /* does not need to know about the background color; see */
+ /* https://bel.fi/alankila/lcd/ and */
+ /* https://bel.fi/alankila/lcd/alpcor.html for details. */
+ /* */
+ /* *ATTENTION*: Linear blending is even more important when dealing */
+ /* with subpixel-rendered glyphs to prevent color-fringing! A */
+ /* subpixel-rendered glyph must first be filtered with a filter that */
+ /* gives equal weight to the three color primaries and does not */
+ /* exceed a sum of 0x100, see section @lcd_filtering. Then the */
+ /* only difference to gray linear blending is that subpixel-rendered */
+ /* linear blending is done 3~times per pixel: red foreground subpixel */
+ /* to red background subpixel and so on for green and blue. */
/* */
FT_EXPORT( FT_Error )
FT_Render_Glyph( FT_GlyphSlot slot,
@@ -3039,17 +3197,15 @@ FT_BEGIN_HEADER
/* FT_Kerning_Mode */
/* */
/* <Description> */
- /* An enumeration used to specify which kerning values to return in */
+ /* An enumeration to specify the format of kerning values returned by */
/* @FT_Get_Kerning. */
/* */
/* <Values> */
/* FT_KERNING_DEFAULT :: Return grid-fitted kerning distances in */
- /* pixels (value is~0). Whether they are */
- /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* 26.6 fractional pixels. */
/* */
/* FT_KERNING_UNFITTED :: Return un-grid-fitted kerning distances in */
- /* 26.6 fractional pixels. Whether they are */
- /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* 26.6 fractional pixels. */
/* */
/* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
/* units. */
@@ -3059,9 +3215,13 @@ FT_BEGIN_HEADER
/* FreeType heuristically scale down kerning distances at small ppem */
/* values so that they don't become too big. */
/* */
+ /* Both FT_KERNING_DEFAULT and FT_KERNING_UNFITTED use the current */
+ /* horizontal scaling factor (as set e.g. with @FT_Set_Char_Size) to */
+ /* convert font units to pixels. */
+ /* */
typedef enum FT_Kerning_Mode_
{
- FT_KERNING_DEFAULT = 0,
+ FT_KERNING_DEFAULT = 0,
FT_KERNING_UNFITTED,
FT_KERNING_UNSCALED
@@ -3081,7 +3241,7 @@ FT_BEGIN_HEADER
/* FT_Get_Kerning */
/* */
/* <Description> */
- /* Return the kerning vector between two glyphs of a same face. */
+ /* Return the kerning vector between two glyphs of the same face. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
@@ -3109,6 +3269,10 @@ FT_BEGIN_HEADER
/* kernings, are out of the scope of this API function -- they can be */
/* implemented through format-specific interfaces. */
/* */
+ /* Kerning for OpenType fonts implemented in a `GPOS' table is not */
+ /* supported; use @FT_HAS_KERNING to find out whether a font has data */
+ /* that can be extracted with `FT_Get_Kerning'. */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Kerning( FT_Face face,
FT_UInt left_glyph,
@@ -3148,7 +3312,7 @@ FT_BEGIN_HEADER
/* @FT_Attach_Stream). */
/* */
/* Only very few AFM files come with track kerning data; please refer */
- /* to the Adobe's AFM specification for more details. */
+ /* to Adobe's AFM specification for more details. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Track_Kerning( FT_Face face,
@@ -3194,7 +3358,7 @@ FT_BEGIN_HEADER
/* `.notdef'). */
/* */
/* This function always returns an error if the config macro */
- /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
+ /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoption.h'. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph_Name( FT_Face face,
@@ -3210,7 +3374,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the ASCII PostScript name of a given face, if available. */
- /* This only works with PostScript and TrueType fonts. */
+ /* This only works with PostScript, TrueType, and OpenType fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3281,7 +3445,8 @@ FT_BEGIN_HEADER
/* the face (i.e., if it is not listed in the `face->charmaps' */
/* table). */
/* */
- /* It also fails if a type~14 charmap is selected. */
+ /* It also fails if an OpenType type~14 charmap is selected (which */
+ /* doesn't map character codes to glyph indices at all). */
/* */
FT_EXPORT( FT_Error )
FT_Set_Charmap( FT_Face face,
@@ -3316,7 +3481,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return the glyph index of a given character code. This function */
- /* uses a charmap object to do the mapping. */
+ /* uses the currently selected charmap to do the mapping. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3350,9 +3515,8 @@ FT_BEGIN_HEADER
/* FT_Get_First_Char */
/* */
/* <Description> */
- /* This function is used to return the first character code in the */
- /* current charmap of a given face. It also returns the */
- /* corresponding glyph index. */
+ /* Return the first character code in the current charmap of a given */
+ /* face, together with its corresponding glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3365,7 +3529,7 @@ FT_BEGIN_HEADER
/* The charmap's first character code. */
/* */
/* <Note> */
- /* You should use this function with @FT_Get_Next_Char to be able to */
+ /* You should use this function together with @FT_Get_Next_Char to */
/* parse all character codes available in a given charmap. The code */
/* should look like this: */
/* */
@@ -3405,12 +3569,13 @@ FT_BEGIN_HEADER
/* FT_Get_Next_Char */
/* */
/* <Description> */
- /* This function is used to return the next character code in the */
- /* current charmap of a given face following the value `char_code', */
- /* as well as the corresponding glyph index. */
+ /* Return the next character code in the current charmap of a given */
+ /* face following the value `char_code', as well as the corresponding */
+ /* glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
+ /* */
/* char_code :: The starting character code. */
/* */
/* <Output> */
@@ -3423,7 +3588,7 @@ FT_BEGIN_HEADER
/* <Note> */
/* You should use this function with @FT_Get_First_Char to walk */
/* over all character codes available in a given charmap. See the */
- /* note for this function for a simple code example. */
+ /* note for that function for a simple code example. */
/* */
/* Note that `*agindex' is set to~0 when there are no more codes in */
/* the charmap. */
@@ -3440,8 +3605,7 @@ FT_BEGIN_HEADER
/* FT_Get_Name_Index */
/* */
/* <Description> */
- /* Return the glyph index of a given glyph name. This function uses */
- /* driver specific objects to do the translation. */
+ /* Return the glyph index of a given glyph name. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
@@ -3462,8 +3626,10 @@ FT_BEGIN_HEADER
* FT_SUBGLYPH_FLAG_XXX
*
* @description:
- * A list of constants used to describe subglyphs. Please refer to the
- * TrueType specification for the meaning of the various flags.
+ * A list of constants describing subglyphs. Please refer to the
+ * `glyf' table description in the OpenType specification for the
+ * meaning of the various flags (which get synthesized for
+ * non-OpenType subglyphs).
*
* @values:
* FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
@@ -3524,7 +3690,7 @@ FT_BEGIN_HEADER
* @note:
* The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
* interpreted depending on the flags returned in `*p_flags'. See the
- * TrueType specification for details.
+ * OpenType specification for details.
*
*/
FT_EXPORT( FT_Error )
@@ -3564,33 +3730,31 @@ FT_BEGIN_HEADER
/* the font software copyright owner. */
/* */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
- /* If this bit is set, the font may be embedded and temporarily */
- /* loaded on the remote system. Documents containing Preview & */
- /* Print fonts must be opened `read-only'; no edits can be applied */
- /* to the document. */
+ /* The font may be embedded and temporarily loaded on the remote */
+ /* system. Documents containing Preview & Print fonts must be */
+ /* opened `read-only'; no edits can be applied to the document. */
/* */
/* FT_FSTYPE_EDITABLE_EMBEDDING :: */
- /* If this bit is set, the font may be embedded but must only be */
- /* installed temporarily on other systems. In contrast to Preview */
- /* & Print fonts, documents containing editable fonts may be opened */
- /* for reading, editing is permitted, and changes may be saved. */
+ /* The font may be embedded but must only be installed temporarily */
+ /* on other systems. In contrast to Preview & Print fonts, */
+ /* documents containing editable fonts may be opened for reading, */
+ /* editing is permitted, and changes may be saved. */
/* */
/* FT_FSTYPE_NO_SUBSETTING :: */
- /* If this bit is set, the font may not be subsetted prior to */
- /* embedding. */
+ /* The font may not be subsetted prior to embedding. */
/* */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
- /* If this bit is set, only bitmaps contained in the font may be */
- /* embedded; no outline data may be embedded. If there are no */
- /* bitmaps available in the font, then the font is unembeddable. */
+ /* Only bitmaps contained in the font may be embedded; no outline */
+ /* data may be embedded. If there are no bitmaps available in the */
+ /* font, then the font is unembeddable. */
/* */
/* <Note> */
/* The flags are ORed together, thus more than a single value can be */
/* returned. */
/* */
- /* While the fsType flags can indicate that a font may be embedded, a */
- /* license with the font vendor may be separately required to use the */
- /* font in this way. */
+ /* While the `fsType' flags can indicate that a font may be embedded, */
+ /* a license with the font vendor may be separately required to use */
+ /* the font in this way. */
/* */
#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
@@ -3606,13 +3770,13 @@ FT_BEGIN_HEADER
/* FT_Get_FSType_Flags */
/* */
/* <Description> */
- /* Return the fsType flags for a font. */
+ /* Return the `fsType' flags for a font. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Return> */
- /* The fsType flags, @FT_FSTYPE_XXX. */
+ /* The `fsType' flags, see @FT_FSTYPE_XXX. */
/* */
/* <Note> */
/* Use this function rather than directly reading the `fs_type' field */
@@ -3652,8 +3816,9 @@ FT_BEGIN_HEADER
/* Database: */
/* */
/* http://www.unicode.org/reports/tr37/ */
+ /* http://www.unicode.org/ivd/ */
/* */
- /* To date (November 2014), the character with the most variants is */
+ /* To date (January 2017), the character with the most variants is */
/* U+9089, having 32 such IVS. */
/* */
/* Adobe and MS decided to support IVS with a new cmap subtable */
@@ -3882,16 +4047,17 @@ FT_BEGIN_HEADER
/* FT_MulDiv */
/* */
/* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
+ /* Compute `(a*b)/c' with maximum accuracy, using a 64-bit */
+ /* intermediate integer whenever necessary. */
/* */
/* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */
/* */
/* <Input> */
/* a :: The first multiplier. */
+ /* */
/* b :: The second multiplier. */
+ /* */
/* c :: The divisor. */
/* */
/* <Return> */
@@ -3911,12 +4077,12 @@ FT_BEGIN_HEADER
/* FT_MulFix */
/* */
/* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed-point factor. */
+ /* Compute `(a*b)/0x10000' with maximum accuracy. Its main use is to */
+ /* multiply a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
+ /* */
/* b :: The second multiplier. Use a 16.16 factor here whenever */
/* possible (see note below). */
/* */
@@ -3945,12 +4111,12 @@ FT_BEGIN_HEADER
/* FT_DivFix */
/* */
/* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed-point factor. */
+ /* Compute `(a*0x10000)/b' with maximum accuracy. Its main use is to */
+ /* divide a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The numerator. */
+ /* */
/* b :: The denominator. Use a 16.16 factor here. */
/* */
/* <Return> */
@@ -3967,13 +4133,13 @@ FT_BEGIN_HEADER
/* FT_RoundFix */
/* */
/* <Description> */
- /* A very simple function used to round a 16.16 fixed number. */
+ /* Round a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number to be rounded. */
/* */
/* <Return> */
- /* `a' rounded to nearest 16.16 fixed integer, halfway cases away */
+ /* `a' rounded to the nearest 16.16 fixed integer, halfway cases away */
/* from zero. */
/* */
FT_EXPORT( FT_Fixed )
@@ -3986,8 +4152,7 @@ FT_BEGIN_HEADER
/* FT_CeilFix */
/* */
/* <Description> */
- /* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number. */
+ /* Compute the smallest following integer of a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the ceiling function is to be computed. */
@@ -4005,8 +4170,7 @@ FT_BEGIN_HEADER
/* FT_FloorFix */
/* */
/* <Description> */
- /* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number. */
+ /* Compute the largest previous integer of a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the floor function is to be computed. */
@@ -4092,7 +4256,7 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 6
+#define FREETYPE_MINOR 7
#define FREETYPE_PATCH 1
@@ -4138,20 +4302,13 @@ FT_BEGIN_HEADER
/* FT_Face_CheckTrueTypePatents */
/* */
/* <Description> */
- /* Parse all bytecode instructions of a TrueType font file to check */
- /* whether any of the patented opcodes are used. This is only useful */
- /* if you want to be able to use the unpatented hinter with */
- /* fonts that do *not* use these opcodes. */
- /* */
- /* Note that this function parses *all* glyph instructions in the */
- /* font file, which may be slow. */
+ /* Deprecated, does nothing. */
/* */
/* <Input> */
/* face :: A face handle. */
/* */
/* <Return> */
- /* 1~if this is a TrueType font that uses one of the patented */
- /* opcodes, 0~otherwise. */
+ /* Always returns false. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
@@ -4169,9 +4326,7 @@ FT_BEGIN_HEADER
/* FT_Face_SetUnpatentedHinting */
/* */
/* <Description> */
- /* Enable or disable the unpatented hinter for a given face. */
- /* Only enable it if you have determined that the face doesn't */
- /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
+ /* Deprecated, does nothing. */
/* */
/* <Input> */
/* face :: A face handle. */
@@ -4179,9 +4334,7 @@ FT_BEGIN_HEADER
/* value :: New boolean setting. */
/* */
/* <Return> */
- /* The old setting value. This will always be false if this is not */
- /* an SFNT font, or if the unpatented hinter is not compiled in this */
- /* instance of the library. */
+ /* Always returns false. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
@@ -4198,7 +4351,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FREETYPE_H__ */
+#endif /* FREETYPE_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftadvanc.h b/third_party/freetype/include/freetype/ftadvanc.h
index b4d2aed567..dea96e0db4 100644
--- a/third_party/freetype/include/freetype/ftadvanc.h
+++ b/third_party/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
-/* Copyright 2008-2015 by */
+/* Copyright 2008-2017 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>
@@ -181,7 +181,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTADVANC_H__ */
+#endif /* FTADVANC_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftbitmap.h b/third_party/freetype/include/freetype/ftbitmap.h
index 46cc47b7d1..04b2402ad0 100644
--- a/third_party/freetype/include/freetype/ftbitmap.h
+++ b/third_party/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
-/* Copyright 2004-2015 by */
+/* Copyright 2004-2017 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>
@@ -234,7 +234,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTBITMAP_H__ */
+#endif /* FTBITMAP_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftcffdrv.h b/third_party/freetype/include/freetype/ftcffdrv.h
index 6c8e416cee..35758f8fb1 100644
--- a/third_party/freetype/include/freetype/ftcffdrv.h
+++ b/third_party/freetype/include/freetype/ftcffdrv.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for controlling the CFF driver (specification only). */
/* */
-/* Copyright 2013-2015 by */
+/* Copyright 2013-2017 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 __FTCFFDRV_H__
-#define __FTCFFDRV_H__
+#ifndef FTCFFDRV_H_
+#define FTCFFDRV_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
* features preserve the design's weight and spacing much better than
* aliased type would.
*
- * 2) Aligment in the vertical direction: Weights and spacing along the
+ * 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
@@ -110,9 +110,9 @@ FT_BEGIN_HEADER
* to minimize distortion.
*
* @order:
- * hinting-engine
- * no-stem-darkening
- * darkening-parameters
+ * hinting-engine[cff]
+ * no-stem-darkening[cff]
+ * darkening-parameters[cff]
*
*/
@@ -120,7 +120,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @property:
- * hinting-engine
+ * hinting-engine[cff]
*
* @description:
* Thanks to Adobe, which contributed a new hinting (and parsing)
@@ -148,6 +148,8 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `adobe' or `freetype').
*/
@@ -157,8 +159,8 @@ FT_BEGIN_HEADER
* FT_CFF_HINTING_XXX
*
* @description:
- * A list of constants used for the @hinting-engine property to select
- * the hinting engine for CFF fonts.
+ * A list of constants used for the @hinting-engine[cff] property to
+ * select the hinting engine for CFF fonts.
*
* @values:
* FT_CFF_HINTING_FREETYPE ::
@@ -175,7 +177,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @property:
- * no-stem-darkening
+ * no-stem-darkening[cff]
*
* @description:
* By default, the Adobe CFF engine darkens stems at smaller sizes,
@@ -199,13 +201,16 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ *
*/
/**************************************************************************
*
* @property:
- * darkening-parameters
+ * darkening-parameters[cff]
*
* @description:
* By default, the Adobe CFF engine darkens stems as follows (if the
@@ -248,6 +253,14 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable, using eight comma-separated integers without spaces. Here
+ * the above example, using `\' to break the line for readability.
+ *
+ * {
+ * FREETYPE_PROPERTIES=\
+ * cff:darkening-parameters=500,300,1000,200,1500,100,2000,0
+ * }
*/
/* */
@@ -256,7 +269,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTCFFDRV_H__ */
+#endif /* FTCFFDRV_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/fterrdef.h b/third_party/freetype/include/freetype/fterrdef.h
index d865da7127..232dccdc6a 100644
--- a/third_party/freetype/include/freetype/fterrdef.h
+++ b/third_party/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -243,7 +243,7 @@
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
"no Unicode glyph name found" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
- "glyph to big for hinting" )
+ "glyph too big for hinting" )
/* BDF errors */
diff --git a/third_party/freetype/include/freetype/fterrors.h b/third_party/freetype/include/freetype/fterrors.h
index 0507b9ad7d..021989d0dd 100644
--- a/third_party/freetype/include/freetype/fterrors.h
+++ b/third_party/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -72,13 +72,13 @@
/* */
/* This macro ends the list. */
/* */
- /* Additionally, you have to undefine `__FTERRORS_H__' before */
- /* #including this file. */
+ /* Additionally, you have to undefine `FTERRORS_H_' before #including */
+ /* this file. */
/* */
/* Here is a simple example. */
/* */
/* { */
- /* #undef __FTERRORS_H__ */
+ /* #undef FTERRORS_H_ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, NULL } }; */
@@ -99,7 +99,17 @@
/* */
-#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__
@@ -210,7 +220,7 @@
#undef FT_ERR_PREFIX
#endif
-#endif /* __FTERRORS_H__ */
+#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
/* END */
diff --git a/third_party/freetype/include/freetype/ftfntfmt.h b/third_party/freetype/include/freetype/ftfntfmt.h
index 1f8ff28f10..337758328a 100644
--- a/third_party/freetype/include/freetype/ftfntfmt.h
+++ b/third_party/freetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* Support functions for font formats. */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 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 __FTFNTFMT_H__
-#define __FTFNTFMT_H__
+#ifndef FTFNTFMT_H_
+#define FTFNTFMT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -89,4 +89,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTFNTFMT_H__ */
+#endif /* FTFNTFMT_H_ */
+
+
+/* END */
diff --git a/third_party/freetype/include/freetype/ftglyph.h b/third_party/freetype/include/freetype/ftglyph.h
index 803ad39621..6b51792514 100644
--- a/third_party/freetype/include/freetype/ftglyph.h
+++ b/third_party/freetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -594,7 +594,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTGLYPH_H__ */
+#endif /* FTGLYPH_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftgzip.h b/third_party/freetype/include/freetype/ftgzip.h
index b3a532d5e1..bd5ceaab9f 100644
--- a/third_party/freetype/include/freetype/ftgzip.h
+++ b/third_party/freetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
/* */
/* Gzip-compressed stream support. */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 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
@@ -117,11 +117,11 @@ FT_BEGIN_HEADER
*
* @inout:
* output_len ::
- * Before calling the function, this is the 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'.
+ * 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.
@@ -142,7 +142,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTGZIP_H__ */
+#endif /* FTGZIP_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftimage.h b/third_party/freetype/include/freetype/ftimage.h
index 82f284c4f9..e21a2203b4 100644
--- a/third_party/freetype/include/freetype/ftimage.h
+++ b/third_party/freetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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
@@ -747,7 +747,7 @@ 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 `ftrender.h' for more */
@@ -860,16 +860,6 @@ FT_BEGIN_HEADER
/* This can be used to write anti-aliased outlines directly to a */
/* given background bitmap, and even perform translucency. */
/* */
- /* Note that the `count' field cannot be greater than a fixed value */
- /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
- /* `ftoption.h'. By default, this value is set to~32, which means */
- /* that if there are more than 32~spans on a given scanline, the */
- /* callback is called several times with the same `y' parameter in */
- /* order to draw all callbacks. */
- /* */
- /* Otherwise, the callback is only called once per scan-line, and */
- /* only for those scanlines that do have `gray' pixels on them. */
- /* */
typedef void
(*FT_SpanFunc)( int y,
int count,
@@ -1190,6 +1180,7 @@ FT_BEGIN_HEADER
typedef struct FT_Raster_Funcs_
{
FT_Glyph_Format glyph_format;
+
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
FT_Raster_SetModeFunc raster_set_mode;
@@ -1203,7 +1194,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTIMAGE_H__ */
+#endif /* FTIMAGE_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftincrem.h b/third_party/freetype/include/freetype/ftincrem.h
index 840af25b05..f6ae2baed6 100644
--- a/third_party/freetype/include/freetype/ftincrem.h
+++ b/third_party/freetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType incremental loading (specification). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 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
@@ -348,7 +348,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTINCREM_H__ */
+#endif /* FTINCREM_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftlcdfil.h b/third_party/freetype/include/freetype/ftlcdfil.h
index 4cd999a4b3..928bb0f3ea 100644
--- a/third_party/freetype/include/freetype/ftlcdfil.h
+++ b/third_party/freetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
-/* Copyright 2006-2015 by */
+/* Copyright 2006-2017 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
- * that 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.
- *
- * 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
- *
- * {
- * dst = alpha * src + (1 - alpha) * dst ,
- * }
- *
- * 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.
- *
- * 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
- *
- * {
- * [a - c, a + c, 2 * a, a + c, a - c] .
- * }
- *
- * 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, 0x50, 0x60, 0x50, 0x10] ,
- * }
- *
- * 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.
+ * in order to activate it and explicitly call @FT_Library_SetLcdFilter
+ * to enable it.
+ *
+ * A filter should have two properties:
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Examples:
+ *
+ * - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
+ * normalized.
+ *
+ * - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
+ * normalized.
+ *
+ * - [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 */
diff --git a/third_party/freetype/include/freetype/ftlist.h b/third_party/freetype/include/freetype/ftlist.h
index 12b48c78f7..5309cb18ba 100644
--- a/third_party/freetype/include/freetype/ftlist.h
+++ b/third_party/freetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -270,7 +270,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTLIST_H__ */
+#endif /* FTLIST_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftmm.h b/third_party/freetype/include/freetype/ftmm.h
index 6ef47987e6..96dd62523c 100644
--- a/third_party/freetype/include/freetype/ftmm.h
+++ b/third_party/freetype/include/freetype/ftmm.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -43,11 +43,10 @@ FT_BEGIN_HEADER
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
- /* George Williams has extended this interface to make it work with */
- /* both Type~1 Multiple Masters fonts and GX distortable (var) */
- /* fonts. Some of these routines only work with MM fonts, others */
- /* will work with both types. They are similar enough that a */
- /* consistent interface makes sense. */
+ /* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */
+ /* and OpenType variation fonts. Some of the routines only work with */
+ /* Adobe MM fonts, others will work with all three types. They are */
+ /* similar enough that a consistent interface makes sense. */
/* */
/*************************************************************************/
@@ -58,10 +57,11 @@ FT_BEGIN_HEADER
/* FT_MM_Axis */
/* */
/* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters fonts. */
+ /* A structure to model a given axis in design space for Multiple */
+ /* Masters fonts. */
/* */
- /* This structure can't be used for GX var fonts. */
+ /* This structure can't be used for TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
@@ -85,10 +85,11 @@ FT_BEGIN_HEADER
/* FT_Multi_Master */
/* */
/* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
+ /* A structure to model the axes and space of a Multiple Masters */
/* font. */
/* */
- /* This structure can't be used for GX var fonts. */
+ /* This structure can't be used for TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
@@ -115,27 +116,35 @@ FT_BEGIN_HEADER
/* FT_Var_Axis */
/* */
/* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters and GX var fonts. */
+ /* A structure to model a given axis in design space for Multiple */
+ /* Masters, TrueType GX, and OpenType variation fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
- /* Not always meaningful for GX. */
+ /* Not always meaningful for TrueType GX or OpenType */
+ /* variation fonts. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
- /* FreeType computes meaningful default values for MM; it */
- /* is then an integer value, not in 16.16 format. */
+ /* FreeType computes meaningful default values for Adobe */
+ /* MM fonts. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
- /* tag :: The axis's tag (the GX equivalent to `name'). */
- /* FreeType provides default values for MM if possible. */
+ /* tag :: The axis's tag (the equivalent to `name' for TrueType */
+ /* GX and OpenType variation fonts). FreeType provides */
+ /* default values for Adobe MM fonts if possible. */
/* */
- /* strid :: The entry in `name' table (another GX version of */
- /* `name'). */
- /* Not meaningful for MM. */
+ /* strid :: The axis name entry in the font's `name' table. This */
+ /* is another (and often better) version of the `name' */
+ /* field for TrueType GX or OpenType variation fonts. Not */
+ /* meaningful for Adobe MM fonts. */
+ /* */
+ /* <Note> */
+ /* The fields `minimum', `def', and `maximum' are 16.16 fractional */
+ /* values for TrueType GX and OpenType variation fonts. For Adobe MM */
+ /* fonts, the values are integers. */
/* */
typedef struct FT_Var_Axis_
{
@@ -157,9 +166,10 @@ FT_BEGIN_HEADER
/* FT_Var_Named_Style */
/* */
/* <Description> */
- /* A simple structure used to model a named style in a GX var font. */
+ /* A structure to model a named style in a TrueType GX or OpenType */
+ /* variation font. */
/* */
- /* This structure can't be used for MM fonts. */
+ /* This structure can't be used for Adobe MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
@@ -167,10 +177,14 @@ FT_BEGIN_HEADER
/* */
/* strid :: The entry in `name' table identifying this style. */
/* */
+ /* psid :: The entry in `name' table identifying a PostScript name */
+ /* for this style. */
+ /* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
+ FT_UInt psid; /* since 2.7.1 */
} FT_Var_Named_Style;
@@ -181,31 +195,42 @@ FT_BEGIN_HEADER
/* FT_MM_Var */
/* */
/* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* or GX var distortable font. */
+ /* A structure to model the axes and space of a Adobe MM, TrueType */
+ /* GX, or OpenType variation font. */
/* */
- /* Some fields are specific to one format and not to the other. */
+ /* Some fields are specific to one format and not to the others. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
- /* MM; no limit in GX. */
+ /* Adobe MM fonts; no limit in TrueType GX or */
+ /* OpenType variation fonts. */
/* */
/* num_designs :: The number of designs; should be normally */
- /* 2^num_axis for MM fonts. Not meaningful for GX */
+ /* 2^num_axis for Adobe MM fonts. Not meaningful */
+ /* for TrueType GX or OpenType variation fonts */
/* (where every glyph could have a different */
/* number of designs). */
/* */
- /* num_namedstyles :: The number of named styles; only meaningful for */
- /* 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'. */
+ /* num_namedstyles :: The number of named styles; a `named style' is */
+ /* a tuple of design coordinates that has a string */
+ /* ID (in the `name' table) associated with it. */
+ /* The font can tell the user that, for example, */
+ /* [Weight=1.5,Width=1.1] is `Bold'. */
+ /* */
+ /* For Adobe Multiple Masters fonts, this value is */
+ /* always zero because the format does not support */
+ /* named styles. */
/* */
/* axis :: An axis descriptor table. */
- /* GX fonts contain slightly more data than MM. */
+ /* TrueType GX and OpenType variation fonts */
+ /* contain slightly more data than Adobe MM fonts. */
+ /* Memory management of this pointer is done */
+ /* internally by FreeType. */
/* */
/* namedstyle :: A named style table. */
- /* Only meaningful with GX. */
+ /* Only meaningful for TrueType GX and OpenType */
+ /* variation fonts. Memory management of this */
+ /* pointer is done internally by FreeType. */
/* */
typedef struct FT_MM_Var_
{
@@ -224,9 +249,10 @@ FT_BEGIN_HEADER
/* FT_Get_Multi_Master */
/* */
/* <Description> */
- /* Retrieve the Multiple Master descriptor of a given font. */
+ /* Retrieve a variation descriptor of a given Adobe MM font. */
/* */
- /* This function can't be used with GX fonts. */
+ /* This function can't be used with TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
@@ -248,14 +274,17 @@ FT_BEGIN_HEADER
/* FT_Get_MM_Var */
/* */
/* <Description> */
- /* Retrieve the Multiple Master/GX var descriptor of a given font. */
+ /* Retrieve a variation descriptor for a given font. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
- /* amaster :: The Multiple Masters/GX var descriptor. */
- /* Allocates a data structure, which the user must free. */
+ /* amaster :: The variation descriptor. */
+ /* Allocates a data structure, which the user must */
+ /* deallocate with `free' after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@@ -271,10 +300,11 @@ FT_BEGIN_HEADER
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
- /* For Multiple Masters fonts, choose an interpolated font design */
- /* through design coordinates. */
+ /* For Adobe MM fonts, choose an interpolated font design through */
+ /* design coordinates. */
/* */
- /* This function can't be used with GX fonts. */
+ /* This function can't be used with TrueType GX or OpenType variation */
+ /* fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -302,8 +332,9 @@ FT_BEGIN_HEADER
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
- /* For Multiple Master or GX Var fonts, choose an interpolated font */
- /* design through design coordinates. */
+ /* Choose an interpolated font design through design coordinates. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -328,11 +359,43 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Get_Var_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* Get the design coordinates of the currently selected interpolated */
+ /* font. */
+ /* */
+ /* This function works with all supported variation formats. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of design coordinates to retrieve. If it */
+ /* is larger than the number of axes, set the excess */
+ /* values to~0. */
+ /* */
+ /* <Output> */
+ /* coords :: The design coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
- /* For Multiple Masters and GX var fonts, choose an interpolated font */
- /* design through normalized blend coordinates. */
+ /* Choose an interpolated font design through normalized blend */
+ /* coordinates. */
+ /* */
+ /* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@@ -344,7 +407,9 @@ FT_BEGIN_HEADER
/* use default values for the remaining axes. */
/* */
/* coords :: The design coordinates array (each element must be */
- /* between 0 and 1.0). */
+ /* between 0 and 1.0 for Adobe MM fonts, and between */
+ /* -1.0 and 1.0 for TrueType GX and OpenType variation */
+ /* fonts). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@@ -358,6 +423,37 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Get_MM_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* Get the normalized blend coordinates of the currently selected */
+ /* interpolated font. */
+ /* */
+ /* This function works with all supported variation formats. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of normalized blend coordinates to */
+ /* retrieve. If it is larger than the number of axes, */
+ /* set the excess values to~0.5 for Adobe MM fonts, and */
+ /* to~0 for TrueType GX and OpenType variation fonts. */
+ /* */
+ /* <Output> */
+ /* coords :: The normalized blend coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_Var_Blend_Coordinates */
/* */
/* <Description> */
@@ -368,12 +464,26 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Fixed* coords );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Var_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* This is another name of @FT_Get_MM_Blend_Coordinates. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Var_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
/* */
FT_END_HEADER
-#endif /* __FTMM_H__ */
+#endif /* FTMM_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftmodapi.h b/third_party/freetype/include/freetype/ftmodapi.h
index 544279a68a..d5bf376512 100644
--- a/third_party/freetype/include/freetype/ftmodapi.h
+++ b/third_party/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -111,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 */
@@ -125,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;
@@ -610,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 that 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
@@ -663,7 +661,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTMODAPI_H__ */
+#endif /* FTMODAPI_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftmoderr.h b/third_party/freetype/include/freetype/ftmoderr.h
index 9d7f981409..7f608375e8 100644
--- a/third_party/freetype/include/freetype/ftmoderr.h
+++ b/third_party/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
-/* Copyright 2001-2015 by */
+/* Copyright 2001-2017 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 */
diff --git a/third_party/freetype/include/freetype/ftotval.h b/third_party/freetype/include/freetype/ftotval.h
index e744b713fb..b5d27cfe74 100644
--- a/third_party/freetype/include/freetype/ftotval.h
+++ b/third_party/freetype/include/freetype/ftotval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
-/* Copyright 2004-2015 by */
+/* Copyright 2004-2017 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
@@ -106,12 +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 )
/**********************************************************************
*
@@ -198,7 +198,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTOTVAL_H__ */
+#endif /* FTOTVAL_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftoutln.h b/third_party/freetype/include/freetype/ftoutln.h
index b6ec70de8c..07f73ebb1b 100644
--- a/third_party/freetype/include/freetype/ftoutln.h
+++ b/third_party/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-2015 by */
+/* Copyright 1996-2017 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>
@@ -115,6 +115,10 @@ FT_BEGIN_HEADER
/* outline for stroking purposes (otherwise it would result in a */
/* visible dot when round caps are used). */
/* */
+ /* Similarly, the function returns success for an empty outline also */
+ /* (doing nothing, this is, not calling any emitter); if necessary, */
+ /* you should filter this out, too. */
+ /* */
FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
@@ -213,6 +217,10 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* An empty outline, or an outline with a single point only is also */
+ /* valid. */
+ /* */
FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline );
@@ -563,7 +571,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTOUTLN_H__ */
+#endif /* FTOUTLN_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftrender.h b/third_party/freetype/include/freetype/ftrender.h
index ec8da700b1..960837580a 100644
--- a/third_party/freetype/include/freetype/ftrender.h
+++ b/third_party/freetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
/* */
/* FreeType renderer modules public interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
+
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
@@ -226,7 +227,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTRENDER_H__ */
+#endif /* FTRENDER_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftsizes.h b/third_party/freetype/include/freetype/ftsizes.h
index bef8424715..2f3958a857 100644
--- a/third_party/freetype/include/freetype/ftsizes.h
+++ b/third_party/freetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType size objects management (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -153,7 +153,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTSIZES_H__ */
+#endif /* FTSIZES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftsnames.h b/third_party/freetype/include/freetype/ftsnames.h
index 0f7fbe1744..f6daf8c7da 100644
--- a/third_party/freetype/include/freetype/ftsnames.h
+++ b/third_party/freetype/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -147,8 +147,8 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
- /* null-terminated. The application should deallocate it if it is no */
- /* longer in use. */
+ /* null-terminated. Note that you don't have to deallocate `string' */
+ /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
@@ -194,7 +194,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FT_SFNT_NAMES_H__ */
+#endif /* FTSNAMES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftsynth.h b/third_party/freetype/include/freetype/ftsynth.h
index fbcbad871a..1863fa2383 100644
--- a/third_party/freetype/include/freetype/ftsynth.h
+++ b/third_party/freetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
-/* Copyright 2000-2015 by */
+/* Copyright 2000-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,8 +41,8 @@
/* adapted to the particular needs. */
-#ifndef __FTSYNTH_H__
-#define __FTSYNTH_H__
+#ifndef FTSYNTH_H_
+#define FTSYNTH_H_
#include <ft2build.h>
@@ -78,7 +78,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTSYNTH_H__ */
+#endif /* FTSYNTH_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftsystem.h b/third_party/freetype/include/freetype/ftsystem.h
index 2bc999910b..1aa4762ad6 100644
--- a/third_party/freetype/include/freetype/ftsystem.h
+++ b/third_party/freetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType low-level system interface definition (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -290,7 +290,7 @@ FT_BEGIN_HEADER
* 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.
+ * 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.)
*
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTSYSTEM_H__ */
+#endif /* FTSYSTEM_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/fttrigon.h b/third_party/freetype/include/freetype/fttrigon.h
index 485ec51587..89f0350675 100644
--- a/third_party/freetype/include/freetype/fttrigon.h
+++ b/third_party/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
-/* Copyright 2001-2015 by */
+/* Copyright 2001-2017 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
@@ -344,7 +344,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTTRIGON_H__ */
+#endif /* FTTRIGON_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ftttdrv.h b/third_party/freetype/include/freetype/ftttdrv.h
index dc0081a0b9..a7b937fa53 100644
--- a/third_party/freetype/include/freetype/ftttdrv.h
+++ b/third_party/freetype/include/freetype/ftttdrv.h
@@ -5,7 +5,7 @@
/* FreeType API for controlling the TrueType driver */
/* (specification only). */
/* */
-/* Copyright 2013-2015 by */
+/* Copyright 2013-2017 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 __FTTTDRV_H__
-#define __FTTTDRV_H__
+#ifndef FTTTDRV_H_
+#define FTTTDRV_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -138,31 +138,37 @@ FT_BEGIN_HEADER
* interpreter-version
*
* @description:
- * Currently, two versions are available, representing 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).
+
+ * 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). 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.
+ * 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'.
+ * `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 activate subpixel
+ * 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_38;
+ * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
*
*
* FT_Init_FreeType( &library );
@@ -175,6 +181,8 @@ FT_BEGIN_HEADER
* @note:
* This property can be used with @FT_Property_Get also.
*
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `35', `38', or `40').
*/
@@ -197,9 +205,19 @@ FT_BEGIN_HEADER
*
* 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).
+ * 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
@@ -207,9 +225,9 @@ FT_BEGIN_HEADER
* 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.
+ * 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
@@ -290,13 +308,14 @@ FT_BEGIN_HEADER
* the version~1 gasp table exclusively (like Color ClearType), while
* v1.6 only respects the values of version~0 (bits 0 and~1).
*
- * FreeType doesn't provide all capabilities of the most recent
- * ClearType incarnation, thus we identify our subpixel support as
- * version~38.
+ * 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
/* */
@@ -304,7 +323,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTTTDRV_H__ */
+#endif /* FTTTDRV_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/fttypes.h b/third_party/freetype/include/freetype/fttypes.h
index 706a1be4ef..eab8adaad4 100644
--- a/third_party/freetype/include/freetype/fttypes.h
+++ b/third_party/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -596,7 +596,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTTYPES_H__ */
+#endif /* FTTYPES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/autohint.h b/third_party/freetype/include/freetype/internal/autohint.h
index 8d5a9773cb..bae83e7384 100644
--- a/third_party/freetype/include/freetype/internal/autohint.h
+++ b/third_party/freetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/ftcalc.h b/third_party/freetype/include/freetype/internal/ftcalc.h
index 67ade7e5f9..c9ac9d8246 100644
--- a/third_party/freetype/include/freetype/internal/ftcalc.h
+++ b/third_party/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -47,7 +47,7 @@ FT_BEGIN_HEADER
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
- register FT_Int32 t, t2;
+ FT_Int32 t, t2;
__asm
@@ -80,7 +80,7 @@ FT_BEGIN_HEADER
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
- register FT_Int32 t, t2;
+ FT_Int32 t, t2;
__asm__ __volatile__ (
@@ -116,7 +116,7 @@ FT_BEGIN_HEADER
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
- register FT_Int32 result;
+ FT_Int32 result;
__asm__ __volatile__ (
@@ -152,7 +152,7 @@ FT_BEGIN_HEADER
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
- register FT_Int32 result;
+ FT_Int32 result;
__asm
{
@@ -412,7 +412,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTCALC_H__ */
+#endif /* FTCALC_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftdebug.h b/third_party/freetype/include/freetype/internal/ftdebug.h
index 216c73031e..5dcd2b1740 100644
--- a/third_party/freetype/include/freetype/internal/ftdebug.h
+++ b/third_party/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -249,7 +249,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTDEBUG_H__ */
+#endif /* FTDEBUG_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftdriver.h b/third_party/freetype/include/freetype/internal/ftdriver.h
index 16856d3df8..e82fa8d41f 100644
--- a/third_party/freetype/include/freetype/internal/ftdriver.h
+++ b/third_party/freetype/include/freetype/internal/ftdriver.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -67,15 +67,6 @@ FT_BEGIN_HEADER
FT_Int32 load_flags );
- typedef FT_UInt
- (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
- typedef FT_Long
- (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
-
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
@@ -213,7 +204,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 +394,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTDRIVER_H__ */
+#endif /* FTDRIVER_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftgloadr.h b/third_party/freetype/include/freetype/internal/ftgloadr.h
index 970dd70cc3..f41c3df554 100644
--- a/third_party/freetype/include/freetype/internal/ftgloadr.h
+++ b/third_party/freetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2017 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 */
@@ -166,7 +148,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTGLOADR_H__ */
+#endif /* FTGLOADR_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/fthash.h b/third_party/freetype/include/freetype/internal/fthash.h
new file mode 100644
index 0000000000..f22f9d5d39
--- /dev/null
+++ b/third_party/freetype/include/freetype/internal/fthash.h
@@ -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 */
diff --git a/third_party/freetype/include/freetype/internal/ftmemory.h b/third_party/freetype/include/freetype/internal/ftmemory.h
index c0c553b4fc..59e5b58a57 100644
--- a/third_party/freetype/include/freetype/internal/ftmemory.h
+++ b/third_party/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType memory management macros (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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) )
@@ -106,10 +108,12 @@ FT_BEGIN_HEADER
/*
* The allocation functions return a pointer, and the error code
- * is written to through the `p_error' parameter. See below for
- * for documentation.
+ * is written to through the `p_error' parameter.
*/
+ /* The `q' variants of the functions below (`q' for `quick') don't fill */
+ /* the allocated or reallocated memory with zero bytes. */
+
FT_BASE( FT_Pointer )
ft_mem_alloc( FT_Memory memory,
FT_Long size,
@@ -141,6 +145,9 @@ FT_BEGIN_HEADER
const void* P );
+ /* The `Q' variants of the macros below (`Q' for `quick') don't fill */
+ /* the allocated or reallocated memory with zero bytes. */
+
#define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
(FT_Long)(size), \
@@ -380,7 +387,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTMEMORY_H__ */
+#endif /* FTMEMORY_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftobjs.h b/third_party/freetype/include/freetype/internal/ftobjs.h
index da5582dc3f..772d82c315 100644
--- a/third_party/freetype/include/freetype/internal/ftobjs.h
+++ b/third_party/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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
@@ -193,6 +193,7 @@ FT_BEGIN_HEADER
typedef struct FT_CMap_ClassRec_
{
FT_ULong size;
+
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;
@@ -341,12 +342,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 */
@@ -365,7 +360,6 @@ FT_BEGIN_HEADER
FT_Incremental_InterfaceRec* incremental_interface;
#endif
- FT_Bool ignore_unpatented_hinter;
FT_Int refcount;
} FT_Face_InternalRec;
@@ -506,6 +500,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 )
+
/*************************************************************************/
/* */
@@ -534,7 +531,16 @@ FT_BEGIN_HEADER
FT_BASE( FT_Pointer )
ft_module_get_service( FT_Module module,
- const char* service_id );
+ const char* service_id,
+ FT_Bool global );
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_BASE( FT_Error )
+ ft_property_string_set( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ FT_String* value );
+#endif
/* */
@@ -772,13 +778,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 );
@@ -844,7 +843,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. */
@@ -877,7 +876,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFilter lcd_filter;
FT_Int lcd_extra; /* number of extra pixels */
- FT_Byte lcd_weights[7]; /* filter weights, if any */
+ FT_Byte lcd_weights[5]; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
@@ -982,8 +981,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). */
@@ -1041,8 +1040,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). */
@@ -1101,8 +1100,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). */
@@ -1175,11 +1174,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'. */
/* */
@@ -1379,11 +1378,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'. */
/* */
@@ -1565,7 +1564,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTOBJS_H__ */
+#endif /* FTOBJS_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftpic.h b/third_party/freetype/include/freetype/internal/ftpic.h
index 7f9154f419..0d43ed20f7 100644
--- a/third_party/freetype/include/freetype/internal/ftpic.h
+++ b/third_party/freetype/include/freetype/internal/ftpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (declaration). */
/* */
-/* Copyright 2009-2015 by */
+/* Copyright 2009-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/ftrfork.h b/third_party/freetype/include/freetype/internal/ftrfork.h
index da61ca75b5..25a44a4487 100644
--- a/third_party/freetype/include/freetype/internal/ftrfork.h
+++ b/third_party/freetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (specification). */
/* */
-/* Copyright 2004-2015 by */
+/* Copyright 2004-2017 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>
@@ -43,11 +43,12 @@ FT_BEGIN_HEADER
typedef struct FT_RFork_Ref_
{
- FT_UShort res_id;
- FT_Long offset;
+ FT_Short res_id;
+ FT_Long offset;
} FT_RFork_Ref;
+
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
typedef FT_Error
(*ft_raccess_guess_func)( FT_Library library,
@@ -227,7 +228,7 @@ FT_BEGIN_HEADER
/* 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 `snft' resources, sorting */
+ /* to restore Type1 font properly. For `sfnt' resources, sorting */
/* may induce a different order of the faces in comparison to that */
/* by QuickDraw API. */
/* */
@@ -260,7 +261,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTRFORK_H__ */
+#endif /* FTRFORK_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftserv.h b/third_party/freetype/include/freetype/internal/ftserv.h
index 11a0c7f3de..c84afba4a8 100644
--- a/third_party/freetype/include/freetype/internal/ftserv.h
+++ b/third_party/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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
@@ -109,27 +109,27 @@ FT_BEGIN_HEADER
*/
#ifdef __cplusplus
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- *_pptr_ = _tmp_; \
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
+ *_pptr_ = _tmp_; \
FT_END_STMNT
#else /* !C++ */
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- ptr = _tmp_; \
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
+ ptr = _tmp_; \
FT_END_STMNT
#endif /* !C++ */
@@ -167,6 +167,7 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
+ /* FT_DEFINE_SERVICEDESCREC8 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
@@ -283,6 +284,28 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
+#define FT_DEFINE_SERVICEDESCREC8( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { serv_id_8, serv_data_8 }, \
+ { NULL, NULL } \
+ };
+
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
@@ -593,6 +616,62 @@ FT_BEGIN_HEADER
return FT_Err_Ok; \
}
+#define FT_DEFINE_SERVICEDESCREC8( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = serv_id_7; \
+ clazz[6].serv_data = serv_data_7; \
+ clazz[7].serv_id = serv_id_8; \
+ clazz[7].serv_data = serv_data_8; \
+ clazz[8].serv_id = NULL; \
+ clazz[8].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
#endif /* FT_CONFIG_OPTION_PIC */
@@ -635,6 +714,7 @@ FT_BEGIN_HEADER
{
FT_Pointer service_POSTSCRIPT_FONT_NAME;
FT_Pointer service_MULTI_MASTERS;
+ FT_Pointer service_METRICS_VARIATIONS;
FT_Pointer service_GLYPH_DICT;
FT_Pointer service_PFR_METRICS;
FT_Pointer service_WINFNT;
@@ -739,6 +819,7 @@ FT_BEGIN_HEADER
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
+#define FT_SERVICE_METRICS_VARIATIONS_H <freetype/internal/services/svmetric.h>
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
@@ -757,7 +838,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTSERV_H__ */
+#endif /* FTSERV_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftstream.h b/third_party/freetype/include/freetype/internal/ftstream.h
index 384e5df305..02b2f0bc90 100644
--- a/third_party/freetype/include/freetype/internal/ftstream.h
+++ b/third_party/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -530,7 +530,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTSTREAM_H__ */
+#endif /* FTSTREAM_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/ftvalid.h b/third_party/freetype/include/freetype/internal/ftvalid.h
index 9cda6eef5f..df6f7c5778 100644
--- a/third_party/freetype/include/freetype/internal/ftvalid.h
+++ b/third_party/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
-/* Copyright 2004-2015 by */
+/* Copyright 2004-2017 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 */
@@ -153,7 +153,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FTVALID_H__ */
+#endif /* FTVALID_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/internal.h b/third_party/freetype/include/freetype/internal/internal.h
index 809ce59c92..02046813a3 100644
--- a/third_party/freetype/include/freetype/internal/internal.h
+++ b/third_party/freetype/include/freetype/internal/internal.h
@@ -4,7 +4,7 @@
/* */
/* Internal header files (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
diff --git a/third_party/freetype/include/freetype/internal/psaux.h b/third_party/freetype/include/freetype/internal/psaux.h
index 1c5f784f52..286d6040cb 100644
--- a/third_party/freetype/include/freetype/internal/psaux.h
+++ b/third_party/freetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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
@@ -678,6 +679,7 @@ FT_BEGIN_HEADER
FT_Int num_subrs;
FT_Byte** subrs;
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 */
diff --git a/third_party/freetype/include/freetype/internal/pshints.h b/third_party/freetype/include/freetype/internal/pshints.h
index 12aaabacd4..49116eb443 100644
--- a/third_party/freetype/include/freetype/internal/pshints.h
+++ b/third_party/freetype/include/freetype/internal/pshints.h
@@ -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-2015 by */
+/* Copyright 2001-2017 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>
@@ -716,7 +716,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __PSHINTS_H__ */
+#endif /* PSHINTS_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svcid.h b/third_party/freetype/include/freetype/internal/services/svcid.h
index 4a535a6f42..cce94d8df6 100644
--- a/third_party/freetype/include/freetype/internal/services/svcid.h
+++ b/third_party/freetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType CID font services (specification). */
/* */
-/* Copyright 2007-2015 by */
+/* Copyright 2007-2017 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -16,8 +16,8 @@
/***************************************************************************/
-#ifndef __SVCID_H__
-#define __SVCID_H__
+#ifndef SVCID_H_
+#define SVCID_H_
#include FT_INTERNAL_SERVICE_H
@@ -84,7 +84,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVCID_H__ */
+#endif /* SVCID_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svfntfmt.h b/third_party/freetype/include/freetype/internal/services/svfntfmt.h
index f8b3617364..376d9255bb 100644
--- a/third_party/freetype/include/freetype/internal/services/svfntfmt.h
+++ b/third_party/freetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType font format service (specification only). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 __SVFNTFMT_H__
-#define __SVFNTFMT_H__
+#ifndef SVFNTFMT_H_
+#define SVFNTFMT_H_
#include FT_INTERNAL_SERVICE_H
@@ -49,7 +49,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVFNTFMT_H__ */
+#endif /* SVFNTFMT_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svgldict.h b/third_party/freetype/include/freetype/internal/services/svgldict.h
index f78bca5d77..0cd13618d8 100644
--- a/third_party/freetype/include/freetype/internal/services/svgldict.h
+++ b/third_party/freetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svkern.h b/third_party/freetype/include/freetype/internal/services/svkern.h
index bc26f15941..b8344e96e9 100644
--- a/third_party/freetype/include/freetype/internal/services/svkern.h
+++ b/third_party/freetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Kerning service (specification). */
/* */
-/* Copyright 2006-2015 by */
+/* Copyright 2006-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svmetric.h b/third_party/freetype/include/freetype/internal/services/svmetric.h
new file mode 100644
index 0000000000..cac9bf88ba
--- /dev/null
+++ b/third_party/freetype/include/freetype/internal/services/svmetric.h
@@ -0,0 +1,153 @@
+/***************************************************************************/
+/* */
+/* svmetric.h */
+/* */
+/* The FreeType services for metrics variations (specification). */
+/* */
+/* Copyright 2016-2017 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 SVMETRIC_H_
+#define SVMETRIC_H_
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
+ *
+ */
+
+#define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations"
+
+
+ /* HVAR */
+
+ typedef FT_Error
+ (*FT_HAdvance_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_LSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_RSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ /* VVAR */
+
+ typedef FT_Error
+ (*FT_VAdvance_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_TSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_BSB_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ typedef FT_Error
+ (*FT_VOrg_Adjust_Func)( FT_Face face,
+ FT_UInt gindex,
+ FT_Int *avalue );
+
+ /* MVAR */
+
+ typedef void
+ (*FT_Metrics_Adjust_Func)( FT_Face face );
+
+
+ FT_DEFINE_SERVICE( MetricsVariations )
+ {
+ FT_HAdvance_Adjust_Func hadvance_adjust;
+ FT_LSB_Adjust_Func lsb_adjust;
+ FT_RSB_Adjust_Func rsb_adjust;
+
+ FT_VAdvance_Adjust_Func vadvance_adjust;
+ FT_TSB_Adjust_Func tsb_adjust;
+ FT_BSB_Adjust_Func bsb_adjust;
+ FT_VOrg_Adjust_Func vorg_adjust;
+
+ FT_Metrics_Adjust_Func metrics_adjust;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ ) \
+ static const FT_Service_MetricsVariationsRec class_ = \
+ { \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
+ hadvance_adjust_, \
+ lsb_adjust_, \
+ rsb_adjust_, \
+ vadvance_adjust_, \
+ tsb_adjust_, \
+ bsb_adjust_, \
+ vorg_adjust_, \
+ metrics_adjust_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
+ { \
+ clazz->hadvance_adjust = hadvance_adjust_; \
+ clazz->lsb_adjust = lsb_adjust_; \
+ clazz->rsb_adjust = rsb_adjust_; \
+ clazz->vadvance_adjust = vadvance_adjust_; \
+ clazz->tsb_adjust = tsb_adjust_; \
+ clazz->bsb_adjust = bsb_adjust_; \
+ clazz->vorg_adjust = vorg_adjust_; \
+ clazz->metrics_adjust = metrics_adjust_; \
+ };
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* SVMETRIC_H_ */
+
+
+/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svmm.h b/third_party/freetype/include/freetype/internal/services/svmm.h
index f2cecfbb3b..97af1ac984 100644
--- a/third_party/freetype/include/freetype/internal/services/svmm.h
+++ b/third_party/freetype/include/freetype/internal/services/svmm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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
@@ -58,46 +58,91 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
+ typedef FT_Error
+ (*FT_Get_Var_Design_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ typedef FT_Error
+ (*FT_Get_MM_Blend_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+ typedef FT_Error
+ (*FT_Get_Var_Blend_Func)( FT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var );
+
+ typedef void
+ (*FT_Done_Blend_Func)( FT_Face );
+
FT_DEFINE_SERVICE( MultiMasters )
{
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
+ FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
+ FT_Get_Var_Design_Func get_var_design;
+
+ /* for internal use; only needed for code sharing between modules */
+ FT_Get_Var_Blend_Func get_var_blend;
+ FT_Done_Blend_Func done_blend;
};
#ifndef FT_CONFIG_OPTION_PIC
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- { \
- get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ { \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
- { \
- clazz->get_mm = get_mm_; \
- clazz->set_mm_design = set_mm_design_; \
- clazz->set_mm_blend = set_mm_blend_; \
- clazz->get_mm_var = get_mm_var_; \
- clazz->set_var_design = set_var_design_; \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
+ { \
+ clazz->get_mm = get_mm_; \
+ clazz->set_mm_design = set_mm_design_; \
+ clazz->set_mm_blend = set_mm_blend_; \
+ clazz->get_mm_blend = get_mm_blend_; \
+ clazz->get_mm_var = get_mm_var_; \
+ clazz->set_var_design = set_var_design_; \
+ clazz->get_var_design = get_var_design_; \
+ clazz->get_var_blend = get_var_blend_; \
+ clazz->done_blend = done_blend_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
@@ -107,7 +152,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVMM_H__ */
+#endif /* SVMM_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svpostnm.h b/third_party/freetype/include/freetype/internal/services/svpostnm.h
index a89f79e479..022cdec195 100644
--- a/third_party/freetype/include/freetype/internal/services/svpostnm.h
+++ b/third_party/freetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript name services (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svprop.h b/third_party/freetype/include/freetype/internal/services/svprop.h
index c9f07ce33a..eb2d4eed15 100644
--- a/third_party/freetype/include/freetype/internal/services/svprop.h
+++ b/third_party/freetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType property service (specification). */
/* */
-/* Copyright 2012-2015 by */
+/* Copyright 2012-2017 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
@@ -29,7 +29,8 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Properties_SetFunc)( FT_Module module,
const char* property_name,
- const void* value );
+ const void* value,
+ FT_Bool value_is_string );
typedef FT_Error
(*FT_Properties_GetFunc)( FT_Module module,
@@ -75,7 +76,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVPROP_H__ */
+#endif /* SVPROP_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svpscmap.h b/third_party/freetype/include/freetype/internal/services/svpscmap.h
index 66da6e1043..b32122e5d6 100644
--- a/third_party/freetype/include/freetype/internal/services/svpscmap.h
+++ b/third_party/freetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svpsinfo.h b/third_party/freetype/include/freetype/internal/services/svpsinfo.h
index 752a266025..0220ce529c 100644
--- a/third_party/freetype/include/freetype/internal/services/svpsinfo.h
+++ b/third_party/freetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript info service (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svsfnt.h b/third_party/freetype/include/freetype/internal/services/svsfnt.h
index 252ae1cf5e..49d18e43e0 100644
--- a/third_party/freetype/include/freetype/internal/services/svsfnt.h
+++ b/third_party/freetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType SFNT table loading service (specification). */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svttcmap.h b/third_party/freetype/include/freetype/internal/services/svttcmap.h
index cd95b9ab81..30f7feec71 100644
--- a/third_party/freetype/include/freetype/internal/services/svttcmap.h
+++ b/third_party/freetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType/sfnt cmap extra information service. */
/* */
-/* Copyright 2003-2015 by */
+/* Copyright 2003-2017 by */
/* Masatake YAMATO, Redhat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -19,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
@@ -100,7 +100,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVTTCMAP_H__ */
+#endif /* SVTTCMAP_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/services/svtteng.h b/third_party/freetype/include/freetype/internal/services/svtteng.h
index 272ee8c055..e4b368ad40 100644
--- a/third_party/freetype/include/freetype/internal/services/svtteng.h
+++ b/third_party/freetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType engine query service (specification). */
/* */
-/* Copyright 2006-2015 by */
+/* Copyright 2006-2017 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 */
diff --git a/third_party/freetype/include/freetype/internal/services/svttglyf.h b/third_party/freetype/include/freetype/internal/services/svttglyf.h
index f5cb76a9f8..b7793059fd 100644
--- a/third_party/freetype/include/freetype/internal/services/svttglyf.h
+++ b/third_party/freetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType glyph service. */
/* */
-/* Copyright 2007-2015 by */
+/* Copyright 2007-2017 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -15,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
@@ -63,7 +63,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SVTTGLYF_H__ */
+#endif /* SVTTGLYF_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/sfnt.h b/third_party/freetype/include/freetype/internal/sfnt.h
index 30f53bf09c..348b5a9437 100644
--- a/third_party/freetype/include/freetype/internal/sfnt.h
+++ b/third_party/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -742,7 +742,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __SFNT_H__ */
+#endif /* SFNT_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/t1types.h b/third_party/freetype/include/freetype/internal/t1types.h
index 029acc4009..b2e35d42d1 100644
--- a/third_party/freetype/include/freetype/internal/t1types.h
+++ b/third_party/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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
@@ -107,6 +108,7 @@ FT_BEGIN_HEADER
FT_Int num_subrs;
FT_Byte** subrs;
FT_UInt* subrs_len;
+ FT_Hash subrs_hash;
FT_Int num_glyphs;
FT_String** glyph_names; /* array of glyph names */
@@ -249,7 +251,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __T1TYPES_H__ */
+#endif /* T1TYPES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/internal/tttypes.h b/third_party/freetype/include/freetype/internal/tttypes.h
index 1507a7c57a..6af73034ce 100644
--- a/third_party/freetype/include/freetype/internal/tttypes.h
+++ b/third_party/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -185,7 +185,7 @@ FT_BEGIN_HEADER
/* */
/* CompLength :: Compressed table length (in bytes). */
/* */
- /* OrigLength :: Unompressed table length (in bytes). */
+ /* OrigLength :: Uncompressed table length (in bytes). */
/* */
/* CheckSum :: The table checksum. This value can be ignored. */
/* */
@@ -1060,6 +1060,34 @@ FT_BEGIN_HEADER
} TT_SbitTableType;
+ /* OpenType 1.8 brings new tables for variation font support; */
+ /* to make the old MM and GX fonts still work we need to check */
+ /* the presence (and validity) of the functionality provided */
+ /* by those tables. The following flag macros are for the */
+ /* field `variation_support'. */
+ /* */
+ /* Note that `fvar' gets checked immediately at font loading, */
+ /* while the other features are only loaded if MM support is */
+ /* actually requested. */
+
+ /* FVAR */
+#define TT_FACE_FLAG_VAR_FVAR ( 1 << 0 )
+
+ /* HVAR */
+#define TT_FACE_FLAG_VAR_HADVANCE ( 1 << 1 )
+#define TT_FACE_FLAG_VAR_LSB ( 1 << 2 )
+#define TT_FACE_FLAG_VAR_RSB ( 1 << 3 )
+
+ /* VVAR */
+#define TT_FACE_FLAG_VAR_VADVANCE ( 1 << 4 )
+#define TT_FACE_FLAG_VAR_TSB ( 1 << 5 )
+#define TT_FACE_FLAG_VAR_BSB ( 1 << 6 )
+#define TT_FACE_FLAG_VAR_VORG ( 1 << 7 )
+
+ /* MVAR */
+#define TT_FACE_FLAG_VAR_MVAR ( 1 << 8 )
+
+
/*************************************************************************/
/* */
/* TrueType Face Type */
@@ -1161,6 +1189,11 @@ FT_BEGIN_HEADER
/* */
/* psnames :: A pointer to the PostScript names service. */
/* */
+ /* mm :: A pointer to the Multiple Masters service. */
+ /* */
+ /* var :: A pointer to the Metrics Variations */
+ /* service. */
+ /* */
/* hdmx :: The face's horizontal device metrics */
/* (`hdmx' table). This table is optional in */
/* TrueType/OpenType fonts. */
@@ -1182,18 +1215,6 @@ FT_BEGIN_HEADER
/* file `ttconfig.h' for comments on the */
/* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
/* */
- /* num_locations :: The number of glyph locations in this */
- /* TrueType file. This should be */
- /* identical to the number of glyphs. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* glyph_locations :: An array of longs. These are offsets to */
- /* glyph data within the `glyf' table. */
- /* Ignored for Type 2 font faces. */
- /* */
- /* glyf_len :: The length of the `glyf' table. Needed */
- /* for malformed `loca' tables. */
- /* */
/* font_program_size :: Size in bytecodes of the face's font */
/* program. 0 if none defined. Ignored for */
/* Type 2 fonts. */
@@ -1219,22 +1240,19 @@ FT_BEGIN_HEADER
/* units. Comes from the `cvt ' table. */
/* Ignored for Type 2 fonts. */
/* */
- /* num_kern_pairs :: The number of kerning pairs present in the */
- /* font file. The engine only loads the */
- /* first horizontal format 0 kern table it */
- /* finds in the font file. Ignored for */
- /* Type 2 fonts. */
- /* */
- /* kern_table_index :: The index of the kerning table in the font */
- /* kerning directory. Ignored for Type 2 */
- /* fonts. */
- /* */
/* interpreter :: A pointer to the TrueType bytecode */
/* interpreters field is also used to hook */
/* the debugger in `ttdebug'. */
/* */
- /* unpatented_hinting :: If true, use only unpatented methods in */
- /* the bytecode interpreter. */
+ /* extra :: Reserved for third-party font drivers. */
+ /* */
+ /* postscript_name :: The PS name of the font. Used by the */
+ /* postscript name service. */
+ /* */
+ /* glyf_len :: The length of the `glyf' table. Needed */
+ /* for malformed `loca' tables. */
+ /* */
+ /* glyf_offset :: The file offset of the `glyf' table. */
/* */
/* doblend :: A boolean which is set if the font should */
/* be blended (this is for GX var). */
@@ -1243,10 +1261,89 @@ FT_BEGIN_HEADER
/* variation tables (rather like Multiple */
/* Master data). */
/* */
- /* extra :: Reserved for third-party font drivers. */
+ /* is_default_instance :: Set if the glyph outlines can be used */
+ /* unmodified (i.e., without applying glyph */
+ /* variation deltas). */
/* */
- /* postscript_name :: The PS name of the font. Used by the */
- /* postscript name service. */
+ /* variation_support :: Flags that indicate which OpenType */
+ /* functionality related to font variation */
+ /* support is present, valid, and usable. */
+ /* For example, TT_FACE_FLAG_VAR_FVAR is only */
+ /* set if we have at least one design axis. */
+ /* */
+ /* horz_metrics_size :: The size of the `hmtx' table. */
+ /* */
+ /* vert_metrics_size :: The size of the `vmtx' table. */
+ /* */
+ /* num_locations :: The number of glyph locations in this */
+ /* TrueType file. This should be */
+ /* identical to the number of glyphs. */
+ /* Ignored for Type 2 fonts. */
+ /* */
+ /* glyph_locations :: An array of longs. These are offsets to */
+ /* glyph data within the `glyf' table. */
+ /* Ignored for Type 2 font faces. */
+ /* */
+ /* hdmx_table :: A pointer to the `hdmx' table. */
+ /* */
+ /* hdmx_table_size :: The size of the `hdmx' table. */
+ /* */
+ /* hdmx_record_count :: The number of hdmx records. */
+ /* */
+ /* hdmx_record_size :: The size of a single hdmx record. */
+ /* */
+ /* hdmx_record_sizes :: An array holding the ppem sizes available */
+ /* in the `hdmx' table. */
+ /* */
+ /* sbit_table :: A pointer to the font's embedded bitmap */
+ /* location table. */
+ /* */
+ /* sbit_table_size :: The size of `sbit_table'. */
+ /* */
+ /* sbit_table_type :: The sbit table type (CBLC, SBIX, etc.). */
+ /* */
+ /* sbit_num_strikes :: The number of sbit strikes exposed by */
+ /* FreeType's API, omitting invalid strikes. */
+ /* */
+ /* sbit_strike_map :: A mapping between the strike indices */
+ /* exposed by the API and the indices used in */
+ /* the font's sbit table. */
+ /* */
+ /* kern_table :: A pointer to the `kern' table. */
+ /* */
+ /* kern_table_size :: The size of the `kern' table. */
+ /* */
+ /* num_kern_tables :: The number of supported kern subtables */
+ /* (up to 32; FreeType recognizes only */
+ /* horizontal ones with format 0). */
+ /* */
+ /* kern_avail_bits :: The availability status of kern subtables; */
+ /* if bit n is set, table n is available. */
+ /* */
+ /* kern_order_bits :: The sortedness status of kern subtables; */
+ /* if bit n is set, table n is sorted. */
+ /* */
+ /* bdf :: Data related to an SFNT font's `bdf' */
+ /* table; see `tttypes.h'. */
+ /* */
+ /* horz_metrics_offset :: The file offset of the `hmtx' table. */
+ /* */
+ /* vert_metrics_offset :: The file offset of the `vmtx' table. */
+ /* */
+ /* sph_found_func_flags :: Flags identifying special bytecode */
+ /* functions (used by the v38 implementation */
+ /* of the bytecode interpreter). */
+ /* */
+ /* sph_compatibility_mode :: */
+ /* This flag is set if we are in ClearType */
+ /* backwards compatibility mode (used by the */
+ /* v38 implementation of the bytecode */
+ /* interpreter). */
+ /* */
+ /* ebdt_start :: The file offset of the sbit data table */
+ /* (CBDT, bdat, etc.). */
+ /* */
+ /* ebdt_size :: The size of the sbit data table. */
/* */
typedef struct TT_FaceRec_
{
@@ -1291,6 +1388,16 @@ FT_BEGIN_HEADER
/* handle glyph names <-> unicode & Mac values */
void* psnames;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* a typeless pointer to the FT_Service_MultiMasters table used to */
+ /* handle variation fonts */
+ void* mm;
+
+ /* a typeless pointer to the FT_Service_MetricsVariationsRec table */
+ /* used to handle the HVAR, VVAR, and MVAR OpenType tables */
+ void* var;
+#endif
+
/***********************************************************************/
/* */
@@ -1334,10 +1441,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
/***********************************************************************/
/* */
@@ -1351,18 +1454,21 @@ FT_BEGIN_HEADER
const char* postscript_name;
FT_ULong glyf_len;
+ FT_ULong glyf_offset; /* since 2.7.1 */
+
+ FT_Bool isCFF2; /* since 2.7.1 */
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Bool doblend;
GX_Blend blend;
+
+ FT_Bool is_default_instance; /* since 2.7.1 */
+ FT_UInt32 variation_support; /* since 2.7.1 */
#endif
/* since version 2.2 */
- FT_Byte* horz_metrics;
FT_ULong horz_metrics_size;
-
- FT_Byte* vert_metrics;
FT_ULong vert_metrics_size;
FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
@@ -1378,6 +1484,7 @@ FT_BEGIN_HEADER
FT_ULong sbit_table_size;
TT_SbitTableType sbit_table_type;
FT_UInt sbit_num_strikes;
+ FT_UInt* sbit_strike_map;
FT_Byte* kern_table;
FT_ULong kern_table_size;
@@ -1393,12 +1500,18 @@ 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 */
+
+#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+ /* since 2.7 */
+ FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
+ FT_ULong ebdt_size;
+#endif
} TT_FaceRec;
@@ -1492,8 +1605,6 @@ FT_BEGIN_HEADER
FT_Vector pp1;
FT_Vector pp2;
- FT_ULong glyf_offset;
-
/* the zone where we load our glyphs */
TT_GlyphZoneRec base;
TT_GlyphZoneRec zone;
@@ -1515,12 +1626,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 */
diff --git a/third_party/freetype/include/freetype/t1tables.h b/third_party/freetype/include/freetype/t1tables.h
index a6ea415af5..81c9034533 100644
--- a/third_party/freetype/include/freetype/t1tables.h
+++ b/third_party/freetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -755,7 +755,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __T1TABLES_H__ */
+#endif /* T1TABLES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/ttnameid.h b/third_party/freetype/include/freetype/ttnameid.h
index c9585f2413..7da5c45072 100644
--- a/third_party/freetype/include/freetype/ttnameid.h
+++ b/third_party/freetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
/* */
/* TrueType name ID definitions (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -1231,7 +1231,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __TTNAMEID_H__ */
+#endif /* TTNAMEID_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/tttables.h b/third_party/freetype/include/freetype/tttables.h
index 1568f40364..7a278e2b19 100644
--- a/third_party/freetype/include/freetype/tttables.h
+++ b/third_party/freetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -175,6 +175,8 @@ FT_BEGIN_HEADER
/* caret_Slope_Run :: The run coefficient of the cursor's */
/* slope. */
/* */
+ /* caret_Offset :: The cursor's offset for slanted fonts. */
+ /* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
@@ -188,6 +190,11 @@ FT_BEGIN_HEADER
/* short_metrics :: A pointer into the `hmtx' table. */
/* */
/* <Note> */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `caret_Slope_Rise', */
+ /* `caret_Slope_Run', and `caret_Offset'. */
+ /* */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields, */
/* which are different. */
@@ -219,7 +226,7 @@ FT_BEGIN_HEADER
/* The following fields are not defined by the TrueType specification */
/* but they are used to connect the metrics header to the relevant */
- /* `HMTX' table. */
+ /* `hmtx' table. */
void* long_metrics;
void* short_metrics;
@@ -297,8 +304,6 @@ FT_BEGIN_HEADER
/* slope. */
/* */
/* caret_Offset :: The cursor's offset for slanted fonts. */
- /* This value is `reserved' in vmtx */
- /* version 1.0. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
@@ -309,11 +314,17 @@ FT_BEGIN_HEADER
/* smaller than the total number of glyphs */
/* in the font. */
/* */
- /* long_metrics :: A pointer into the `vmtx' table. */
+ /* long_metrics :: A pointer into the `vmtx' table. */
/* */
- /* short_metrics :: A pointer into the `vmtx' table. */
+ /* short_metrics :: A pointer into the `vmtx' table. */
/* */
/* <Note> */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `Ascender', */
+ /* `Descender', `Line_Gap', `caret_Slope_Rise', `caret_Slope_Run', */
+ /* and `caret_Offset'. */
+ /* */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields, */
/* which are different. */
@@ -344,8 +355,8 @@ FT_BEGIN_HEADER
FT_UShort number_Of_VMetrics;
/* The following fields are not defined by the TrueType specification */
- /* but they're used to connect the metrics header to the relevant */
- /* `HMTX' or `VMTX' table. */
+ /* but they are used to connect the metrics header to the relevant */
+ /* `hmtx' or `vmtx' table. */
void* long_metrics;
void* short_metrics;
@@ -359,12 +370,22 @@ FT_BEGIN_HEADER
/* TT_OS2 */
/* */
/* <Description> */
- /* A structure used to model a TrueType OS/2 table. All fields */
+ /* 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 that do not include an OS/2 */
/* table. In this case, the `version' field is always set to 0xFFFF. */
/* */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `sCapHeight', */
+ /* `sTypoAscender', `sTypoDescender', `sTypoLineGap', `sxHeight', */
+ /* `usWinAscent', `usWinDescent', `yStrikeoutPosition', */
+ /* `yStrikeoutSize', `ySubscriptXOffset', `ySubScriptXSize', */
+ /* `ySubscriptYOffset', `ySubscriptYSize', `ySuperscriptXOffset', */
+ /* `ySuperscriptXSize', `ySuperscriptYOffset', and */
+ /* `ySuperscriptYSize'. */
+
typedef struct TT_OS2_
{
FT_UShort version; /* 0x0001 - more or 0xFFFF */
@@ -429,11 +450,17 @@ FT_BEGIN_HEADER
/* TT_Postscript */
/* */
/* <Description> */
- /* A structure used to model a TrueType PostScript table. All fields */
+ /* A structure used to model a TrueType `post' table. All fields */
/* comply to the TrueType specification. This structure does not */
/* reference the PostScript glyph names, which can be nevertheless */
/* accessed with the `ttpost' module. */
/* */
+ /* <Note> */
+ /* For an OpenType variation font, the values of the following fields */
+ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */
+ /* friends) if the font contains an `MVAR' table: `underlinePosition' */
+ /* and `underlineThickness'. */
+ /* */
typedef struct TT_Postscript_
{
FT_Fixed FormatType;
@@ -447,7 +474,7 @@ FT_BEGIN_HEADER
FT_ULong maxMemType1;
/* Glyph names follow in the file, but we don't */
- /* load them by default. See the ttpost.c file. */
+ /* load them by default. See file `ttpost.c'. */
} TT_Postscript;
@@ -458,7 +485,7 @@ FT_BEGIN_HEADER
/* TT_PCLT */
/* */
/* <Description> */
- /* A structure used to model a TrueType PCLT table. All fields */
+ /* A structure used to model a TrueType `PCLT' table. All fields */
/* comply to the TrueType specification. */
/* */
typedef struct TT_PCLT_
@@ -488,7 +515,7 @@ FT_BEGIN_HEADER
/* TT_MaxProfile */
/* */
/* <Description> */
- /* The maximum profile is a table containing many max values, which */
+ /* The maximum profile (`maxp') table contains many max values, which */
/* can be used to pre-allocate arrays. This ensures that no memory */
/* allocation occurs during a glyph load. */
/* */
@@ -587,7 +614,7 @@ FT_BEGIN_HEADER
/* */
/* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
/* */
- /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */
+ /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure. */
/* */
/* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
/* */
@@ -823,7 +850,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __TTTABLES_H__ */
+#endif /* TTTABLES_H_ */
/* END */
diff --git a/third_party/freetype/include/freetype/tttags.h b/third_party/freetype/include/freetype/tttags.h
index 3836c7bbfd..32eb2fdc26 100644
--- a/third_party/freetype/include/freetype/tttags.h
+++ b/third_party/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2017 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>
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
+#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
@@ -61,6 +62,7 @@ FT_BEGIN_HEADER
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
+#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
@@ -79,6 +81,7 @@ FT_BEGIN_HEADER
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
+#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
@@ -100,12 +103,13 @@ 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_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
FT_END_HEADER
-#endif /* __TTAGS_H__ */
+#endif /* TTAGS_H_ */
/* END */