Skip to content

Commit

Permalink
Update freetype to 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
volzhs committed Jun 25, 2017
1 parent 0cac329 commit 0f8cc0f
Show file tree
Hide file tree
Showing 474 changed files with 21,186 additions and 5,509 deletions.
6 changes: 6 additions & 0 deletions modules/freetype/SCsub
Expand Up @@ -34,10 +34,13 @@ if (env['builtin_freetype'] != 'no'):
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
"src/bzip2/ftbzip2.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gxvalid/gxvalid.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/otvalid/otvalid.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
Expand Down Expand Up @@ -77,6 +80,9 @@ if (env['builtin_freetype'] != 'no'):
break
if not inserted:
env.Append(LIBS=[lib])
env.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY'])
if (env['target'] != 'release'):
env.Append(CCFLAGS=['-DZLIB_DEBUG'])

# Godot source files
env.add_source_files(env.modules_sources, "*.cpp")
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/README.md
Expand Up @@ -59,7 +59,7 @@ TODO.
## freetype

- Upstream: https://www.freetype.org
- Version: 2.6.5
- Version: 2.8
- License: FreeType License (BSD-like)

Files extracted from upstream source:
Expand Down
28 changes: 23 additions & 5 deletions thirdparty/freetype/include/freetype/config/ftconfig.h
Expand Up @@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2016 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, */
Expand Down Expand Up @@ -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> */
Expand Down Expand Up @@ -325,6 +333,15 @@ FT_BEGIN_HEADER
#endif


#ifdef _WIN64
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32bit integers, 64bit pointers */
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
#else
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
#endif


/*************************************************************************/
/* */
/* miscellaneous */
Expand All @@ -338,10 +355,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
Expand Down
15 changes: 14 additions & 1 deletion thirdparty/freetype/include/freetype/config/ftheader.h
Expand Up @@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2016 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, */
Expand Down Expand Up @@ -354,6 +354,19 @@
#define FT_TRUETYPE_DRIVER_H <freetype/ftttdrv.h>


/*************************************************************************
*
* @macro:
* FT_PCF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the PCF driver module.
*
*/
#define FT_PCF_DRIVER_H <freetype/ftpcfdrv.h>


/*************************************************************************
*
* @macro:
Expand Down
128 changes: 116 additions & 12 deletions thirdparty/freetype/include/freetype/config/ftoption.h
Expand Up @@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2016 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, */
Expand Down Expand Up @@ -75,6 +75,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 */
Expand Down Expand Up @@ -148,7 +178,7 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
/* #define FT_CONFIG_OPTION_USE_LZW */ // -GODOT-
#define FT_CONFIG_OPTION_USE_LZW

This comment has been minimized.

Copy link
@akien-mga

akien-mga Jun 29, 2017

Member

Did you change this on purpose, or was it a mistake?

This comment has been minimized.

Copy link
@volzhs

volzhs Jun 29, 2017

Author Member

no. I just overwrite all freetype 2.8 sources. does it cause a problem?

This comment has been minimized.

Copy link
@akien-mga

akien-mga Jun 29, 2017

Member

I don't know, it was probably disabled for a reason initially but I don't know it :)

This comment has been minimized.

Copy link
@volzhs

volzhs Jun 29, 2017

Author Member

I'm not sure either but what about letting it as it is for a future update if it didn't break something?



/*************************************************************************/
Expand All @@ -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 */ // -GODOT-
#define FT_CONFIG_OPTION_USE_ZLIB

This comment has been minimized.

Copy link
@akien-mga

akien-mga Jun 29, 2017

Member

Same here.



/*************************************************************************/
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -596,17 +640,21 @@ FT_BEGIN_HEADER
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
/* There are three options. */
/* There are three possible values. */
/* */
/* 1. This option is associated with the `Infinality' moniker. */
/* Contributed by an individual nicknamed Infinality with the goal of */
/* Value 1: */
/* This value 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. */
/* */
/* 2. The new default mode for the TrueType driver. The Infinality code */
/* The corresponding interpreter version is v38. */
/* */
/* Value 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 */
Expand All @@ -616,22 +664,27 @@ FT_BEGIN_HEADER
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
/* 3. Compile both. */
/* The corresponding interpreter version is v40. */
/* */
/* Value 3: */
/* Compile both, making both v38 and v40 available (the latter is the */
/* default). */
/* */
/* 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. */
/* switch between between v35 and the ones you define (using */
/* `FT_Property_Set'). */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */


Expand Down Expand Up @@ -788,6 +841,33 @@ FT_BEGIN_HEADER
/* #define CFF_CONFIG_OPTION_OLD_ENGINE */


/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** 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 */


/*************************************************************************/
/*************************************************************************/
/**** ****/
Expand All @@ -806,7 +886,9 @@ FT_BEGIN_HEADER

/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* Compile autofit module with fallback Indic script support, covering */
/* some scripts that the `latin' submodule of the autofit module doesn't */
/* (yet) handle. */
/* */
#define AF_CONFIG_OPTION_INDIC

Expand All @@ -825,6 +907,26 @@ FT_BEGIN_HEADER
/* */
#define AF_CONFIG_OPTION_USE_WARPER

/*************************************************************************/
/* */
/* Use TrueType-like size metrics for `light' auto-hinting. */
/* */
/* It is strongly recommended to avoid this option, which exists only to */
/* help some legacy applications retain its appearance and behaviour */
/* with respect to auto-hinted TrueType fonts. */
/* */
/* The very reason this option exists at all are GNU/Linux distributions */
/* like Fedora that did not un-patch the following change (which was */
/* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */
/* */
/* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */
/* */
/* [truetype] Fix metrics on size request for scalable fonts. */
/* */
/* This problematic commit is now reverted (more or less). */
/* */
/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */

/* */


Expand All @@ -842,13 +944,15 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER

#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#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
#endif


Expand Down
5 changes: 3 additions & 2 deletions thirdparty/freetype/include/freetype/config/ftstdlib.h
Expand Up @@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2016 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, */
Expand Down Expand Up @@ -142,7 +142,8 @@
/**********************************************************************/


#define ft_atol atol
#define ft_strtol strtol
#define ft_getenv getenv


/**********************************************************************/
Expand Down

0 comments on commit 0f8cc0f

Please sign in to comment.