Skip to content

Commit 889104d

Browse files
jungshikandi34
authored andcommitted
Update FreeType from 2.6.2 to c38be52bf8de (2.7 + a few post-2.7 CLs)
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=c38be52b Keep all the configuration options as before. Likewise, exclude unused files (Jamfiles, various mk files, builds/, docs/, ChangeLog*, directories under src/ for disabled modules, etc). Update README.android to record the configurations. Besides, disable a new option (TT_CONFIG_OPTION_SUBPIXEL_HINTING) for branches. Note that a bulk of changes in this CL come from the code to implement this option. BUG: 31470908 AOSP-Change-Id: I1ca90aec171d9580415b8531e2b767e9dd31164c CVE-2016-10244 Change-Id: I4485d2ea543c52f8145ab23372cf3e5c7345879b (cherry picked from commit 055aee28cedc3631434b2636fc6093c0d4d818ab)
1 parent a2d2f3a commit 889104d

File tree

297 files changed

+7314
-7281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+7314
-7281
lines changed

Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# this is now the default FreeType build for Android
22
#
33
ifndef USE_FREETYPE
4-
USE_FREETYPE := 2.6.2
4+
USE_FREETYPE := 2.7
55
endif
66

7-
ifeq ($(USE_FREETYPE),2.6.2)
7+
ifeq ($(USE_FREETYPE),2.7)
88
LOCAL_PATH:= $(call my-dir)
99
include $(CLEAR_VARS)
1010

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Introduction
5252
encourage you to use the following text:
5353

5454
"""
55-
Portions of this software are copyright <year> The FreeType
55+
Portions of this software are copyright © <year> The FreeType
5656
Project (www.freetype.org). All rights reserved.
5757
"""
5858

README.android

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
Name: FreeType
2-
Version: 2.6.2 + update
3-
Revision: a512b0fe7a8d9db0e5aa9c0a4db1e92cb861722d
1+
Freetype
42

5-
Local modifications:
3+
The following modules are disabled in include/freetype/config/ftmodule.h:
4+
t1
5+
t1cid
6+
pfr
7+
t42
8+
winfnt
9+
pcf
10+
psaux
11+
bdf
612

7-
1. Drop unused build files (Jamfiles, {module,rules}.mk)
8-
2. Drop src directories for unused modules:
9-
bdf, cid, pcf, pfr, type1, type42, winfonts
10-
3. Drop src/{bzip2,tools,lzw,otvalid,gxvalid}
11-
4. Customize include/freetype/config/{ftmodule,ftoption}.h by applying
12-
module_option.diff
13+
The following options are disabled in include/freetype/config/ftoption.h:
1314

14-
To faciliate an easier update, all the files in src/{base,autofit} are kept
15-
even if some of them are for dropped modules/options. Android.mk can be used
16-
to control exactly what's built.
15+
FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
16+
FT_CONFIG_OPTION_INCREMENTAL
17+
TT_CONFIG_OPTION_SUBPIXEL_HINTING
18+
19+
The following option is enabled to support color fonts.
20+
21+
FT_CONFIG_OPTION_USE_PNG

README.version

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
URL: http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=c38be52b
2+
Version: c38be52bf8de3b1699d74932b849bf150265819e (2.7 + update)
3+
BugComponent: 75970

include/freetype/config/ftconfig.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/* */
55
/* ANSI-specific configuration file (specification only). */
66
/* */
7-
/* Copyright 1996-2015 by */
7+
/* Copyright 1996-2016 by */
88
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
99
/* */
1010
/* This file is part of the FreeType project, and may only be used, */
@@ -35,8 +35,8 @@
3535
/* */
3636
/*************************************************************************/
3737

38-
#ifndef __FTCONFIG_H__
39-
#define __FTCONFIG_H__
38+
#ifndef FTCONFIG_H_
39+
#define FTCONFIG_H_
4040

4141
#include <ft2build.h>
4242
#include FT_CONFIG_OPTIONS_H
@@ -275,7 +275,13 @@ FT_BEGIN_HEADER
275275
/* */
276276
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
277277

278-
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
278+
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
279+
280+
#define FT_LONG64
281+
#define FT_INT64 long long int
282+
#define FT_UINT64 unsigned long long int
283+
284+
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
279285

280286
/* this compiler provides the __int64 type */
281287
#define FT_LONG64
@@ -309,7 +315,7 @@ FT_BEGIN_HEADER
309315
#define FT_INT64 long long int
310316
#define FT_UINT64 unsigned long long int
311317

312-
#endif /* _MSC_VER */
318+
#endif /* __STDC_VERSION__ >= 199901L */
313319

314320
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
315321

@@ -461,7 +467,7 @@ FT_BEGIN_HEADER
461467
FT_END_HEADER
462468

463469

464-
#endif /* __FTCONFIG_H__ */
470+
#endif /* FTCONFIG_H_ */
465471

466472

467473
/* END */

include/freetype/config/ftheader.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/* */
55
/* Build macros of the FreeType 2 library. */
66
/* */
7-
/* Copyright 1996-2015 by */
7+
/* Copyright 1996-2016 by */
88
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
99
/* */
1010
/* This file is part of the FreeType project, and may only be used, */
@@ -15,8 +15,8 @@
1515
/* */
1616
/***************************************************************************/
1717

18-
#ifndef __FT_HEADER_H__
19-
#define __FT_HEADER_H__
18+
#ifndef FTHEADER_H_
19+
#define FTHEADER_H_
2020

2121

2222
/*@***********************************************************************/
@@ -753,8 +753,7 @@
753753
* FT_UNPATENTED_HINTING_H
754754
*
755755
* @description:
756-
* A macro used in #include statements to name the file containing the
757-
* FreeType~2 API which performs color filtering for subpixel rendering.
756+
* Deprecated.
758757
*/
759758
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
760759

@@ -766,7 +765,7 @@
766765
*
767766
* @description:
768767
* A macro used in #include statements to name the file containing the
769-
* FreeType~2 API which performs color filtering for subpixel rendering.
768+
* FreeType~2 API which performs incremental glyph loading.
770769
*/
771770
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
772771

@@ -828,7 +827,7 @@
828827
#endif /* FT2_BUILD_LIBRARY */
829828

830829

831-
#endif /* __FT2_BUILD_H__ */
830+
#endif /* FTHEADER_H_ */
832831

833832

834833
/* END */

include/freetype/config/ftoption.h

Lines changed: 98 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/* */
55
/* User-selectable configuration macros (specification only). */
66
/* */
7-
/* Copyright 1996-2015 by */
7+
/* Copyright 1996-2016 by */
88
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
99
/* */
1010
/* This file is part of the FreeType project, and may only be used, */
@@ -16,8 +16,8 @@
1616
/***************************************************************************/
1717

1818

19-
#ifndef __FTOPTION_H__
20-
#define __FTOPTION_H__
19+
#ifndef FTOPTION_H_
20+
#define FTOPTION_H_
2121

2222

2323
#include <ft2build.h>
@@ -75,6 +75,36 @@ FT_BEGIN_HEADER
7575
/*************************************************************************/
7676

7777

78+
/*************************************************************************/
79+
/* */
80+
/* If you enable this configuration option, FreeType recognizes an */
81+
/* environment variable called `FREETYPE_PROPERTIES', which can be used */
82+
/* to control the various font drivers and modules. The controllable */
83+
/* properties are listed in the section `Controlling FreeType Modules' */
84+
/* in the reference's table of contents; currently there are properties */
85+
/* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */
86+
/* TrueType (file `ftttdrv.h'). */
87+
/* */
88+
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
89+
/* multiple lines for better readability). */
90+
/* */
91+
/* <optional whitespace> */
92+
/* <module-name1> ':' */
93+
/* <property-name1> '=' <property-value1> */
94+
/* <whitespace> */
95+
/* <module-name2> ':' */
96+
/* <property-name2> '=' <property-value2> */
97+
/* ... */
98+
/* */
99+
/* Example: */
100+
/* */
101+
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
102+
/* cff:no-stem-darkening=1 \ */
103+
/* autofitter:warping=1 */
104+
/* */
105+
/* #define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES */
106+
107+
78108
/*************************************************************************/
79109
/* */
80110
/* Uncomment the line below if you want to activate sub-pixel rendering */
@@ -492,7 +522,21 @@ FT_BEGIN_HEADER
492522
/* code will be used. */
493523
/* */
494524
/* Setting this macro is needed for systems that prohibit address */
495-
/* fixups, such as BREW. */
525+
/* fixups, such as BREW. [Note that standard compilers like gcc or */
526+
/* clang handle PIC generation automatically; you don't have to set */
527+
/* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
528+
/* compilers.] */
529+
/* */
530+
/* Note that FT_CONFIG_OPTION_PIC support is not available for all */
531+
/* modules (see `modules.cfg' for a complete list). For building with */
532+
/* FT_CONFIG_OPTION_PIC support, do the following. */
533+
/* */
534+
/* 0. Clone the repository. */
535+
/* 1. Define FT_CONFIG_OPTION_PIC. */
536+
/* 2. Remove all subdirectories in `src' that don't have */
537+
/* FT_CONFIG_OPTION_PIC support. */
538+
/* 3. Comment out the corresponding modules in `modules.cfg'. */
539+
/* 4. Compile. */
496540
/* */
497541
/* #define FT_CONFIG_OPTION_PIC */
498542

@@ -586,73 +630,53 @@ FT_BEGIN_HEADER
586630
/*************************************************************************/
587631
/* */
588632
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
589-
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
590-
/* replaces the native TrueType hinting mechanism when anything but */
591-
/* FT_RENDER_MODE_MONO is requested. */
592-
/* */
593-
/* Enabling this causes the TrueType driver to ignore instructions under */
594-
/* certain conditions. This is done in accordance with the guide here, */
595-
/* with some minor differences: */
633+
/* subpixel hinting support into the TrueType driver. This modifies the */
634+
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
635+
/* requested. */
596636
/* */
597-
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
637+
/* In particular, it modifies the bytecode interpreter to interpret (or */
638+
/* not) instructions in a certain way so that all TrueType fonts look */
639+
/* like they do in a Windows ClearType (DirectWrite) environment. See */
640+
/* [1] for a technical overview on what this means. See `ttinterp.h' */
641+
/* for more details on the LEAN option. */
598642
/* */
599-
/* By undefining this, you only compile the code necessary to hint */
600-
/* TrueType glyphs with native TT hinting. */
643+
/* There are three options. */
601644
/* */
602-
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
603-
/* defined. */
645+
/* 1. This option is associated with the `Infinality' moniker. */
646+
/* Contributed by an individual nicknamed Infinality with the goal of */
647+
/* making TrueType fonts render better than on Windows. A high */
648+
/* amount of configurability and flexibility, down to rules for */
649+
/* single glyphs in fonts, but also very slow. Its experimental and */
650+
/* slow nature and the original developer losing interest meant that */
651+
/* this option was never enabled in default builds. */
604652
/* */
605-
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
606-
607-
608-
/*************************************************************************/
653+
/* 2. The new default mode for the TrueType driver. The Infinality code */
654+
/* base was stripped to the bare minimum and all configurability */
655+
/* removed in the name of speed and simplicity. The configurability */
656+
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
657+
/* Courier. Legacy fonts are fonts that modify vertical stems to */
658+
/* achieve clean black-and-white bitmaps. The new mode focuses on */
659+
/* applying a minimal set of rules to all fonts indiscriminately so */
660+
/* that modern and web fonts render well while legacy fonts render */
661+
/* okay. */
609662
/* */
610-
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
611-
/* of the TrueType bytecode interpreter is used that doesn't implement */
612-
/* any of the patented opcodes and algorithms. The patents related to */
613-
/* TrueType hinting have expired worldwide since May 2010; this option */
614-
/* is now deprecated. */
663+
/* 3. Compile both. */
615664
/* */
616-
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
617-
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
618-
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
619-
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
665+
/* By undefining these, you get rendering behavior like on Windows */
666+
/* without ClearType, i.e., Windows XP without ClearType enabled and */
667+
/* Win9x (interpreter version v35). Or not, depending on how much */
668+
/* hinting blood and testing tears the font designer put into a given */
669+
/* font. If you define one or both subpixel hinting options, you can */
670+
/* switch between between v35 and the ones you define. */
620671
/* */
621-
/* This macro is only useful for a small number of font files (mostly */
622-
/* for Asian scripts) that require bytecode interpretation to properly */
623-
/* load glyphs. For all other fonts, this produces unpleasant results, */
624-
/* thus the unpatented interpreter is never used to load glyphs from */
625-
/* TrueType fonts unless one of the following two options is used. */
672+
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
673+
/* defined. */
626674
/* */
627-
/* - The unpatented interpreter is explicitly activated by the user */
628-
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
629-
/* when opening the FT_Face. */
675+
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
630676
/* */
631-
/* - FreeType detects that the FT_Face corresponds to one of the */
632-
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
633-
/* contains a hard-coded list of font names and other matching */
634-
/* parameters (see function `tt_face_init' in file */
635-
/* `src/truetype/ttobjs.c'). */
636-
/* */
637-
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
638-
/* */
639-
/* { */
640-
/* FT_Parameter parameter; */
641-
/* FT_Open_Args open_args; */
642-
/* */
643-
/* */
644-
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
645-
/* */
646-
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
647-
/* open_args.pathname = my_font_pathname; */
648-
/* open_args.num_params = 1; */
649-
/* open_args.params = &parameter; */
650-
/* */
651-
/* error = FT_Open_Face( library, &open_args, index, &face ); */
652-
/* ... */
653-
/* } */
654-
/* */
655-
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
677+
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
678+
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
679+
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
656680

657681

658682
/*************************************************************************/
@@ -843,7 +867,7 @@ FT_BEGIN_HEADER
843867
/* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
844868
/* information; by default it is switched off). */
845869
/* */
846-
/* #define AF_CONFIG_OPTION_USE_WARPER */
870+
#define AF_CONFIG_OPTION_USE_WARPER
847871

848872
/* */
849873

@@ -856,14 +880,19 @@ FT_BEGIN_HEADER
856880

857881

858882
/*
859-
* This macro is defined if either unpatented or native TrueType
860-
* hinting is requested by the definitions above.
883+
* This macro is defined if native TrueType hinting is requested by the
884+
* definitions above.
861885
*/
862886
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
863887
#define TT_USE_BYTECODE_INTERPRETER
864-
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
865-
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
866-
#define TT_USE_BYTECODE_INTERPRETER
888+
889+
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
890+
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
891+
#endif
892+
893+
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
894+
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
895+
#endif
867896
#endif
868897

869898

@@ -898,7 +927,7 @@ FT_BEGIN_HEADER
898927
FT_END_HEADER
899928

900929

901-
#endif /* __FTOPTION_H__ */
930+
#endif /* FTOPTION_H_ */
902931

903932

904933
/* END */

0 commit comments

Comments
 (0)